//============================================================================
//以下新增代码,自动生成子菜单项
//请勿随意修改

var xmldoc=null;// xml文档对象变量
putxmlsrc("/include/menu.xml");

function putxmlsrc(str){//载入菜单数据文件
  xmldoc= new ActiveXObject("Microsoft.XMLDOM");//创建xml文档对象
  xmldoc.async=false;
  xmldoc.load(str);//载入菜单数据
}

function genSubmenu(parentChannel)
{
  var subMenuItem = xmldoc.selectSingleNode("//node()[@value='"+parentChannel+"']");
   var childItem = subMenuItem.selectNodes("./SubMenu")

   if (childItem.length>0){
	   //document.write("<ul>");
      for(var i=0;i<childItem.length;i++){
	   if(childItem[i].getAttribute("url").indexOf("http://")!=-1)
          {
		    document.write("<li><a target='_blank' href='"+childItem[i].getAttribute("url")+"' title='"+childItem[i].getAttribute("name")+"'>"+childItem[i].getAttribute("name")+"</a></li>");
          }
          else
          {
		    document.write("<li><a target='_parent' href='"+childItem[i].getAttribute("url")+"' title='"+childItem[i].getAttribute("name")+"'>"+childItem[i].getAttribute("name")+"</a></li>");
          }
          /*
          if(parentChannel=="channel898" && i==10)
          {
            document.write("<li><a target='_parent' href='"+subMenuItem.getAttribute("url")+"' title='"+childItem[i].getAttribute("name")+"'>更多</a></li>");
            break;
          } 
          */
         }
	   //document.write("</ul>");
   }

}



