function Heritage()
{
var str;
str=document.frmHotels.SelectHeritage.value;
window.location=str+"_hotels.htm";
}
function fDeluxe()
{
var str;
str=document.frmHotels.SelectDeluxe.value;
window.location="../"+str+"_hotels.htm#dlx";
}
function fFirst()
{
var str;
str=document.frmHotels.SelectFirst.value;
window.location="../"+str+"_hotels.htm#First";
}
function fBudget()
{
var str;
str=document.frmHotels.SelectBudget.value;
window.location="../"+str+"_hotels.htm#bgt";
}
function Deluxe()
{
var str;
str=document.frmHotels.SelectDeluxe.value;
window.location=str+"_hotels.htm#dlx";
}
function First()
{
var str;
str=document.frmHotels.SelectFirst.value;
window.location=str+"_hotels.htm#First";
}
function Budget()
{
var str;
str=document.frmHotels.SelectBudget.value;
window.location=str+"_hotels.htm#bgt";
}
function Feedback()
{
	if(frmFeedback.TComments.value=="")
	{
		alert("Please Enter Feedback");
		frmFeedback.TComments.focus();
		return;
	}

	if(document.frmFeedback.TName.value=="")
	{
		alert("Name can't be left blank");
		frmFeedback.TName.focus();
		return;
	}
	if(document.frmFeedback.TEmail.value=="")
	{
		alert("Email Id can't be left blank");
		frmFeedback.TEmail.focus();
		return;
	}
	else
	{
		var msg;
		msg=emailCheck(frmFeedback.TEmail.value);
		if (msg != "done")
		{
			alert(msg);
			frmFeedback.TEmail.focus();
			return;
		}
  	}
	frmFeedback.submit();
}
function imail()
{
	if(document.frmTour.TName.value=="")
	{
		alert("Name can't be left blank");
		frmTour.TName.focus();
		return;
	}
	if(document.frmTour.TEmail.value=="")
	{
		alert("Email Id can't be left blank");
		frmTour.TEmail.focus();
		return;
	}
	else
	{
		var msg;
		msg=emailCheck(frmTour.TEmail.value);
		if (msg != "done")
		{
			alert(msg);
			frmTour.TEmail.focus();
			return;
		}
  	}
	if(frmTour.TContact.value=="")
	{
		alert("Contact No. can't be left blank");
		frmTour.TContact.focus();
		return;
	}
	if(frmTour.TPerson.value=="")
	{
		alert("No. of persons can't be left blank");
		frmTour.TPerson.focus();
		return;
	}
	frmTour.submit();
}
function emailCheck (emailStr)
{
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var matchArray=emailStr.match(emailPat)
	var Msg;
	if (matchArray==null) 
	{
		//    alert("Email address seems incorrect (check @ and .'s)")
		Msg="Email Id seems incorrect (check @ and .'s)";
	    return Msg;
	}
	var user=matchArray[1]
	var domain=matchArray[2]
	// See if "user" is valid 
	if (user.match(userPat)==null)
	 {
	   // user is not valid
		//	   alert("The username doesn't seem to be valid.")
		Msg="The username doesn't seem to be valid.";
        return Msg;
     }
	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null)
	 {
	    for (var i=1;i<=4;i++)
	       {
	      	  if (IPArray[i]>255)
                    {
	         	  //alert("Destination IP address is invalid!")
				  Msg="Destination IP address is invalid!";
				  return Msg;
		    }
	       }
	   return true
	 }

	var domainArray=domain.match(domainPat)
	if (domainArray==null)
	 {
		//alert("The domain name doesn't seem to be valid.")
		Msg="The domain name doesn't seem to be valid.";
	   return Msg;
         }
	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3)
	 {
	  // the address must end in a two letter or three letter word.
	  //alert("The address must end in a three-letter domain, or two letter country.")
	  Msg="The Id must end in a three-letter domain, or two letter country.";
	  return Msg;
	 }

	// Make sure there's a host name preceding the domain.
	if (len<2)
	 {
	  var errStr="Email Id is missing a hostname!"
	  //alert(errStr)
	  Msg=errStr;
	  return Msg;
	 }

	// If we've gotten this far, everything's valid!
	//return true;
	return "done";
  }
  
function hbmail()
{
	if(document.frmhotel.hname.value=="")
	{
		alert("Name can't be left blank");
		frmhotel.hname.focus();
		return;
	}
	if(document.frmhotel.hemail.value=="")
	{
		alert("Email Id can't be left blank");
		frmhotel.hemail.focus();
		return;
	}
	else
	{
		var msg;
		msg=emailCheck(frmhotel.hemail.value);
		if (msg != "done")
		{
			alert(msg);
			frmhotel.hemail.focus();
			return;
		}
  	}
	if(frmhotel.hperson.value=="")
	{
		alert("No. of Person can't be left blank");
		frmhotel.hperson.focus();
		return;
	}
	if(frmhotel.hcity.value=="")
	{
		alert("City of Hotel can't be left blank");
		frmhotel.hcity.focus();
		return;
	}
	if(frmhotel.hduration.value=="")
	{
		alert("Duration can't be left blank");
		frmhotel.hduration.focus();
		return;
	}
	frmhotel.submit();
}