var xmlHttp;
var xmlHttp2;
function getXmlHttpObject(){
	var objXMLHttp=null;
	if (window.XMLHttpRequest){
 		objXMLHttp=new XMLHttpRequest();
 	}
	else if (window.ActiveXObject){
 		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
 	}
 	return objXMLHttp;
}
//--------------Category List-----------------------------------------------------
function get_categories(){
	xmlHttp2=getXmlHttpObject();
	if(xmlHttp2==null){
		alert("You are using a too old browser. Please update the browser.");
		return;
	}
	else{
		var url="../scripts/pub_categories.php";
		xmlHttp2.onreadystatechange=set_categories;
		xmlHttp2.open("GET",url,true);
		xmlHttp2.send(null);
	}
}
function set_categories()
{
	if(xmlHttp2.readyState!=4){
		document.getElementById("category_list").innerHTML='Loading Publication Categories...';	
	}
	if(xmlHttp2.readyState==4){		
	document.getElementById("category_list").innerHTML=xmlHttp2.responseText;
	}
}
//--------------Publication List-----------------------------------------------------
function get_pub_list(pc_id){
	xmlHttp=getXmlHttpObject();
	if(xmlHttp==null){
		alert("You are using a too old browser. Please update the browser.");
		return;
	}
	else{
		var url="../scripts/pub_desc.php";
		url=url+"?pc_id="+pc_id;
		xmlHttp.onreadystatechange=set_pub_list;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
}
function set_pub_list()
{
	if(xmlHttp.readyState!=4){
		document.getElementById("publication_list").innerHTML='Loading list of publications...';	
	}
	if(xmlHttp.readyState==4){		
	document.getElementById("publication_list").innerHTML=xmlHttp.responseText;		
	}
}
function showMsg(){
	document.getElementById("pub_desc").innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="1" bgcolor="#CDCDCD"></td></tr><tr><td height="1"></td></tr><tr><td height="25" align="left" valign="middle" background="../about_us/images_about/h_back.jpg" style=" background-repeat:repeat-y"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="24" height="25" align="center" valign="middle"><img src="../resource_centre/images_resource/i_pub_icon.gif" width="12" height="13" /></td><td align="left" valign="middle" class="style1 style3">Knowledge Service Team</td></tr></table></td></tr><tr><td height="1"></td></tr><tr><td></td></tr><tr><td><table width="100%" border="0" cellspacing="10" cellpadding="0"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#FF6666"><table width="100%" border="0" cellspacing="1" cellpadding="0"><tr><td height="25" bgcolor="#FFFFCC">&nbsp;&nbsp;No publications available.</td></tr></table></td></tr></table></td></tr></table></td></tr></table>';	
}
