// JavaScript Document

//Create a boolean variable to check for a valid IE instance.
var xmlhttp = false;
//Check if we are using IE.
try {
//If the javascript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using IE.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp = false;
}
}
//If we are using a non-IE browser, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
//----------------------------------------
function showArchive(objID,catID,AuthID,BodyID)
{
	 
	 var obj = document.getElementById(objID);
	 var catLink = ""	
	 var _connector = "" 
	 var AuthLink = ""
 	 var BodyLink = "" 

	 if(catID > 0)
	  	catLink = "?categorylist=" + catID
		
	 if(catLink == "")
	 	_connector = "?" 
	 else
	 	_connector = "&" 
		
	 if(AuthID != "")
	 {
		AuthID	= AuthID.replace("&","~!~") ;
		AuthLink = _connector+"authorlist=" + AuthID
	 }

	if(catLink == "" && AuthLink == "")
	 	_connector = "?" 
	 else
	 	_connector = "&" 
		
	 if(BodyID != "")
	 {
		BodyID	= BodyID.replace("&","~!~") ;
	  	BodyLink = _connector+"bodypartlist=" + BodyID 
	 }
		
	  xmlhttp.open('GET', "archive_ajax.php"+catLink+AuthLink+BodyLink);
	  
	  xmlhttp.onreadystatechange = function() {
	  if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		obj.innerHTML = xmlhttp.responseText;
	  }else
			obj.innerHTML = '<table cellspacing="0" cellpadding="2" bordercolor="#ffffff" border="1" align="center" width="100%"><tr><TD align="center" height="25">&nbsp;</TD></tr><tr><TD align="center"><img src="images/loading-indicator.gif" alt="" align=""></TD></tr></table>'
	  }
      xmlhttp.send(null);


}

