function fac_goTo( url ) {
	window.location.href = url;
}

function fac_navBar( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#FFF';
			default:
				if ( document.getElementsByTagName ) {
					
				}
		}
	} else {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#C5C5C5';
			default:
				if ( document.getElementsByTagName ) {
					
				}
		}
	}
}

function fac_navBarClick( tableCellRef, navStyle, url ) {
	fac_navBar( tableCellRef, 0, navStyle );
	fac_goTo( url );
}

function launch_popunder(dest, target, loadblank )
{
    if( ! target )
        target = "_blank";
	starturl = dest;
	if( loadblank )
	{
		starturl = 'http://beta.4thegame.com/graphics/blank.gif';
	}
    win=window.open(starturl, target );
    // Set the window position just off the right edge of the screen
	win.moveTo(0,0);
	win.resizeTo(screen.width,screen.height);
    win.opener = self
	if( loadblank )
	{
		win.location = dest;
	}
	self.focus();
    //return false;
}

function launch_window(dest, newWidth, newHeight, attr, target)
{
    if( ! target )
        target = "_blank";
    win=window.open(dest, target, "width="+newWidth+",height="+newHeight+","+"status=no,menubar=no,resizable=no,alwaysraised=yes,"+attr);
    // Set the window position just off the right edge of the screen
    position=newWidth+40;
    win.moveTo(screen.width-position,screen.height/2-newHeight/2);
    win.opener = self
    //return false;
}

function changePlayerPic(id,bform,thnfile)
{
    var fieldName = "img"+id;
    //alert( 'Changing "'+fieldName+'" to "'+thnfile+'"' );
    if( document.images )
    {
        document.images[fieldName].src = thnfile;
    }
    else
    {
        bform[fieldName].src = thnfile;
    }
    return true;
}

