// JavaScript Document
function loadXMLDoc()
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","ajax.asp?Prodname="+parm+"",true);
xmlhttp.send();
}
function loadReviewForm()
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("addreview").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","_reviews_write2.asp?ID="+parm1+"",true);
xmlhttp.send();
}
 
 function newAjax(){
	var xmlhttp=false;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (E) {
 			xmlhttp = false;
 		}
  	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function sndRating(idnum,rateval) 
{
		
	ajax=newAjax();
	ajax.open("GET", "ratingprocess.asp"+"?id="+idnum+"&rateval="+rateval+"",true);
	
	ajax.onreadystatechange=function() {
		
		if (ajax.readyState==4) {
			var resp = ajax.responseText;	
			var dvelement = document.getElementById('dv'+idnum);
            dvelement.innerHTML = "Thank you for your feedback!";		
		}
	}
	
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("?id="+idnum+"&rateval="+rateval+"")
	
 }


