function onMap(x,idPola,Arkusz){
	if (x==1) {document.body.style.cursor="pointer";}
	else	{document.body.style.cursor="default";}
   
	if((Arkusz.length) && (idPola.length) ){ 
		e = document.getElementById(idPola);
		e.className = Arkusz;
	}
}
function SwitchWidocznosc(x){
	if(obj=document.getElementById("kopia1").style.visibility == "hidden"){
	    obj=document.getElementById("kopia2").style.visibility="hidden";
	    obj=document.getElementById("kopia1").style.visibility="visible";
	}else {
	    obj=document.getElementById("kopia1").style.visibility="hidden";
	    obj=document.getElementById("kopia2").style.visibility="visible";
	}
}

function SwitchWidocznoscDiv(idElementSet,idElementUnSet){
	    obj=document.getElementById(idElementUnSet).style.visibility="hidden";
	    obj=document.getElementById(idElementUnSet).style.height="0px";
	    obj=document.getElementById(idElementSet).style.visibility="visible";
	    obj=document.getElementById(idElementSet).style.height="auto";
}

function setTyp3IfNeed(){
  var oTypArchiwum = document.getElementById("archiwdata[typ]");
  var oKontrolkaTypArchiwum = document.getElementById("kontrolkaTypArchiwum");
  var oRodzajDodaniaArchiwum0 = document.getElementById("archiwdata[radd][0]");
  var oRodzajDodaniaArchiwum1 = document.getElementById("archiwdata[radd][1]");
  var oTytulOpisu = document.getElementById("archiwdata[nazwatxt]");
  //var oOpis = document.getElementById("archiwdata[opistxt]");
  var oOpis = document.getElementById("ta");
  var oFoto = document.getElementById("updFoto");
  var oZrodloFoto = document.getElementById("updNoweFoto");
  var setNewTyp = '';	 
	
	
  KontrolkaTypArchiwum = oKontrolkaTypArchiwum.value;	
  TypArchiwum = oTypArchiwum.value;
  RAdd0 = oRodzajDodaniaArchiwum0.value;
  RAdd1 = oRodzajDodaniaArchiwum1.value;
  noweFoto = oFoto.value;
  zrodloFoto = oZrodloFoto.value;	
  Tytul = oTytulOpisu.value;
  Opis = oOpis.value;
	
  if(TypArchiwum < 3){
	  if( (TypArchiwum == 1) && ( (oTytulOpisu.value.length > 0) || (oOpis.value.length > 0) ) ){
	     	document.getElementById("archiwdata[typ]").value = 3;
			oKontrolkaTypArchiwum.value = 3;
			document.getElementById("archiwdata[radd][1]").value = 5
	  }	
	  if( (TypArchiwum == 2) && ( noweFoto > 0 ) && (zrodloFoto.length > 0)){
	     	document.getElementById("archiwdata[typ]").value = 3;
			oKontrolkaTypArchiwum.value = 3;
			document.getElementById("archiwdata[radd][1]").value = 1
	  }		
  }	
}
function setWartoscZmiennej(idPola,wartoscPola){
   document.getElementById(idPola).value=wartoscPola;
}
