// JavaScript Document
//MAKE AN HTTP REQUEST ==================================
var vHttpRequest = false;
try {
  vHttpRequest = new XMLHttpRequest();
} catch (trymicrosoft) {
  try {
    vHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (othermicrosoft) {
    try {
      vHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (failed) {
      vHttpRequest = false;
    }//END TRY 3
  }//END TRY 2
}//END TRY 1
if(!vHttpRequest){
  alert("Error: Your browser needs updating to use this page!")
};//END IF
//******************* FIRES EVERY TIME THE KEY IS PRESSED ****************************************
showReviews = function(prop,path,star){
		var vURL=path+"includes/reviews/reviews-http.asp";
			vURL=vURL+"?prop="+prop;
			vURL=vURL+"&path="+path;
			vURL=vURL+"&star="+star;
			vHttpRequest.onreadystatechange=showReviewsPage;
			//vHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
			vHttpRequest.open("GET",vURL,true);
			vHttpRequest.send(null);
			//alert(vURL)
}//END MAKE FUNCTION
//*********************** RETURNS WITH THE IMAGENAME AND CHANGES THE IMAGE ********************************
function showReviewsPage(){ 
	if(vHttpRequest.readyState== 4 ){
		if (vHttpRequest.status == 200){
			var arrResponse= vHttpRequest.responseText;
		//var arrResponse= vHttpRequest.responseText.split("~");
		//var randomnumber=Math.floor(Math.random()*100)
		document.getElementById('reviewsdiv').innerHTML = arrResponse;
			vHttpRequest.abort(); //NEEDED FOR IE
		}//END IF
	}//END IF
}//END MAKE FUNCTION

