// JavaScript Document
xmlhttp = new Array();
function loadurl(dest,sendInfo,div,subscript,hideDivWhileLoading) { 

	if (hideDivWhileLoading == null){
		hideDivWhileLoading = true;
	}
	
	mydiv = div;
	
	
	if (hideDivWhileLoading){
		if (document.getElementById(mydiv)){
			document.getElementById(mydiv).style.display='none';
		}
	}
	
	if (document.getElementById(mydiv+'Loading')){
		document.getElementById(mydiv+'Loading').style.display='inline';
	}
	
		try { 
			// Moz supports XMLHttpRequest. IE uses ActiveX.  
			// browser detction is bad. object detection works for any browser  
			xmlhttp[subscript] = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch (e) { 
			alert("ERROR");
		} 
		
	// the xmlhttp object triggers an event everytime the status changes  
	// triggered() function handles the events  
	xmlhttp[subscript].onreadystatechange = function() { triggered(subscript , div, sendInfo); };
	xmlhttp[subscript].open("POST", dest+"?"+sendInfo); 
	xmlhttp[subscript].send(null); 
} 

function triggered(subscript, mydiv, sendInfo) { 
	if ((xmlhttp[subscript].readyState == 4) && (xmlhttp[subscript].status == 200)) { 

		if (document.getElementById(mydiv+'Loading')){
			document.getElementById(mydiv+'Loading').style.display='none';
		}

		if (document.getElementById(mydiv)){
			
			document.getElementById(mydiv).innerHTML = xmlhttp[subscript].responseText; 
			document.getElementById(mydiv).style.display='block';

			getStarsInfo(sendInfo);
			//Effect.BlindDown(mydiv);
			
			//This is for the star ratings on the main page.
			//if (mydiv=='main_content'){
			//alert(sendInfo.indexOf('featured'));
			//}
		} else {
			showStars(xmlhttp[subscript].responseText);
		 
		}
	} 
}

function doNothing(){
	var x = "blah"
}