var et,root;
var cba="#646464";
if (!root) root='';
function ShowFoto(img,par){ad(root+'/img.php?img='+img+'&root='+root+'&par='+par)}
function GE(eId){return document.getElementById(eId)}
function ad(url){
	if (GE('ax111')) document.body.removeChild(GE('ax111'));
	var jsel=document.createElement('SCRIPT');
	jsel.type='text/javascript';
	jsel.id='ax111';
	jsel.src=url;
	document.body.appendChild(jsel);
	return true;
}
function check_fill(obj,mail,descr){
	var msg='';
	if (!descr) descr='';
	et=0;
	for (i=0;i<obj.length;i++) {
		o=obj[i];
		if (o.value.length==0) {
			 et=1;
			 o.style.backgroundColor=cba;
			 if (descr[i]) msg=msg+'- '+descr[i]+"\n";
		}
		else o.style.backgroundColor="";
	}
	if (mail!='' && mail!=undefined && mail.value.length>0) {
		var filter=/^.+@.+\..{2,4}$/;
		if (!filter.test(mail.value)) {
			mail.style.backgroundColor=cba; 
			msg=msg+"- Mail\n";et=1;
		}
	}
	if (msg) alert(msg);
	if (et) return false;
}
function chv(obj,nova,old){if (obj.value==old) obj.value=nova}
var _roll,pp;
function roll(obj,how,h,oh){
	pp=oh;
	_roll=window.setInterval("roll"+how+"('"+obj+"',"+h+","+oh+")",1);
}
function roll1(o,h,oh){
	pp=pp+10;
	o=GE(o);
	o.style.height=pp;
	if (pp>=h) {
		window.clearInterval(_roll);
		o.style.height="auto";
		o.innerHTML=o.innerHTML.replace('1,'+h+','+oh,'0,'+oh+','+h);
		o.innerHTML=o.innerHTML.replace('[+]','[-]');
	}
}
function roll0(o,h,oh){
	pp=pp-10;
	o=GE(o);
	o.style.height=pp;
	if (pp<=h) {
		window.clearInterval(_roll);
		o.innerHTML=o.innerHTML.replace('0,'+h+','+oh,'1,'+oh+','+h);
		o.innerHTML=o.innerHTML.replace('[-]','[+]');
	}
}
function endstream(val){
	if (val==1) GE('stream').innerHTML="<hr>Konec / End<hr>";
}
function gourlcode(val,def1,def2){
	obj1=GE('urlname');
	obj2=GE('urlcode');
	if (obj1.value!=def1) add='?name='+encodeURIComponent(obj1.value); 
	else add='';
	if (obj2.value=='' || obj2.value==def2) obj2.style.backgroundColor=cba; 
	else location.href=val+obj2.value+add;
}
