/////////PODSWIETLANIE DOLEGLIWOSCI W MENU //////////////
function podswietl(newColor)
{
 elem=document.getElementById("link_1");
 elem.style.color = newColor;
}

function wyczysc(newColor)
{
 elem=document.getElementById("link_1");
 elem.style.color = newColor;
}



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();
    }	 
 
  }

/////WYSOKOSC DIVOV/////////////////////////////////////////////////////////////
function divy() { 
    var okno= new Array (); 
  
    var top = document.getElementById('top');
  	//var box_menu_top = document.getElementById('box_menu_top');
    //var box_location = document.getElementById('box_location');
    //var box_content = document.getElementById('box_content'); 
    //var box_promotion = document.getElementById('box_promotion'); 
    
    var suma_box;
	  var roznica;
	  
	  var top_h = top.offsetHeight;
    //alert(top_h);
    //var box_menu_top_h = box_menu_top.offsetHeight;
    //var box_location_h = box_location.offsetHeight;
	  //var box_content_h = box_content.offsetHeight;
    //var box_promotion_h = box_promotion.offsetHeight;
    
    
    okno = getPageSize();
 
   // suma_box=top_h + box_menu_top_h + box_location_h + box_content_h + box_promotion_h;

    if (suma_box < okno[1]){
   
      var test1 = document.body.scrollHeight;
      var test2 = document.body.offsetHeight;
      
      roznica = (okno[1] - suma_box - 70);

      box_promotion.style.marginTop = (roznica) + "px";
      //box_promotion.style.background = "ffffff";
      
      //var test3 = document.body.scrollHeight;
      //var test4 = document.body.offsetHeight;
      //box_promotion.style.marginTop = (roznica - (test1 - test3)) + "px";
    
    }
   
}


///ROZMIAR STRONY///////////////////////////////////////////////////////////////
function getPageSize(){
  var windowWidth, windowHeight;
  
  if (self.innerHeight) {    // all except Explorer
    windowWidth = self.innerWidth;
    windowHeight = self.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
    windowWidth = document.documentElement.clientWidth;
    windowHeight = document.documentElement.clientHeight;
  } else if (document.body) { // other Explorers
      windowWidth = document.body.clientWidth;
      windowHeight = document.body.clientHeight;
  }    
  
  
  //alert (windowWidth);
  //alert (windowHeight);
  
  var arrayPageSize = new Array(windowWidth,windowHeight); 
  return arrayPageSize;
  }
  
///////////////////////////////////////////////////////////////////////////////
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 + " " + dz + " " + tm + " " + ro;
 
  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);
   } 
 }


/*********** CZAS NA PODSTRONIE JAK KUPIC ************/
function czas2() 
    {
  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 (ld==0) {td="sobota"}
  if (ld==1) {td="niedziela"}
  if (ld==2) {td="poniedziałek"}
  if (ld==3) {td="wtorek"}
  if (ld==4) {td="środa"}
  if (ld==5) {td="czwartek"}
  if (ld==6) {td="piątek"}
  
  
  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 + " " + (dz-1) + " " + tm + " " + ro;
 
  if (document.layers)
   {
   document.layers.Data1.document.write(pl2)
   document.layers.Data1.document.close()
   //setTimeout("czas()",1000)
   }
  else if (document.all)
   {
   Data1.innerHTML=pl2
  // setTimeout("czas()",1000)
   }
  else
   {
   warstwa = document.getElementById("Data1");
      warstwa.innerHTML = pl2;
  // setTimeout("czas()",1000);
   } 
 }

