﻿// Ride the carousel...
jQuery(document).ready(function() {
	jQuery("#slider").jcarousel({
		scroll: 1,
		start: 4,
		visible: 4,
		initCallback: mycarousel_initCallback,
		buttonNextHTML: null,
		buttonPrevHTML: null
	});
	jQuery("body").bind("load", function() {
	    topImg = new Image();
	    topImg.src = "../images/header.png";
	});
});

var gcarousel;
var timer;

function mycarousel_initCallback(carousel) {
	gcarousel = carousel;
	
	jQuery('.jcarousel-prev-vertical').bind('mouseover', function() {
	    timer = setInterval("gcarousel.prev();", 10);
	});

	jQuery('.jcarousel-prev-vertical').bind('mouseout', function() {
		clearInterval(timer);
	});


	jQuery('.jcarousel-next-vertical').bind('mouseover', function() {
	timer = setInterval("gcarousel.next();", 10);
		
	});
	jQuery('.jcarousel-next-vertical').bind('mouseout', function() {

		clearInterval(timer);
	});
};

/* Google website search */
      //<![CDATA[
      google.load('search', '1');
      var searchControl;
      function OnLoad() {

        google.search.Search.getBranding(document.getElementById("branding"));

        // site restricted blog search
        var dpreviewSearch = new google.search.WebSearch();
        dpreviewSearch.setUserDefinedLabel("bsshop.cz");
        dpreviewSearch.setSiteRestriction("bsshop.cz");

        searchControl = new google.search.SearchControl();
        searchControl.addSearcher(dpreviewSearch);

        if (document.getElementById('searchText').value != null) {
        	var query = document.getElementById('searchValue').value;
        	document.getElementById('searchText').value = query;
        }
        
        var options = new google.search.DrawOptions();
        options.setDrawMode(GSearchControl.DRAW_MODE_TABBED);
        searchControl.draw(document.getElementById("searchResults"), options);

        // Execute an inital search
        searchControl.execute(query);
      }

      google.setOnLoadCallback(OnLoad, true);

    //]]>
   
