function rozsvit(e) {
	e.setAttribute('class','polozkaON'); 
	e.setAttribute('className','polozkaON');
}

function zhasni(e) {
	e.setAttribute('class','polozka'); 
	e.setAttribute('className','polozka');
}

function showHide(uroven) {
	if(uroven == 1) {
		var e = document.getElementById('druha_uroven');
	} else {
		var e = document.getElementById('treti_uroven');
	}
	if(e.style.display == "block" || e.style.display == "" ) {
		e.setAttribute('style','diplay: none');
		e.style.cssText = "display: none";
	} else {
		e.setAttribute('style','diplay: block');
		e.style.cssText = "display: block";
	}
	//document.getElementById('druha_uroven').style.display='block';
}

/***** odesilaci formular po poptavku - zkopirovano ze starych stranek */
function FP_callJS() {
	eval(arguments[0]);
}

function zmena(co,jak) {//v1.0
	var muzu;
	muzu=true;
	
	if(document.forms.napis[co].value=="ON") {
		document.forms.napis[co].value="OFF";
	} else { 
		document.forms.napis[co].value="ON"; 
	}
	
	aha1 = new String(document.forms.napis.T2.value);
	aha2 = new String(document.forms.napis.T3.value);
	pozice1=aha2.search("@");
	if (document.forms.napis.C1.value=="OFF" && document.forms.napis.C2.value=="OFF" && document.forms.napis.C5.value=="OFF") { 
		muzu=false;
	}
	if (aha1.length==0||aha2.length==0||pozice1<1) { 
		muzu=false;
	}
	
	
	if(muzu){ 
		document.forms.napis.img2.disabled=false;
		FP_swapImg(1,0,/*id*/'img2',/*url*/'./image/button1.jpg')
	}
	else {
		document.forms.napis.img2.disabled=true;
		FP_swapImg(1,0,/*id*/'img2',/*url*/'./image/button3.jpg');
		//		WFP_changeProp(/*id*/'img2',0,'style.cursor','default')
	}

}

//
function vynuluj() {//v1.0
	document.forms.napis.reset();
	document.forms.napis.C1.value="OFF";
	document.forms.napis.C2.value="OFF";
	//document.forms.napis.C3.value="OFF";
	//document.forms.napis.C4.value="OFF";
	document.forms.napis.C5.value="OFF";
	//document.forms.napis.C6.value="OFF";
}

function odesli() {//v1.0
// document.getElementById("odeslat") bylo window.odeslat
	document.getElementById("odeslat").from.value=document.forms.napis.T3.value;
	
	document.getElementById("odeslat").Odesilatel.value="  Jméno: "+document.forms.napis.T1.value+"   Príjmení: "+document.forms.napis.T2.value;
	document.getElementById("odeslat").Telefon.value=" "+document.forms.napis.T4.value;
	document.getElementById("odeslat").Zprava.value=" "+document.forms.napis.S1.value;     
	info=" "                                    
	if (document.forms.napis.C1.value=="ON") info=info+"Elektrické revize, " ;
	if (document.forms.napis.C2.value=="ON") info=info+"Elektrické rozvody, " ;
	//if (document.forms.napis.C3.value=="ON") info=info+"Instalace registracní pokladny, " ;
	//if (document.forms.napis.C4.value=="ON") info=info+"Správa pocítacové síte, " ;
	if (document.forms.napis.C5.value=="ON") info=info+"Zabezpecovací systémy, " ;
	//if (document.forms.napis.C6.value=="ON") info=info+"Vedení úcetnictví, " ;
	document.getElementById("odeslat").Informace.value=info; 
	
	document.getElementById("odeslat").submit();

}

function kontrola(kde) {//v1.0
var kde,pozice,muzu;
muzu=true;
aha = new String(document.forms.napis[kde].value);
aha1 = new String(document.forms.napis.T2.value);
aha2 = new String(document.forms.napis.T3.value);
pozice1=aha2.search("@");



if (aha.length==0) {if (kde=="T2"){ alert("Příjmení je nutné vyplnit");document.forms.napis.T2.focus();muzu=false}
					else { alert("E-mail je nutné vyplnit");document.forms.napis.T3.focus();muzu=false}}
else {pozice=aha.search("@")
	 if (pozice<1&&kde=="T3") { alert("Špatně vyplněná e-mail adresa");document.forms.napis.T3.focus();muzu=false}}

if (document.forms.napis.C1.value=="OFF"&&document.forms.napis.C2.value=="OFF"&&document.forms.napis.C5.value=="OFF") muzu=false;
if (aha1.length==0||aha2.length==0||pozice1<1) muzu=false;
if(muzu){ document.forms.napis.img2.disabled=false;
		  FP_swapImg(1,0,/*id*/'img2',/*url*/'./image/button1.jpg')}
else { document.forms.napis.img2.disabled=true;
		  FP_swapImg(1,0,/*id*/'img2',/*url*/'./image/button3.jpg');
		  FP_changeProp(/*id*/'img2',0,'style.cursor','default')};

}



function FP_preloadImgs() {//v1.0
	var d=document,a=arguments; 
	if(!d.FP_imgs) d.FP_imgs=new Array();
	for(var i=0; i<a.length; i++) { 
 		d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; 
	}
}

function FP_swapImg() {//v1.0
	var doc=document,args=arguments,elm,n; 
	doc.$imgSwaps=new Array(); 
	for(n=2; n<args.length; n+=2) { 
 		elm=FP_getObjectByID(args[n]);
 		if(elm) {
 			doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 			elm.$src=elm.src;
 			elm.src=args[n+1];
 		}
 	}
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function FP_changeProp() {//v1.0
 var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
 d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o"; 
 ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) { 
  s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
 x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
 if(s) eval(s+"=v"); }
}

//<form method="POST" name="pokus" action="--WEBBOT-SELF--">
//	<!--webbot bot="SaveResults" U-File="file:///C:/Documents and Settings/Ondra/Dokumenty/Weby/web6/_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE" S-Builtin-Fields="REMOTE_NAME REMOTE_USER HTTP_USER_AGENT" -->

//--WEBBOT-SELF---->
//	<!--webbot bot="SaveResults" U-File="C:\Documents and Settings\Ondra\Plocha\wwwcsc1510\files\form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE" S-Email-Format="HTML/BR" S-Email-Address="vampola@tiscali.cz" B-Email-Label-Fields="TRUE" B-Email-Subject-From-Field="FALSE" S-Email-Subject="WWW aplikace" S-Date-Format="%d. %B %Y" S-Builtin-Fields="REMOTE_NAME REMOTE_USER HTTP_USER_AGENT Date" -->
	
////	<input type="hidden" name="charset" value="windows-1250" >

//<input type="hidden" name="subject" value="WWW stránky" >

//<input type="hidden" name="to" value="ovampola@csc.cz" >

//<input type="hidden" name="err" value="http://www.csc.cz/files/poptavka.htm" >
//		<input type="hidden" name="ok" value="http://www.csc.cz/files/poptavka.htm" >

//mailto:info@csc.cz"  enctype="text/plain
