$(document).ready(function()
{	
	//Header menu	
	 $(".hasSecondLevel").hover(
      function () {       
	   $(this).addClass("no-border");
      }, 
      function () {        
		$(this).removeClass("no-border");
	  }
    );
	
	$("#header .menu ul li").hover(
      function () {       
	   $("img",this).css("display","inline");
      }, 
      function () {        
		$("img",this).css("display","none");
	  }
    );
	
	
		
	//Red menu	
	$(".li1").hover(
		function () {       
			$(".red_menu_inner",this).css("display","inline");
			$("a:not(.a2)",this).addClass("active");
		}, 
		function () {        
			$(".red_menu_inner",this).css("display","none");
			$("a:not(.a2 .active)",this).removeClass("active");
		}
	);
	
		
	
	//Prepare menu
	$(".red_menu .a1").each(function(i) {			
			var width=$(this).width();			
			var width1=width+85;
			var width2=width+22;
			var parent=$(this).parent();
			$(".red_menu_inner",parent).css("margin-left","-"+width1+"px");
			$(".red_menu_inner a",parent).css("width",width2+"px");
		}
	);
	
	//Hover submenu
	$(".red_menu_inner li").hover(
		function () { 			
			$("img",this).css("display","inline");			
		}, 
		function () {
			$("img",this).css("display","none");
		}
    );
	
	
	
	
	
	
		
});


function sh(id,rks){
 
var visi = id.split('|');
if (rks){
 var rks = rks.split('|');
}

var kiek = visi.length-1;
var poz = "";
 if ((kiek > 0) && (document.getElementById('mor').className == "iskl")) {poz = "none";}
 if ((kiek > 0) && (document.getElementById('mor').className == "suskl")) {poz = "block";}


for (i=0;i<=kiek;i=i+1){
 var id = visi[i];
 var st=document.getElementById(id).style.display;
 
 if (poz) {st = poz;}
 
 if (st == "none" || st == ""){
   document.getElementById(id).style.display = "block";
   if (kiek > 0) {document.getElementById('mor').className='suskl'; document.getElementById('mor').innerHTML=rks[1];}
 }else{
   document.getElementById(id).style.display = "none";
   if (kiek > 0) {document.getElementById('mor').className='iskl'; document.getElementById('mor').innerHTML=rks[0];}
 }
}
}

function koo( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}



