
function createHttpRequest(){
    if(window.ActiveXObject){
        try{
            return new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e){
            try{
                return new ActiveXObject("Microsoft.XMLHTTP");
            }catch(e2){
                return null;
            }
        }       
    }else if(window.XMLHttpRequest){
        /*
        try{ 
            netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
        } catch (e){ 
            alert('Permission UniversalBrowserRead denied.');
        } 
        */               
        return new XMLHttpRequest();    
    }else{
        return null;    
    }    
}

var stylesheet = null;
var xslProc = null;

function getLinkMenu(inMenu1, inMenu2, inMenu3){ 

	var xmlhttp = false;
    xmlhttp = createHttpRequest();

    if(!xmlhttp) return "Your browser is not supported";        
    
	var xmlurl = "/Common/Xml/Menu.xml";
	var xslurl = "/Common/Xsl/LinkMenu.xsl";
    
    // load XML
    xmlhttp.open("GET", xmlurl, false);
    xmlhttp.send(null);

    var xmlDoc = xmlhttp.responseXML;
	
	var navLnk="/"
	var count1 = 0;
	var count2 = 0;
	var count3 = 0;

	if(xmlDoc.parseError != 0)
	{
		// error
	}
	else
	{
		if(inMenu1!=''){

			node1 = xmlDoc.documentElement.selectSingleNode("//menu1[@id='"+ inMenu1 +"']") ;

			if( node1 != null ){
				navLnk = node1.getAttribute("link")	
				count1 = node1.childNodes.length ;
			}

			if(inMenu2!='' && count1 > 0){
				
				node2 = node1.selectSingleNode("menu2[@id='"+ inMenu2 +"']") ;

				if( node2 != null ){
					navLnk = node2.getAttribute("link")
					count2 = node2.childNodes.length ;
				}

				if(inMenu3!='' && count2 > 0){
				
					node3 = node2.selectSingleNode("menu3[@id='"+ inMenu3 +"']") ;

					if( node3 != null ){
						navLnk = node3.getAttribute("link")
						count3 = node3.childNodes.length ;
					}

				}
			
			}
		
		}

	}
	
	location.href=navLnk;	

 }