

/**********************************************/
/* Locations drop down menu                   */
/**********************************************/
stdBrowser=(document.getElementById)?true:false
function toggleMenu(currElem,nextPos) {
    menuObj=(stdBrowser)?document.getElementById(currElem).style : eval("document." + currElem)
    if (toggleMenu.arguments.length == 1) {
        nextPos = (parseInt(menuObj.visiblity)=='visible')?'hidden' : 'visible' 
    }
    menuObj.visibility = nextPos;
    menus = document.getElementsByTagName( 'span' );
    for (i=0;i<menus.length;i++) {
        menu = menus[i];
        if ((menu.id.indexOf('s_')==0) && (menu.id!=currElem)) {
            menu.style.visibility = 'hidden';
        }
    }
}
/**********************************************/
/* Keyhandler for search box                  */
/**********************************************/
function keyhandler(e) {
    if (e==13 || window.event.keyCode==13) {document.formSearch.submit()}
} 
/**********************************************/
/* subsection selection drop down             */
/**********************************************/
/*startList = function() {
  if (document.all&&document.getElementById) {
    navRoot = document.getElementById("subsectionfilter");
    if navRoot {
      for (i=0; i<navRoot.childNodes.length; i++) {
        node = navRoot.childNodes[i];
        if (node.nodeName=="li") {
          alert('ok');
          node.onmouseover=function() {this.className+=" over"; }
          node.onmouseout=function()  {this.className=this.className.replace(" over", "");}
        } 
      }
    }
  }
}
window.onload=startList;*/

/**********************************************/
/* code to hide email addresses from spiders  */
/**********************************************/
function print_mail_to_link(lhs,rhs)
{
   document.write('<a href="mailto');
   document.write(':' + lhs + '@');
   document.write(rhs + '"><font size=-2>' + lhs + '@' + rhs + '<\/font><\/a>');
}

/****************************************************/
/* Cookie handling                                  */
/****************************************************/
function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function loginline() {
    var cookie = readCookie( 'logincookie3' )
    if (cookie>'') {
        if (cookie.substring(0,1)=='"') 
            cookie = cookie.substring(1,cookie.length-1);
        document.write( 'You are logged in as <' + 'strong>' + cookie + '<' + '\/strong> [<a href="/myworld66/login?dologout=1">log out<' + '\/a>]'  );
    } else {
        document.write( 'You are not logged in | <' + 'a href="\/myworld66\/login">login<' + '\/a> | <' + 'a href="\/myworld66\/register">register<' + '\/a>' );
    }
    document.write( '<a href="#" title="cookie4: ' + readCookie( 'logincookie4' )+ ' 5:' + readCookie( 'logincookie5' )+ ' 6:' + readCookie( 'logincookie6' ) + '">.</a>' );
}


