var errors,s;
var sorsz = 0;		
var lasthotel = "";
var utas_price = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var utas2_price = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var jegy1 = 0;
var jegy2 = 0;
var jegysum = 0;
var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
			
function openpicwin(poz,hid)
{window.open('/showpic.aspx?lg=hu&poz='+poz+'&hid='+hid,'Picture','width=590;height=427;location=0;menubar=0;status=0;titlebar=0,toolbar=0');}

			
function winpopup(wurl)
{window.open(wurl,'csehszlo','scrollbars=yes,status=yes,menubar=yes,titlebar=yes,location=yes,toolbar=yes,width=800,height=427');}


function offer(wurl)
{a=window.open(wurl,'csehszlo','scrollbars=no,status=no,menubar=no,titlebar=no,location=no,toolbar=no,width=500,height=280');
 a.location=wurl;
}

function deluser(b,s)
{
	b.removeChild(document.getElementById("row"+s.name.substring(3)));
	document.utform.usz.value = document.getElementById("utazok").getElementsByTagName("tr").length-1;
}
function chguser(s)
{
	var b = document.getElementById("dat3_ubirth"+s.name.substring(12));
	if (s.selectedIndex==1)
		b.style.display="";
	else
		b.style.display="none";
}

function showhide(id,value)
{
	var akt = document.getElementById(id);
	if (akt!=null)
	{
		if (value)
			akt.style.display = "block"; 		
		else
			akt.style.display = "none"; 
	}
	
	
}

function showhotel(name)
{
    if (lasthotel!="")
    {
        hotel = document.getElementById('h'+lasthotel);
        hotel.style.display = "none";    
        hotel = document.getElementById('b'+lasthotel);
        hotel.style.display = "block";    
	hotel = document.getElementById('l'+lasthotel);
        hotel.className="divclose";  
        
    }    
    hotel = document.getElementById('h'+name);
    hotel.style.display = "block";
    hotel = document.getElementById('b'+name);
    hotel.style.display = "none";
    hotel = document.getElementById('l'+name);
    hotel.className="divopen";  
    lasthotel = name;
}	
function adduser()
{
		mytable = document.getElementById("utazok");
		if (sorsz==0) sorsz = mytable.getElementsByTagName("tr").length+1;
		else sorsz = sorsz +1 ;				
        mytablebody = mytable.getElementsByTagName("tbody").item(0);
        mycurrent_row=document.createElement("TR");mycurrent_row.setAttribute("id","row"+sorsz);

		mycurrent_cell=document.createElement("TD");				
		input = document.createElement("INPUT");input.setAttribute("type","button");input.name="del"+sorsz;input.value="Torles";
		input.onclick = function(){deluser(mytablebody,this);};
		mycurrent_cell.appendChild(input);				
		mycurrent_row.appendChild(mycurrent_cell);


		mycurrent_cell=document.createElement("TD");
		input = document.createElement("INPUT");input.setAttribute("type","text");input.setAttribute("name","dat2_uname"+sorsz);				
		mycurrent_cell.appendChild(input);	
		mycurrent_row.appendChild(mycurrent_cell);			
		
		mycurrent_cell=document.createElement("TD");
		input = document.createElement("INPUT");input.setAttribute("type","text");input.setAttribute("name","dat3_unat"+sorsz);				
		mycurrent_cell.appendChild(input);	
		mycurrent_row.appendChild(mycurrent_cell);			
		
		mycurrent_cell=document.createElement("TD");			
		input = document.createElement("SELECT");
		elem = new Option("nem","0");	input[0]=elem;
		elem2 = new Option("igen","1");	input[1]=elem2;
		input.name = "dat3_ugyerek"+sorsz;
		input.onclick = function(){chguser(this);};
		mycurrent_cell.appendChild(input);	
		mycurrent_row.appendChild(mycurrent_cell);			

		mycurrent_cell=document.createElement("TD");
		input = document.createElement("INPUT");input.setAttribute("type","text");input.setAttribute("name","dat3_ubirth"+sorsz);				
		input.setAttribute("id","dat3_ubirth"+sorsz);		
		input.style.display="none";
		mycurrent_cell.appendChild(input);	
		mycurrent_row.appendChild(mycurrent_cell);			
		
		mytablebody.appendChild(mycurrent_row);
		mytable.appendChild(mytablebody);
		document.utform.usz.value = document.getElementById("utazok").getElementsByTagName("tr").length-1;
}

function trim(e) {return e.replace(/(^\s*)|(\s*$)/g, "");}

function isemptystr(e)
{
  if (trim(e)=='') return true; else return false;
}

function ncheckEmail(a) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(a)){
		return (true)
	}		
	return (false)
}

function chkRadio(f){
	var sel = false; 
	var a = eval("document."+f);
	for (var i=0;i<a.length;i++)
	{
		var e = a[i];if (e.checked) 
		sel = true;
	} 
	return sel;
}

function submitkapcs()
{
	theform  = eval('document.kapcs');
	if (isemptystr(theform.name.value)) {alert(err_empty);theform.name.focus();return;}
	if (isemptystr(theform.phone.value)) {alert(err_empty);theform.phone.focus();return;}
	if (!ncheckEmail(theform.email.value)) {alert(err_email);theform.email.focus();return;}
	if (isemptystr(theform.targy.value)) {alert(err_empty);theform.targy.focus();return;}	
	if (isemptystr(theform.message.value)) {alert(err_empty);theform.message.focus();return;}
				
	theform.submit();
}

function szavaz()
{
	theform  = eval('document.szavazas');
	if (!chkRadio("szavazas.vote")) {alert(err_empty);return;}	
	theform.submit();	
}

function showoffer()
{
	window.document.offer.url.value=unescape(window.opener.document.location);
	window.document.offer.content.value=window.opener.document.body.innerHTML;
}

function calcprice(sorsz)
{
	var myDate=new Date()
	myDate.setFullYear(document.getElementById("utas_"+sorsz+"_szul_ev").value,document.getElementById("utas_"+sorsz+"_szul_ho").selectedIndex+1,document.getElementById("utas_"+sorsz+"_szul_nap").value)
	alert(myDate);
	
}

function setcity()
{ 
	theform  = eval('document.order');
	if ((theform.cityfrom.selectedIndex!=-1) && (theform.cityto.selectedIndex!=-1))
	{
		document.getElementById("city1").innerHTML = theform.cityfrom.options[theform.cityfrom.selectedIndex].text + " - " + theform.cityto.options[theform.cityto.selectedIndex].text;
		var pr_name = "p_"+ theform.cityfrom.options[theform.cityfrom.selectedIndex].value + "_" + theform.cityto.options[theform.cityto.selectedIndex].value;
		var pr_0 = null;
		var pr_1 = null;
		
		if (typeof( window[ pr_name + "_0" ] ) != "undefined")
		{
			pr_0 = eval(pr_name+ "_0");		
			document.getElementById("alapar").innerHTML = pr_0[0] + " Ft";
			document.getElementById("junior").innerHTML = pr_0[1] + " Ft";
			document.getElementById("isc").innerHTML = pr_0[2] + " Ft";		
			document.getElementById("child").innerHTML = pr_0[3] + " Ft";						
		}
		else {
			document.getElementById("alapar").innerHTML = "-";
			document.getElementById("junior").innerHTML = "-";
			document.getElementById("isc").innerHTML = "-";		
			document.getElementById("child").innerHTML = "-";			
		    }
		
		if (typeof( window[ pr_name + "_1" ] ) != "undefined")
		{
			pr_1 = eval(pr_name+ "_1");		
			document.getElementById("alapar2").innerHTML = pr_1[0] + " Ft";
			document.getElementById("junior2").innerHTML = pr_1[1] + " Ft";
			document.getElementById("isc2").innerHTML = pr_1[2] + " Ft";		
			document.getElementById("child2").innerHTML = pr_1[3] + " Ft";						
		}
		else 
		{
			document.getElementById("alapar2").innerHTML = "-";
			document.getElementById("junior2").innerHTML = "-";
			document.getElementById("isc2").innerHTML = "-";		
			document.getElementById("child2").innerHTML = "-";			
		}  
	    jegy1 = 0;
		for(var i = 1; i <= document.order.personnum.selectedIndex+1;i++)
		{
			if (document.order.vissza.checked)
			{
				if (pr_1!=null)  
				{
					if (document.getElementById("utas_"+i+"_szul_ev").value.length == 4) 
					{
						utas_price[i] = pr_1[0];
						var uDate=new Date();
						var mDate=new Date();
						uDate.setFullYear(document.getElementById("utas_"+i+"_szul_ev").value);
						uDate.setMonth(document.getElementById("utas_"+i+"_szul_ho").getAttribute("value"));
						uDate.setDate(document.getElementById("utas_"+i+"_szul_nap").value);
						uyear = Math.round((mDate - uDate)/31536000000);
						if ((uyear < 26) || (uyear > 60)) utas_price[i] = pr_1[1];
						if (document.getElementById("utas_"+i+"_isic").checked) utas_price[i] = pr_1[2];
						if (uyear < 15)  utas_price[i] = pr_1[3];					
						jegy1 = jegy1 + utas_price[i];
						document.getElementById("utas_ar_"+i).innerHTML = utas_price[i];
					} else { document.getElementById("utas_ar_"+i).innerHTML = pr_1[0]; jegy1 = jegy1 + pr_1[0]; }
				} else document.getElementById("utas_ar_"+i).innerHTML = "-";
			}
			else
			{
				if (pr_0!=null)  
				{
					if (document.getElementById("utas_"+i+"_szul_ev").value.length == 4) 
					{				
						utas_price[i] = pr_0[0];
						var uDate=new Date();
						var mDate=new Date();
						uDate.setFullYear(document.getElementById("utas_"+i+"_szul_ev").value);
						uDate.setMonth(document.getElementById("utas_"+i+"_szul_ho").getAttribute("value"));
						uDate.setDate(document.getElementById("utas_"+i+"_szul_nap").value);
						uyear = Math.round((mDate - uDate)/31536000000);
						if ((uyear < 26) || (uyear > 60)) utas_price[i] = pr_0[1];
						if (document.getElementById("utas_"+i+"_isic").checked) utas_price[i] = pr_0[2];
						if (uyear < 15)  utas_price[i] = pr_0[3];					
						jegy1 = jegy1 + utas_price[i];
						document.getElementById("utas_ar_"+i).innerHTML = utas_price[i];
					} else  { document.getElementById("utas_ar_"+i).innerHTML = pr_0[0]; jegy1 = jegy1 + pr_0[0];}					 
				} else document.getElementById("utas_ar_"+i).innerHTML = "-";
			}				
		}		
	}	
	if (theform.cityfrom2)	
	{
		if ((theform.cityfrom2.selectedIndex!=-1) && (theform.cityto2.selectedIndex!=-1))
		{
			document.getElementById("city2").innerHTML = theform.cityfrom2.options[theform.cityfrom2.selectedIndex].text + " - " + theform.cityto2.options[theform.cityto2.selectedIndex].text;
			var pr2_name = "p_"+ theform.cityfrom2.options[theform.cityfrom2.selectedIndex].value + "_" + theform.cityto2.options[theform.cityto2.selectedIndex].value;
			var pr2_0 = null;
			var pr2_1 = null;	
			if (typeof( window[ pr2_name + "_0" ] ) != "undefined")
			{
				pr2_0 = eval(pr2_name+ "_0");		
				document.getElementById("alapar_2").innerHTML = pr2_0[0] + " Ft";
				document.getElementById("junior_2").innerHTML = pr2_0[1] + " Ft";
				document.getElementById("isc_2").innerHTML = pr2_0[2] + " Ft";		
				document.getElementById("child_2").innerHTML = pr2_0[3] + " Ft";						
			}
			else {
				document.getElementById("alapar_2").innerHTML = "-";
				document.getElementById("junior_2").innerHTML = "-";
				document.getElementById("isc_2").innerHTML = "-";		
				document.getElementById("child_2").innerHTML = "-";			
				}
			
			if (typeof( window[ pr2_name + "_1" ] ) != "undefined")
			{
				pr2_1 = eval(pr2_name+ "_1");		
				document.getElementById("alapar2_2").innerHTML = pr2_1[0] + " Ft";
				document.getElementById("junior2_2").innerHTML = pr2_1[1] + " Ft";
				document.getElementById("isc2_2").innerHTML = pr2_1[2] + " Ft";		
				document.getElementById("child2_2").innerHTML = pr2_1[3] + " Ft";						
			}
			else 
			{
				document.getElementById("alapar2_2").innerHTML = "-";
				document.getElementById("junior2_2").innerHTML = "-";
				document.getElementById("isc2_2").innerHTML = "-";		
				document.getElementById("child2_2").innerHTML = "-";			
			}  	
			jegy2 = 0;
			for(var i = 1; i <= document.order.personnum2.selectedIndex+1;i++)
			{
				if (document.order.vissza2.checked)
				{
					if (pr2_1!=null)  
					{
						utas_price[i] = pr2_1[0];
						var uDate=new Date();
						var mDate=new Date();
						uDate.setFullYear(document.getElementById("utas2_"+i+"_szul_ev").value);
						uDate.setMonth(document.getElementById("utas2_"+i+"_szul_ho").getAttribute("value"));
						uDate.setDate(document.getElementById("utas2_"+i+"_szul_nap").value);
						uyear = Math.round((mDate - uDate)/31536000000);
						if ((uyear < 26) || (uyear > 60)) utas2_price[i] = pr2_1[1];
						if (document.getElementById("utas2_"+i+"_isic").checked) utas2_price[i] = pr2_1[2];
						if (uyear < 15)  utas2_price[i] = pr2_1[3];					
						jegy2 = jegy2 + utas2_price[i];
						document.getElementById("utas2_ar_"+i).innerHTML = utas2_price[i];
					} else document.getElementById("utas2_ar_"+i).innerHTML = "-";
				}
				else
				{
					if (pr2_0!=null)  
					{
						utas2_price[i] = pr2_0[0];
						var uDate=new Date();
						var mDate=new Date();
						uDate.setFullYear(document.getElementById("utas2_"+i+"_szul_ev").value);
						uDate.setMonth(document.getElementById("utas2_"+i+"_szul_ho").getAttribute("value"));
						uDate.setDate(document.getElementById("utas2_"+i+"_szul_nap").value);
						uyear = Math.round((mDate - uDate)/31536000000);
						if ((uyear < 26) || (uyear > 60)) utas2_price[i] = pr2_0[1];
						if (document.getElementById("utas2_"+i+"_isic").checked) utas2_price[i] = pr2_0[2];
						if (uyear < 15)  utas2_price[i] = pr2_0[3];					
						jegy2 = jegy2 + utas2_price[i];
						document.getElementById("utas2_ar_"+i).innerHTML = utas2_price[i];
					} else document.getElementById("utas2_ar_"+i).innerHTML = "-";
				}				
			}					
					
		}		
			
	}		
	document.getElementById("price1").innerHTML = jegy1;
	document.getElementById("price2").innerHTML = jegy2;
	document.getElementById("sum").innerHTML = jegy1+jegy2;	
}

function initorder(mc,pc,pc2)
{
	if (pc < 1) pc = 1;
	if (pc2 < 1) pc2 = 1;
	for(var i=1;i<=mc;i++)	
	{
		var myi = document.getElementById("utas_"+i+"_tr");
		if (i<=pc) myi.style.display="block"; else myi.style.display="none";		
	}
	document.getElementById("usz1").innerHTML = pc;
	
	for(var i=1;i<=mc;i++)	
	{
		var myi = document.getElementById("utas2_"+i+"_tr");
		if (i<=pc2) myi.style.display="block"; else myi.style.display="none";		
	}	
	document.getElementById("usz2").innerHTML = pc2;
	showhide('tdvissza',document.getElementById("vissza").checked);	
	//showhide('tablejegy2',document.getElementById("jegy2").checked);
	//showhide('divjegy2',document.getElementById("jegy2").checked);	
	showhide('tdvissza2',document.getElementById("vissza2").checked);
	setcity();
}

function setpasscount(pc,mc)
{ 
	pc = pc+1;
	for(var i=1;i<=mc;i++)	
	{
		var myi = document.getElementById("utas_"+i+"_tr");
		if (i<=pc) myi.style.display="block"; else myi.style.display="none";		
	}
	document.getElementById("usz1").innerHTML = pc;
	setcity();
	setmonth();	
}

function setpasscount2(pc,mc)
{ 
	pc = pc+1;
	for(var i=1;i<=mc;i++)	
	{
		var myi = document.getElementById("utas2_"+i+"_tr");
		if (i<=pc) myi.style.display="block"; else myi.style.display="none";		
	}
	document.getElementById("usz2").innerHTML = pc;	
	setcity();
}

function setmonth()
{
	for(var i=1;i<21;i++)
	{
	/*	var s = eval("document.order.utas2_"+i+"_szul_ho");
		var v = s.getAttribute("value");
		if (v=="") v = 1;
		for (var j=1;j<13;j++)
		{	
			var newOpt = new Option(monthname[j-1],j );
		    s.options[s.length] = newOpt;
	    }
	    s.options[parseInt(v)].selected = true;
	  
	*/  
	   
		s = eval("document.order.utas_"+i+"_szul_ho");
		v = s.getAttribute("value");
		if (s.length==0)
		{
			for (var j=1;j<13;j++)
			{	
				var newOpt = new Option(monthname[j-1],j );
				s.options[s.length] = newOpt;
			}
			if (v!="") s.options[parseInt(v)-1].selected = true;	
		}	    
	}
}


function error(z){errors++;return ('\n- '+z);}
function text(i)
{
	this.trim = function(){return i.value.replace(/(^\s*)|(\s*$)/g, "");}
	this.istel = function(){var re = new RegExp('^[0-9 #()-\\/]+$');if (i.value.match(re)) return true;}
	this.isnum = function(){var re = new RegExp('^[0-9]');if (i.value.match(re)) return true;}
	this.isemail = function(){if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(i.value)) return true;}
	this.isdate = function(){var monthLength = new Array(31,28,31,30,31,30,31,31,30,31,30,31);z = i.split(',');var day= z[0];var month=z[1];var year=z[2];if (!day || !month || !year) return false;if (year/4 == parseInt(year/4)) monthLength[1] = 29;if (day > monthLength[month-1]) return false;monthLength[1] = 28;var now = new Date(); now = now.getTime();var dateToCheck = new Date();dateToCheck.setYear(year);dateToCheck.setMonth(month-1);dateToCheck.setDate(day);var checkDate = dateToCheck.getTime();if (!checkDate) return false; var futureDate = (now < checkDate);if (!futureDate) {return -2} else {return true;}}
	this.length = function(m){if (this.trim(i.value).length>=m) return true;}
	this.color = function(c){y='white';z='black';if (!c){y='orange';z='white'} i.style.background=y;i.style.color=z;}
	if (i.value != "undefined") 
	{
		if (i.value) this.value = i.value;
		if (i.value) this.color(1);
	}	
	if (i.selectedIndex != "undefined") 
	{
		this.value = i.selectedIndex;
		if (i.selectedIndex > 0 ) this.color(1);
	}
}

function chkdate(y,m,d)
{
  m = m - 1;
  var datum = new Date()
  datum.setFullYear(y);
  datum.setMonth(m)
  datum.setDate(d)
  if ((datum.getFullYear() != y) || (datum.getMonth() != m)  || (datum.getDate() != d)) return false;
  return true;
}



function sendorder()
{
	errors=0;s='';
	var theform = document.order;


	aa1 = new text(theform.cityfrom); if (aa1.value<1)  {aa1.color(0);s+=error(err_city);}	
	aa2 = new text(theform.cityto); if (aa2.value<1)  {aa2.color(0);s+=error(err_city);}		
	if ((document.getElementById("sum").innerHTML=="0") && (aa1.value>0) &&	(aa2.value>0) )
	{
	 s+=error(err_nobill);
	 aa1.color(0);s+=error(err_city);
	 aa2.color(0);s+=error(err_city);
	}
	a1 = new text(theform.date1); if (!a1.length(9))  {a1.color(0);s+=error(err_date);}	

	if (document.order.vissza.checked)
	{
		a2= new text(theform.date2); if (!a2.length(9))  {a2.color(0);s+=error(err_date);}	
	}

	for(var i = 1; i <= document.order.personnum.selectedIndex+1;i++)
	{	
		    var inp = eval('document.order.utas_'+i+'_nev');
			c1 = new text(inp); if (!c1.length(1))  {c1.color(0);s+=error(err_ln);}	
		    var inp = eval('document.order.utas_'+i+'_szul_ev');
			c2 = new text(inp); if (!c2.isnum())  {c2.color(0);s+=error(err_numeric);}												
		    var inp = eval('document.order.utas_'+i+'_szul_nap');
			c3 = new text(inp); if (!c3.isnum())  {c3.color(0);s+=error(err_numeric);}	
			if(!chkdate(parseInt(document.getElementById("utas_"+i+"_szul_ev").value),parseInt(document.getElementById("utas_"+i+"_szul_ho").selectedIndex+1),parseInt(document.getElementById("utas_"+i+"_szul_nap").value))) {c3.color(0);s+=error(err_date);}
												
	}
	/*if (document.getElementById("jegy2").checked)
	{
		aa1 = new text(theform.cityfrom2); if (aa1.value<1)  {aa1.color(0);s+=error(err_city);}	
		aa2 = new text(theform.cityto2); if (aa2.value<1)  {aa2.color(0);s+=error(err_city);}		
		b1 = new text(theform.date1_2); if (!b1.length(9))  {b1.color(0);s+=error(err_date);}	
		if (document.order.vissza2.checked)
		{
			b2 = new text(theform.date2_2); if (!b2.length(9))  {b2.color(0);s+=error(err_date);}	
		}	
		for(var i = 1; i <= document.order.personnum2.selectedIndex+1;i++)
		{	
				var inp = eval('document.order.utas2_'+i+'_nev');
				c1 = new text(inp); if (!c1.length(1))  {c1.color(0);s+=error(err_ln);}	
				var inp = eval('document.order.utas2_'+i+'_szul_ev');
				c2 = new text(inp); if (!c2.isnum())  {c2.color(0);s+=error(err_numeric);}									
				var inp = eval('document.order.utas2_'+i+'_szul_nap');
				c3 = new text(inp); if (!c3.isnum())  {c3.color(0);s+=error(err_numeric);}											
		}		
	}	*/
	a3 = new text(theform.mobil); if (!a3.istel())    {a3.color(0);s+=error(err_tel);}	
	a4 = new text(theform.email); if (!a4.isemail())  {a4.color(0);s+=error(err_email);}	
	a41 = new text(theform.email2); if (theform.email.value!=theform.email2.value) {a41.color(0);s+=error(err_email2);}	
	a5 = new text(theform.name);  if (!a5.length(1))  {a5.color(0);s+=error(err_fn);}				

	if (errors>0) {alert(err_head+'\n'+s);} else { theform.submit();}			

}

function sendorder_old()
{
	theform  = eval('document.order');
	if (theform.cityfrom.selectedIndex<1)  {alert(err_empty);theform.cityfrom.focus();return;}
	if (theform.cityto.selectedIndex<1)  {alert(err_empty);theform.cityto.focus();return;}
	if (isemptystr(theform.date1.value)) {alert(err_empty);theform.date1.focus();return;}
	if (document.order.vissza.checked)
	{
		if (isemptystr(theform.date2.value)) {alert(err_empty);theform.date2.focus();return;}
	}
	for(var i = 1; i <= document.order.personnum.selectedIndex+1;i++)
	{	
		    var inp = eval('document.order.utas_'+i+'_nev');
			if (isemptystr(inp.value)) {alert(err_empty);inp.focus();return;}
		    var inp = eval('document.order.utas_'+i+'_szul_ev');
			if (isemptystr(inp.value)) {alert(err_empty);inp.focus();return;}								
		    var inp = eval('document.order.utas_'+i+'_szul_nap');
			if (isemptystr(inp.value)) {alert(err_empty);inp.focus();return;}										
	}
	/*if (document.getElementById("jegy2").checked)
	{
		if (theform.cityfrom2.selectedIndex<1)  {alert(err_empty);theform.cityfrom2.focus();return;}
		if (theform.cityto2.selectedIndex<1)  {alert(err_empty);theform.cityto2.focus();return;}
		if (isemptystr(theform.date1_2.value)) {alert(err_empty);theform.date1_2.focus();return;}
		if (document.order.vissza2.checked)
		{
			if (isemptystr(theform.date2_2.value)) {alert(err_empty);theform.date2_2.focus();return;}
		}	
		for(var i = 1; i <= document.order.personnum2.selectedIndex+1;i++)
		{	
				var inp = eval('document.order.utas2_'+i+'_nev');
				if (isemptystr(inp.value)) {alert(err_empty);inp.focus();return;}
				var inp = eval('document.order.utas2_'+i+'_szul_ev');
				if (isemptystr(inp.value)) {alert(err_empty);inp.focus();return;}								
				var inp = eval('document.order.utas2_'+i+'_szul_nap');
				if (isemptystr(inp.value)) {alert(err_empty);inp.focus();return;}										
		}		
	}*/	
	if (isemptystr(theform.mobil.value)) {alert(err_empty);theform.mobil.focus();return;}	
	if (isemptystr(theform.email.value)) {alert(err_empty);theform.email.focus();return;}		
	if (isemptystr(theform.name.value)) {alert(err_empty);theform.name.focus();return;}				
	theform.submit();
}

function dateStatusHandler(date, y, m, d) {
	var myDate=new Date();
	myDate.setDate(myDate.getDate()+1);	  
	if (date < myDate) return true; 
	return false; 
  };