// This function does the actual browser detection
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;
}
// Example:
// alert( readCookie("myCookie") );
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;
}


if(readCookie("zzy_adstatus") != "zzy_adtop")
{
document.write("<div id=\"hasIE_level1\" style=\"background:#EFF8FF; text-align: center; padding:1px 0 1px; border:0 solid #B2D1ED;border-width:1px 0; width:100%; z-index:100;margin-bottom:1px;position: absolute;left:0;\"><div id=\"iewarning\" style=\"float:left;margin:-1px -9px 0 5px;\"><img align=\"absmiddle\" src=\"guanggao/warning.gif\" border=\"0\" /></div><div id=\"closeimg\" style=\"width:19px; float:right;padding-right:5px;\"><a href=\"javascript:closediv('hasIE_level1');\" title=\"关闭提示\"><img src=\"guanggao/close.gif\" align=\"absmiddle\" border=\"0\" /></a></div><div style=\" margin-top:2px;font-size:12px;color:#000000\">[站长提示]　<a href=\"http://my918.net/\" title=\"购买格子请点这里！\" target=\"_blank\"><font color=\"#ff0000\"> 一个格子每年只要1元：>>   我们正在谱写互联网的历史，拥有属于你自己的一格！一旦购买网站流量快速飙升！！！让你的网站被更多人快速看到>></font></a></div></div><div style=\"clear:both;height:23px;\"></div>");
}
function closediv(id) {
    writeCookie("zzy_adstatus","zzy_adtop",2);
    document.getElementById(id).style.display = 'none';
}

var g_myBodyInstance = document.body;
var g_myBodyInstanceString = "document.body";
if(document.compatMode != "BackCompat"){
    // for looser.dtd
    g_myBodyInstance = document.documentElement;
    g_myBodyInstanceString = "document.documentElement";
}
var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
                parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinNS5 = (navigator.appName.indexOf("Netscape") >= 0 &&
                parseFloat(navigator.appVersion) >= 5) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;
var isMacIE = (isMinIE4 && navigator.userAgent.indexOf("Mac") >= 0) ? 1 : 0;

var getFFVersion=navigator.userAgent.substring(
                    navigator.userAgent.indexOf("Firefox")).split("/")[1];
//extra height in px to add to iframe in FireFox 1.0+ browsers
var FFextraHeight=getFFVersion<1.5? 16 : 0;


function getLayer(name) {
  if (isMinNS5)
    return document.getElementById(name);
  else if (isMinIE4)
    return eval('document.all.' + name);
  else if (isMinNS4)
    return findLayer(name, document);

  return null;
}

function findLayer(name, doc) {

  var i, layer;

  for (i = 0; i < doc.layers.length; i++) {
    layer = doc.layers[i];
    if (layer.name == name)
      return layer;
    if (layer.document.layers.length > 0) {
      layer = findLayer(name, layer.document);
      if (layer != null)
        return layer;
    }
  }

  return null;
}

function moveLayerTo(layer, x, y) {
  if (isMinIE4) {
    layer.style.left = x;
    layer.style.top  = y;
  }
  else if (isMinNS5) {
    layer.style.left = x+'px';
    layer.style.top  = y+'px';
  }
  else if (isMinNS4)
    layer.moveTo(x, y);
}

function getPageLeft(layer) {

  if (isMinIE4||isMinNS5)
    return(layer.offsetLeft);
  else if (isMinNS4)
    return(layer.pageX);
  return(-1);
}

function getPageTop(layer) {


  if (isMinIE4||isMinNS5)
    return(layer.offsetTop);
  else if (isMinNS4)
    return(layer.pageY);
  return(-1);
}

function getPageScrollX() {

  if (isMinIE4||isMinNS5)
    return(g_myBodyInstance.scrollLeft);
  else if (isMinNS4)
    return(window.pageXOffset);
  return(-1);
}

function getPageScrollY() {

  if (isMinIE4||isMinNS5)
    return(g_myBodyInstance.scrollTop);
  else if (isMinNS4)
    return(window.pageYOffset);
  return(-1);
}

function getHeight(layer) {

  if (isMinIE4||isMinNS5) {
    if (false && layer.style.pixelHeight)
      return(layer.style.pixelHeight);
    else
      return(layer.clientHeight);
  }
  else if (isMinNS4) {
    if (layer.document.height)
      return(layer.document.height);
    else
      return(layer.clip.bottom - layer.clip.top);
  }
  return(-1);
}

function getWindowHeight() {

  if (isMinIE4||isMinNS5)
    return(g_myBodyInstance.clientHeight);
  else if (isMinNS4)
    return(window.innerHeight);
  return(-1);
}

var g_p_zealNavigatorBar = null;
g_p_zealNavigatorBar = getLayer('hasIE_level1');
g_p_zealNavigatorBar1 = getLayer('hasIE_level2');
if(!isMinIE4){g_p_zealNavigatorBar.style.position = 'fixed';g_p_zealNavigatorBar1.style.position = 'fixed';}
function reposzealNavigatorBar(){
    if(isMinIE4){
        try{
            moveLayerTo(g_p_zealNavigatorBar,
                        getPageLeft(g_p_zealNavigatorBar),
                        getPageScrollY());
        }catch(e){}
    }
}
window.onresize = reposzealNavigatorBar;
window.onscroll = reposzealNavigatorBar;
window.onload = reposzealNavigatorBar;