/****************************************************************************************************/
/*                           				Module_AdvRotation										*/
/* 				This file contains funtions that will rotate ads on the homepage.					*/
/*										Date Created: 05/05/2007		 						*/
/*																			 						*/
/*						Copyright © 2007 The Corcoran Group, Inc. All Rights Reserved 				*/
/****************************************************************************************************/
//<![CDATA[
var ServiceURLV	= 		"/SurveyPoll.aspx?";		// The server-side script
var HttpObjectV 	= 		getHTTPObject();
var advTypeV = "";

function SendXmlHttpRequestV(id_val){
	
	
	advTypeV=id_val;
	var stt=id_val.split("_");
	var the_id=stt[2];
	var the_val=stt[1];
	var the_color=stt[3];
	
	  var obj= eObjects.createXmlHttpObject();
    

 r=ServiceURLV +"id="+ escape(the_id)+"&value="+ escape(the_val)+"&color="+ escape(the_color);
        eObjects.SendXmlHttpRequest(obj,r, HandleHttpResponseV);
        
  
	//if (!isWorking && HttpObjectV) {
	//alert('r'+the_id+the_val+the_color);
	  	//HttpObjectV.open("POST", ServiceURLV +"id="+ escape(the_id)+"&value="+ escape(the_val)+"&color="+ escape(the_color), true);	
	  //	HttpObjectV.onreadystatechange = HandleHttpResponseV;	
	  //	HttpObjectV.send('');
	//}
	
	  eObjects.DestroyXmlHttpObject();
}
function HandleHttpResponseV(data){
	//if (HttpObjectV.readyState == 4){
	
		//if (HttpObjectV.responseText.indexOf('invalid') == -1) {
			//results = HttpObjectV.responseText;
			
			var p=data.split("~-~");
			document.getElementById("tr_surveyspacer").style.display="none";
			document.getElementById("td_questionbox").innerHTML=p[1];
			document.getElementById("div_results").innerHTML=p[0];
		//}
	//}
}
function getHTTPObject() {

  var xmlhttp;

  
  /*@cc_on

  @if (@_jscript_version >= 5)

    try {

      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e) {

      try {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (E) {

        xmlhttp = false;

      }

    }

  @else

  xmlhttp = false;

  @end @*/
	 if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {

    try {

      xmlhttp = new XMLHttpRequest();
	  //xmlhttp.overrideMimeType('text/xml');

    } catch (e) {

      xmlhttp = false;

    }

  }
  



  return xmlhttp;

}
 //]]>
