var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only


if (document.getElementById){  
document.write('<style type="text/css">\n')
document.write('.menu_1_2{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu_1(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("menu_1").getElementsByTagName("ul");  
		if(el.style.display != "block"){  
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="menu_1_2")  
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}



if (document.getElementById){  
document.write('<style type="text/css">\n')
document.write('.menu_1_2{display: none;}\n')
document.write('</style>\n')
}



function SwitchMenu_1_2(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("menu_1").getElementsByTagName("ul");  
		if(el.style.display != "block"){  
			for (var i=0; i<ar.length; i++){
			//	if (ar[i].className=="sub1_1_1")  
			//	  ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}


if (document.getElementById){  
document.write('<style type="text/css">\n')
document.write('.menu_2_2{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu_2(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("menu_2").getElementsByTagName("ul");  
		if(el.style.display != "block"){  
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="menu_2_2")  
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}


if (document.getElementById){  
document.write('<style type="text/css">\n')
document.write('.menu_2_2{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu_2_2(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("menu_2").getElementsByTagName("ul");  
		if(el.style.display != "block"){  
			for (var i=0; i<ar.length; i++){
			//	if (ar[i].className=="sub1_1_1")  
			//	ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}




function wyswietl(T,t){
   T.nextSibling.style.display=t?'block':'none'
  }


function ImgWinOpen(file,title,w,h)
{
     look='';
     sbars = 0;
     resize = 0;
     if(w > screen.availWidth)
     {
     		w = screen.availWidth-30;
     		sbars = 1;
     		resize = 1;
     }
     if(h > screen.availHeight)
     {
     		h = screen.availHeight-60;
     		sbars = 1;
     		resize = 1;
     }
     
	  look = 'scrollbars='+sbars+', resizable='+resize+', width='+w+',height='+h+'';
     newWin = window.open(file,'newWindow','toolbar=0,location=0,'+look);
	  newWin.document.write("<html><head><title>"+title+"</title></head>");
	  newWin.document.write("<body leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 marginwidth=0 marginheight=0 margin=0 onClick='window.close();' style='cursor:pointer;'><img src=" +file+ " / alt='Kliknij, aby zamkn±ć okno'>");
	  newWin.document.write("</body></html>");
	 
}



function formularz_open(adres) 
  {
  noweOkno = window.open(adres, 'okienko', 'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=no, status=no, width=560, height=260')
  }

//CHMURKA///////////////////////////////////////////////////////////////////////
function wyswietl(T,t){
   T.nextSibling.style.display=t?'block':'none'
  }


//POP-UP-ZDJECIA////////////////////////////////////////////////////////////////////////
function ImgWinOpen(file,title,w,h)
{
     look='';
     sbars = 0;
     resize = 0;
     if(w > screen.availWidth)
     {
     		w = screen.availWidth-30;
     		sbars = 1;
     		resize = 1;
     }
     if(h > screen.availHeight)
     {
     		h = screen.availHeight-60;
     		sbars = 1;
     		resize = 1;
     }
     
	  look = 'scrollbars='+sbars+', resizable='+resize+', width='+w+',height='+h+'';
     newWin = window.open(file,'newWindow','toolbar=0,location=0,'+look);
	  newWin.document.write("<html><head><title>"+title+"</title></head>");
	  newWin.document.write("<body leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 marginwidth=0 marginheight=0 margin=0 onClick='window.close();' style='cursor:pointer;'><img src=" +file+ " / alt='Kliknij, aby zamknąć okno'>");
	  newWin.document.write("</body></html>");
	 
}
 
 

////////////////////////////////////////////////////////////////////////////////  
function subskrypcja_box()
  {
  if (document.getElementById("e_mail").value)
    {
    document.getElementById("formularz_subskrypcja").submit();
    }
  else
    {
    alert("wpisz poprawnie adres e-mail");
    } 
  }


////////////////////////////////////////////////////////////////////////////////  
function szukaj()
  {

  var komunikat="";
	if(document.form_search.fraza.value=="") komunikat="* Wpisz szukaną fraze\n";
	if(document.form_search.fraza.value.length < 3) komunikat+="* Wpisana fraza jest za krótka ( min.3 znaki )";
	if( komunikat!="") {
		alert(komunikat);
		return false;
	}
	document.form_search.submit();
  }


////////////////////////////////////////////////////////////////////////////////
function biuletyn()
  {
  
  var komunikatBledu="" ;
  var komunikatBledu1="" ;
  var komunikatBledu2="" ;
  var komunikatBledu3="" ;

  if (document.getElementById("wiek").value=="") komunikatBledu1 += "Prosz?ypeni?ole: Firma\n\n" ;
	if (document.getElementById("status").value=="") komunikatBledu2 += "Prosz?ypeni?ole: Login\n\n" ;
	if (document.getElementById("wojewodztwo").value=="") komunikatBledu3 += "Prosz?ypeni?ole: Haslo\n\n" ;
  
  
	
//	if (document.getElementById("status").value=="0") 
//    {komunikatBledu += "*Status\n" ;}
	
//	if (document.getElementById("wojewodztwo").value=="0") 
//    {komunikatBledu += "*Wojewdztwo\n" ;}
	
//	if (document.getElementById("wellness").value=="0") 
//    {komunikatBledu += "*Wellness\n" ;}
	
//	alert ("asdasdasd");
	
  if (komunikatBledu != "") 
    { 
    komunikatBledu = komunikatBledu ; 
    alert(komunikatBledu);
    }
	else
    {
    document.getElementById("formularz_biuletyn").submit();
    }	 
 
  }
  
  
///////////////////////////////////////////////////////////////////////////////
function pop_up(plik,tytul,w,h) 
{	
var pl=plik;
var title=tytul;
var hight=h;
var width=w;
newWin =window.open(pl, title,'height='+hight+', width='+width+',resizable=yes,scrollbars=yes,screenX=0,screenY=0');
}


function czas() 
    {
  var god, mi, se, dz, ld, m, dzi, ro, tm, td;
  
  dzi = new Date();
  god=dzi.getHours();
  mi=dzi.getMinutes();
  se=dzi.getSeconds();
  ro=dzi.getYear();
  dz=dzi.getDate();
  m=dzi.getMonth();
  ld=dzi.getDay();
  if (ld==0) {td="Niedziela"}if (ld==1) {td="Poniedziałek"}if (ld==2) {td="Wtorek"}if (ld==3) {td="Środa"}if (ld==4) {td="Czwartek"}if (ld==5) {td="Piątek"}if (ld==6) {td="Sobota"}
  if (m==0) {tm="stycznia"}if (m==1) {tm="lutego"}if (m==2) {tm="marca"}if (m==3) {tm="kwietnia"}if (m==4) {tm="maja"}if (m==5) {tm="czerwca"}if (m==6) {tm="lipca"}if (m==7) {tm="sierpnia"}if (m==8) {tm="września"}if (m==9) {tm="października"}if (m==10) {tm="listopada"}if (m==11) {tm="grudnia"}
  if (m < 10) {m="0"+m;}
  if (dz < 10) {dz="0"+dz;}
  if (god < 10) {god="0"+god;}
  if (mi < 10) {mi="0"+mi;}
  if (se < 10) {se="0"+se;}
  if (ro ==107) ( ro=2007)
  
   pl2=td + " <b>" + dz + " " + tm + " " + ro+ "</b>";
 
  if (document.layers)
   {
   document.layers.Data2.document.write(pl2)
   document.layers.Data2.document.close()
   //setTimeout("czas()",1000)
   }
  else if (document.all)
   {
   Data2.innerHTML=pl2
  // setTimeout("czas()",1000)
   }
  else
   {
   warstwa = document.getElementById("Data2");
      warstwa.innerHTML = pl2;
  // setTimeout("czas()",1000);
   } 
 }


////////////////////////////////////////////////////////////////////////////////  
function zaloguj()
  {

  var komunikat="";
	if(document.form_login.e_mail.value=="" || document.form_login.haslo.value=="") komunikat="* Pusty login lub hasło\n";
	if( komunikat!="") {
		alert(komunikat);
		return false;
	}
	document.form_login.submit();
  }

/////WYSOKOSC DIVOV/////////////////////////////////////////////////////////////
function div_home() { 
    
	var left = document.getElementById('left');
	var right = document.getElementById('right');
	//var box_certificates = document.getElementById('box_certificates'); 
	
	var left_h = left.offsetHeight;
	var right_h = right.offsetHeight;
	//var box_certificates_h = box_certificates.offsetHeight;
	
	var maks; 
	
	maks = Math.max(left_h,right_h)
	
	left.style.height = maks +"px";
	right.style.height = maks +"px";
	//box_certificates.style.height = maks +"px";

}

