// versioning
var gBrowserVer = parseInt(navigator.appVersion);
var gBrowserName = navigator.appName;



// util
	function rand( range )
	{
		var now = new Date();
		var num =( now.getTime() ) % range;
		return num;
	}
	function popwindow( theUrl, theName, theWidth, theHeight, theX, theY )
	{
		window.open( theUrl,theName,"left="+theX+",top="+theY+",toolbar=no,scrollbars=no,width="+theWidth+",height="+theHeight+",resizable=no");
	}


// right click override
var gMessage='Copyright © 2005 Brainite.';
function rightClickHandler( theEvent )
{
	if( document.all )
	{
		if( event.button == 2 ) 
		{
			alert( gMessage );
			return false;
		}
	}
	if( document.layers )
	{
		if( theEvent.which == 3 )
		{
			alert( gMessage );
			return false;
		}
	}
}



 
// image fliping   
	
	function loadNewImage( theName )
	{
		window[ theName + "but_nrm" ] = new Image();
		window[ theName + "but_ovr" ] = new Image();
		window[ theName + "but_nrm" ].src = "graphics/buttons/"+theName+"but_nrm.gif";
		window[ theName + "but_ovr" ].src = "graphics/buttons/"+theName+"but_ovr.gif";
	}
	function loadNewJPG( theName )
	{
		window[ theName + "but_nrm" ] = new Image();
		window[ theName + "but_ovr" ] = new Image();
		window[ theName + "but_info" ] = new Image();
		window[ theName + "but_nrm" ].src = "graphics/buttons/"+theName+"but_nrm.jpg";
		window[ theName + "but_ovr" ].src = "graphics/buttons/"+theName+"but_ovr.jpg";
		window[ theName + "but_info" ].src = "graphics/buttons/"+theName+"but_info.jpg";
	}
	
	function imageChange( theImageName, theVariableName )
	{
		if( document.images )
			document[theImageName].src = eval( theVariableName + ".src" );
	}
	
	function mouseOverDoubleFlip( theName )
	{
		imageChange( theName + "but", theName + "but_ovr" );
		imageChange( "info", theName + "but_info" )
	}
	
	function mouseOutDoubleFlip( theName )
	{
		imageChange( theName + "but", theName + "but_nrm" );
		imageChange( "info", "blank_info" );
	}

if( document.layers ) 
{
	document.captureEvents( Event.MOUSEDOWN );
}
document.onmousedown = rightClickHandler;

// local image loading
if( document.images )
{
	var blank_info = new Image();
	blank_info.src = "graphics/blankinfo.jpg";
	loadNewImage( "home" );
	loadNewImage( "links" );
	loadNewImage( "about" );
	loadNewImage( "calendar" );
	loadNewImage( "resume" );
	loadNewImage( "feedback" );
	loadNewJPG( "red" );
	loadNewJPG( "orange" );
	loadNewJPG( "yellow" );
	loadNewJPG( "green" );
	loadNewJPG( "blue" );
	loadNewJPG( "purple" );

}
	
