/* - - - - - - - - - - - - - - - - - - - - - - -
 JavaScript
 Friday, April 22, 2005 12:11:17 PM
 - - - - - - - - - - - - - - - - - - - - - - - */

/***********************************AJITH**************************************/

    function Srsubmit()
    {
     var ct=document.Srhform.City.value;
     if (ct == "")
     {
     alert ( "Please   enter  your    Destination ");
     document.Srhform.City.focus();
     }
     else
     { document.Srhform.submit();
     }
    }

     function  photo_win(hid)
     {
     window.open("photo_display.php?ht="+hid, "photo","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=630, height=450")
     }

     function  more_win(hid)
     {
     window.open("search_more.php?ht="+hid, "More","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=630, height=450")
     }

      function checkPolicy()
     {
        if(document.frmbook3.Policy.checked == true)
        {
            document.frmbook3.B3.style.backgroundColor="#707056";
            document.frmbook3.B3.disabled=false;
        }
        else
        {
           document.frmbook3.B3.style.backgroundColor="#ECE9D8";
           document.frmbook3.B3.disabled=true;
        }
     }

     function echeck(str)
        {
            var at="@";
            var dot=".";
            var lat=str.indexOf(at);
            var lstr=str.length;
            var ldot=str.indexOf(dot);
            if (str.indexOf(at)==-1)
            {
               alert("Invalid E-mail ID");
               return false;
            }

            if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
            {
               alert("Invalid E-mail ID");
               return false;
            }

            if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
            {
                alert("Invalid E-mail ID");
                return false;
            }

             if (str.indexOf(at,(lat+1))!=-1)
             {
                alert("Invalid E-mail ID");
                return false;
             }

             if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
             {
                alert("Invalid E-mail ID");
                return false;
             }

             if (str.indexOf(dot,(lat+2))==-1)
             {
                alert("Invalid E-mail ID");
                return false;
             }

             if (str.indexOf(" ")!=-1)
             {
                alert("Invalid E-mail ID");
                return false;
             }

             return true;
        }

        function validate_email()
        {
          var emailID=document.bookfrm.Email;
          if (echeck(emailID.value)==false)
          {
              //emailID.value="";
              emailID.focus();
              return false;
          }
        }

       function   checkName()
       {
        return false;
       //document.frmbook3.submit();
         /* var  fst_nm=document.frmbook3.Fname.value;
          var  lst_nm=document.frmbook3.Lname.value;
          if (fst_nm.indexOf(" ")!=-1)
          {
           alert(" First  Name  Cannot  be  Empty ");
           document.frmbook3.Fname.Focus();
           //return false;

          }
          if (lst_nm.indexOf(" ")!=-1)
          {
           alert(" Last  Name  Cannot  be  Empty ");
           document.frmbook3.Lname.Focus();
           //return false;

          }
          else
          {
           document.frmbook3.submit();
          // return true;
          } */
        }

/***********************************AJITH**************************************/


/***********************************SUNITA**************************************/

        function submitIndex()
        {
            if(document.frmIndex.txtUserName.value=="")
            {
                alert("Please enter your user name");
                return false;
            }
            var emailID=document.frmIndex.txtUserName;
            if (echeck(emailID.value)==false)
            {
                emailID.value="";
                emailID.focus();
                return false;
            }
            if(document.frmIndex.txtPassword.value=="")
            {
                alert("Please enter the password");
                return false;
            }
            document.frmIndex.submit();
        }

        /***********************PHONE NUMBER VALIDATION************************/

        //Login
        function submitLogin()
        {
            if(document.frmLogin.txtUserName.value=="")
            {
                alert("Please enter your Email");
                return false;
            }
            var emailID=document.frmLogin.txtUserName;
            if (echeck(emailID.value)==false)
            {
                emailID.value="";
                emailID.focus();
                return false;
            }
            if(document.frmLogin.txtPassword.value=="")
            {
                alert("Please enter the password");
                return false;
            }
            document.frmLogin.submit();
            return false;
        }


/***********************************SUNITA*************************************/