isNN = document.layers ? 1 : 0; 
        
function noContext(){return false;}

function noContextKey(e)
	{
	if(isNN){
	    if (e.keyCode == 96){ return (false);}
		} else {
	    if (event.keyCode == 96){ return (false);}
		}
	}

function noClick(e)
	{
	if(isNN)
		{
	    if(e.which > 1) {return false;}
		} else { 
	    //if(e.button > 1){return false;}
		}
	}

if(isNN)
	{ 
	 document.captureEvents(Event.MOUSEDOWN);
	}

function winstat(sMsg)
	{
    window.status = sMsg;
    return true;
	}

function IsANumber(entry)
	{
	validChar = '0123456789';				// characters allowed in hex
	strlen = entry.length;					// how long is test string
	if (strlen < 1) { return false;}		// no check!
	entry = entry.toUpperCase();			// in case of lowercase characters

	for (i=0; i < strlen; i++ )
		{
	    if (validChar.indexOf(entry.charAt(i)) < 0)
			{
			return false;
			}
	    } // end scanning loop
	    
	return true;
	}
	
function TestShockwave()
	{
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax = 500;

    var xOffset = (xMax - 320)/2, yOffset = (yMax - 500)/2;
	window.open("shockwavetest/default.asp",'testsw','nostatus,nomenubar,resizable=no,width=340,height=600,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
	}
	
function ShowPerformance(memberID)
	{
	var h
	h = screen.height - 175;
	window.open('http://www.ToadGames.com/userrating.asp?ID='+memberID,'Performance','nostatus,nomenubar,scrollbars=yes,resizable=yes,height='+h+',width=420,top=45,left=25');
	}
	
function ShowForum()
	{
	//alert("The Forum Is Off-Line For Maintenance And Will Be Back Shortly.");
	window.open("forum/","TG_Forum","scrollbars=yes,resizable=yes,top=30,left=5");
	return true;
	}

function ValidateEmail( emailStr)
	{
	var myRegExp = new RegExp("^[A-Za-z0-9_\.-]+@[A-Za-z0-9_\.-]+[\.][A-Za-z]+$");
	return myRegExp.test(emailStr);
	}
	
function ShowGameHighScores(gameid)
	{
	var h
	//h = screen.height - 300;
	//window.open('highscores/showscores.asp?gameid='+gameid,'High_Scores','scrollbars=yes,resizable=yes,top=35,left=20,height='+h+',width=420');
	window.open('highscores/showscores.asp?gameid='+gameid,'High_Scores','scrollbars=yes,resizable=yes,top=45,left=35,height=600,width=420');
	}

function ShowGameInfo( gameID)
	{
	var infoFrame = document.getElementById('GameInfo');
	
	infoFrame.contentWindow.location = "_game_info.asp?g=" + gameID + "&showit=1";
	}
	
var delayb4scroll = 4000;
var marqueespeed = 1;
var pauseit = 1;
var thedirection = 1;

var copyspeed = marqueespeed;
var pausespeed =(pauseit==0)? copyspeed: 0;
var actualheight='';

function scrollmarquee( )
	{
	if (thedirection == 1)
		{
		if (parseInt(cross_marquee.style.top) > (actualheight * (-1) + 8 ))
			cross_marquee.style.top = parseInt(cross_marquee.style.top) - copyspeed + "px";
		else
			cross_marquee.style.top = parseInt(marqueeheight) + 8 + "px";
		}
	else
		{
		if (parseInt(cross_marquee.style.top) < 130)
			cross_marquee.style.top = parseInt(cross_marquee.style.top) + copyspeed + "px";
		else
			cross_marquee.style.top = ((actualheight * (-1) + 8 )-10) + "px";
		}
	}
	
function initializemarquee( )
	{
	cross_marquee = document.getElementById("vmarquee")
	cross_marquee.style.top = 4
	marqueeheight = document.getElementById("marqueecontainer").offsetHeight
	actualheight = cross_marquee.offsetHeight;
	
	//window.status = actualheight + '/' + marqueeheight;
	
	if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1)
		{
		cross_marquee.style.height = marqueeheight+"px";
		cross_marquee.style.overflow = "scroll";
		return;
		}
		
	setTimeout('lefttime=setInterval("scrollmarquee()",50)', delayb4scroll)
	}

function stopmarquee()
	{
	copyspeed = 0;
	}
function startmarquee()
	{
	copyspeed = marqueespeed;
	}
function fastmarquee()
	{
	copyspeed = 4;
	}
function scrollup( )
	{
	thedirection = 1;
	startmarquee( );
	}
function scrolldown( )
	{
	thedirection = 0;
	startmarquee( );
	}
