// RivarWeb.js
//////////////////////////
var activeMenu = "";

function screengen()
{
	if (navigator.appName == 'Microsoft Internet Explorer' && (navigator.platform.substring(0,3) == 'Win')) {
		var scw=screen.Width-10;
		var sch=screen.Height-52;
		woo=window.open ("neopres.htm", "21cstart", "left=0,top=0,resizable=yes,width=" + scw + ",height=" + sch);
	}
	else if (navigator.appName == 'Netscape' || navigator.platform == 'MacPPC') {
		woo=window.open ("neopres.htm", "21cstart", "screenX=0,screenY=0,resizable=yes,outerWidth=" + screen.width + ",outerHeight=" + screen.height);
	}
	else {
		document.write("<HTML><BODY><CENTER><H1>Get Netscape or ie 4.0</H1></CENTER></BODY></HTML>");
	}
}

function preloadImages()
{
	/*document.roll1.src='images/anatomy_home1x2_alt.jpg';
	document.roll2.src='images/anatomy_home3x2_alt.jpg';
	document.roll3.src='images/anatomy_home4x2_alt.jpg';
	document.roll4.src='images/anatomy_home4x5_alt.jpg';
	document.roll5.src='images/anatomy_home5x2.gif';
	document.roll6.src='images/anatomy_home7x1.gif';*/
}

function openthispage(url,winname,w,h) 
{ 
	window.open(url,winname,"width=" + w + ",height=" + h);
}

function openWnd(url)
{
        var daWnd;
        if (url.indexOf('NeoPress.CnBin') != -1){
                daWnd = window.open(url,"devTools","width=660,height=500,resizable=no,dependent=yes");
        } else {
                daWnd = window.open(url,"devTools","width=600,height=400,scrollbars=yes,resizable=no,dependent=yes");
        }
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function positionMenus()
{
	if(navigator.appName == "Microsoft Internet Explorer")
   {
		document.getElementById("cnMenu").style.top = 105;
		document.getElementById("cnMenu").style.left = 1;
		
		document.getElementById("prodMenu").style.top = 105;
		document.getElementById("prodMenu").style.left = 103;
		
		document.getElementById("rivarMenu").style.top = 105;
		document.getElementById("rivarMenu").style.left = 208;
	}
	else
	{
		document.getElementById("cnMenu").style.top = 105;
		document.getElementById("cnMenu").style.left = 1;
		
		document.getElementById("prodMenu").style.top = 105;
		document.getElementById("prodMenu").style.left = 103;
		
		document.getElementById("rivarMenu").style.top = 105;
		document.getElementById("rivarMenu").style.left = 208;
	}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function buttonMouseOut( button, menuName )
{
	document.getElementById( menuName ).style.visibility="hidden";
}


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function swapImages( imgId, imgSrc  )
{
	document.getElementById( imgId ).src=imgSrc;
}

function menuOver(MenuID){
  // If DOM1 supported and element exists ...
  if((document.getElementById)&&(document.getElementById(MenuID)!=null)){
    // If this menu is already open ...
    if(LiveMenu==document.getElementById(MenuID)){
      // Do not close it
      clearTimeout(Timeout_ID);
    }
    // Another might still be open ...
    else{
      // If another menu is open ...
      if(LiveMenu!=null){
        // Do not wait, shut it now
        clearTimeout(Timeout_ID);
        hideNow();
      }
    }
    // This is the new 'live' menu, make it visible
    LiveMenu = document.getElementById(MenuID);
    // LiveMenu.style.visibility is
    // initially empty in IE5 until
    // it is assigned by these
    // functions, so must check that
    // it's not null before proceeding...
    if((LiveMenu.style)&&(LiveMenu.style.visibility!=null)){
      LiveMenu.style.visibility = 'visible';
    }
  }
}

function stayOpen(MenuID){
  // If menuOver has not been called or the menu is hidden, do nothing
  if((LiveMenu==null)||((LiveMenu.style)&&(LiveMenu.style.visibility)&&(LiveMenu.style.visibility=='hidden')))return;
  else menuOver(MenuID);
}

function menuOut(MenuID){
  // If DOM1 supported and a menu is open ...
  if((document.getElementById)&&(document.getElementById(MenuID)!=null)){
    // Get the current live menu
    LiveMenu = document.getElementById(MenuID);
    // Prepare to shut it in 250 milliseconds
    Timeout_ID = window.setTimeout('hideNow();',250);
  }
}

function hideNow(){
  if((LiveMenu.style)&&(LiveMenu.style.visibility)){
    LiveMenu.style.visibility = 'hidden';
  }
}

function changeLocation(page, args)
{	
	self.location=page + "?" + args;
}
