//menu top
jQuery.noConflict();

jQuery().ready(function()
{


	jQuery("#nav0 .menu1 .ih a").click(function()
	{
		isClicked = true;
	});

	jQuery("#nav0 .menu1 .ih a").mouseover(function()
	{
		if (!isClicked){
			window.clearTimeout(TimerMenu);
		}
		

		jQuery("#nav0 .menu1 .ih .ish").removeClass("ish");
		jQuery(this).addClass("ish");

		var element_index = jQuery("#nav0 .menu1 .ih a").index(this);
		
		//jQuery("#nav0 div:visible").hide();
		jQuery("#nav0 #navc1,#navc2,#navc3,#navc4,#navc5").hide();		
		
		
		element_index = element_index +1;
		//jQuery("#nav0 div").eq(element_index).show();
		jQuery("#navc" + element_index).show();
		

		//return true;
	});
	
	jQuery("#nav0 .menu1 .ih a").click(function()
	{
		isClicked = true;
		//return true;
	});	
	
	jQuery("#navc1,#navc2,#navc3,#navc4,#navc5").mouseenter(function()
	{
		window.clearTimeout(TimerMenu);
		//return true;
	});
	
	jQuery("#select_producer1,#select_producer2,#select_producer3,#select_producer4,#select_producer5").mouseenter(function()
	{
		isClicked = true;
		//return true;
	});	

	
	jQuery("#navc1,#navc2,#navc3,#navc4,#navc5,#nav0 .menu1 .ih a").mouseleave(function()
	{
		if (!isClicked){
			TimerMenu = window.setTimeout("HideMenus()",700);
		}
		//return true;
	});

	var TimerMenu;
	var isClicked = false;
	
});

function HideMenus(){
	jQuery("#nav0 #navc1,#navc2,#navc3,#navc4,#navc5").hide();
	return true;	
}




//slajdy content0
featuredcontentglider.init({
	gliderid: "content0", //ID of main glider container
	contentclass: "section", //Shared CSS class name of each glider content
	togglerid: "content0_menu", //ID of toggler container
	remotecontent: "", //Get gliding contents from external file on server? "filename" or "" to disable
	selected: 0, //Default selected content index (0=1st)
	persiststate: false, //Remember last content shown within browser session (true/false)?
	speed: 700, //Glide animation duration (in milliseconds)
	direction: "updown", //set direction of glide: "updown", "downup", "leftright", or "rightleft"
	autorotate: false, //Auto rotate contents (true/false)?
	autorotateconfig: [5000, 1] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
});

// wywolanie onchange niestandardowego selecta
function SelectOnChange(id, wartosc){
	switch(id){
		case "wyszukiwarkaKategoria":
			ChangeSearchType(wartosc);
			break;
		case "SortOrderSelect":
			window.location=wartosc;
			break;
		case "TopSearchRozmiarB":
			document.getElementById("TopSearchRozmiarB").value = wartosc;
			document.getElementById("upper_form").submit();
			break;
		case "TopSearchRozmiarM":
			document.getElementById("TopSearchRozmiarM").value = wartosc;
			document.getElementById("upper_form").submit();
			break;	
		case "TopSearchProducent":
			document.getElementById("TopSearchProducent").value = wartosc;
			document.getElementById("upper_form").submit();
			break;	
		case "TopSearchdeliveryTime":
			document.getElementById("TopSearchdeliveryTime").value = wartosc;
			document.getElementById("upper_form").submit();
			break;
		case "TopSearchcenaDo":
			document.getElementById("TopSearchcenaDo").value = wartosc;
			document.getElementById("upper_form").submit();
			break;			
			
			
	}
	
}

function ChangeSearchType(type){
								
	//type = document.getElementById("wyszukiwarkaKategoria").value;
	if (type == "bielizna" || type == "odziez" || type == "dodatki" || type == "kosmetyki"){
		
		document.getElementById("Rozmiary_Biustonosze").style.display = "none";
		document.getElementById("Rozmiary_SML").style.display = "none";
		
		
		if (type == "bielizna"){
			document.getElementById("Rozmiary_Biustonosze").style.display = "block";
			document.getElementById("Rozmiary_SML").style.display = "block";
			document.getElementById("TopCategory").value = "62";
		}
		if (type == "odziez"){
			document.getElementById("Rozmiary_SML").style.display = "block";
			document.getElementById("TopCategory").value = "40";
		}			
		if (type == "dodatki"){									
			document.getElementById("TopCategory").value = "44";
		}
		if (type == "kosmetyki"){									
			document.getElementById("TopCategory").value = "61";
		}									
	}
	

}

function ShowNewsletterDIV(){
	try{
		jQuery('#theNewsletterLayer').slideToggle('normal');
	}catch(e){}
}

