function Print()
{
var pom = parent.main.location.toString();
pom = pom.replace(/main.php/g,'print.php');
newWin = window.open(pom,"print","width=650,height=800,left=0,top=0,toolbar=1,menubar=1");
}

function Action(path)
{
newWin = window.open("/ext/php/akce.php#"+path,"Akce","width=600,resizable,scrollbars=1");
}

function Mail()
{
newWin = window.open("/ext/php/mail.php","mail","width=480,height=250,resizable");
}

function MailInsert()
{
var pom = window.opener.parent.main.location.toString();
pom = pom.replace(/main.php/g,'index.html');
if(pom.indexOf("?") > 0)
	pom = pom.substring(0,pom.indexOf("?"));
document.getElementById('mail_URL').innerHTML = pom;
document.form.mail_link.value = pom;
}

function Send(hlas1,hlas2)
{
if(document.form.mail_pro.value=="" || document.form.mail_pro.value=="@") 
		{
		alert(hlas1);
		document.form.mail_pro.select();
		}
	else
	if(document.form.mail_od.value=="") 
		{
		alert(hlas2);
		document.form.mail_od.select();
		}
		else
		document.form.submit();
}

function Shop()
{
newWin = window.open("/ext/php/order.php","shop","width=600,height=600,resizable,scrollbars=1");
}

function Order(hlas4,hlas1,hlas2,hlas3)
{
if(document.form.osoby.value=="") 
	{
	alert(hlas4);
	document.form.osoby.select();
	}
	else
	if(document.form.jmeno.value=="") 
			{
			alert(hlas1);
			document.form.jmeno.select();
			}
		else
		if(document.form.ulice.value=="") 
			{
			alert(hlas2);
			document.form.ulice.select();
			}
			else
			if(document.form.psc1.value=="") 
				{
				alert(hlas2);
				document.form.psc1.select();
				}
				else
				if(document.form.psc2.value=="") 
					{
					alert(hlas2);
					document.form.psc2.select();
					}
					else
					if(document.form.mesto.value=="") 
						{
						alert(hlas2);
						document.form.mesto.select();
						}
						else
						if(document.form.kontakt_value.value=="") 
							{
							alert(hlas3);
							document.form.kontakt_value.select();
							}
							else			
							document.form.submit();
}

function Price(string)
{
var object1=eval("document.form"+string+".cena"),
	object2=eval("document.form"+string+".termin");

object1.value=object2[object2.selectedIndex].id;
}

function InitView(str,width,height)
{
str=("/ext/php/view.php?file="+str);

height=height*1;
height+=60;
width=width*1;
width+=40;

newWin = window.open(str,"view","width="+width+",height="+height+",left=0,top=0,toolbar=1,menubar=1, scrollbars=1,resizable=1");
}

function Kontrola(hlas1,hlas2,hlas3,hlas4)
{
if(document.form.name.value=="")
	{
	alert(hlas1);
	document.form.name.select();
	}
	else
	if(document.form.subject.value=="")
		{
		alert(hlas2);
		document.form.subject.select();
		}
		else
		if(document.form.body.value=="")
			{
			alert(hlas3);
			document.form.body.select();
			}
			else 
			if(document.form.kontakt_value.value=="") 
				{
				alert(hlas4);
				document.form.kontakt_value.select();
				pom=0
				}
				else 
				document.form.submit();
}