//====================== Browser checks
// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var Opera = window.opera ? true : false;
var IE = (document.all && document.getElementById && !Opera) ? true:false;
var IE6    = (IE && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );

function checkBrowser()
{
    if(IE6)
	{
	  startList();
	}	
}


function startList() {	
  var nav_menusub = getElementsByClassName("nav_menu_level_2");   
  for (i=0; i<nav_menusub.length; i++) {
    navRoot = nav_menusub[i];
    for (j=0; j<navRoot.childNodes.length; j++) {
      node = navRoot.childNodes[j];
      if (node.nodeName=="LI") {
        node.onmouseover=function() {
          this.className+=" over";
        }
        node.onmouseout=function() {
          this.className=this.className.replace(" over", "");
        }
      }
    }
  }

  if (document.getElementById("hpnav")) {
    navRoot = document.getElementById("hpnav");
	
    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI") {
        node.onmouseover=function() {
          this.className+=" over";
        }
        node.onmouseout=function() {
          this.className=this.className.replace(" over", "");
        }
      }
    }
  }
}

function hiliteLI(id) {
  //if(!is.ie6) return;
  //document.getElementById(id).style.backgroundImage="url(v_1_1.gif)";
}

function restoreLI(id) {
  //if(!is.ie6) return;
  //document.getElementById(id).style.backgroundImage="none";
}


/* general helper functions */

// returns array of elements with class classname
function getElementsByClassName(classname) {
  var a = [];
  var re = new RegExp('\\b' + classname + '\\b');
  var els = document.all?document.all:document.getElementsByTagName("*");
  for(var i=0,j=els.length; i<j; i++)
    if(re.test(els[i].className))a.push(els[i]);
  return a;
}

// add & remove css classes
function addClass(el,clName) {
  if (el) {
    if (el.className.indexOf(clName) < 0)
      el.className += " "+clName;
  }
}
function removeClass(el,clName) {
  if (el)
    el.className = el.className.replace(clName,"");
	}