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

    $('#color1').colorPicker();
    $('#color2').colorPicker();
    $('#color3').colorPicker();
    $('#color4').colorPicker();

	$('.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(url + "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
			});
		});
	});

   animateInit();
   
   pageReloadBlock();
   
    $(".delivery_date").datepicker({ changeFirstDay: false, showOn: "both", buttonImage: "images/calendar.png", buttonImageOnly: true });
	$(".jCarouselLite").jCarouselLite({
	    auto: 1000,
	    visible: 5,
	    speed: 2000
	});
    /*
	$('*[title]').tooltip({ 
    	delay: 0, 
    	showURL: false
    });
	*/	
    $('#browser').html('Používáte <strong>' + $.browser.name + '</strong> ve verzi <strong>' + $.browser.version + '</strong> ' + $.os.name);
    if ($.browser.name == 'msie' && $.browser.version < 7 && $.cookie('oldIE') != 'none') {
        $.cookie('oldIE', 'none');
        $('#oldIE').css('display','block');
    }     
 });

 function animateInit() {
   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.addDiv('brandHP', 'fade=0');
   animatedcollapse.addDiv('micekText', 'fade=1');
   animatedcollapse.init();
 }
