var xmlhttp = createXmlHttpRequestObject();

// retrieves the XMLHttpRequest object
function createXmlHttpRequestObject()
{
// will store the reference to the XMLHttpRequest object

var xmlhttp;
// if running Internet Explorer
if(window.ActiveXObject)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{

xmlhttp = false;
}
}
// if running Mozilla or other browsers
else
{
try
{
xmlhttp = new XMLHttpRequest();
}
catch (e)
{
xmlhttp = false;
}
}
// return the created object or display an error message
if (!xmlhttp)

alert("Error creating the XMLHttpRequest object.");
else

return xmlhttp;
}
function loadFragmentInToElement(fragment_url, element_id,cat_id) {
document.body.style.background="url(/templates/rhuk_milkyway/images/body-bg4.jpg) center top no-repeat";

var element = document.getElementById(element_id);
fragment_url = fragment_url+'&cat_id='+cat_id;

xmlhttp.open("GET", fragment_url);

xmlhttp.onreadystatechange = function() {

if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {

element.innerHTML = xmlhttp.responseText;

}else{

}

}

xmlhttp.send(null);

} 

