// JavaScript Document
			$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements.
				/*$('a[@rel*=lightbox]').colorbox({transition:"fade"});*/
				$("a[rel='lightbox']").colorbox({transition:"fade"});
				$("a[rel='dotaz']").colorbox({iframe:true, width:400, height:400});	
				$("a[rel='doporucit']").colorbox({iframe:true, width:400, height:500});	
				$("a[rel='essox']").colorbox({iframe:true, width:700, height:620});	
				$('#my_dropdown_billing_country, #my_dropdown_shipping_country').sSelect();

				/*//toggle message_body
				$(".message_head").click(function(){
					$(this).next(".message_body").slideToggle(500)
					return false;
				});
			
				$(".message_head").click(function(){
					$(this).next(".message_body_show").slideToggle(500)
					return false;
				});			
				//collapse all messages
				//$(".message_body").slideUp(500)*/
				$("#navmenu-h li,#navmenu-v li").hover(
				   function() { $(this).addClass("iehover"); },
				   function() { $(this).removeClass("iehover"); }
				);
				
				//onclick reset input value
				$('.form_input').focus(
					function() {
						if (this.value == this.defaultValue) {
							this.value = '';
						}
					}
					);
				$('.form_input').blur(
					function() {
						if (this.value == '') {
							this.value = this.defaultValue;
						}
					}
				);
				
				//change text/password input 
				$('#password-clear').show();
				$('#password-password').hide();
				
				$('#password-clear').focus(function() {
					$('#password-clear').hide();
					$('#password-password').show();
					$('#password-password').focus();
				});
				$('#password-password').blur(function() {
					if($('#password-password').val() == '') {
						$('#password-clear').show();
						$('#password-password').hide();
					}
				});	
				
				// check for what is/isn't already checked and match it on the fake ones
				$("input:checkbox").each( function() {
					(this.checked) ? $("#fake"+this.id).addClass('fakechecked') : $("#fake"+this.id).removeClass('fakechecked');
				});
				// function to 'check' the fake ones and their matching checkboxes
				$(".fakecheck").click(function(){
					($(this).hasClass('fakechecked')) ? $(this).removeClass('fakechecked') : $(this).addClass('fakechecked');
					$(this.hash).trigger("click");
					return false;
				});	
				
				$("#reg_check").click(function(){
					$("#shipping_table").toggle();
				});
				
				$(".postovne").click(function(){
					$(".cart_contact_name").val($('#cart_contact_name').val());
					$(".cart_contact_company").val($('#cart_contact_company').val());
					$(".cart_contact_street").val($('#cart_contact_street').val());
					$(".cart_contact_city").val($('#cart_contact_city').val());
					$(".cart_contact_zip").val($('#cart_contact_zip').val());
					$(".cart_contact_phone").val($('#cart_contact_phone').val());
					$(".cart_contact_email").val($('#cart_contact_email').val());
					$(".cart_invoice_company").val($('#cart_invoice_company').val());
					$(".cart_invoice_street").val($('#cart_invoice_street').val());
					$(".cart_invoice_city").val($('#cart_invoice_city').val());
					$(".cart_invoice_zip").val($('#cart_invoice_zip').val());
					$(".cart_invoice_ic").val($('#cart_invoice_ic').val());
					$(".cart_invoice_dic").val($('#cart_invoice_dic').val());
					$("#cart_postovne").submit();
				});
				
				$("input:checkbox").click(function(){
					var group = "input:checkbox[name='"+$(this).attr("name")+"']";
					$(group).filter(':checked').not(this).removeAttr('checked');
				});
				
				$("#oblibene_button").click(function() {
					var myvar = $(this).attr("class");
					var arr = myvar.split('_');
					//alert(arr[1]);
				  	//$('#content_load').html('<div class="loading"><img src="/images/35-1.gif" width="30" height="30" /></div>');
					$('#oblibene_button').load("/inc/ajax_oblibene.php?produkt_id="+arr[1]);
					//alert($(this).attr("rel"));
					//$('#content_load').load("/gallery/gallery.php");
					return false;
				});
				
				$(".print").click(function(event){
					event.preventDefault();
					window.print();
			   	});
				
				var InfiniteRotator =
				{
					init: function()
					{
						//initial fade-in time (in milliseconds)
						var initialFadeIn = 1000;
			 
						//interval between items (in milliseconds)
						var itemInterval = 10000;
			 
						//cross-fade time (in milliseconds)
						var fadeTime = 2500;
			 
						//count number of items
						var numberOfItems = $('.rotating-item').length;
			 
						//set current item
						var currentItem = 0;
			 
						//show first item
						$('.rotating-item').eq(currentItem).fadeIn(initialFadeIn);
			 
						//loop through the items
						var infiniteLoop = setInterval(function(){
							$('.rotating-item').eq(currentItem).fadeOut(fadeTime);
			 
							if(currentItem == numberOfItems -1){
								currentItem = 0;
							}else{
								currentItem++;
							}
							$('.rotating-item').eq(currentItem).fadeIn(fadeTime);
			 
						}, itemInterval);
					}
				};
			 
				InfiniteRotator.init();	
				
			});			
			
	  function initialize() {
		var latlng = new google.maps.LatLng(49.592111,17.252084);
		var myOptions = {
		  zoom: 14,
		  scrollwheel: false,
		  center: latlng,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
		  var marker = new google.maps.Marker({
			  position: latlng, 
			  map: map, 
			  title:"Hello World!"
		  });	
	  }	
	  
	  function initialize_olomouc() {
		var latlng = new google.maps.LatLng(49.584355,17.223601);
		var myOptions = {
		  zoom: 14,
		  scrollwheel: false,
		  center: latlng,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("olomouc_canvas"), myOptions);
		  var marker = new google.maps.Marker({
			  position: latlng, 
			  map: map, 
			  title:"Prodejna Olomouc"
		  });	
	  }	
	  
	  function initialize_prerov() {
		var latlng = new google.maps.LatLng(49.454859,17.436002);
		var myOptions = {
		  zoom: 14,
		  scrollwheel: false,
		  center: latlng,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("prerov_canvas"), myOptions);
		  var marker = new google.maps.Marker({
			  position: latlng, 
			  map: map, 
			  title:"Prodejna Přerov"
		  });	
	  }	
	  
	  function initialize_unicov() {
		var latlng = new google.maps.LatLng(49.771653,17.116324);
		var myOptions = {
		  zoom: 14,
		  scrollwheel: false,
		  center: latlng,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("unicov_canvas"), myOptions);
		  var marker = new google.maps.Marker({
			  position: latlng, 
			  map: map, 
			  title:"Prodejna Uničov"
		  });	
	  }	
	  
	  function initialize_prostejov() {
		var latlng = new google.maps.LatLng(49.484046,17.125899);
		var myOptions = {
		  zoom: 14,
		  scrollwheel: false,
		  center: latlng,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("prostejov_canvas"), myOptions);
		  var marker = new google.maps.Marker({
			  position: latlng, 
			  map: map, 
			  title:"Prodejna Prostějov"
		  });	
	  }		  	  	  	  				
	  
		var flashvars = {};
		var params = {};
		params.wmode = "transparent";
		var attributes = {};
		swfobject.embedSWF("/text.swf", "bottom_flash", "550", "150", "8.0.0", false, flashvars, params, attributes);
		swfobject.embedSWF("/text1.swf", "text_flash1", "550", "40", "8.0.0", false, flashvars, params, attributes);
		swfobject.embedSWF("/text2.swf", "text_flash2", "550", "40", "8.0.0", false, flashvars, params, attributes);
		swfobject.embedSWF("/header.swf", "header_flash", "380", "100", "8.0.0", false, flashvars, params, attributes);
		swfobject.embedSWF("/essox.swf", "bottom_banner", "550", "102", "8.0.0", false, flashvars, params, attributes);
