function loadElements(url,elem,callback)
{
	var xmlhttp;
    var isIE;
    if(navigator.appName == "Microsoft Internet Explorer")
    {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    	isIE = true;
    }
    else
    {
        xmlhttp = new XMLHttpRequest();   
    	isIE = false;
    }

    xmlhttp.open("GET",url,true);
        xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState==4) {
       
            if( xmlhttp.status == 200)
            {	
            	//alert(xmlhttp.responseText);   
                processResponse(xmlhttp.responseXML,elem,isIE);
                if(callback)
    			{
    				callback();
    			}
            }
            else
            {
                //code for server err codes
                processServerErr( xmlhttp.status);
            }
        }
    }
    xmlhttp.send(null)
}

function ajaxRequest(url,callback)
{
	var xmlhttp;
    var isIE;
    if(navigator.appName == "Microsoft Internet Explorer")
    {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    	isIE = true;
    }
    else
    {
        xmlhttp = new XMLHttpRequest();   
    	isIE = false;
    }
    
    xmlhttp.open("GET",url,true);
        xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState==4) {
       
            if(xmlhttp.status == 200)
            {	
            	//alert(xmlhttp.responseText);   
                callback(xmlhttp.responseXML,isIE)
            }
            else
            {
                //code for server err codes
                //callback( xmlhttp.status);
            }
        }
    }
    xmlhttp.send(null)
}

function processResponse(xmldoc,elem,isIE)
{
 		var root = xmldoc.documentElement;
 		var data;
 		if(isIE)
 		{
 			data = root.childNodes[0].data
 		}
 		else
 		{
 			data = root.childNodes[1].data
 		}
 		
    	var targetElem = document.getElementById(elem);
    	targetElem.innerHTML = data;
    	
    	
}

function showById(id)
{
	document.getElementById(id).style.display = 'block';
}

function hideById(id)
{
	document.getElementById(id).style.display = 'none';
}

function rateObject(value,otype,oid)
{
	document.location = 'objects.php?action=rate&oid=' + oid + '&otype=' + otype + '&rate=' + value;
}

function showHideById(id)
{
	var elem = document.getElementById(id);
	if(elem.style.display == 'none')
	{
		elem.style.display = 'block';
	}
	else
	{
		elem.style.display = 'none';
	}
}

function gotoURL(url)
{
	document.location = url;
}

