var xmlHttp;
var elementId;
var menuId = "menu0";
function GetXmlHttpObject(handler){
    var objXmlHttp = null;
    try{
        objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP")
    }catch(e){
        try{
            objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
        } 
        catch(oc){
            objXmlHttp = null
        }
    }
    if(!objXmlHttp && typeof XMLHttpRequest != "undefined"){
        objXmlHttp = new XMLHttpRequest()
    }

    try {
      objXmlHttp.onload = handler;
      objXmlHttp.onerror = handler;
    } catch (e) { }
    
    try {
        objXmlHttp.onreadystatechange = handler;
    } catch (e) { }
    return objXmlHttp
}

function SendXmlHttpRequest(xmlhttp, url) { 
  xmlhttp.open('GET', url, true); 
  xmlhttp.send(null); 
}

function ExecuteCall(url, callbackMethod)
{ 
  try 
  { 
    xmlHttp = GetXmlHttpObject(callbackMethod); 
    SendXmlHttpRequest(xmlHttp, url); 
  }
  catch(e){} 
} 

function onXmlComplete() 
{ 
  try
  {
    //readyState of 4 or 'complete' represents 
    //that data has been returned 
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
    {
      var data = xmlHttp.responseText; 
      if (data.length > 0)
      {
		document.getElementById(elementId).innerHTML = data; 
		document.getElementById(menuId).className="active";
      } 
    }
  }
  catch(e){}
} 

function loadXml(_str,_id, _menuid)
{ 
  try 
  { 
  	elementId=_id;
    if(menuId != null) {
		document.getElementById(menuId).className="";
  	}
  	menuId = _menuid;
    ExecuteCall(_str, onXmlComplete);
  }
  catch(e){} 
} 
//loadXml('channel.xml','content-in')