function Validator(form)
{
   for (var i=0; i<2; i++) 
   {
     if (form.elements[i].value == "") 
	 { 
       alert ("Заполните, пожалуйста, все поля, отмеченные звездочкой (*)."); 
       return false;
     }
  }
  
alert ("mail.php?f1="+form.f1.value+"&f2="+form.f2.value+"&f3="+form.f3.value+"&f4="+window.location.href);
w=250;
h=100;  
obj=open("mail.php?f1="+form.f1.value+"&f2="+form.f2.value+"&f3="+form.f3.value+"&f4="+window.location.href, "404", "top="+((screen.height-h)/2)+", left="+((screen.width-w)/2)+", width="+w+", height="+h+", status=no, toolbar=no, menubar=no"); 
obj.document.close(); 
}

function ValidatorPop(form)
{
   for (var i=0; i<2; i++) 
   {
     if (form.elements[i].value == "") 
	 { 
       alert ("Заполните, пожалуйста, все поля, отмеченные звездочкой (*)."); 
       return false;
     }
  }

window.location.replace("mail.php?f1="+form.f1.value+"&f2="+form.f2.value+"&f3="+form.f3.value+"&f4="+window.location.href); 
return false;
}

function ShowHotel(par)
{
w=620;
h=400;  	
obj=open("hotel.php"+par, "404", "top="+((screen.height-h)/2)+", left="+((screen.width-w)/2)+", width="+w+", height="+h+", status=no, toolbar=no, menubar=no, scrollbars=yes"); 
obj.document.close(); 
}

function ShowDetail(par)
{
w=620;
h=400;  	
obj=open("detail.php"+par, "404", "top="+((screen.height-h)/2)+", left="+((screen.width-w)/2)+", width="+w+", height="+h+", status=no, toolbar=no, menubar=no, scrollbars=yes"); 
obj.document.close(); 
}

function chdate(parent,id, mde)
{
if (mde=='popup')
	{
		if (parent.date.value==0)
		{
		window.location.href='detail.php?id='+id+'&tours='+id+'&mode=popup';	
		}
		else
		{
		window.location.href='detail.php?id='+id+'&tours='+id+'&mode=popup&fix='+parent.date.value+'&type=fix';	
		}
	}
	else
	{
		if (parent.date.value==0)
		{
		window.location.href='tours_'+id+'_'+id+'.html';	
		}
		else
		{
		window.location.href='tours_'+id+'_'+id+'_date_'+parent.date.value+'.html';
		}
	}
}

