 $(document).ready(function(){
 
 	function myokfunc(){
	}

	//init colorpicker:
	//$.ColorPicker.init();	
	/*
	$("#menu ul li a[id^='a_']").click(function() {
		var linkId = $(this).attr('id');
		var catId = linkId.split('_');
		$('.hiddenSubmenu').attr({style: "display:none"});
		$('.submenu_' + catId[1]).attr({style: "display: block"});
		//return false;
	});
	*/

	$('.sendToFriend').click(function (e) {
		e.preventDefault();
		// load the contact form using ajax
		$.get(url + "inc/sendfriend.php?product="+window.location, function(data){
			// create a modal dialog with the data
			$(data).modal({
				close: false,
				overlayId: 'contact-overlay',
				containerId: 'contact-container',
				onOpen: contact.open,
				onShow: contact.show,
				onClose: contact.close
			});
		});
	});
			 	 
	$('.availability').click(function (e) {
		e.preventDefault();
		// load the contact form using ajax
		var code = $('.kod').html();
		codeElems = code.split(':');
		$.get("../inc/ajax/checkAvailability.php?product="+window.location+'&code='+codeElems[1], function(data){
			// create a modal dialog with the data
			$(data).modal({

				close: false,
				overlayId: 'contact-overlay',
				containerId: 'contact-container',
				onOpen: availability.open,
				onShow: availability.show,
				onClose: availability.close
			});
		});
	});

    $('.availabilityRapr').click(function (e) {
        e.preventDefault();

        var product=$(this).find('input').attr("value");
		$.get("../inc/ajax/checkAvailabilityRapr.php?product="+product, function(data){
			// create a modal dialog with the data
			$(data).modal({

				close: false,
				overlayId: 'contact-overlay',
				containerId: 'contact-container',
				onOpen: availability.open,
				onShow: availability.show,
				onClose: availability.close
			});
		});
	});
				 	 
   animatedcollapse.addDiv('menuCont', 'fade=0');
   animatedcollapse.addDiv('schranka', 'fade=0');
   animatedcollapse.addDiv('basketId', 'fade=0');
   animatedcollapse.addDiv('infoBox', 'fade=0');
   animatedcollapse.addDiv('log', 'fade=0');
   animatedcollapse.addDiv('glossatyList', 'fade=0');
   animatedcollapse.addDiv('ANKETA', 'fade=0');
   animatedcollapse.addDiv('NEWS', 'fade=0');
   animatedcollapse.addDiv('NEWSL', 'fade=0');
   animatedcollapse.addDiv('quickContact', 'fade=0');
   animatedcollapse.addDiv('productHistory', 'fade=0');
   animatedcollapse.addDiv('currencyCalc', 'fade=0');
   animatedcollapse.addDiv('categoryHistory', 'fade=0');
   animatedcollapse.addDiv('actionProducts', 'fade=0');
   animatedcollapse.addDiv('newProducts', 'fade=0');
   animatedcollapse.addDiv('monitoredProducts', 'fade=0');
   animatedcollapse.addDiv('mostWantedProducts', 'fade=0');
   animatedcollapse.addDiv('recommendProducts', 'fade=0');
   animatedcollapse.addDiv('saleProducts', 'fade=0');
   animatedcollapse.addDiv('specSearch', 'fade=0');   	   	
   animatedcollapse.addDiv('catDownl', 'fade=0');   	    	
   animatedcollapse.addDiv('pay', 'fade=0');   	    	    	
   animatedcollapse.addDiv('tagClouds', 'fade=0');    	    	
   animatedcollapse.addDiv('menuDes', 'fade=0');   	  	  
   animatedcollapse.init();
   pageReloadBlock();
   
   
   var captcha = $('#refreshimg');
   if(captcha.length == 1)
   {
      refreshimg();
   }

    $(".delivery_date").datepicker({ changeFirstDay: false, showOn: "both", buttonImage: "images/calendar.png", buttonImageOnly: true, onSelect: function (input, date) { changeDeliveryDate(input, date); }});

	$(".jCarouselLite").jCarouselLite({
	    auto: 1000,
	    visible: 5,
	    speed: 2000
	});
	
    $('#browser').html('Používáte <strong>' + $.browser.name + '</strong> ve verzi <strong>' + $.browser.version + '</strong> ' + $.os.name); 
 });

