function booking(mychoice)
{ 
	Window=open("","","scrollbars=no,menubar=no,width=490,height=500, top=35,left=150");
	Window.document.open();
	Window.document.write("<HTML><head><title>Marcopolo World Travels</title></head>")
	Window.document.write("<body bgcolor='black'>")
	Window.document.write("<div align='center'><center><b><font color='white' face='Arial' size='4'>Marcopolo World Travels 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 background='images/sikkim-bg.jpg' 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='Arial' color='#800000'><b>")
	Window.document.write(mychoice)
	Window.document.write("</font><font size='2' face='Tahoma'> . Please provide us with the following information about yourself</b></font></td></tr>")
	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>* Phone</b> (Include Country/Area Code):</font></td><td><input type=text name='phone'> </td></tr>")
	Window.document.write("<tr><td><font size='2' face='Tahoma'><b>Fax</b> (Include Country/Area Code):</font></td><td><input type=text name='fax'> </td></tr>")
	Window.document.write("<tr><td><font size='2' face='Tahoma'><b>* Address :</b></font></td><td><textarea name='address' cols='17' rows='3'></textarea> </td></tr>")
	Window.document.write("<tr><td><font size='2' face='Tahoma'><b>* Country :</b></font></td><td><input type=text name='country'> </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>* Departure date :</b></font></td><td><input type=text name='departure'> </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='17' rows='3'></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></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 formcheck3=Window.document.myform.phone.value;
	var formcheck4=Window.document.myform.address.value;
	var formcheck5=Window.document.myform.country.value;
	var formcheck6=Window.document.myform.arrival.value;
	var formcheck7=Window.document.myform.departure.value;



	var flag =0;
	
	if(formcheck=="" || formcheck2=="" || formcheck3=="" || formcheck4==""|| formcheck5=="" || formcheck6 == "" || formcheck7 == "")
	{
		alert('Please fill up the fields marked with a *');
		flag=1;
            Window.document.myform.name.focus();
		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);
		}
		



	}


}


