function lapor(str, ID)
{
loc=ID
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
url="spam.asp?r="+str;
//url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged3;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function reputation(str, ID, q, t)
{
loc=ID
xmlHttp=GetXmlHttpObject();
xmlHttp2=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
url="reputate.asp?" + loc + "=" +str;

//url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

url2 = "commentList.asp?q=" + q;
xmlHttp2.onreadystatechange=stateChanged5;
xmlHttp2.open("GET",url2,true);
xmlHttp2.send(null);

}
function stateChanged5()
{ 
	if (xmlHttp.readyState==2)
	{
		document.getElementById('reviews_container').innerHTML = "Loading...";
	}
	else if (xmlHttp.readyState==4)
	{ 
		document.getElementById('reviews_container').innerHTML = xmlHttp2.responseText;
	}
}
function stateChanged3() 
{ 
	if (xmlHttp.readyState==4)
	{ 
	if (self.innerHeight) { // Everyone but IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		myScroll = window.pageYOffset;
	} else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		myScroll = document.documentElement.scrollTop;
	} else if (document.body) { // Other IE, such as IE7
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		myScroll = document.body.scrollTop;
	}

	// Page size w/offscreen areas

	if (window.innerHeight && window.scrollMaxY) {	
		myScrollWidth = document.body.scrollWidth;
		myScrollHeight = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac
		myScrollWidth = document.body.scrollWidth;
		myScrollHeight = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		myScrollWidth = document.body.offsetWidth;
		myScrollHeight = document.body.offsetHeight;
	}
	var theWindow = document.getElementById(loc);
	
	theWindow.style.left = ((myWidth - 360) / 2) + 'px';
	theWindow.style.top = ((myHeight / 2) - 150 + myScroll) + 'px';
	//theWindow.style.top = '10px';
	
	theWindow.style.display='block';
	document.getElementById('fullscreen').style.height = myScrollHeight + 'px';
	document.getElementById('fullscreen').style.display='block';
	theWindow.innerHTML = xmlHttp.responseText + theWindow.innerHTML;
	}
}

function stateChanged2() 
{ 
	if (xmlHttp.readyState==4)
	{ 
	if (self.innerHeight) { // Everyone but IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		myScroll = window.pageYOffset;
	} else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		myScroll = document.documentElement.scrollTop;
	} else if (document.body) { // Other IE, such as IE7
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		myScroll = document.body.scrollTop;
	}

	// Page size w/offscreen areas

	if (window.innerHeight && window.scrollMaxY) {	
		myScrollWidth = document.body.scrollWidth;
		myScrollHeight = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac
		myScrollWidth = document.body.scrollWidth;
		myScrollHeight = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		myScrollWidth = document.body.offsetWidth;
		myScrollHeight = document.body.offsetHeight;
	}
	var theWindow = document.getElementById('reputationID');
	
	theWindow.style.left = ((myWidth - 360) / 2) + 'px';
    theWindow.style.top = ((myHeight / 2) - 150 + myScroll) + 'px';
   //theWindow.style.top = '10px';
	
	theWindow.style.display='block';
	document.getElementById('fullscreen').style.height = myScrollHeight + 'px';
	document.getElementById('fullscreen').style.display='block';
	theWindow.innerHTML = xmlHttp.responseText + theWindow.innerHTML;
	}
}

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;
}

function closeBar(str)
{
	document.getElementById(str).style.display='none';
	document.getElementById('fullscreen').style.display='none';
	document.getElementById(str).innerHTML = "<a href='javascript:void(0);' id='laporClose' onClick=closeBar('" + str + "')>Close</a>";
}
