////////////////////////Register start//////////////////

   var http_request = false;
   function makePOSTRequestRegister(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;
      }
       
      http_request.onreadystatechange = alertContentsRegister;
      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 alertContentsRegister() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
           //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('registerspan').innerHTML = result;            
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
 
 

   
   function getRegisterlink(vid) {
	var poststr = "&var=" + vid ;
	   	
      makePOSTRequestRegister('ajax-register.php', poststr);
   }  
   
   
  
    function getformRegister(obj) { 
   	  var poststr = "&action=" + encodeURI( document.getElementById("action").value )+ 
   	  		        "&uname=" + encodeURI( document.getElementById("uname").value )+
	   			  "&uemail=" + encodeURI( document.getElementById("uemail").value )+	
	   	  		  "&mobile=" + encodeURI( document.getElementById("mobile").value );
   	 makePOSTRequestRegister('ajax-register.php', poststr);
   }
  
////////////////////////Register start//////////////////  

////////////////////////Contact start//////////////////

   var http_request = false;
   function makePOSTRequestCon(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;
      }
       
      http_request.onreadystatechange = alertContentsCon;
      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 alertContentsCon() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('contactspan').innerHTML = result;            
         } else {
            alert('There was a problem with the request.');
         }
      }
   }

   function getConlink(vid) {
   	  var poststr = "&var=" + vid ;
      makePOSTRequestCon('ajax-contact.php', poststr);
   }
   
   function getformCon(obj) { 
   	  var poststr ="&action=" + encodeURI( document.getElementById("action").value )+   
   	  		 "&contactto=" + encodeURI( document.getElementById("contactto").value )+
   	 		 "&uname=" + encodeURI( document.getElementById("uname").value )+
   	 		 "&city=" + encodeURI( document.getElementById("city").value )+
   	 		 "&email=" + encodeURI( document.getElementById("email").value )+
   	 		 "&mobile=" + encodeURI( document.getElementById("mobile").value )+
   	 		 "&message=" + encodeURI( document.getElementById("message").value );
      makePOSTRequestCon('ajax-contact.php', poststr);
   }
////////////////////////Contact end//////////////////


////////////////////////Questionnaire start//////////////////
   var http_request = false;
   function makePOSTRequestQues(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;
      }
       
      http_request.onreadystatechange = alertContentsQues;
      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 alertContentsQues() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('quesspan').innerHTML = result;            
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
 
   function getQueslink(vid) {
   	  var poststr = "&pid=" + vid ;
      makePOSTRequestQues('ajax-questionnaire.php', poststr);
   }
   
   function getformQues(obj) { 
   	  var poststr ="&action=" + encodeURI( document.getElementById("action").value )+    	   
   	 		 "&uname=" + encodeURI( document.getElementById("uname").value )+
   	 		 "&i_hear1=" + encodeURI( document.getElementById("i_hear1").checked ? 1 : 0)+
   	 		 "&i_hear2=" + encodeURI( document.getElementById("i_hear2").checked ? 1 : 0)+
   	 		 "&i_hear3=" + encodeURI( document.getElementById("i_hear3").checked ? 1 : 0)+
   	 		 "&i_hear4=" + encodeURI( document.getElementById("i_hear4").checked ? 1 : 0)+
   	 		 "&i_hear5=" + encodeURI( document.getElementById("i_hear5").checked ? 1 : 0)+
   	 		 "&t_hear=" + encodeURI( document.getElementById("t_hear").value )+
   	 		 "&look1=" + encodeURI( document.getElementById("look1").checked ? 1 : 0)+
   	 		 "&look2=" + encodeURI( document.getElementById("look2").checked ? 1 : 0)+
   	 		 "&nav1=" + encodeURI( document.getElementById("nav1").checked ? 1 : 0)+
   	 		 "&nav2=" + encodeURI( document.getElementById("nav2").checked ? 1 : 0)+
   	 		 "&nav3=" + encodeURI( document.getElementById("nav3").checked ? 1 : 0)+
   	 		 "&service1=" + encodeURI( document.getElementById("service1").checked ? 1 : 0)+
   	 		 "&service2=" + encodeURI( document.getElementById("service2").checked ? 1 : 0)+
   	 		 "&service3=" + encodeURI( document.getElementById("service3").checked ? 1 : 0)+
   	 		 "&service4=" + encodeURI( document.getElementById("service4").checked ? 1 : 0)+
   	 		 "&service5=" + encodeURI( document.getElementById("service5").checked ? 1 : 0)+
   	 		 "&add=" + encodeURI( document.getElementById("add").value )+
   	 		 "&rating1=" + encodeURI( document.getElementById("rating1").checked ? 1 : 0)+
   	 		 "&rating2=" + encodeURI( document.getElementById("rating2").checked ? 1 : 0)+
   	 		 "&rating3=" + encodeURI( document.getElementById("rating3").checked ? 1 : 0)+
   	 		 "&rating4=" + encodeURI( document.getElementById("rating4").checked ? 1 : 0)+
   	 		 "&rating5=" + encodeURI( document.getElementById("rating5").checked ? 1 : 0);
      makePOSTRequestQues('ajax-questionnaire.php', poststr);
   }
////////////////////////Questionnaire end//////////////////


////////////////////////Suggestions start//////////////////
   var http_request = false;
   function makePOSTRequestSug(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;
      }
       
      http_request.onreadystatechange = alertContentsSug;
      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 alertContentsSug() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('sugspan').innerHTML = result;            
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
 
   function getSuglink(vid) {
   	  var poststr = "&pid=" + vid ;
      makePOSTRequestSug('ajax-suggestion.php', poststr);
   }
   
   function getformSug(obj) { 
   	  var poststr ="&action=" + encodeURI( document.getElementById("action").value )+    	   
   	 		 "&uname=" + encodeURI( document.getElementById("uname").value )+
   	 		 "&email=" + encodeURI( document.getElementById("email").value )+
   	 		 "&mobile=" + encodeURI( document.getElementById("mobile").value )+
   	 		 "&title=" + encodeURI( document.getElementById("title").value )+
   	 		 "&sug=" + encodeURI( document.getElementById("sug").value );
      makePOSTRequestSug('ajax-suggestion.php', poststr);
   }
////////////////////////Suggestions end//////////////////

////////////////////////UEFA start//////////////////
   var http_request = false;
   function makePOSTRequestUefa(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;
      }
       
      http_request.onreadystatechange = alertContentsUefa;
      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 alertContentsUefa() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('uefaspan').innerHTML = result;            
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
 
   function getUefalink(vid) {
   	  var poststr = "&pid=" + vid ;
      makePOSTRequestUefa('ajax-uefa.php', poststr);
   }
   
   function getformUefa(obj) { 
   	  var poststr ="&action=" + encodeURI( document.getElementById("action").value )+    	   
   	 		 "&uname=" + encodeURI( document.getElementById("uname").value )+
   	 		 "&city=" + encodeURI( document.getElementById("city").value )+
   	 		 "&email=" + encodeURI( document.getElementById("email").value )+
   	 		 "&mobile=" + encodeURI( document.getElementById("mobile").value )+
   	 		 "&hear1=" + encodeURI( document.getElementById("hear1").checked )+
   	 		 "&hear2=" + encodeURI( document.getElementById("hear2").checked )+
   	 		 "&hear3=" + encodeURI( document.getElementById("hear3").checked )+
   	 		 "&hear4=" + encodeURI( document.getElementById("hear4").checked )+
   	 		 "&hearo=" + encodeURI( document.getElementById("hearo").value )+
   	 		 "&use1=" + encodeURI( document.getElementById("use1").checked )+
   	 		 "&use2=" + encodeURI( document.getElementById("use2").checked )+
   	 		 "&use3=" + encodeURI( document.getElementById("use3").checked )+
   	 		 "&plan1=" + encodeURI( document.getElementById("plan1").checked )+
   	 		 "&plan2=" + encodeURI( document.getElementById("plan2").checked )+
   	 		 "&finance1=" + encodeURI( document.getElementById("finance1").checked )+
   	 		 "&finance2=" + encodeURI( document.getElementById("finance2").checked )+
   	 		 "&acquire1=" + encodeURI( document.getElementById("acquire1").checked )+
   	 		 "&acquire2=" + encodeURI( document.getElementById("acquire2").checked )+
   	 		 "&acquire3=" + encodeURI( document.getElementById("acquire3").checked )+
   	 		 "&interest1=" + encodeURI( document.getElementById("interest1").checked )+
   	 		 "&interest2=" + encodeURI( document.getElementById("interest2").checked )+
   	 		 "&interest3=" + encodeURI( document.getElementById("interest3").checked )+
   	 		 "&learn1=" + encodeURI( document.getElementById("learn1").checked )+
   	 		 "&learn2=" + encodeURI( document.getElementById("learn2").checked )+
   	 		 "&learn3=" + encodeURI( document.getElementById("learn3").checked )+
   	 		 "&learn4=" + encodeURI( document.getElementById("learn4").checked )+
   	 		 "&learno=" + encodeURI( document.getElementById("learno").value )+
   	 		 "&moreinfo=" + encodeURI( document.getElementById("moreinfo").checked )+
   	 		 "&test1=" + encodeURI( document.getElementById("test1").checked )+
   	 		 "&test2=" + encodeURI( document.getElementById("test2").checked )+
   	 		 "&test3=" + encodeURI( document.getElementById("test3").checked )+
   	 		 "&test4=" + encodeURI( document.getElementById("test4").checked );
     
      makePOSTRequestUefa('ajax-uefa.php', poststr);
   }
////////////////////////UEFA end//////////////////
