            ////////////////// Ajax for email check//////////

     function getXMLHTTP() { 
              var xmlhttp=false;
               try{
                    xmlhttp=new XMLHttpRequest();
                }
                catch(e)	{
                    try{
                        xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    catch(e){
                        try{
                            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
                        }
                        catch(e1){
                            xmlhttp=false;
                        }
                    }
                }
 
                return xmlhttp;
            }
           
			 function getCheck1(str)
            {
 
                var req2 = getXMLHTTP();

               if (req2) {
                    req2.onreadystatechange = function() {
                        if (req2.readyState == 4)
                        {
                          document.getElementById('emailChk').innerHTML='';
                         document.getElementById('emailChk').innerHTML=req2.responseText;;

                        }
                    }
                }
                req2.open("POST", str, true);
                req2.send(null);
            }
 
///////////////////////////////////////////////////////////////////////////////////
           /* function loginCheck(email){
                var email = email.value;

               // alert (email);

                req.open('get', 'check_email.php?email=' + email);
                req.onreadystatechange = function handleResponse(){
                    if(req.readyState == 4){
                        var response = req.responseText;
                       // alert(response);

                        if(response == 1){
                            alert("Given Email already exist. Try Other");
                            //alert(ind);
                            document.form1.email.focus();
                            document.form1.email.value="";
                        }else{
                         //  alert(response);
                        }
                    }
                } //call the function
                req.send(null);
            };*/
///////////////////////////////////////////////////////////////////////////////////
function define()
{
if((document.getElementById('datepicker1').value=='')  || (document.getElementById('datepicker').value=='') || (document.getElementById('roomtype').value=='') || (document.getElementById('nroom').value==''))
{
document.getElementById('error').innerHTML='Please Fill All The Field';	

document.getElementById('error').style.color = 'yellow';
document.getElementById("error").style.backgroundColor="red"
//alert("Please Fill your first name");
return false;
}
 


document.form1.submit();
}
function unblock_check()
{
if((document.getElementById('name').value=='')  || (document.getElementById('phone').value=='') || (document.getElementById('date').value=='') || (document.getElementById('query').value==''))
{
document.getElementById('error1').innerHTML='Please Fill All The Field';	

document.getElementById('error1').style.color = 'yellow';
document.getElementById("error1").style.backgroundColor="red"
//alert("Please Fill your first name");
return false;
}

 if ((document.getElementById('email').value.indexOf('@') == -1) ||  (document.getElementById('email').value.indexOf('.') == -1)) 
             {
              
document.getElementById('error1').innerHTML='Please fill Correct E-mail Address';	
document.getElementById('error1').style.color = 'black';
document.getElementById("error1").style.backgroundColor="orange" ;
			  
                 document.getElementById('email').value= "";
				 document.getElementById('email').focus() ;
				 return false ;
               }

document.form2.submit();
}
