eval($import("static/js_p_sys/xml.js"));

function showSub(id){
    var obj=document.getElementById(id);
    obj.style.display = '';
    document.getElementById('link').style.display = "none";
    if(getIEVersion()=='7.0')
    {
        obj.style.height = 33 + 'px';
        obj.style.marginTop = -12;
    } 
    if(getIEVersion()=='6.0')
    {      
      obj.style.marginTop=-13+'px';
      obj.style.height = 37 + 'px';
      document.getElementById('lang').style.marginTop = 0;
    }
    if (getIEVersion() == '8.0') {
      obj.style.height = 34 + 'px';
      obj.style.marginTop = -13;
      document.getElementById('link').style.height = 13;
      if (document.documentMode == 8) // IE8 document mode
      {
          obj.style.marginTop = -12;
      }
     }
     if (getIEVersion() == undefined) {
         obj.style.height = 38+ 'px';
         obj.style.marginTop = -12+'px';
     }
}
function hideSub(id){
    var obj=document.getElementById(id);
    obj.style.display='none';
    document.getElementById('link').style.display="";
    if(getIEVersion()=='6.0')
    {
        document.getElementById('link').style.height = 18 + 'px';
        //document.getElementById('spea').style.width = 872 + 'px';
    }
    if(getIEVersion()=='7.0')
    {
       document.getElementById('link').style.height=14;
    }
     if(getIEVersion()=='8.0')
    {
        document.getElementById('link').style.height = 14;
        if (document.documentMode == 8) // IE8 document mode
        {
            document.getElementById('link').style.height = 13;
        }
    }
    if(getIEVersion()==undefined) {
        document.getElementById('link').style.height = 15 + 'px';
        
    }
}
function initSpec() {
    initMenuN();
    if(getIEVersion()=='6.0')
    {
       document.getElementById('link').style.height=18;
       document.getElementById('spea').style.width = 865+ 'px';
    }
    else if(getIEVersion()=='7.0')
    {
        document.getElementById('link').style.height = 14;
        
        document.getElementById('spea').style.width = 868;
    }
     else if(getIEVersion()=='8.0')
    {
        document.getElementById('link').style.height = 14;
        document.getElementById('link').style.marginTop = 5;
        document.getElementById('spea').style.width = 868;
        if (document.documentMode == 8) {
            document.getElementById('link').style.height = 13 ;
            document.getElementById('link').style.marginTop =7;
        }
       
   }
 else if (getIEVersion() == undefined) {

        document.getElementById('link').style.height = 15+'px';
        document.getElementById('spea').style.width = 868 + "px";
        document.getElementById('link').style.marginTop= 7+'px';
    }
}
function getIEVersion()
{ 
    if(navigator.appName == "Microsoft Internet Explorer") 
    { 
        var str=navigator.appVersion;
        str=str.split('MSIE ')[1].split(';');
        var ver=str[0]+""; 
        return ver;
    } 
} 

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{

    var arVersion = navigator.appVersion.split("MSIE") 
    var version = parseFloat(arVersion[1]) 
    if ((version >= 5.5) && (document.body.filters)) 
    { 
       for(var j=0; j<document.images.length; j++) 
       { 
          var img = document.images[j] 
          var imgName = img.src.toUpperCase() 

          if (imgName.substring(imgName.length-8, imgName.length)=='BT-1.PNG') 
          { 
             var imgID = (img.id) ? "id='" + img.id + "' " : "" 
             var imgClass = (img.className) ? "class='" + img.className + "' " : "" 
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " 
             var imgStyle = "display:inline-block;" + img.style.cssText 
             if (img.align == "left") imgStyle = "float:left;" + imgStyle 
             if (img.align == "right") imgStyle = "float:right;" + imgStyle 
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
             var strNewHTML = "<span " + imgID + imgClass + imgTitle 
             + " style=\"" + "width:" + img.width + "px; height:" + (img.height-6) + "px;" + imgStyle + ";" 
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" 
             + "(src=\'" + imgName.substring(0, imgName.length-3)+ 'png' + "\', sizingMethod='scale');\"></span>" 
             img.outerHTML = strNewHTML 
             alert(strNewHTML);
             j = j-1 
          } 
       } 
    }
}

//intitial the second level right banner content 
var initRightBanner = function() {
    var menuConfig = "RightBanner/banner_first_level.xml";
    var menuXslt = "RightBanner/rightBanner.xslt";
    var xlm = new xmlMaster()
    var result = "";
    if (document.implementation && document.implementation.createDocument) {
        try {
            xmlDoc = document.implementation.createDocument("", "", null);
            xmlDoc.async = false;
            xmlDoc.load(menuConfig);
        }
        catch (e) {
            var xmlhttp = new window.XMLHttpRequest();
            xmlhttp.open("GET", menuConfig, false);
            xmlhttp.send(null);
            xmlDoc = xmlhttp.responseXML.documentElement;
        }
        try {
            xslDoc = document.implementation.createDocument("", "", null);
            xslDoc.async = false;
            xslDoc.load(menuXslt);
        }
        catch (e) {
            var xmlhttp = new window.XMLHttpRequest();
            xmlhttp.open("GET", menuXslt, false);
            xmlhttp.send(null);
            xslDoc = xmlhttp.responseXML.documentElement;
        }
        try {

            var xsltProcessor = new XSLTProcessor();
            xsltProcessor.importStylesheet(xslDoc);
            result = xsltProcessor.transformToFragment(xmlDoc, document);
            $("container2").innerHTML = "";
            $("container2").appendChild(result);
        }
        catch (e) {
            alert("error:003");
        }
    }
    else if (typeof window.ActiveXObject != 'undefined') {

        var xlm = new xmlMaster()

        result = xlm.trans(menuConfig, menuXslt, true, true, false);
        if (result == null) {
            result = xlm.trans(menuConfig, menuXslt, true, true, false);
        }
        $("container2").innerHTML = result;
    }
    else {
        alert("Browser unknown!");
    }
}

var initMenuN = function() {
    var menuConfig = "Menu_cn.xml";
    var menuXslt = "Menu_cn.xslt";
    var result = "";
    if (document.implementation && document.implementation.createDocument) {
        try {
            xmlDoc = document.implementation.createDocument("", "", null);
            xmlDoc.async = false;
            xmlDoc.load(menuConfig);
        }
        catch (e) {
            var xmlhttp = new window.XMLHttpRequest();
            xmlhttp.open("GET", menuConfig, false);
            xmlhttp.send(null);
            xmlDoc = xmlhttp.responseXML.documentElement;
        }
        try {
            xslDoc = document.implementation.createDocument("", "", null);
            xslDoc.async = false;
            xslDoc.load(menuXslt);
        }
        catch (e) {
            var xmlhttp = new window.XMLHttpRequest();
            xmlhttp.open("GET", menuXslt, false);
            xmlhttp.send(null);
            xslDoc = xmlhttp.responseXML.documentElement;
        }
        try {

            var xsltProcessor = new XSLTProcessor();
            xsltProcessor.importStylesheet(xslDoc);
            result = xsltProcessor.transformToFragment(xmlDoc, document);
            $("MenuReplace").innerHTML = "";
            $("MenuReplace").appendChild(result);
        }
        catch (e) {
            alert("error:003");
        }
    }
    else if (typeof window.ActiveXObject != 'undefined') {

        var xlm = new xmlMaster()

        result = xlm.trans(menuConfig, menuXslt, true, true, false);
        if (result == null) {
            result = xlm.trans(menuConfig, menuXslt, true, true, false);
        }
        $("MenuReplace").innerHTML = result;
    }
    else {
        alert("Browser unknown!");
    }
}

if (window.ActiveXObject) {
    window.attachEvent('onload', correctPNG);
} //Firefox, Mozilla, Opera, etc. 
else if (document.implementation && document.implementation.createDocument) {
    window.addEventListener("load", correctPNG, false);
}
//window.attachEvent("onload", correctPNG); 