function booking(mychoice)
{ 
	Window=open("","","scrollbars=no,menubar=no,width=490,height=400, top=55,left=150");
	Window.document.open();
	Window.document.write("<HTML><head><title>Package Tours Booking Enquiry</title></head>")
	Window.document.write("<body")
	Window.document.write("<div align='center'><center><b><font face='Arial' size='4'>Package Tours Booking Enquiry </font></b>")
	Window.document.write("<form name='myform' method='POST' action='booknow.php'>")
	Window.document.write("<input type='hidden' name='choice' value='")
	Window.document.write(mychoice)
	Window.document.write("'>")
	Window.document.write("<center><table border='0' cellpadding='0' cellspacing='0' width='100%' bgcolor='#5B83AD'><tr><td colspan=2></td></tr>")
	Window.document.write("<tr><td rowspan='15' width='30'></td><td colspan='2'><font size='2' face='Tahoma'><b>Dear Visitor,</b></font></td></tr>")
	Window.document.write("<tr><td colspan='2'><font size='2' face='Tahoma'><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You have chosen </b></font>")
	Window.document.write("<font size='2' face='Tahoma' color='white'><b>")
	Window.document.write(mychoice)
	Window.document.write("</font><font size='2' face='Tahoma'> Package Tour. Please provide us with the following information about yourself</b></font></td></tr><hr>")
	Window.document.write("<tr><td colspan='2'>&nbsp;</td></tr></tr><td><font size='2' face='Tahoma'><b>* Name :</b></font></td><td><input type=text name='name'> </td></tr>")
	Window.document.write("<tr><td><font size='2' face='Tahoma'><b>* Email :</b></font></td><td><input type=text name='email'> </td></tr>")
	Window.document.write("<tr><td><font size='2' face='Tahoma'><b>Arrival date :</b></font></td><td><input type=text name='arrival'> </td></tr>")
	Window.document.write("<tr><td><font size='2' face='Tahoma'><b>* Total number of persons :</b></font></td><td><input type=text name='persons'> </td></tr>")
	Window.document.write("<tr><td><font size='2' face='Tahoma'><b>Other Information you would like:</b></font></td><td><textarea name='comments' cols='20' rows='5'></textarea> </td></tr>")
	Window.document.write("<tr><td colspan='2'>&nbsp;</td></tr><tr><td colspan=2 align=center><input type='button' name='send' value='send' ></td></tr>")
	Window.document.myform.send.onclick=check;
	Window.document.write("<tr><td colspan='2'>&nbsp;</td></tr></table><hr></center>")
	Window.document.write("</form>")
	Window.document.write("</body></html>")
	Window.focus();
}

function check()
{

	var formcheck=Window.document.myform.name.value;
	var formcheck2=Window.document.myform.email.value;


	var flag =0;
	
	if(formcheck=="" || formcheck2=="" )
	{
		alert('Please fill up the fields marked with a *');
		flag=1;
		return (false);
	}
	
	
	
	if(flag==0)
	{
		if(formcheck2.indexOf(" ") >= 0 )
		{
			alert("Please enter the E-Mail address without any white space character.");
			Window.document.myform.email.focus();
			return (false);
		}

		
		AtRateCheckfrom = formcheck2.indexOf("@");
		AtDotCheckfrom  = formcheck2.indexOf(".");

		
		AtRateCheckLastfrom = formcheck2.lastIndexOf("@");
		AtDotCheckLastfrom = formcheck2.lastIndexOf(".");
 

		
		if ( (AtRateCheckfrom == -1) || (AtDotCheckfrom == -1) && flag==0)
		{
			alert("Please enter your valid email-id"); 
			Window.document.myform.email.focus();
			
			
			return (false);
		}
		
			
		if( (AtRateCheckLastfrom != AtRateCheckfrom)  && flag==0)
		{
			alert("Please enter your valid email-id"); 
			Window.document.myform.email.focus();
			return (false);
		}

		BeforeAtRatefrom = formcheck2.substring(0,formcheck2.indexOf("@"));
		AfterAtRatefrom = formcheck2.substring(formcheck2.indexOf("@")+1,formcheck2.length);

				
		if (AfterAtRatefrom.indexOf(".") == -1 && flag==0)
		{
			alert("Please enter your valid email-id"); 
			Window.document.myform.email.focus();
			return (false);
		}

		
		middlefrom = AfterAtRatefrom.substring(0, AfterAtRatefrom.indexOf("."))
		lastfrom = AfterAtRatefrom.substring(AfterAtRatefrom.indexOf(".") + 1,AfterAtRatefrom.length)

		
		if (BeforeAtRatefrom.length == 0 || middlefrom.length == 0 || lastfrom.length == 0 && flag==0)
		{
			alert("Please enter your valid E-Mail"); 
			Window.document.myform.email.focus();
			return (false);
		}
		else
		{
			Window.document.myform.submit();
			return (true);
		}
		



	}


}

