function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function showit(which){
	clear_delayhide();
	thecontent=(which==-1)? "" : submenu[which];
	if (document.getElementById||document.all)
	menuobj.innerHTML=thecontent;
	else if (document.layers){
	menuobj.document.write(thecontent);
	menuobj.document.close();
	}
}

function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide);
}

function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide);
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function getRef(obj){
      if(typeof obj == "string")
         obj= document.getElementById(obj);
      return obj;
}

function setClassName(obj, className){
    getRef(obj).className= className;
}

function CStyle(id,nstyle) { 
	obj.classname = nstyle;
}

function menu1inout(obj,classname) {
	 if (obj.id != menuselected) {
	 setClassName(obj.id,classname);
	 }
}

function menu1select(obj) {
	 setClassName(menuselected,'topmenu');
	 setClassName(obj.id,'topmenuselect');
	 menuselected=obj.id;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
