
// JavaScript Document
function correctPNG()
{ 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-3, imgName.length) == "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 + "px;" + imgStyle + ";" 
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" 
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
             img.outerHTML = strNewHTML 
             j = j-1 
           } 
       } 
     }     
} 
function nTabs(thisObj,Num){
if(thisObj.className == "active")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
var i;
for(i=0; i < tabList.length; i++)
{
  if (i == Num)
  {
   thisObj.className = "active"; 
      document.getElementById(tabObj+"_Content"+i).style.display = "block";
  }else{
   tabList[i].className = "normal"; 
   document.getElementById(tabObj+"_Content"+i).style.display = "none";
  }
} 
}
window.attachEvent("onload", correctPNG); 


function Show(id,i_id){
        var on_img="images/opened_r2_c2.gif";//打开时图片
        var off_img="images/closed_r2_c2.gif";//隐藏时图片
        var obj=document.getElementById('c_'+id);
        if(obj.style.display=="none"){
                obj.style.display="";
        i_id.src=on_img;
        //将子菜单Id放入Cookies
        var curShow = readCookie('curShow');
        if(curShow!='')
        {
          var arr_curShow = curShow.split(',');
          var found = false;
          for(i=0;i<arr_curShow.length-1;i++)
          {
            if(arr_curShow[i].toString()==id) {found=true;}
          }
          if(!found){writeCookie('curShow',curShow+','+id,12)}
        }
        else {
          writeCookie('curShow',id,12)
        }
        //将子菜单Id放入Cookies End
        }else{
                obj.style.display="none";
        i_id.src=off_img;
        //将子菜单Id从Cookies中移除
        var curShow = readCookie('curShow');
        if(curShow!='')
        {
          var arr_curShow = curShow.split(',');
          for(i=0;i<arr_curShow.length;i++)
          {
            if(arr_curShow[i].toString()==id) {arr_curShow=arr_curShow.del(i--);}
          }
          curShow = arr_curShow.join(',');
          //alert(curShow);
          writeCookie('curShow',curShow,12)
        }
        //将子菜单Id从Cookies中移除 End
        }

}

function readCookie(name)

{

  var cookieValue = "";

  var search = name + "=";

  if(document.cookie.length > 0)

  { 

    offset = document.cookie.indexOf(search);

    if (offset != -1)

    { 

      offset += search.length;

      end = document.cookie.indexOf(";", offset);

      if (end == -1) end = document.cookie.length;

      cookieValue = unescape(document.cookie.substring(offset, end))

    }

  }

  return cookieValue;

}

function writeCookie(name, value, hours)

{

  var expire = "";

  if(hours != null)

  {

    expire = new Date((new Date()).getTime() + hours * 3600000);

    expire = "; expires=" + expire.toGMTString();

  }

  document.cookie = name + "=" + escape(value) + expire;

}
Array.prototype.del=function(n) {  //n表示第几项，从0开始算起。
//prototype为对象原型，注意这里为对象增加自定义方法的方法。
  if(n<0)  //如果n<0，则不进行任何操作。
    return this;
  else
    return this.slice(0,n).concat(this.slice(n+1,this.length));
}


window.onload = function a()
{
  var curShow = readCookie('curShow');
  var totalShow = 5;  //自己修改一共有多少个二级分类
  if(curShow!=''&&curShow!=null)
  {
    for(i=1;i<=totalShow;i++)
    {
      document.getElementById('c_'+i).display="none";
    }
    var arr_curShow;
    arr_curShow = curShow.split(',');
    for(i=0;i<=arr_curShow.length-1;i++)
    {
      if(arr_curShow[i]!=''){document.getElementById('c_'+arr_curShow[i]).style.display="";}
    }

  }
}
function fillfoot(){
	var df = document.getElementById("copyright");
	if(df != null){
		df.innerHTML='\u5730\u5740\uff1a\u676d\u5dde\u5e02\u62f1\u5885\u533a\u7965\u7b26\u9547\u4e09\u58a9\u8def66\u5f0418\u53f7 \u90ae\u7f16\uff1a310011 \u7535\u8bdd\uff1a86-571-88038591 \u4f20\u771f\uff1a86-571-88351573 <span class=\"text05\"><a  href=\"msnim:chat?contact=Hz3b@163.com\"><img height=\"17\" title=\"msn:Hz3b@163.com\" src=\"images/msn.GIF\" width=\"78\" align=\"absmiddle\" border=\"0\" /></a></span> <span class=\"text05\"><a href=\"msnim:chat?contact=hz3b-apple@hotmail.com\"><img height=\"17\" title=\"msn:hz3b-apple@hotmail.com\" src=\"images/msn.GIF\" width=\"78\" align=\"absmiddle\" border=\"0\" /></a></span><br/>\u676d\u5dde\u661f\u8fb0\u4e09\u6bd4\u9f7f\u79d1\u5668\u6750\u6709\u9650\u516c\u53f8\u7248\u6743\u6240\u6709  \u6d59ICP\u590709052885\u53f7 <a href=\"admin/login.aspx\">\u7f51\u7ad9\u7ba1\u7406</a>';
	}
}
