/*
Snake Game Written by Omar Wally surfsup_79@hotmail.com
Permission granted to Dynamicdrive.com to include script in archive
For this and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

function opengame(){
if (document.all)
window.open("game.htm","gamewin","status,width=220,height=260,border=0")
else
alert("You need IE 4+ to play Snake. Sorry")
}

function openRoute()
{
	openCenteredWindow( 'Route.html', 750, 536, '', 'menubar=yes' );
}
function openCenteredWindow(url, width, height, name, parms) {
   var left = Math.floor( (screen.width - width) / 2);
   var top = Math.floor( (screen.height - height) / 2);
   var winParms = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width;
   if (parms) { winParms += "," + parms; }
   var win = window.open(url, name, winParms);
   return win;
}

function checkFotoWidth( img, maxw )
{
	if( maxw==undefined)
		maxw = 200;
	if(img.width>maxw || ( img.style.cursor == "hand" && img.width==maxw ))
	{
		img.width=maxw;
		img.style.cursor = "hand";
		img.onclick= function(){ openCenteredWindow( this.src, 750, 536, '', 'menubar=yes' ); }
	}
}