
var process_request = "正在处理您的请求...";


var Element = {
  next : function(elem) 
  {
    var n = elem;
    do 
    {
       n = n.nextSibling;
    } 
    while (n && n.nodeType != 1)
    return n;
  },
  prev : function(elem)
  {
    var n = elem;
    do
    {
       n = n.previousSibling;
    } 
    while (n && n.nodeType != 1)
    return n;
  },
  first: function(elem)
  {
    var n = elem.childNodes[0];
    if (n && n.nodeType != 1)
    {
      n = n.nextSibling;
    }

    return n;
  },
  last : function(elem)
  {
    //var n = elem.lastNode;
    var n = elem.childNodes[elem.childNodes.length-1];
    if (n.nodeType != 1)
    {
      n = n.previousSibling;
    }
    return n;
  },
  show : function(elem, arg) 
  {
    if (navigator.isIE())
    {
      if (arg=="table" || arg=="table-row" || arg=="table-cell") 
      {
        arg = "block";
      }
    }
    elem.style.display = (typeof(arg) == "undefined") ? "" : arg;
  },
  hide : function(elem) 
  {
    elem.style.display = "none";
  },
  remove : function(elem) 
  {
    elem.parentNode.removeChild(elem);
  },
  addClass : function(elem, className) 
  {
    if (!this.hasClass(elem, className))
    {
      var arr = elem.className.split(" ");
      arr.push(className);
      elem.className = arr.join(" ");
    }
  },
  removeClass :function(elem, className) 
  {
    if (this.hasClass(elem, className))
    {
      var arr = elem.className.split(" ");
      arr.remove(className);
      elem.className = arr.join(" ");
    }
  },
  hasClass : function(elem, className) 
  {
     var arr = elem.className.split(" ");
     return arr.inArray(className);
  },
  contains : function(elem, find)
  {
    do 
    {
      if (find == elem)
      {
        return true;
      }
    } 
    while(find = find.parentNode)
    return false;
  },
  getPosition : function(elem) 
  {
    var valueT = 0, valueL = 0;
    do 
    {
      valueT += elem.offsetTop  || 0;
      valueL += elem.offsetLeft || 0;
      elem = elem.offsetParent;
    } 
    while (elem);
    var pos = {top:valueT, left:valueL};
    return pos;
  },
  getStyle: function(element, style) 
  {
    element = $(element);
    style = style == 'float' ? 'cssFloat' : style;
    var value = '';
    try 
    {
      var value = element.style[style];
    }
    catch(ex) 
    {
      return value;
    }
    if (!value)
    {
      if(element.currentStyle) 
      {
        value = element.currentStyle[style];
      } 
      else 
      {
        var css = document.defaultView.getComputedStyle(element, null);
        value = css ? css[style] : null;
      }
    }
    if (style == 'opacity') 
    {
      return value ? parseFloat(value) : 1.0;
    }
    return value == 'auto' ? null : value;
  },
  center : function (element) 
  {
    element.style.position = 'absolute';
    var _x  =  document.body.scrollWidth;
    var _y  = window.innerHeight > 0 ? window.innerHeight : document.body.clientHeight;
    var _s_h=0;
    if (element.style.position != 'fixed')
    {
      _s_h=  document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
    }
    c_x    =  _x /2 - element.clientWidth/2;
    c_y    =  _y/2 + _s_h - element.clientHeight/2;
    element.style.left = c_x + 'px';
    element.style.top  = c_y + 'px';
  },
  setSelectable: function(elem, selectable)
  {
    if (navigator.isFirefox()) {
      if (selectable)
        elem.style.MozUserSelect = "";
      else
        elem.style.MozUserSelect = "none";
    }
    else {
      if (selectable)
        Event.stopObserving(elem, "selectstart", this._falseFunction);
      else
        Event.observe(elem, "selectstart", this._falseFunction);
    }
  },
  _falseFunction: function() {
    return false;
  }
};


var items = document.getElementById('nav_list').getElementsByTagName('li');

  for (i = 0; i < items.length; i++)
  {
    
	var item = items[i];
	
	//alert (Element.last(item).className);
	
    if (Element.last(item).className == 'nav_li')
    {
      //alert (1);
	  //alert(Element.last(item).tagName);
      //alert(Element.first(item).tagName);
      var d = Element.last(item);
      var a = Element.first(item);
      a.onmouseover = function(e)
      {
        Element.next(this).style.display = 'block';
      }
      a.onmouseout = function(e)
      {
        Element.next(this).style.display = 'none';
      }
      
	  d.onmouseover = function(e)
      {
        var l = this.parentNode;
        var a = Element.first(l);
        this.style.display = 'block';
        a.className = 'hover';
      }
      d.onmouseout = function(e)
      {
        var l = this.parentNode;
        var a = Element.first(l);
        this.style.display = 'none';
        a.className = '';
      }
	  
    }
  }