   var http_request = false;

   function makePOSTRequest(url, parameters, spaname) {
      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;
      }
      
      http_request.onreadystatechange =  function (){ 
	  if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            
			result = http_request.responseText;
            
			document.getElementById(spaname).innerHTML = result;
			
         } else {
            alert('There was a problem with the request.');
         }
      }  
	  };
	  
      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);
	  
	 
	  
   }

function showAnimate(imgName) {
	var poststr = "imgName=" + imgName;
	//alert(imgName);
//document.getElementById('swfC').innerHTML = "<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td 	class=\"qandaText\" align=\"center\" style=\"color:#666666\" valign=\"middle\"><img src=\"/images/loading.gif\" width=\"16\" height=\"16\" /><br>Wait while loading content...</td</tr></table>";
makePOSTRequest('_contactopeft.php', poststr, 'swfC');  


}

function fetchGallery(locGroup) {
	 	  
	   var poststr = "locGroup=" + locGroup;
	 
              	
	
	document.getElementById("PopGallery").innerHTML = "<table width=\"100%\" height=\"100\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>Sending your answer<td></td</tr></table>";
	
					
	makePOSTRequest('_showgallery.php', poststr, 'PopGallery'); 
	
}


function dataGets() {
	
	
	 	  
	   var poststr = "title=" + encodeURI( document.getElementById("title").value ) +
				   "&firstname=" + encodeURI( document.getElementById("firstname").value )+
					"&familyname=" + encodeURI( document.getElementById("familyname").value )+
					"&jobtitle=" + encodeURI( document.getElementById("jobtitle").value )+
					"&companyname=" + encodeURI( document.getElementById("companyname").value )+
					"&postaladdress=" + encodeURI( document.getElementById("postaladdress").value )+
					"&telephone=" + encodeURI( document.getElementById("telephone").value )+
					"&email=" + encodeURI( document.getElementById("email").value )+
					"&mobile=" + encodeURI( document.getElementById("mobile").value )+
					"&lstcountry=" + encodeURI( document.getElementById("lstcountry").value )+
					"&secname=" + encodeURI( document.getElementById("secname").value )+
					"&exhname=" + encodeURI( document.getElementById("exhname").value )+
					"&cb1=" + cb1;
	 
                 	
	
	document.getElementById("formsp").innerHTML = "<table width=\"100%\" height=\"100\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>Sending your answer<td></td</tr></table>";
	
					
	makePOSTRequest('../../_submitform.php', poststr, 'formsp');  
	
}


function sendContact() {
error = false;
var emailID=document.getElementById("emailtxt");
	//alert(emailID.value);
	if ((emailID.value==null)||(emailID.value=="")){
		//alert("Please Enter your Email ID")
		document.getElementById("emailerror").innerHTML = "Enter Email ID";
		emailID.focus()
		error = true;
	}
	else
	{
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		error = true;
	}
	
	}

	if (error != true)  	  
	  {
	
         var poststr = "name=" + encodeURI( document.getElementById("name").value ) +
				   "&email=" + encodeURI( document.getElementById("emailtxt").value )+
					"&message=" + encodeURI( document.getElementById("message").value );        	
	
	document.getElementById("contactForm").innerHTML = "<table width=\"100%\" height=\"250\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"color:#FFFFFF; font-size:11px\" align=\"center\" valign=\"middle\"><img src=\"/images/loading.gif\" width=\"16\" height=\"16\" border=\"0\" align=\"absmiddle\"/> Sending your Inquiry</td></tr></table>";
	
					
	makePOSTRequest('/_contactsend.php', poststr, 'contactForm');  
	}
}

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					
	}

