
// find browser for display property - ie doesn't like display=table
var ie = (navigator.appName=='Microsoft Internet Explorer') ? true : false;

var xmlReq;


function showTop5(td_id,script) 
{
	xmlReq = getXMLHTTP();
	if(!xmlReq)
		return;
	var t = document.getElementById(td_id);

	
	if(td_id == "crd6_td1") {
		t.style.backgroundImage="url(images/nav_slice.gif)";
		t.style.backgroundRepeat="repeat-x";
		document.getElementById("crd6_nav1").style.color = "black";
		document.getElementById("crd6_nav2").style.color = "#EFF0F2";
		document.getElementById("crd6_td1a").style.backgroundImage = "url(images/nav_right1.gif)";
		document.getElementById("crd6_td1a").style.backgroundRepeat = "no-repeat";
		//document.getElementById("crd6_td1a").style.width = "5px";
		document.getElementById("crd6_td2").style.backgroundImage = "url(images/nav_bg.gif)";
		document.getElementById("crd6_td2").style.backgroundRepeat = "repeat-x";
				
	} else {
		
		t.style.backgroundImage="url(images/nav_slice.gif)";
		t.style.backgroundRepeat="repeat-x";
		document.getElementById("crd6_nav2").style.color = "black";
		document.getElementById("crd6_nav1").style.color = "#EFF0F2";
		//("crd6_nav1").hover.style.color = "#FFDE7C";
		document.getElementById("crd6_td1a").style.backgroundImage = "url(images/nav_slice.gif)";
		document.getElementById("crd6_td1a").style.backgroundRepeat = "repeat-x";
		document.getElementById("crd6_td1a").style.width = "18px";
		document.getElementById("crd6_td1").style.backgroundImage = "url(images/nav_bg.gif)";
		document.getElementById("crd6_td1").style.backgroundRepeat = "repeat-x";
	}
    
	document.getElementById("crd6_content1").innerHTML="";
		
	
	var url = "includes/top5"+script+".php";
	
	xmlReq.open("GET", url, true);
	xmlReq.send(null);
	xmlReq.onreadystatechange = function(){
		if(xmlReq.readyState == 4){
			document.getElementById("crd6_content1").innerHTML = xmlReq.responseText;
		}
	}
}		
		


function getXMLHTTP() 
{
	xmlReq = false;
	
	try
	 {
		 // Firefox, Opera 8.0+, Safari
		 xmlReq=new XMLHttpRequest();
	 }
	catch (e)
	 {
		 // Internet Explorer
		 try
		  {
		  	xmlReq=new ActiveXObject("Msxml2.XMLHTTP");
		  }
		 catch (e)
		  {
			  xmlReq=new ActiveXObject("Microsoft.XMLHTTP");
		  }
 	}
	return xmlReq;
	
}


function insertTop5(title)
{
	xmlReq = getXMLHTTP();
	if(!xmlReq)
		return;
	
	//var title = document.title;
	var path = location.pathname;
	var url = "../../../includes/insertTop5read.php?title="+title+"&id="+path;
	
	xmlReq.open("GET", url, true);
	xmlReq.send(null);
	
}

	
