
function TopCategoryMenu(IDname,Sw)
{

   // var Obj=document.getElementById(IDname);
   var Arr = $(IDname);
   //alert(Arr.childNodes.length);
   //alert($(IDname).children());
//var childLength = $(Arr[0]).children().length;
//alert("Length :::"+ childLength );
//    
//   alert(IDname);
    if (Arr != null)
    {
        if (Sw)
        {    
      
       if(Arr.childNodes.length > 0)              
		        Arr.style.display="block";
//                 
//	        if(Obj.childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes.length > 0)              
//		        Obj.style.display="block";
        }
        else
        { 
            Arr.style.display="none";
        }
    }
}
      
function BackgroundColor(Obj,BG)
{ 
    Obj.style.backgroundColor=BG;
}
//http://xmlfile.modetour.com/XMLInclude/Menu/Modetour/topMenu/MenuList_Theme_PUS.xml
//http://xmlfile.modetour.com/XMLInclude/Menu/Modetour/topMenu/MenuList_Theme_TAE.xml
//http://xmlfile.modetour.com/XMLInclude/Menu/Modetour/topMenu/MenuList_Theme_KWJ.xml
//http://xmlfile.modetour.com/XMLInclude/Menu/Modetour/topMenu/MenuList_Theme_CJJ.xml

function LocalCategoryMenu(IDname,Sw,startLocation,theid)
{
    var Obj=document.getElementById(IDname);
    
    if (Obj != null)
    {
        if (Sw)
        {    
            if (Obj.innerHTML == "")
            {                     
                if (request == null) createRequest();
                var XmlPara="startLocation=" + startLocation + "&theid=" + theid;
                                
                request.open("post","/XML/Menu/LocalCategory.aspx",false); 
                request.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
               
                if (isIE()) {
                    request.onreadystatechange = function() {LocalResult(IDname)};
                    request.send(XmlPara);
                }
                else {
                    request.send(XmlPara);
                    LocalResult(IDname);
                }  
            }     
            
            if(Obj.childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes.length > 0)                  
                Obj.style.display="block";            
        }
        else
        { 
            Obj.style.display="none";
        }
    }
}

var LocalObj = null;
function LocalResult(IDname)
{
    if (request.readyState == 4 && request.status == 200)
    {
        var g_oDocument = DomLoadXml(request.responseText);
        
        var ErrNode=Get_selectNodes("ModeTour/ErrorReason");
        if (ErrNode != null)
        {
            alert(Get_NodeValue(ErrNode));            
            return;
        }
        //alert(STL);
        if (LocalObj == null) LocalObj = DomLoad("/XSL/Menu/LocalCategory_T7.xsl");                    
        document.getElementById(IDname).innerHTML = Transformer(g_oDocument, LocalObj); 
        //alert(document.getElementById(IDname).innerHTML);
    }
}

