var et,root;
var cba="#AAC6DF";
if (!root) root='';
function GE(eId){return document.getElementById(eId)}
function ShowFoto(img,par){ad(root+'/img.php?img='+img+'&root='+root+'&par='+par);}
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}

window.onload = function() {load_fade();}

var objects=new Array();
var _fade,op=30;
function setopacity() {
	if (document.all) GE('link').style.filter="alpha(opacity=35)";
	else GE('link').style.opacity=0.3;
}
function load_fade() {
	objects.push(GE("link"));
	_fade = window.setInterval("start_fade()",10);
}
function start_fade() {
	op++;
	for (var i=0;objects[i];i++)
		if (document.all) objects[i].style.filter="alpha(opacity="+op+")";
		else objects[i].style.opacity=op/100;
	if (op>150) {
		window.clearInterval(_fade);
		_fade = window.setInterval("end_fade()",1);
	}
}
function end_fade() {
	op--;
	for (var i=0;objects[i];i++)
		if (document.all) objects[i].style.filter="alpha(opacity="+op+")";
		else objects[i].style.opacity=op/100;
	if (op<30) {
		window.clearInterval(_fade);
		_fade = window.setInterval("start_fade(150)",10);
	}
}
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="<h1>uLIVE.cz</h1><hr>Konec / End<hr>";
	else if (val==2) GE('stream').innerHTML="<h1>uLIVE.cz</h1><hr>Vysílatel ukončil / Sender closed<hr>";
	else if (val==3) GE('stream').innerHTML="<h1>uLIVE.cz</h1><hr>Dostali jste KICK / You are BANNED<hr>";
}
function fbw(){
	document.write("<iframe src='//www.facebook.com/plugins/like.php?href="+encodeURIComponent(location.href)+"&amp;send=false&amp;layout=button_count&amp;width=120&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;height=20' scrolling='no' width=120 height='20' frameborder='0'></iframe>");
}
