var selectLists = document.getElementsByTagName('');
var http_request = false;
   function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      showThankYou();
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
      //showThankYou();
   }
   
   function showThankYou()
   {
   		window.scrollTo(0,0);
        if(document.getElementById('formType').value=='private')
        {
					document.getElementById('thankYouDiv').style.display='block';
                    document.getElementById('thankYouDiv').focus();
                    document.getElementById('dbginfo').innerHTML='';
					document.getElementById('tripInfoDiv').style.display='none';
					document.getElementById('personalInfoDiv').style.display='none';
					document.getElementById('addressDiv').style.display='none';
					document.getElementById('otherInfoDiv').style.display='none';
					document.getElementById('buttonDiv').style.display='none';
        }
        else if (document.getElementById('formType').value=='education')
        {
					document.getElementById('thankYouDiv').style.display='block';
					document.getElementById('personalInfoDiv').style.display='none';
					document.getElementById('schoolInfoDiv').style.display='none';
					document.getElementById('destinationInterestDiv').style.display='none';
					document.getElementById('travelDateDiv').style.display='none';
					document.getElementById('accomdationDiv').style.display='none';
					document.getElementById('otherInfoDiv').style.display='none';
					document.getElementById('buttonDiv').style.display='none';
        }
                
   }

   function alertContents()
   {
      if (http_request.readyState == 4)
	  {
         
           //alert(http_request.responseText);
            result = http_request.responseText;
			
				if(document.getElementById('formType').value=='private')
				{
					document.getElementById('thankYouDiv').style.display='block';
                    document.getElementById('dbginfo').innerHTML=result;
					document.getElementById('tripInfoDiv').style.display='none';
					document.getElementById('personalInfoDiv').style.display='none';
					document.getElementById('addressDiv').style.display='none';
					document.getElementById('otherInfoDiv').style.display='none';
					document.getElementById('buttonDiv').style.display='none';
				}
				else if (document.getElementById('formType').value=='education')
				{
					document.getElementById('thankYouDiv').style.display='block';
					document.getElementById('personalInfoDiv').style.display='none';
					document.getElementById('schoolInfoDiv').style.display='none';
					document.getElementById('destinationInterestDiv').style.display='none';
					document.getElementById('travelDateDiv').style.display='none';
					document.getElementById('accomdationDiv').style.display='none';
					document.getElementById('otherInfoDiv').style.display='none';
					document.getElementById('buttonDiv').style.display='none';
					
					
				}
			
      }
      else
      {
        showThankYou();
      }
   }
  
   var testEmailresults;

	function checkemail()
	{
		 
		 var str=document.getElementById('emailIds').value;
		 var filter=/^.+@.+\..{2,3}$/;
		
		 if (filter.test(str))
		 {
			testEmailresults=true;
		 }
		 else
		 {
			testEmailresults=false;
		 }
		 return (testEmailresults);
	}
 
 //function for educational section starts
 
   function  EducationGenForm(){
	   	   
   	var pstr=''; 
		if(document.getElementById('firstName').value=="")
	 	{
			alert("Please , enter your first name");
			document.getElementById('firstName').focus();
			return false;
		 }
		 else
	 	{
			pstr=pstr+'f_name=';
		 	pstr=pstr+encodeURI(document.getElementById('firstName').value);
		 }
		 
		if(document.getElementById('lastName').value=="")
	 	{
			alert("Please , enter your last name");
			document.getElementById('lastName').focus();
			return false;
	 	}
	 	else
		 {
			pstr=pstr+'&l_name=';
		 	pstr=pstr+encodeURI(document.getElementById('lastName').value);
	 	}
		
		
	 	if(document.getElementById('emailIds').value=="")
	 	{
			alert("Please , enter your emailid");
			document.getElementById('emailIds').focus();
		return false;
		}
	 	else
	 	{
			if(checkemail()){
		 		pstr=pstr+'&email=';
		 		pstr=pstr+encodeURI(document.getElementById('emailIds').value);
		 	}		 
			else
			 {
				alert("Please , enter your valid emailid");
				document.getElementById('emailIds').focus();
				return false;
		 	}
	 }	 


		if(document.getElementById('position').value=="")
	 	{
			alert("Please , enter the position");
			document.getElementById('position').focus();
			return false;
		 }
		else
	 	{
			pstr=pstr+'&position=';
		 	pstr=pstr+encodeURI(document.getElementById('position').value);
		}
		
	  if(document.getElementById('phone').value=="")
	 {
		alert("Please , enter your contact number");
		document.getElementById('phone').focus();
		return false;
	 }
	 else
	 {
		 pstr=pstr+'&phone=';
		 pstr=pstr+encodeURI(document.getElementById('phone').value);
	 }
		
	 if(document.getElementById('school').value=="")
	 {
		alert("Please , enter your Institute name");
		document.getElementById('school').focus();
		return false;
	 }
	 else
	 {
		 pstr=pstr+'&school=';
		 pstr=pstr+encodeURI(document.getElementById('school').value);
	 }
	 
	 if(document.getElementById('students').value!="")
	 {
		pstr=pstr+'&students=';
		pstr=pstr+encodeURI(document.getElementById('students').value);
	 }
	 
	 
	 if(document.getElementById('chaperons').value!="")
	 {
		pstr=pstr+'&chaperons=';
		pstr=pstr+encodeURI(document.getElementById('chaperons').value);
	 }	
	
	 if(document.getElementById('agelevel').value!="")
	 {
		pstr=pstr+'&agelevel=';
		pstr=pstr+encodeURI(document.getElementById('agelevel').value);
	 }	
	
	if(document.getElementById('city').value=="")
	 {
		alert("Please , Select your city");
		document.getElementById('city').focus();
		return false;
	 }
	 else
	 {
		 pstr=pstr+'&city=';
		 pstr=pstr+encodeURI(document.getElementById('city').value);
	 }

	if(document.getElementById('state').value=="")
	 {
		alert("Please , Select your state");
		document.getElementById('state').focus();
		return false;
	 }
	 else
	 {
		 pstr=pstr+'&state=';
		 pstr=pstr+encodeURI(document.getElementById('state').value);
	 }
	
	// use change start 2010.10.28
	//alert( document.getElementById('country').value );
	if(document.getElementById('country').value!="")
	 {
	 	 pstr=pstr+'&country=';
		 pstr=pstr+encodeURI(document.getElementById('country').value);

	 }
	 else
	 {
		alert("Please , Select your country");
		document.getElementById('country').focus();
		return false;
	 }
	 // use change end 2010.10.28
	
	var checkBoxTripValues = get_checkBox_location();
	if(checkBoxTripValues!="")
	 {
		pstr=pstr+'&location=';
		pstr=pstr+encodeURI(checkBoxTripValues);
	 }
	
	if(document.getElementById('otherLocation').value!="")
	 {
		pstr=pstr+'&otherLocation=';
		pstr=pstr+encodeURI(document.getElementById('otherLocation').value);
	 }
	 
	var checkBoxInterestValues = get_checkBox_interest();
	if(checkBoxInterestValues!="")
	 {
		pstr=pstr+'&interest=';
		pstr=pstr+encodeURI(checkBoxInterestValues);
	 }
	
	if(document.getElementById('otherInterest').value!="")
	 {
		pstr=pstr+'&otherInterest=';
		pstr=pstr+encodeURI(document.getElementById('otherInterest').value);
	 }
	
	
	if(document.getElementById('seasons').value!="")
	 {
		pstr=pstr+'&seasons=';
		pstr=pstr+encodeURI(document.getElementById('seasons').value);
	 }
	 
	 if(document.getElementById('year').value!="")
	 {
		pstr=pstr+'&year=';
		pstr=pstr+encodeURI(document.getElementById('year').value);
	 }
	 
	 if(document.getElementById('days').value!="")
	 {
		pstr=pstr+'&days=';
		pstr=pstr+encodeURI(document.getElementById('days').value);
	 }
	
	if(document.getElementById('stay').value!="")
	 {
		pstr=pstr+'&stay=';
		pstr=pstr+encodeURI(document.getElementById('stay').value);
	 }
	
	if(document.getElementById('budget').value!="")
	 {
		pstr=pstr+'&budget=';
		pstr=pstr+encodeURI(document.getElementById('budget').value);
	 }
	/* 
    if(document.getElementById('accommodation').value!="")
	 {
		poststr=poststr+'&accommodation=';
		poststr=poststr+encodeURI(document.getElementById('accommodation').value);
	 }
	*/
	 if(document.getElementById('learnAbt').value=="")
	 {
		alert("Please , select how do you learn about wildchina ?");
		document.getElementById('learnAbt').focus();
		return false;
	 }
	
	if(document.getElementById('learnAbt').value!="")
	 {
		pstr=pstr+'&aboutwc=';
		pstr=pstr+encodeURI(document.getElementById('learnAbt').value);
	 }
	 
	 if(document.getElementById('learnAbt').value=="Other")
	 {
		pstr=pstr+'&otherlearn=';
		pstr=pstr+encodeURI(document.getElementById('otherlearn').value);
	 }
	 
	  if(document.getElementById('comments').value!="")
	 {
		pstr=pstr+'&comments=';
		pstr=pstr+encodeURI(document.getElementById('comments').value);
	 }
	 	
		
	var baseUrl = document.getElementById('baseUrl').value ;
	makePOSTRequest( baseUrl+'china-educational-travel/sendMail' , pstr );
		
			
	}

// use change start 
//function for three educational section ends

   function  EducationThreeForm(){
	   	  
		if(document.getElementById('firstname').value=="")
	 	{
			alert("Please , enter your first name");
			document.getElementById('firstname').focus();
			return false;
		 }

		 
		if(document.getElementById('lastname').value=="")
	 	{
			alert("Please , enter your last name");
			document.getElementById('lastname').focus();
			return false;
	 	}


			 		if(document.getElementById('positionb').value=="")
	 	{
			alert("Please , enter the position");
			document.getElementById('positionb').focus();
			return false;
		 }


		
				
	 	if(document.getElementById('email').value=="")
	 	{
			alert("Please , enter your email");
			document.getElementById('email').focus();
		return false;
		}
	 	else
	 	{
					 
			var str=document.getElementById('email').value;
		 var filter=/^.+@.+\..{2,3}$/;
		
		 if (filter.test(str)){

		 	}		 
			else
			 {
				alert("Please , enter your valid email");
				document.getElementById('email').focus();
				return false;
		 	}
	 }	 
	 

	  if(document.getElementById('phoneb').value=="")
	 {
		alert("Please , enter your contact number");
		document.getElementById('phoneb').focus();
		return false;
	 }



	/*	
	 if(document.getElementById('school').value=="")
	 {
		alert("Please , enter your Institute name");
		document.getElementById('school').focus();
		return false;
	 }
	 else
	 {
		 pstr=pstr+'&school=';
		 pstr=pstr+encodeURI(document.getElementById('school').value);
	 }
	 
	 if(document.getElementById('students').value!="")
	 {
		pstr=pstr+'&students=';
		pstr=pstr+encodeURI(document.getElementById('students').value);
	 }
	 
	 
	 if(document.getElementById('chaperons').value!="")
	 {
		pstr=pstr+'&chaperons=';
		pstr=pstr+encodeURI(document.getElementById('chaperons').value);
	 }	
	
	 if(document.getElementById('agelevel').value!="")
	 {
		pstr=pstr+'&agelevel=';
		pstr=pstr+encodeURI(document.getElementById('agelevel').value);
	 }	
	
	if(document.getElementById('city').value=="")
	 {
		alert("Please , Select your city");
		document.getElementById('city').focus();
		return false;
	 }
	 else
	 {
		 pstr=pstr+'&city=';
		 pstr=pstr+encodeURI(document.getElementById('city').value);
	 }

	if(document.getElementById('state').value=="")
	 {
		alert("Please , Select your state");
		document.getElementById('state').focus();
		return false;
	 }
	 else
	 {
		 pstr=pstr+'&state=';
		 pstr=pstr+encodeURI(document.getElementById('state').value);
	 }
	
	// use change start 2010.10.28
	//alert( document.getElementById('country').value );
	if(document.getElementById('country').value!="")
	 {
	 		pstr=pstr+'&country=';
		 pstr=pstr+encodeURI(document.getElementById('country').value);
	 }
	 else
	 {
		alert("Please , Select your country");
		document.getElementById('country').focus();
		return false;
	 }
	 // use change end 2010.10.28
	
	
	
	if(document.getElementById('seasons').value!="")
	 {
		pstr=pstr+'&seasons=';
		pstr=pstr+encodeURI(document.getElementById('seasons').value);
	 }
	 
	 if(document.getElementById('year').value!="")
	 {
		pstr=pstr+'&year=';
		pstr=pstr+encodeURI(document.getElementById('year').value);
	 }
	 
	 if(document.getElementById('days').value!="")
	 {
		pstr=pstr+'&days=';
		pstr=pstr+encodeURI(document.getElementById('days').value);
	 }
	
	if(document.getElementById('stay').value!="")
	 {
		pstr=pstr+'&stay=';
		pstr=pstr+encodeURI(document.getElementById('stay').value);
	 }
	
	if(document.getElementById('budget').value!="")
	 {
		pstr=pstr+'&budget=';
		pstr=pstr+encodeURI(document.getElementById('budget').value);
	 }
	
	 if(document.getElementById('learnAbt').value=="")
	 {
		alert("Please , select how do you learn about wildchina ?");
		document.getElementById('learnAbt').focus();
		return false;
	 }
	
	if(document.getElementById('learnAbt').value!="")
	 {
		pstr=pstr+'&aboutwc=';
		pstr=pstr+encodeURI(document.getElementById('learnAbt').value);
	 }
	 
	 if(document.getElementById('learnAbt').value=="other")
	 {
		pstr=pstr+'&otherlearn=';
		pstr=pstr+encodeURI(document.getElementById('otherlearn').value);
	 }
	 
	  if(document.getElementById('comments').value!="")
	 {
		pstr=pstr+'&comments=';
		pstr=pstr+encodeURI(document.getElementById('comments').value);
	 }
	 	*/
		
  // var baseUrl = document.getElementById('baseUrl').value ;
  // makePOSTRequest( baseUrl+'china-educational-travel/sendMail' , pstr );
		
			
	}
 //-- use change end --
//function for educational section ends

   function sendMailByAjax() {
   

	   
	 var poststr='';  
      //alert("Post--"+poststr);
	 if(document.getElementById('firstName').value=="")
	 {
		alert("Please , enter your first name");
		document.getElementById('firstName').focus();
		return false;
	 }
	 else
	 {
		 poststr=poststr+'f_name=';
		 poststr=poststr+encodeURI(document.getElementById('firstName').value);
	 }
	 
	 if(document.getElementById('lastName').value=="")
	 {
		alert("Please , enter your last name");
		document.getElementById('lastName').focus();
		return false;
	 }
	 else
	 {
		 poststr=poststr+'&l_name=';
		 poststr=poststr+encodeURI(document.getElementById('lastName').value);
	 }
	 
	 if(document.getElementById('emailIds').value=="")
	 {
		alert("Please , enter your emailid");
		document.getElementById('emailIds').focus();
		return false;
	 }
	 else
	 {
		 if(checkemail()){
		 poststr=poststr+'&email=';
		 poststr=poststr+encodeURI(document.getElementById('emailIds').value);
		 }
		 else
		 {
			alert("Please , enter your valid emailid");
			document.getElementById('emailIds').focus();
			return false;
		 }
	 }	 
	 
	 if(document.getElementById('address').value=="")
	 {
		/* disable by king July 13 2011
	    alert("Please , enter your address");
		document.getElementById('address').focus();
		return false;*/
	 }
	 else
	 {
		 poststr=poststr+'&address=';
		 poststr=poststr+encodeURI(document.getElementById('address').value);
	 }	 	 
	 if(document.getElementById('city').value=="")
	 {
		alert("Please , enter your city");
		document.getElementById('city').focus();
		return false;
	 }
	 else
	 {
		 poststr=poststr+'&city=';
		 poststr=poststr+encodeURI(document.getElementById('city').value);
	 }  
	 
	 if(document.getElementById('state').value=="")
	 {
		alert("Please , enter your state/province");
		document.getElementById('state').focus();
		return false;
	 }
	 else
	 {
		 poststr=poststr+'&state=';
		 poststr=poststr+encodeURI(document.getElementById('state').value);
	 } 
	  
	 if(document.getElementById('postal').value=="")
	 {
		alert("Please , enter your postal code");
		document.getElementById('postal').focus();
		return false;
	 }
	 else
	 {
		 poststr=poststr+'&postal=';
		 poststr=poststr+encodeURI(document.getElementById('postal').value);
	 }
	 
	 if(document.getElementById('country').value=="")
	 {
		alert("Please , enter your country");
		document.getElementById('country').focus();
		return false;
	 }
	 else
	 {
		 poststr=poststr+'&country=';
		 poststr=poststr+encodeURI(document.getElementById('country').value);
	 }
    
     //alert("1");
	 if(document.getElementById('telePhone').value!="")
	 {
		 if(document.getElementById('telePhone').value.length > 6)
		 {
			poststr=poststr+'&phone=';
			poststr=poststr+encodeURI(document.getElementById('telePhone').value);
		 }
	 }
     
     //alert("2");
	  if(document.getElementById('departureDate').value!="")
	 {
		poststr=poststr+'&departureDate=';
		poststr=poststr+encodeURI(document.getElementById('departureDate').value);
	 }

    //alert("3");
	  if(document.getElementById('returnDate').value!="")
	 {
		poststr=poststr+'&returnDate=';
		poststr=poststr+encodeURI(document.getElementById('returnDate').value);
	 }
     //alert("4");
	 if(document.getElementById('departureMonth').value!="")
	 {
		poststr=poststr+'&departureMonth=';
		poststr=poststr+encodeURI(document.getElementById('departureMonth').value);
	 }
     
     //alert("5");
	 
	 if(document.getElementById('adult').value!="")
	 {
		poststr=poststr+'&adult=';
		poststr=poststr+encodeURI(document.getElementById('adult').value);
	 }
     
     //alert("6");
	 	 	 	 
	 if(document.getElementById('children').value!="")
	 {
		poststr=poststr+'&children=';
		poststr=poststr+encodeURI(document.getElementById('children').value);
		var noChildren = document.getElementById('children').value;
		for(i=1;i<=noChildren;i++)
		{
			 poststr=poststr+'&selAge'+i+'=';
			 poststr=poststr+encodeURI(document.getElementById('selAge'+i).value);
		}
	 }
     
    //alert("7");
	 
	  if(document.getElementById('budget').value!="")
	 {
		poststr=poststr+'&budget=';
		poststr=poststr+encodeURI(document.getElementById('budget').value);
	 }
    //alert("7");

    if(document.getElementById('accommodation').value!="")
	 {
		poststr=poststr+'&accommodation=';
		poststr=poststr+encodeURI(document.getElementById('accommodation').value);
	 }
     
     //alert("8");
	 var checkBoxTripValues = get_checkBox_values();
	 
	 if(checkBoxTripValues!="")
	 {
		poststr=poststr+'&tripInterest=';
		poststr=poststr+encodeURI(checkBoxTripValues);
	 }
     
     //alert("9");
     var destinationsValues = get_destination_checkBox_values();
     if(destinationsValues !="")
     {
        poststr=poststr+'&destinations=';
		poststr=poststr+encodeURI(destinationsValues);
     }
     
     //alert("10");
	 
	 if(document.getElementById('learnAbt').value=="")
	 {
		alert("Please , select how do you learn about wildchina ?");
		document.getElementById('learnAbt').focus();
		return false;
	 }
	 
	 if(document.getElementById('learnAbt').value!="")
	 {
		poststr=poststr+'&aboutwc=';
		poststr=poststr+encodeURI(document.getElementById('learnAbt').value);
	 }
	 
	 if(document.getElementById('learnAbt').value=="Other")
	 {
		poststr=poststr+'&otherlearn=';
		poststr=poststr+encodeURI(document.getElementById('otherlearn').value);
	 }
	 
	  if(document.getElementById('comments').value!="")
	 {
		poststr=poststr+'&comments=';
		poststr=poststr+encodeURI(document.getElementById('comments').value);
	 }
	  if(document.getElementById('mailHeading').value!="")
	 {
		poststr=poststr+'&mailHeading=';
		poststr=poststr+encodeURI(document.getElementById('mailHeading').value);
	 }
    //alert("11");
    if(document.getElementById('numberofdays').value!="")
	 {
		poststr=poststr+'&numberofdays=';
		poststr=poststr+encodeURI(document.getElementById('numberofdays').value);
	 }
     
	 //alert("Post--"+poststr);
     /* var poststr = "mytextarea1=" + encodeURI( document.getElementById("mytextarea1").value ) +
                    "&mytextarea2=" + encodeURI( document.getElementById("mytextarea2").value );*/
	  /*var poststr = "mytextarea1=" + encodeURI( document.getElementById('fst').value);*/
        
	  var baseUrl = document.getElementById('baseUrl').value ;
	  	  	  				
      makePOSTRequest(baseUrl+'private-china-tours/sendEmail', poststr);
	  
   }
   
 //function for Corporate section starts
	 
   function  CorporateInquiryForm(){
	   	   
   	var cstr=''; 
		if(document.getElementById('firstName').value=="")
	 	{
			alert("Please , enter your first name");
			document.getElementById('firstName').focus();
			return false;
		 }
		 else
	 	{
			cstr=cstr+'f_name=';
		 	cstr=cstr+encodeURI(document.getElementById('firstName').value);
		 }
		 
		if(document.getElementById('lastName').value=="")
	 	{
			alert("Please , enter your last name");
			document.getElementById('lastName').focus();
			return false;
	 	}
	 	else
		 {
			cstr=cstr+'&l_name=';
		 	cstr=cstr+encodeURI(document.getElementById('lastName').value);
	 	}
		
		
	 	if(document.getElementById('emailIds').value=="")
	 	{
			alert("Please , enter your emailid");
			document.getElementById('emailIds').focus();
		return false;
		}
	 	else
	 	{
			if(checkemail()){
		 		cstr=cstr+'&email=';
		 		cstr=cstr+encodeURI(document.getElementById('emailIds').value);
		 	}		 
			else
			 {
				alert("Please , enter your valid emailid");
				document.getElementById('emailIds').focus();
				return false;
		 	}
	 }	 


		if(document.getElementById('position').value=="")
	 	{
			alert("Please , enter the position");
			document.getElementById('position').focus();
			return false;
		 }
		else
	 	{
			cstr=cstr+'&position=';
		 	cstr=cstr+encodeURI(document.getElementById('position').value);
		}
		
	  if(document.getElementById('phone').value=="")
	 {
		alert("Please , enter your contact number");
		document.getElementById('phone').focus();
		return false;
	 }
	 else
	 {
		 cstr=cstr+'&phone=';
		 cstr=cstr+encodeURI(document.getElementById('phone').value);
	 }
		
	 if(document.getElementById('company').value=="")
	 {
		alert("Please , enter your Institute name");
		document.getElementById('company').focus();
		return false;
	 }
	 else
	 {
		 cstr=cstr+'&company=';
		 cstr=cstr+encodeURI(document.getElementById('company').value);
	 }
	 
	 if(document.getElementById('com_type').value!="")
	 {
		cstr=cstr+'&com_type=';
		cstr=cstr+encodeURI(document.getElementById('com_type').value);
	 }
	 
	 
	 if(document.getElementById('participants').value!="")
	 {
		cstr=cstr+'&participants=';
		cstr=cstr+encodeURI(document.getElementById('participants').value);
	 }	
	
	
	if(document.getElementById('city').value=="")
	 {
		alert("Please , Select your city");
		document.getElementById('city').focus();
		return false;
	 }
	 else
	 {
		 cstr=cstr+'&city=';
		 cstr=cstr+encodeURI(document.getElementById('city').value);
	 }

	if(document.getElementById('state').value=="")
	 {
		alert("Please , Select your state");
		document.getElementById('state').focus();
		return false;
	 }
	 else
	 {
		 cstr=cstr+'&state=';
		 cstr=cstr+encodeURI(document.getElementById('state').value);
	 }
	
	//alert( document.getElementById('country') );
	if(document.getElementById('country').value=="")
	 {
		alert("Please , Select your country");
		document.getElementById('country').focus();
		return false;
	 }
	 else
	 {
		 cstr=cstr+'&country=';
		 cstr=cstr+encodeURI(document.getElementById('country').value);
	 }
	
	var checkBoxEventValues = get_checkBox_eventType();

	if(checkBoxEventValues!="")
	 {
		cstr = cstr+'&event_type=';
		cstr = cstr+encodeURI(checkBoxEventValues);
	 }
	
	if(document.getElementById('otherEvent').value!="")
	 {
		cstr = cstr+'&otherEvent=';
		cstr = cstr+encodeURI(document.getElementById('otherEvent').value);
	 }
	 
	 
	var checkBoxNeedValues = get_checkBox_eventNeed();
	if(checkBoxNeedValues!="")
	 {
		cstr = cstr+'&event_need=';
		cstr = cstr+encodeURI(checkBoxNeedValues);
	 }
	
	if(document.getElementById('otherNeeds').value!="")
	 {
		cstr = cstr+'&otherNeeds=';
		cstr = cstr+encodeURI(document.getElementById('otherNeeds').value);
	 }
	
	 if(document.getElementById('location').value!="")
	 {
		cstr=cstr+'&location=';
		cstr=cstr+encodeURI(document.getElementById('location').value);
	 }
	
	if(document.getElementById('datepicker1').value!="")
	 {
		cstr=cstr+'&departure_date=';
		cstr=cstr+encodeURI(document.getElementById('datepicker1').value);
	 }	
	 
	 if(document.getElementById('datepicker2').value!="")
	 {
		cstr=cstr+'&return_date=';
		cstr=cstr+encodeURI(document.getElementById('datepicker2').value);
	 }	
		
	
	 if(document.getElementById('learnAbt').value=="")
	 {
		alert("Please , select how do you learn about wildchina ?");
		document.getElementById('learnAbt').focus();
		return false;
	 }
	
	if(document.getElementById('learnAbt').value!="")
	 {
		cstr=cstr+'&aboutwc=';
		cstr=cstr+encodeURI(document.getElementById('learnAbt').value);
	 }
	 
	 if(document.getElementById('learnAbt').value=="Other")
	 {
		cstr=cstr+'&otherlearn=';
		cstr=cstr+encodeURI(document.getElementById('otherlearn').value);
	 }
	 
	  if(document.getElementById('comments').value!="")
	 {
		cstr=cstr+'&comments=';
		cstr=cstr+encodeURI(document.getElementById('comments').value);
	 }
	 	
	  if(document.getElementById('token').value!="")
	 {
		cstr=cstr+'&token=';
		cstr=cstr+encodeURI(document.getElementById('token').value);
	 }
		
	var baseUrl = document.getElementById('baseUrl').value ;
	makePOSTRequest( baseUrl+'corporate-travel/sendCoporateInquiryMail' , cstr );
		
			
	} 	 	
 
 //function for Corporate section Ends
 
   
   

function get_checkBox_values()
{
	var c_value = "";
	for (var i=0; i < document.inquiryForm.tripInterest.length; i++)
   	{
   		if (document.inquiryForm.tripInterest[i].checked)
      	{
      		c_value = c_value + document.inquiryForm.tripInterest[i].value;
			
			if(i<(document.inquiryForm.tripInterest.length-1))
			{
				c_value = c_value + ",";
			}
      	}
   	}
	return c_value;
}



//Return the check box values for destinations
function get_destination_checkBox_values()
{
	var c_value = "";
	for (var i=0; i < document.inquiryForm.destinations.length; i++)
   	{
   		if (document.inquiryForm.destinations[i].checked)
      	{
            if(c_value == "")
            {
                c_value = document.inquiryForm.destinations[i].value;
            }
            else
            {
                c_value = c_value + "," + document.inquiryForm.destinations[i].value;

            }
			
      	}
   	}
	return c_value;
}



//Return the check box values for location
function get_checkBox_location()
{
	var c_value = "";
	for (var i=0; i < document.GeneralForm.location.length; i++)
   	{
   		if (document.GeneralForm.location[i].checked)
      	{
      		if(document.GeneralForm.location[i].value!='Other')
			{
				c_value = c_value + document.GeneralForm.location[i].value;
			
			
				if(i<(document.GeneralForm.location.length-1))
				{
					c_value = c_value + ",";
				}
			
			}
      	}
   	}
	return c_value;
}

//Return the check box values for Interest
function get_checkBox_interest()
{
	var c_value = "";
	for (var i=0; i < document.GeneralForm.interest.length; i++)
   	{
   		if (document.GeneralForm.interest[i].checked)
      	{
      		if(document.GeneralForm.interest[i].value!='Other')
			{
			c_value = c_value + document.GeneralForm.interest[i].value;
			
			if(i<(document.GeneralForm.interest.length-1))
			{
				c_value = c_value + ",";
			}
			}
      	}
   	}
	return c_value;
}

//Return the checkbox values for event types
function get_checkBox_eventType()
{
	var c_value = "";
	for (var i=0; i < document.CorporateForm.eventType.length; i++)
   	{
   		if (document.CorporateForm.eventType[i].checked)
      	{
      		if(document.CorporateForm.eventType[i].value!='Other')
			{
				c_value = c_value + document.CorporateForm.eventType[i].value;
			
			
				if(i<(document.CorporateForm.eventType.length-1))
				{
					c_value = c_value + ",";
				}
			
			}
      	}
   	}
	return c_value;	
	
}

//Return the checkbox values for event needs
function get_checkBox_eventNeed()
{
	var c_value = "";
	for (var i=0; i < document.CorporateForm.eventNeeds.length; i++)
   	{
   		if (document.CorporateForm.eventNeeds[i].checked)
      	{
      		if(document.CorporateForm.eventNeeds[i].value!='Other')
			{
				c_value = c_value + document.CorporateForm.eventNeeds[i].value;
			
			
				if(i<(document.CorporateForm.eventNeeds.length-1))
				{
					c_value = c_value + ",";
				}
			
			}
      	}
   	}
	return c_value;	

}
// use change start
function ShowOtherFieldb()
{
	if(document.getElementById('learnAbtb').value=="Other")
	{
		document.getElementById('dispOtherb').style.display='block';
	}
}

//use change end
function ShowOtherField()
{
	if((document.getElementById('learnAbt').value=="Other")
       ||(document.getElementById('learnAbt').value=="Magazine/Newspaper")
       ||(document.getElementById('learnAbt').value=="Guidebook - Others")
       ||(document.getElementById('learnAbt').value=="Conference or Event"))
	{
		document.getElementById('dispOther').style.display='block';
	}
    else
    {
        document.getElementById('dispOther').style.display='none';
    }
}
function ShowOtherFieldForLocation(id)
{
	 var srcElement = document.getElementById(id);
       if(srcElement != null) {
	   if(srcElement.style.display == "block") {
     		  srcElement.style.display= 'none';
   	    }
            else {
                   srcElement.style.display='block';
            }
            return false;
       }

	//document.getElementById('dispOtherLocation').style.display='block';
		
}

function ShowOtherFieldForInterest(id)
{
	
	 var srcElement = document.getElementById(id);
       if(srcElement != null) {
	   if(srcElement.style.display == "block") {
     		  srcElement.style.display= 'none';
   	    }
            else {
                   srcElement.style.display='block';
            }
            return false;
       }
	
	//document.getElementById('dispOtherInterest').style.display='block';

}

function generateAgeSelectField(field){
	//alert("Val--"+field);
	
	var innerArea ='';
	var innerAreaLabel ='';
	for(i=1;i<=field;i++)
	{
		
		innerAreaLabel=innerAreaLabel+'<label>Age of Child #'+i+':</label>';
		innerAreaLabel=innerAreaLabel+'<br/>';
		
		innerArea=innerArea+'<select name="selAge'+i+'" id="selAge'+i+'">';
		innerArea=innerArea+'<option value="1">1</option>';
		innerArea=innerArea+'<option value="2">2</option>';
		innerArea=innerArea+'<option value="3">3</option>';
		innerArea=innerArea+'<option value="4">4</option>';
		innerArea=innerArea+'<option value="5">5</option>';
		innerArea=innerArea+'<option value="6">6</option>';
		innerArea=innerArea+'<option value="7">7</option>';
		innerArea=innerArea+'<option value="8">8</option>';
		innerArea=innerArea+'<option value="9">9</option>';
		innerArea=innerArea+'<option value="10">10</option>';
		innerArea=innerArea+'<option value="11">11</option>';
		innerArea=innerArea+'<option value="12">12</option>';
		innerArea=innerArea+'<option value="13">13</option>';
		innerArea=innerArea+'<option value="14">14</option>';
		innerArea=innerArea+'<option value="15">15</option>';
		innerArea=innerArea+'<option value="16">16</option>';
		innerArea=innerArea+'<option value="17">17</option>';
		
		innerArea=innerArea+'</select>';
		innerArea=innerArea+'<br/>';
	}
	
	
	document.getElementById('childLabel').className="adlt";
	document.getElementById('childLabel').innerHTML=innerAreaLabel;
	document.getElementById('childAge').className="adlt";
	document.getElementById('childAge').innerHTML=innerArea;
}
function tryit(popLayer, popCon, TPos)
{

	if(document.getElementById('end').value=="Message sent")
	{
		DvLayerOpen(popLayer, popCon, TPos);
	}
}
function DvLayerOpen(popLayer, popCon, TPos)
{
	

	var DvLayerId = document.getElementById(popLayer); 	       // Var for Main full Opaque Layer
	var DvMessageId = document.getElementById(popCon);         // Var for Main content div popup Layer
	var ScrollHeight = document.documentElement.scrollHeight;  // Value for scroll height of the page
	var ScrollWidth = document.body.scrollWidth; 			   // Value for scroll width of the page
	var ClientHeight = document.documentElement.clientHeight;  // Value for browser height of the page
	var ClietnWidth = document.documentElement.clientWidth;    // Value for Browser width of the page
	var OffsetHeight = document.documentElement.offsetHeight;  // Value for scroll height for Safari of the page
	var OffsetWidth = document.documentElement.offsetWidth;    // Value for height height for Safari of the page
		
	//For Select DropBox Hide//
	for (var counter=0; counter<selectLists.length; counter++){
		version=parseInt(navigator.appVersion);
		if (navigator.appName=='Microsoft Internet Explorer')
			selectLists[counter].style.visibility = 'hidden'
		else
			selectLists[counter].style.MozOpacity = .90;
			selectLists[counter].style.opacity = .90;
			selectLists[counter].style.filter = 'alpha(opacity=' + 90 + ')';
	}
	
	//For Select DropBox Hide//
	DvLayerId.style.display="block";

	 if(ScrollHeight>ClientHeight){
			DvLayerId.style.height=ScrollHeight+"px";
		} else
		DvLayerId.style.height=ClientHeight+"px";
	var aaa = document.documentElement.scrollTop;
	document.documentElement.scrollTop = 0;
	DvMessageId.style.display="block";
	var TotalW = document.body.clientWidth;
	var popW = DvMessageId.clientWidth;
	var centerPos = TotalW/2;
	var movePos = popW/2;
	var Lalign = centerPos - movePos;
	DvLayerId.style.width=ClietnWidth+"px";
	DvLayerId.style.top=0+"px";
	DvLayerId.style.left=0+"px";
	DvMessageId.style.left=Lalign + 'px';
	DvMessageId.style.top= TPos + 'px';
	if (DvMessageId.scrollHeight > ScrollHeight){
		DvLayerId.style.height = DvMessageId.clientHeight + 300 + 'px';
	}
	
	
	
	//For maintaining the focus inside the popup on tab//	
	/*
	var allInputs=DvMessageId.getElementsByTagName("input");   // Creating an array of all the inputs present in div with id popCon
	var firstIP=allInputs[0];								   // Getting the first input from the array
	var firstIP;
	var lastIP;
	var allVisIn;
	var x;
	var y;
	
	for(i=0; i<allInputs.length; i++) 						   //For finding the first input filed which is not hidden
	{
		x=i;			
		if(allInputs[x].type != 'hidden' && allInputs[x].disabled == false){
			firstIP=allInputs[x];
			break;
		}		
	}
	
	for(j=0; j<allInputs.length; j++)  						  //For finding the last input filed which is not hidden
	{
		y=j;			
		if(allInputs[y].type != 'hidden' && allInputs[y].disabled == false){
			lastIP=allInputs[y];				
		}			
	}
	
	if(DvLayerId.style.display=='block')                      // For setting the focus on first input element in the form
	{	
		if(firstIP!=null)
		{
			firstIP.focus();
		}
	}
	if(lastIP!=null)
	{
		lastIP.onblur = function setFocus()						  // For avoiding the focus to go into the background page
		{		
			firstIP.focus();		
		}
	}
	*/
}

function DvLayerHide(popLayer, popCon){ 
    document.getElementById(popLayer).style.display='none';
    document.getElementById(popCon).style.display='none';
	//For Select DropBox Show//
	for (var counter=0; counter<selectLists.length; counter++){
		version=parseInt(navigator.appVersion);
		if (navigator.appName=='Microsoft Internet Explorer')
			selectLists[counter].style.visibility = ''
		else
			selectLists[counter].style.MozOpacity = 1.0;
			selectLists[counter].style.opacity = 1.0;
			selectLists[counter].style.filter = 'alpha(opacity=' + 100 + ')';
	}
	//For Select DropBox Show//
}
function slsShow(id){
	document.getElementById(id).style.visibility = 'visible';	
}

function setOpen(divID){
	var DvMessageId = document.getElementById(divID);          // Var for Main content div popup Layer
	var ScrollHeight = document.documentElement.scrollHeight;  // Value for scroll height of the page
	var ScrollWidth = document.body.scrollWidth; 			   // Value for scroll width of the page
	var ClientHeight = document.documentElement.clientHeight;  // Value for browser height of the page
	var ClietnWidth = document.documentElement.clientWidth;    // Value for Browser width of the page
	DvMessageId.style.display="block";
	var leftPos = (ScrollWidth/2) - (DvMessageId.clientWidth/2);
	var topPos = (ClientHeight/2) - (DvMessageId.clientHeight/2);
	var scrollTop = document.documentElement.scrollTop;
	var mostTop = topPos + scrollTop
	DvMessageId.style.top=mostTop+"px";
	DvMessageId.style.left=leftPos+"px";
}
function setHide(divID){ 
    document.getElementById(divID).style.display='none';
}

function DvLayerOpen2(popLayer, popCon, TPos){
	var DvLayerId = document.getElementById(popLayer); 	       // Var for Main full Opaque Layer
	var DvMessageId = document.getElementById(popCon);         // Var for Main content div popup Layer
	var ScrollHeight = document.documentElement.scrollHeight;  // Value for scroll height of the page
	var ScrollWidth = document.body.scrollWidth; 			   // Value for scroll width of the page
	var ClientHeight = document.documentElement.clientHeight;  // Value for browser height of the page
	var ClietnWidth = document.documentElement.clientWidth;    // Value for Browser width of the page
	var OffsetHeight = document.documentElement.offsetHeight;  // Value for scroll height for Safari of the page
	var OffsetWidth = document.documentElement.offsetWidth;    // Value for height height for Safari of the page
	DvLayerId.style.display="block";
	 if(ScrollHeight>ClientHeight){
			DvLayerId.style.height=ScrollHeight+"px";
		} else
		DvLayerId.style.height=ClientHeight+"px";
	var aaa = document.documentElement.scrollTop;
	document.documentElement.scrollTop = 0;
	DvMessageId.style.visibility="visible";
	var TotalW = document.body.clientWidth;
	var popW = DvMessageId.clientWidth;
	var centerPos = TotalW/2;
	var movePos = popW/2;
	var Lalign = centerPos - movePos;
	DvLayerId.style.width=ClietnWidth+"px";
	DvLayerId.style.top=0+"px";
	DvLayerId.style.left=0+"px";
	DvMessageId.style.left=Lalign + 'px';
	DvMessageId.style.top= TPos + 'px';
	if (DvMessageId.scrollHeight > ScrollHeight){
		DvLayerId.style.height = DvMessageId.clientHeight + 300 + 'px';
	}

}
function DvLayerHide2(popLayer, popCon){ 
    document.getElementById(popLayer).style.display='none';
    document.getElementById(popCon).style.visibility='hidden';
}
