/* ostatnie modyfikacje 2008-12-21 */

function dymek(obiekt,typ){
		obiekt.title=''
		obiekt.parentNode.lastChild.style.display=typ?'block':'none'
	}


function odslony(f) {
  wart = f;	
  znacznik = new Date().getTime();
  new Image().src="syst/prog/odslony.php?id="+wart+"&b=78ad56&t="+znacznik;
  return false;
}

function endload() {
  document.getElementById("preload").style.display="none";
  document.getElementById("prelcie").style.display="none";		
  document.getElementById("prelkom").style.display="none";
}

/* skrypty do galerii 2008-09-21 */

var timeout = 50;
var zas;

function zaslon() {

	zas+=0.2;
	if(zas < 0.8)
	{
	 document.getElementById("kurtyna").style.opacity = zas;
	 document.getElementById("kurtyna").style.filter = "alpha(opacity="+(zas*100)+")";
    setTimeout("zaslon()",timeout);
	}
	else
	{
	 zas = 0.8;
	 zie = 80;
	 document.getElementById("kurtyna").style.opacity = zas;
	 document.getElementById("kurtyna").style.filter = "alpha(opacity="+(zas*100)+")";
	 
	 document.getElementById("pokaz").style.opacity = 1;
	 document.getElementById("pokaz").style.filter = "alpha(opacity=100)";
   }	
 }

function zaslona() {
 	zas = 0;
	zaslon();
}

function odslona() {

	if(zas > 0)
	{
	 zas-=0.2;
	 document.getElementById("kurtyna").style.opacity = zas;
	 document.getElementById("kurtyna").style.filter = "alpha(opacity="+(zas*100)+")";
	 setTimeout("odslona()",timeout);
	}
	else
   {
	 document.getElementById("pokaz").style.display = "none";
	 document.getElementById("pokrywa").style.display = "none";
	 document.getElementById("kurtyna").style.display = "none";
	 document.getElementById("pokster").style.display = "none";
   }	 
}

/* licznik znaków w formularzu */

function Ile_znak(Target,maxlength) {
  StrLen=Target.value.length;
  if (StrLen==1&&Target.value.substring(0,1)==" ") 
  {
      Target.value="";
      StrLen=0;
  }
  if (StrLen>maxlength)
  {
      Target.value=Target.value.substring(0,maxlength);
      CharsLeft="koniec";
  } 
  else 
  {
      CharsLeft="zostało "+(maxlength-StrLen)+" znak.";
  }              
  document.wpda.licz_zn.value=CharsLeft;
}

function kasuj_licz(Target) {
	document.wpda.licz_zn.value='';
}

function dym(obiekt,typ){
		obiekt.nextSibling.style.display=typ?'block':'none'
}