﻿var xmlHttp

function checkajaxform(stremail,struser,strmailing)
{
//if (stremail.length==0)
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {alert ("Your browser does not support AJAX!");return;} 

var url="/scripts/ajax/veriform.asp";
url=url+"?email="+stremail;
url=url+"&user="+struser;
url=url+"&type="+strmailing;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedForm;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 
function stateChangedForm() 
{if (xmlHttp.readyState==4){document.getElementById("txtFormTLMMDR").innerHTML=xmlHttp.responseText;}}

function checkajaxform2(stremail,struser,strmailing)
{
//if (stremail.length==0)
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {alert ("Your browser does not support AJAX!");return;} 

var url="/scripts/ajax/veriform.asp";
url=url+"?email="+stremail;
url=url+"&user="+struser;
url=url+"&type="+strmailing;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedForm2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 
function stateChangedForm2() 
{if (xmlHttp.readyState==4){document.getElementById("txtFormTLFMDR").innerHTML=xmlHttp.responseText;}}

function checkajaxformheader(stremail,struser,strmailing)
{
//if (stremail.length==0)
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {alert ("Your browser does not support AJAX!");return;} 

var url="/scripts/ajax/veriform.asp";
url=url+"?email="+stremail;
url=url+"&user="+struser;
url=url+"&type="+strmailing;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedFormHeader;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 
function stateChangedFormHeader() 
{if (xmlHttp.readyState==4){document.getElementById("txtFormTLMMDRHeader").innerHTML=xmlHttp.responseText;}}


function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

<!--
// AJAX FORM PARABOT
 var http = createRequestObject();
 function createRequestObject() 
     {
           var xmlhttp;
	 try 
                 { 
                    xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
                 }
	  catch(e) 
                 {
	    try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
	    catch(f) { xmlhttp=null; }
	    }
	        if(!xmlhttp&&typeof XMLHttpRequest!="undefined") 
                        {
	  	   xmlhttp=new XMLHttpRequest();
	           }
		   return  xmlhttp;
 }
function parabotAjax(parabotid,parabot,user,email) 
  {
	var processingdiv = document.getElementById('processingdiv');
             processingdiv.innerHTML = "<img src='/images/site/ajax-loader.gif'>";
            try
              {
                 http.open('GET', '/scripts/ajax/veriform_parabot.asp?parabotid='+parabotid+'&parabot='+parabot+'&user='+user+'&email='+email);
                 http.onreadystatechange =handleResponseTextParabot;
	    http.send(null);
	 }
	    catch(e){}
	    finally{}
 }
function handleResponseTextParabot() 
  {
     try
         {
             if((http.readyState == 4)&& (http.status == 200))
                {
    	          var processingdiv = document.getElementById('processingdiv');
    	          processingdiv.innerHTML = "";
    	          
    	          var response = http.responseText;
                  var update = new Array();

                    if(response.indexOf('|') != -1) 
                       {
                          update = response.split('|');
                          var emailtxt = document.getElementById('emailtxt');
                          var usertxt = document.getElementById('usertxt');
                          var ajaxform = document.getElementById('ajaxform');
                          

                          //var totalvote = document.getElementById('tv'+update[0]);
                          //var starimg = document.getElementById('star'+update[0]);
                          //drelement.style.display ='none';
                          emailtxt.innerHTML = update[0].toString();
                          usertxt.innerHTML = update[1];
                          //if (update[2] == 1)
                          if (update[2] == 1)
                          {
                          ajaxform.innerHTML = update[3];
                          }
                          

                          //totalvote.innerHTML = update[2];
                          //starimg.innerHTML = update[4].toString();
             }
	        }
        }
	catch(e){alert("an error occured !");}
	finally{}
}
// AJAX FORM PARABOT END