//<script type="text/javascript" language="JavaScript1.2">
var nasobr = new Image();
var gsirka=0;
var gvyska=0;
var gcesta="";
var a;

function jed()
{
	if (!okno.document.all.grafika) 
	{
	a=setTimeout("jed()",1000);
	return;
	}
	if ((okno.document.all) && (okno.document.all.grafika))
	{
		clearTimeout(a); 
		okno.document.all.grafika.width=gsirka;
		okno.document.all.grafika.height=gvyska;
		okno.document.all.grafika.src=nasobr.src;
	//	okno.document.grafika.src=gcesta;
		okno.focus();
		okno.document.all.grafika.alt="Nahráno";
		
	}
}


function nahled(cesta,sirka,vyska,url)
{
	gsirka=sirka;
	gvyska=vyska;
	gcesta=cesta;

	url="nahled.php";
	//okno = new Window;
	//okno = window.open(url,'oknoo','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,dependent,width='+(gsirka+40)+',height='+(gvyska+70)+',left=130,top=15');
	sokna=sirka+0;
	vokna=vyska+0;
	okno = window.open(url,'oknoo','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,dependent,width='+sokna+',height='+vokna+',left=130,top=120');
	nasobr.src = cesta;
	a=setTimeout("jed()",1000);
  	
}

function jdi_new(mark,tofocus)
{
	
	if ((document.mainform) && (document.mainform.restore))
	{
	//alert('jede');
	document.mainform.restore.value = "true";
	//document.mainform.f_mark.value = mark; //kam se vratit
	//document.mainform.f_foc.value = tofocus; //co zaměřit
	//alert(document.mainform.f_foc.value);
	document.mainform.submit();
	}
}

function info(zalozka)  //info o ao a1 b1 atd..
{
	//alert('jo');
	okno = window.open('http://www.prazska.info/www/c/faq.php#'+zalozka,'faq','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,dependent,width=350,height=300,left=2,top=2');
	okno.focus();
	//return false;
}

function umistiReklamu(idElementu,xset,yset)
{
	//el = document.getElementById(idElementu); //,xset,yset);
	
	//html = '<div class="adv"> !!!!!!   </div>';
	
	var newAdv = document.createElement('div');
                   
	newAdv.setAttribute('class', 'adv');
	
	//newAdv.className = "adv";
	
	//newAdv.appendData = "!!!!!!!!";
    
	if (e = document.getElementById(idElementu))
	{
		idElementu.border = "1";
		e.appendChild(newAdv);
		alert("appended");
	}
	
	
	
	//alert(idElementu.currentStyle.left);

}

function umistiReklamu2(za_idElementu,idElementu,htmltext,pocet)
{
	sirka_stranky = 790;
	max_sirka = 430;	
	timeout = 50;
	
	if (e = document.getElementById(idElementu))
	{
		//alert("width : "+ parseInt(e.style.width))
		
		pocet++;
		
		if (parseInt(e.style.width) < max_sirka)
		{
			//x = Math.floor( parseInt(e.style.width)/2+0.8);
			x = pocet;
			//alert(x);
			if (parseInt(e.style.width) + x < max_sirka)
			e.style.width = (parseInt(e.style.width) + x) + "px";
		}
		else
		{
			if (za = document.getElementById(za_idElementu))
			{
				/*
				alert("des");
				za.removeChild(e);			
				*/
				return;
				
			}
			
		}
		
		
		//e.style.visibility = "hidden";
		//e.style.left = 200 + "px";
		//alert('existuje');
		
		
		
		
			
	}
	else
	{
		//alert('ne');
		
		
		//htmltext = "ahoj chlape";
		
		//el = document.getElementById(idElementu); //,xset,yset);
		
		//html = '<div class="adv"> !!!!!!   </div>';
		
		if (e = document.getElementById(za_idElementu))
		{
					
			if (document.all) //IE
			d_sirka = document.body.clientWidth;
			else //Firefox
			d_sirka = (document.width);
			
			okraj = 289;
			
			if (d_sirka > sirka_stranky )
			x_start = Math.floor(((d_sirka - sirka_stranky)/2) ) + okraj;
			else
			x_start =  okraj;
			
			//alert(d_sirka); 
			
			//alert("all:" + document.body.clientWidth);
			
			newAdv = document.createElement('div');
			
			//document.getElementById()
			
			newAdv.style.position = "absolute";
		                   
			newAdv.style.left = x_start + "px";
			newAdv.style.top = 220 + "px";
			
			newAdv.style.width = 1 + "px";
			newAdv.style.height = 74 + "px";
			
			newAdv.style.textAlign = "left";		
			start_clip_x = 100;
			//newAdv.style.clip = "rect(auto "+ start_clip_x + "px auto auto)";
			
			//rect(top right bottom left) 
			
			newAdv.style.overflowX = "hidden";
			
			//newAdv.style.whiteSpace = "nowrap";
			
			newAdv.style.overflowY = "hidden";
			
			//newAdv.style.border = "outset gray 1px";
					
			
			
			
			
			
			
			
			
			newAdv.style.visibility = "visible";
			
			newAdv.setAttribute('id', idElementu);
			
			//newAdv.innerHTML = htmltext;
			
			//o = new Image;
			//o.src = "banner_kurzy.gif";
			
			//newAdv.style.backgroundColor = "transparent";
			newAdv.innerHTML = '<a href="jazykove-kurzy-pro-verejnost-sleva/"><img border="0"  src="http://www.prazska.info/img/cimg/banner_kurzy.gif" id="img_banner"></a>';
			
			//newAdv.setAttribute('class', 'adv');
			//newAdv.setAttribute('className', 'adv'); //IE FIX
			
			e.appendChild(newAdv);
			
			//debugger;
			/*
			if (e = getElementById("img_banner"))
			{
			alert("Asd");
			//e.src = o.src;
			}
			*/
				//alert("appended");
			
		//newAdv.appendData = "!!!!!!!!";
	    
		
		
		}	
	}
	//alert(idElementu.currentStyle.left);
	
	/*if (i==undefined) */ 
	
	i = setTimeout('umistiReklamu2("adv_par","div_adv","nazdar chlape - ",'+ pocet+' )',timeout);
		//i=1;
	
	//ff  = "umistiReklamu2("+za_idElementu+","+idElementu+","+htmltext+")";
	//i = setTimeout(ff,2);
	
	//alert(ff);
	
	
	
	
	/*if (i == undefined)*/ 
	


	
	//if (i=undefined) i = setInterval("umistiReklamu2("+za_idElementu+","+idElementu+","+htmltext+")",1000);
	
}


function checkEmailAddress(email)
{
	var emailFilter=/^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(email))) { 
		alert('E-mailová adresa musí být správně vyplněna.');
    	return false;
    } else {
		return true;
	}
}


//</script>
