﻿function chkNumeric(e)
{var $retVal
if(e.which!=null)
{if((e.which>57||e.which<48)&&e.which!=46&&e.which!=8&&e.which!=0&&e.which!=191)
{$retVal=false;}
else
$retVal=true;}
else
{if((e.keyCode>57||e.keyCode<48)&&e.keyCode!=46)
{$retVal=false;}
else
$retVal=true;}
return $retVal;}
function GetHotelDetail(obj,pk,nm)
{window.open("SearchHotelDetail.aspx?id="+obj+"&pk="+pk+"&nm="+nm,"hotelDetail","top=100,location=no,toolbar=yes,resizable=yes,scrollbars=yes");}
function checkForThreeValues(Obj)
{if(Obj.value.length<3)
{alert("Please enter minimum three characters");return true;}}
function CheckPassValues()
{for(i=0;i<=a-1;i++)
{if(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_ddlTitle").value=="0")
{alert("Please select title.");document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_ddlTitle").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_ddlTitle").style.backgroundColor="#F88017";return false;}
if(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtfname").value=="")
{alert("Please enter first name.");document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtfname").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtfname").style.backgroundColor="#F88017";return false;}
else
{if(checkForThreeValues(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtfname")))
{document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtfname").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtfname").style.backgroundColor="#F88017";return false;}}
if(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtsname").value=="")
{alert("Please enter last name.");document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtsname").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtsname").style.backgroundColor="#F88017";return false;}
else
{if(checkForThreeValues(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtsname")))
{document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtsname").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtsname").style.backgroundColor="#F88017";return false;}}
if(i==0)
{if(document.getElementById("rdPayDirect").checked)
{if(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtAddr").value=="")
{alert("Please enter Address.");document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtAddr").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtAddr").style.backgroundColor="#F88017";return false;}
if(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtCity").value=="")
{alert("Please enter City.");document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtCity").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtCity").style.backgroundColor="#F88017";return false;}
if(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtState").value=="")
{alert("Please enter County.");document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtState").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtState").style.backgroundColor="#F88017";return false;}
if(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtCountry").value=="")
{alert("Please enter Country.");document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtCountry").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtCountry").style.backgroundColor="#F88017";return false;}
if(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtPostcode").value=="")
{alert("Please enter Postcode.");document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtPostcode").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtPostcode").style.backgroundColor="#F88017";return false;}
if(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtEmail").value=="")
{alert("Please enter email address.");document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtEmail").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtEmail").style.backgroundColor="#F88017";return false;}
else
{if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtEmail").value)==false)
{alert("Please enter valid email address.")
document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtEmail").focus();document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtEmail").style.backgroundColor="#F88017";return false;}}
if(document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtPhn1").value=="")
{
    alert("Please enter phone no.");
    document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtPhn1").focus();
    document.getElementById("ctl00_ContentPlaceHolder1_Grdpassinfo_ctl0"+i+"_txtPhn1").style.backgroundColor="#F88017";
    return false;
 }
 
 ////////////////////////
 
 if(document.getElementById("ctl00_ContentPlaceHolder1_txtCardHolder").value=="")
         {
                alert("Please enter card holder name.");
                document.getElementById("ctl00_ContentPlaceHolder1_txtCardHolder").focus();
                document.getElementById("ctl00_ContentPlaceHolder1_txtCardHolder").style.backgroundColor= "#F88017";
                return false;
         }
         if(document.getElementById("ctl00_ContentPlaceHolder1_txtCardNo").value=="")
         {
                alert("Please enter card no.");
                document.getElementById("ctl00_ContentPlaceHolder1_txtCardNo").focus();
                document.getElementById("ctl00_ContentPlaceHolder1_txtCardNo").style.backgroundColor= "#F88017";
                return false;
         }
         if(document.getElementById("ctl00_ContentPlaceHolder1_txtCvc").value=="")
         {
                alert("Please enter valid cvc number.");
                document.getElementById("ctl00_ContentPlaceHolder1_txtCvc").focus();
                document.getElementById("ctl00_ContentPlaceHolder1_txtCvc").style.backgroundColor= "#F88017";
                return false;
          }
 ////////////////////////
 
 }
}
if(document.getElementById("rdPayAgent").checked)
{
         if(document.getElementById("ctl00_ContentPlaceHolder1_txtAgent").value=="")
         {
                alert("Please enter agent name.");
                document.getElementById("ctl00_ContentPlaceHolder1_txtAgent").focus();
                document.getElementById("ctl00_ContentPlaceHolder1_txtAgent").style.backgroundColor= "#F88017";
                return false;
         }
         if(document.getElementById("ctl00_ContentPlaceHolder1_txtABTANo").value=="")
         {
                alert("Please enter correct ABTA/GLOBAL/TTA number.");
                document.getElementById("ctl00_ContentPlaceHolder1_txtABTANo").focus();
                document.getElementById("ctl00_ContentPlaceHolder1_txtABTANo").style.backgroundColor= "#F88017";
                return false;
         }
         if(document.getElementById("ctl00_ContentPlaceHolder1_txtPotcode").value=="")
         {
                alert("Please enter postcode.");
                document.getElementById("ctl00_ContentPlaceHolder1_txtPotcode").focus();
                document.getElementById("ctl00_ContentPlaceHolder1_txtPotcode").style.backgroundColor= "#F88017";
                return false;
          }
          if(document.getElementById("ctl00_ContentPlaceHolder1_txtAgentEmail").value=="")
          {
                alert("Please enter email address.");
                document.getElementById("ctl00_ContentPlaceHolder1_txtAgentEmail").focus();
                document.getElementById("ctl00_ContentPlaceHolder1_txtAgentEmail").style.backgroundColor= "#F88017";
                return false;
          }
          else
          {
             if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById("ctl00_ContentPlaceHolder1_txtAgentEmail").value)==false)
             {
                    alert("Please enter valid email address.")
                    document.getElementById("ctl00_ContentPlaceHolder1_txtAgentEmail").focus();
                    document.getElementById("ctl00_ContentPlaceHolder1_txtAgentEmail").style.backgroundColor= "#F88017";
                    return false;
             }
          }
      

}
}

if(!document.getElementById("ctl00_ContentPlaceHolder1_chkTerm").checked)
{alert("Please accept Terms and Conditions before submitting.");return false;}}

function CallPrint(strid)
{
var prtContent=document.getElementById(strid);
document.getElementById("trFooter").style.display="none";
var WinPrint=window.open('','','left=0,top=0,width=1,height=1,t oolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
}

function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint =
window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
}
//function CallPrint(strid)
//{var prtContent=document.getElementById(strid);document.getElementById("trFooter").style.display="none";var WinPrint=window.open('','','left=0,top=0,width=1,height=1,t oolbar=0,scrollbars=0,status=0');WinPrint.document.write(prtContent.innerHTML);WinPrint.document.close();WinPrint.focus();WinPrint.print();WinPrint.close();
//    
//}


