var et, tr;
var cba = "#FAC104";

function Flat(par,ln){if (!root) root='';ad(root+'/flat.php?par='+par+'&ln='+ln)}
function ShowFoto(img){	if (!root) root='';	ad(root+'/img.php?img='+img+'&root='+root)}
function ad(url) {
	if (document.getElementById('ax111')) document.body.removeChild(document.getElementById('ax111'));
	var jsel = document.createElement('SCRIPT');
	jsel.type = 'text/javascript';
	jsel.id = 'ax111';
	jsel.src = url;
	document.body.appendChild(jsel);
	return true;
}
function imgReload() {
	document.getElementById('camfoto').innerHTML="<img src='"+root+"/external/image.jpg?"+Math.random()+"' alt='online' width=190>";
	setTimeout("imgReload()",60000);
}	

function check_fill(obj,mail) {
	et=0;
	for (i=0;i<obj.length;i++) {
		o = obj[i];
		if (o.value.length == 0) {
			 et=1;
			 o.style.backgroundColor=cba;
		}
		else 
			 o.style.backgroundColor="";
	}
	if (mail!='' && mail!=undefined && mail.value.length > 0) {
		CheckEmail(mail.value)
		if (!tr) {
			mail.style.backgroundColor=cba; 
			return false;
		}
	}
	if (et) return false;
}

function CheckEmail(field){
	var str=field
	var filter=/^.+@.+\..{2,4}$/
	if (filter.test(str)) tr=true;
	else tr=false;
}
function chv(obj,nova,old) {if (obj.value==old) obj.value = nova; }

function selfiltera(val) {
	var val=val.split('-');
	document.getElementById('dstart').value = val[0];
	document.getElementById('dend').value = val[1];
	document.filtry.submit();
}

function selfilterb(val) {
	var val=val.split('-');
	document.getElementById('cdstart').value = val[0];
	document.getElementById('cdend').value = val[1];
	document.filtry.submit();
}