function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
		if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
		if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
		if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0; 						
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
    	ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
    	popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
    	popupWindow[wp].document.body.onbeforeunload = function() {
  			if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
    		window.onbeforeunload = null;	}  
   		autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
  	window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}

function checkEmailValid(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 errMsg="";   
	var matchArray=emailStr.match(emailPat)
	if (matchArray==null) 
	{
	   errMsg=errMsg+"On-Line Reservation System Message:" + '\n' +  '\n' + "The eMail address seems incorrect (please check @ and .).";
	   return errMsg;
	}
	else
	{
	  var user=matchArray[1]
	  var domain=matchArray[2]
	  if (user.match(userPat)==null) 
	  {
		errMsg=errMsg+"On-Line Reservation System Message:" + '\n' +  '\n' + "Your Username is invalid! ";
		return errMsg;       
	  }
	  var IPArray=domain.match(ipDomainPat)
	  if (IPArray!=null) 
	  {
		  for (var i=1;i<=4;i++) 
			  {
			if (IPArray[i]>255) 
				{
				errMsg=errMsg+"On-Line Reservation System Message:" + '\n' +  '\n' + "Destination IP address is invalid! ";
				return errMsg;
				}//IF
			  }//for
	   }//IP Array
	   var domainArray=domain.match(domainPat)
	   if (domainArray==null) 
	   {
		 errMsg=errMsg+"On-Line Reservation System Message:" + '\n' +  '\n' + "The Domain Name is invalid!";
		 return errMsg;
	   }
	   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) 
	   {
		 errMsg=errMsg+"On-Line Reservation System Message:" + '\n' +  '\n' + "The eMail Address must end with a three-letter domain, or two letter country.";
		 return errMsg;	
	   } 
	   if (len<2) 
	   {
		 errMsg=errMsg+"On-Line Reservation System Message:" + '\n' +  '\n' + "Your eMail address does not have a Hostname!";
		 return errMsg;	 
	   } 
	 }//End  Match
	return "0";
}

function checkReservationStep1()
{    
	if  (document.frmData.txtDate.value=="  Click The Icon  >>>")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "The arrival date is missing."); 
        return false;
      }
	if  (document.frmData.txtDate2.value=="  Click The Icon  >>>")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "The Departure Date is missing."); 
        return false;
      }
	if (Date.parse(document.frmData.txtDate.value)>=Date.parse(document.frmData.txtDate2.value))
		{
			alert("On-Line Reservation System Message:" + '\n' +  '\n' + "Departure date must be after the arrival date.");
			return false;
		}
	if (Date.parse(document.frmData.txtDate.value)<(new Date()))
		{
			alert("On-Line Reservation System Message:" + '\n' +  '\n' + "The arrival date is historic.");
			return false;
		}
 	if (Date.parse(document.frmData.txtDate2.value)<(new Date()))
		{
			alert("On-Line Reservation System Message:" + '\n' +  '\n' + "The departure date is historic.");
			return false;
		}
 	return true; 
}

function checkIt()
{
	var total = 0
	var subtotal = 0
	var bookmax = document.frmData.intMax.value/1;
	var bookavai = document.frmData.hid.value/1;
	var newbookmax = document.frmData.intMaxBooking.value/1;
	var ans = true;
	var bOver=false;
	var bZero=false;

	for (i = 0; i<document.frmData.elements.length; ++ i)
	{
		if (isNaN(document.frmData.elements[i].value) || (document.frmData.elements[i].name=="intMax") || (document.frmData.elements[i].name=="intMaxBooking") || (document.frmData.elements[i].name=="strBookingSet") || (document.frmData.elements[i].name=="room_id")  || (document.frmData.elements[i].name=="arrival_date") || (document.frmData.elements[i].name=="depart_date")  || (document.frmData.elements[i].name=="totaldate")   || (document.frmData.elements[i].name=="promotionid")  || (document.frmData.elements[i].name=="singleprice")  || (document.frmData.elements[i].name=="doubleprice")  || (document.frmData.elements[i].name=="dailyprice"))
		{
		}
		else
		{
			subtotal= document.frmData.elements[i].value
			subtotal=subtotal/1
			if(subtotal>0)
			{
				total = total+subtotal
				if(total-bookavai > bookmax)
				{
					bOver=true;
					ans=false;
				}
			}
		}
	}
	if (total-bookavai>newbookmax)
	{
		alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "Sorry, Maximum number of Internet booking is "+newbookmax+".")
		return false;
	}
//	if (bOver==true && ans==false)
//	{
//		if (confirm("On-Line Reservation System Message:" + '\n' +  '\n' + "Sorry, The number of rooms you have requested is greater than the number of rooms requested in Step 1 of 6."+'\n\n'+"Do you wish to continue?"))
//		{
//			document.frmData.intMax.value=newbookmax;
//			return false;
//		}
//		else
//		{
//			document.frmData.intMax.value=bookmax;
//			return false;
//		}
//	}
	return true;
}

function checkFinal()
{
	var total = 0
	var subtotal = 0
	var bookmax = document.frmData.intMax.value/1;
	var bookavai = document.frmData.hid.value/1;
	var ultd = document.frmData.intMaxBooking.value/1;

	for (i = 0; i<document.frmData.elements.length; ++ i)
	{
		if (isNaN(document.frmData.elements[i].value) || (document.frmData.elements[i].name=="intMax") || (document.frmData.elements[i].name=="intMaxBooking") || (document.frmData.elements[i].name=="strBookingSet")  || (document.frmData.elements[i].name=="room_id")  || (document.frmData.elements[i].name=="arrival_date") || (document.frmData.elements[i].name=="depart_date")  || (document.frmData.elements[i].name=="totaldate") || (document.frmData.elements[i].name=="promotionid")   || (document.frmData.elements[i].name=="singleprice")  || (document.frmData.elements[i].name=="doubleprice")  || (document.frmData.elements[i].name=="dailyprice"))
		{
		}
		else
		{
			subtotal= document.frmData.elements[i].value
			subtotal=subtotal/1
			if(subtotal>0)
			{
				total = total+subtotal
			}
		}
	}
	if (total-bookavai ==0)
	{
		alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select a room(s).")
		return false;
	}
       

	if (total-bookavai>ultd)
	{
		alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "Sorry, Maximum number of Internet booking is "+ultd+".")
		return false;
	}
//	if (ultd!=bookmax)
//	{
//		if (total<bookmax)
//		{
//			if (confirm("On-Line Reservation System Message:" + '\n' +  '\n' + "Sorry, The number of rooms you have requested is lesser than the number of rooms requested in Step 1 of 6."+'\n\n'+"Do you wish to continue?"))
//			{
//				document.frmData.intMax.value=1;
//				return false;
//			}
//			else
//			{
//				document.frmData.intMax.value=bookmax;
//				return false;
//			}
//		}
//		else
//		{
//			if (total>bookmax)
//			{
//				if (confirm("On-Line Reservation System Message:" + '\n' +  '\n' + "Sorry, The number of rooms you have requested is greater than the number of rooms requested in Step 1 of 6."+'\n\n'+"Do you wish to continue?"))
//				{
//					document.frmData.intMax.value=ultd;
//					return false;
//				}
//				else
//			{
//					document.frmData.intMax.value=bookmax;
//				return false;
//				}
//			}
//		}
//	}
	return true;
}

function checkReservationStep4()
{   
	if (document.frmData.chkRead.checked==false)
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "Before booking online you might like to read our Privacy Policy and Booking Terms and Conditions."); 
        return false;
      }
	  return true;
}

function checkReservationStep5()
{   
	if  (document.frmData.strFirstName.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your first name."); 
        return false;
      }
	if  (document.frmData.strFamilyName.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your family name.");
        return false;
      }
	if  (document.frmData.strEmail.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your email address");
        return false;
      }
	var e=document.frmData.strEmail.value;
	if (checkEmailValid(e)!="0") 
	{
		alert( checkEmailValid(e));
		return false;	
	}
	if(document.frmData.strSession.value =="LOTUS")
	{
		if(document.frmData.chkCompanyGuarantee.checked==false)
		{
			return checkCCDetail();
		}
	}
	else
	{
		return checkCCDetail();
	}
	  document.frmData.btnSubmit.disabled="yes"
	  document.frmData.btnBack.disabled="yes"
	  document.frmData.btnCancel.disabled="yes"
	return true; 
}

function checkCCDetail()
{
	if  (document.frmData.intCardTypeId.value=="0")
	  {
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to select the type of your credit card."); 
		return false;
	  }
	if  (document.frmData.strCardNumber.value=="")
	  {
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your credit card number."); 
		return false;
	  }
	if  (document.frmData.intMonth.value=="0")
	  {
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to select the month of your credit card expiry date."); 
		return false;
	  }
	if  (document.frmData.intYear.value=="0")
	  {
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to select the year of your credit card expiry date."); 
		return false;
	  }
	var om = (document.frmData.intDepMonth.value)/1;
	var oy = (document.frmData.intDepYear.value)/1;
	var em = (document.frmData.intMonth.value)/1;
	var ey = (document.frmData.intYear.value)/1;
	if(em<om)
	{
		if(ey<=oy)
		{
			alert("On-Line Reservation System Message:" + '\n' +  '\n' + "The credit card has past the expiry date.")
			return false
		}
	}
	if  (document.frmData.strHolderName.value=="")
	  {
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter the name on your credit card."); 
		return false;
	  }
	if  (document.frmData.strAddress.value=="")
	  {
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your credit card address."); 
		return false;
	  }
	if (document.frmData.strAddress.value.length > 300)
	{
		  alert("On-Line Reservation System Message:" + '\n' +  '\n' + "The length of address must be smaller than 300 characters!");
		  return false;
	 }
	if  (document.frmData.strCity.value=="")
	  {
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your credit card city."); 
		return false;
	  }
	if  (document.frmData.strState.value=="")
	  {
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your credit card state/province."); 
		return false;
	  }
	if  (document.frmData.strPostalCode.value=="")
	  {
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your credit card postal/zip."); 
		return false;
	  }
	if  (document.frmData.intCountryId.value=="0")
	  {
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to select your credit card country."); 
		return false;
	  }
	 return true;
}
function SetCompanyGuarantee(opt)
{
	var bflag=document.frmData.bCompanyGuarantee;
	
	if(opt.checked==true)
	{
		bflag.value="True";
		SetBoxesDisabled();
	}
	else
	{
		bflag.value="False";
		SetBoxesEnabled();
	}
}
function SetBoxesDisabled()
{
	document.frmData.intCardTypeId.className="graybox";
	document.frmData.strCardNumber.className="graybox";
	document.frmData.intMonth.className="graybox";
	document.frmData.intYear.className="graybox";
	document.frmData.strHolderName.className="graybox";
	document.frmData.strAddress.className="graybox";
	document.frmData.strCity.className="graybox";
	document.frmData.strState.className="graybox";
	document.frmData.strPostalCode.className="graybox";
	document.frmData.intCountryId.className="graybox";
	document.frmData.intCardTypeId.disabled="yes";
	document.frmData.strCardNumber.disabled="yes";
	document.frmData.intMonth.disabled="yes";
	document.frmData.intYear.disabled="yes";
	document.frmData.strHolderName.disabled="yes";
	document.frmData.strAddress.disabled="yes";
	document.frmData.strCity.disabled="yes";
	document.frmData.strState.disabled="yes";
	document.frmData.strPostalCode.disabled="yes";
	document.frmData.intCountryId.disabled="yes";

	
}
function SetBoxesEnabled()
{
	document.frmData.intCardTypeId.disabled="";
	document.frmData.strCardNumber.disabled="";
	document.frmData.intMonth.disabled="";
	document.frmData.intYear.disabled="";
	document.frmData.strHolderName.disabled="";
	document.frmData.strAddress.disabled="";
	document.frmData.strCity.disabled="";
	document.frmData.strState.disabled="";
	document.frmData.strPostalCode.disabled="";
	document.frmData.intCountryId.disabled="";

	document.frmData.intCardTypeId.className="box";
	document.frmData.strCardNumber.className="box";
	document.frmData.intMonth.className="box";
	document.frmData.intYear.className="box";
	document.frmData.strHolderName.className="box";
	document.frmData.strAddress.className="box";
	document.frmData.strCity.className="box";
	document.frmData.strState.className="box";
	document.frmData.strPostalCode.className="box";
	document.frmData.intCountryId.className="box";
}

function checkCancelResStep1()
{   
	if  (document.frmData.strResNo.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your on-line confirmation number."); 
        return false;
      }
	if  (document.frmData.strEmail.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your email address");
        return false;
      }
	var e=document.frmData.strEmail.value;
	if (checkEmailValid(e)!="0") 
	{
		alert( checkEmailValid(e));
		return false;	
	}
	return true; 
}

function checkResSignIn()
{ 
    if (document.frmData.errMsg.value=="True")
    {
       alert(document.frmData.strWord.value);
       return false;
    }
    return true;
 }

function checkChangeRes()
{   
	if  (document.frmData.strResNo.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your on-line confirmation number."); 
        return false;
      }
	if  (document.frmData.strEmail.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your email address");
        return false;
      }
	var e=document.frmData.strEmail.value;
	if (checkEmailValid(e)!="0") 
	{
		alert( checkEmailValid(e));
		return false;	
	}
	return true; 
}

function checkNewCCRequest()
{   
	if  (document.frmData.intCardTypeId.value=="0")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to select the type of your credit card."); 
        return false;
      }
	if  (document.frmData.strCardNumber.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your credit card number."); 
        return false;
      }
	if  (document.frmData.intMonth.value=="0")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to select the month of your credit card expiry date."); 
        return false;
      }
	if  (document.frmData.intYear.value=="0")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to select the year of your credit card expiry date."); 
        return false;
      }
	var om = (document.frmData.intDepMonth.value)/1;
	var oy = (document.frmData.intDepYear.value)/1;
	var em = (document.frmData.intMonth.value)/1;
	var ey = (document.frmData.intYear.value)/1;
	if(em<om)
	{
		if(ey<=oy)
		{
			alert("On-Line Reservation System Message:" + '\n' +  '\n' + "The credit card has past the expiry date.")
			return false
		}
	}
	if  (document.frmData.strHolderName.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter the name on your credit card."); 
        return false;
      }
	if  (document.frmData.strAddress.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your credit card address."); 
        return false;
      }
	if (document.frmData.strAddress.value.length > 300)
	{
		  alert("On-Line Reservation System Message:" + '\n' +  '\n' + "The length of address must be smaller than 300 characters!");
		  return false;
	 }
	if  (document.frmData.strCity.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your credit card city."); 
        return false;
      }
	if  (document.frmData.strState.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your credit card state/province."); 
        return false;
      }
	if  (document.frmData.strPostalCode.value=="")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your credit card postal/zip."); 
        return false;
      }
	if  (document.frmData.intCountryId.value=="0")
      {
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to select your credit card country."); 
        return false;
      }
	return true; 
}

function checkGroupReservationStep1()
{
	var nd = (document.frmData.intDayNow.value)/1;
	var nm = (document.frmData.intMonthNow.value)/1;
	var ny = (document.frmData.intYearNow.value)/1;

	if  (document.frmData.strGroupName.value=="")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to enter your group name."); 
        return false;
      }
	if  (document.frmData.date15_date.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the date of your check-in date."); 
        return false;
      }
	if  (document.frmData.date15_month.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the month of your check-in date."); 
        return false;
      }
	if  (document.frmData.date15_year.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the year of your check-in date."); 
        return false;
      }
	var id = (document.frmData.date15_date.value)/1;
	var im = (document.frmData.date15_month.value)/1;
	var iy = (document.frmData.date15_year.value)/1;
	if(iy==ny)
	{
		if(im<nm)
		{
			alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The check-in date is historic.")
			return false
		}
		else
		{
			if (im==nm)
			{
				if(id<nd)
				{
					alert("Booking Online Emporiumsuites Message::" + '\n' +  '\n' + "The check-in date is historic.")
					return false
				}
			}
		}
	}
	if  (document.frmData.date16_date.value=="0")
      {
        alert("Booking Online Emporiumsuites Message::" + '\n' +  '\n' + "You have forgotten to select the date of your check-out date."); 
        return false;
      }
	if  (document.frmData.date16_month.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the month of your check-out date."); 
        return false;
      }
	if  (document.frmData.date16_year.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the year of your check-out date."); 
        return false;
      }
	var od = (document.frmData.date16_date.value)/1;
	var om = (document.frmData.date16_month.value)/1;
	var oy = (document.frmData.date16_year.value)/1;	 
	if(oy==ny) 
	{
		if(om<nm)
		{
			alert("Booking Online Emporiumsuites Message::" + '\n' +  '\n' + "The check-out date is historic.")
			return false
		}
		else
		{
			if (om==nm)
			{
				if(od<nd)
				{
					alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The check-out date is historic.")
					return false
				}
			}
		}
	}
	if(oy<iy)
	{
		alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The check-in date is after the check-out date.")
		return false
	}
	else
	{
		if (iy==oy)
		{
			if(om<im)
			{
				alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The check-in date is after the check-out date.")
				return false
			}
			else
			{
				if (om==im)
				{
					if (od<=id)
					{
						alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The check-in date is after the check-out date.")
						return false
					}
				}
			}
		}
	}
//	if  (document.frmData.strNoOfRoom.value=="")
//      {
//        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter a number of room."); 
//        return false;
//      }
//	if  (document.frmData.strRoomRate.value=="")
//      {
//        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your proposed room rate."); 
//        return false;
//      }
//	if  (document.frmData.strCompanyName.value=="")
//      {
//        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your company name."); 
//        return false;
//      }
//	if  (document.frmData.strAddress.value=="")
//      {
//        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your address."); 
//        return false;
//      }
//	if (document.frmData.strAddress.value.length > 300)
//	{
//		  alert("On-Line Reservation System Message:" + '\n' +  '\n' + "The length of address must be smaller than 300 characters!");
//		  return false;
//	 }
//	if  (document.frmData.strTelephone.value=="")
//      {
//        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your phone number."); 
//        return false;
//      }
//	if  (document.frmData.strFax.value=="")
//      {
//        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your fax number."); 
//        return false;
//      }
//	if  (document.frmData.strEmail.value=="")
//      {
//        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your email address."); 
//        return false;
//      }
//	var e=document.frmData.strEmail.value;
//	if (checkEmailValid(e)!="0") 
//	{
//		alert( checkEmailValid(e));
//		return false;	
//	}
//	if  (document.frmData.strContactName.value=="")
//      {
//        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to enter your contact name."); 
//        return false;
//      }
//	if (document.frmData.strMessage.value.length > 1000)
//	{
//		  alert("On-Line Reservation System Message:" + '\n' +  '\n' + "The length of message must be smaller than 1000 characters!");
//		  return false;
//	 }
	return true; 
}

function checkEditIt()
{
	var total = 0
	var subtotal = 0
	var bookmax = document.frmData.intMax.value/1;
	var newbookmax = document.frmData.intMaxBooking.value/1;
	var ans = true;
	var bOver=false;
	var bZero=false;

	for (i = 0; i<document.frmData.elements.length; ++ i)
	{
		if (isNaN(document.frmData.elements[i].value) || (document.frmData.elements[i].name=="intMax") || (document.frmData.elements[i].name=="intMaxBooking") || (document.frmData.elements[i].name=="strBookingSet") || (document.frmData.elements[i].name=="lngReservationId"))
		{
		}
		else
		{
			subtotal= document.frmData.elements[i].value
			subtotal=subtotal/1
			if(subtotal>0)
			{
				total = total+subtotal
				if(total > bookmax)
				{
					bOver=true;
					ans=false;
				}
			}
		}
	}
	if (bOver==true && ans==false)
	{
		if (confirm("On-Line Reservation System Message:" + '\n' +  '\n' + "Sorry, The number of rooms you have requested is greater than the number of rooms requested in Step 1 of 6."+'\n\n'+"Do you wish to continue?"))
		{
			document.frmData.intMax.value=newbookmax;
			return false;
		}
		else
		{
			document.frmData.intMax.value=bookmax;
			return false;
		}
	}
	return true;
}

function checkEditFinal()
{
	var total = 0
	var subtotal = 0
	var bookmax = document.frmData.intMax.value/1;
	var ultd = document.frmData.intMaxBooking.value/1;

	for (i = 0; i<document.frmData.elements.length; ++ i)
	{
		if (isNaN(document.frmData.elements[i].value) || (document.frmData.elements[i].name=="intMax") || (document.frmData.elements[i].name=="intMaxBooking") || (document.frmData.elements[i].name=="strBookingSet") || (document.frmData.elements[i].name=="lngReservationId"))
		{
		}
		else
		{
			subtotal= document.frmData.elements[i].value
			subtotal=subtotal/1
			if(subtotal>0)
			{
				total = total+subtotal
			}
		}
	}
	if (total==0)
	{
		alert("On-Line Reservation System Message:" + '\n' +  '\n' + "You have forgotten to select a room(s).")
		return false;
	}
	if (ultd!=bookmax)
	{
		if (total<bookmax)
		{
			if (confirm("On-Line Reservation System Message:" + '\n' +  '\n' + "Sorry, The number of rooms you have requested is lesser than the number of rooms requested in Step 1 of 6."+'\n\n'+"Do you wish to continue?"))
			{
				document.frmData.intMax.value=1;
				return false;
			}
			else
			{
				document.frmData.intMax.value=bookmax;
				return false;
			}
		}
		else
		{
			if (total>bookmax)
			{
				if (confirm("On-Line Reservation System Message:" + '\n' +  '\n' + "Sorry, The number of rooms you have requested is greater than the number of rooms requested in Step 1 of 6."+'\n\n'+"Do you wish to continue?"))
				{
					document.frmData.intMax.value=ultd;
					return false;
				}
				else
				{
					document.frmData.intMax.value=bookmax;
					return false;
				}
			}
		}
	}
	return true;
}

function checkReservationBehindStep1()
{
	var nd = (document.frmData.intDayNow.value)/1;
	var nm = (document.frmData.intMonthNow.value)/1;
	var ny = (document.frmData.intYearNow.value)/1;

	if  (document.frmData.date15_date.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the date of your arrival date."); 
        return false;
      }
	if  (document.frmData.date15_month.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the month of your arrival date."); 
        return false;
      }
	if  (document.frmData.date15_year.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the year of your arrival date."); 
        return false;
      }
	var id = (document.frmData.date15_date.value)/1;
	var im = (document.frmData.date15_month.value)/1;
	var iy = (document.frmData.date15_year.value)/1;

	if(iy<=ny)
	{
		if(im<nm)
		{
			alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The arrival date is historic.")
			return false
		}
		else
		{
			if (im==nm)
			{
				if(id<nd)
				{
					alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The arrival date is historic.")
					return false
				}
			}
		}
	}
	if  (document.frmData.date16_date.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the date of your departure date."); 
        return false;
      }
	if  (document.frmData.date16_month.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the month of your departure date."); 
        return false;
      }
	if  (document.frmData.date16_year.value=="0")
      {
        alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "You have forgotten to select the year of your departure date."); 
        return false;
      }
	var od = (document.frmData.date16_date.value)/1;
	var om = (document.frmData.date16_month.value)/1;
	var oy = (document.frmData.date16_year.value)/1;	  
	if(oy<=ny)
	{
		if(om<nm)
		{
			alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The departure date is historic.")
			return false
		}
		else
		{
			if (om==nm)
			{
				if(od<nd)
				{
					alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The departure date is historic.")
					return false
				}
			}
		}
	}
	if(oy<iy)
	{
		alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The arrival date is after the departure date.")
		return false
	}
	else
	{
		if (iy==oy)
		{
			if(om<im)
			{
				alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The arrival date is after the departure date.")
				return false
			}
			else
			{
				if (om==im)
				{
					if (od<=id)
					{
						alert("Booking Online Emporiumsuites Message:" + '\n' +  '\n' + "The arrival date is after the departure date.")
						return false
					}
				}
			}
		}
	}
	return true; 
}

function NumberOnly()
{
	if(document.frmData.strCardNumber.value.indexOf(" ")>0)
	{
        alert("On-Line Reservation System Message:" + '\n' +  '\n' + "Do not need to put a space in.."); 
		document.frmData.strCardNumber.focus();
	}
	else
	{
		if  (isNaN(document.frmData.strCardNumber.value))
		  {
			alert("On-Line Reservation System Message:" + '\n' +  '\n' + "Please only put a number in."); 
			document.frmData.strCardNumber.focus();
		  }
	}
}

function CancelRes()
{
		if (confirm("On-Line Reservation System Message:" + '\n' +  '\n' + "Are you sure you want to leave the reservation system?"))
		{
			window.close();
		}
}