function roll_on(obj,name)
{
	roll_on_ext(obj,name,'jpg');
}

function roll_on_ext(obj,name,ext)
{
	obj.src='/images/'+name+'_over.'+ext;
}


function roll_off(obj,name)
{
	roll_off_ext(obj,name,'jpg');
}

function roll_off_ext(obj,name,ext)
{
	obj.src='/images/'+name+'_off.'+ext;
}

function gotoAndClose(targetWindow, newURL)
{
	targetWindow.location = newURL;
	window.close();
}

function MyOpenWindow(URL, WindowName, netscapeWidth, netscapeHeight, width, height)
{
	MyOpenWindowEx(URL, WindowName, netscapeWidth, netscapeHeight, width, height, 0)
}

function MyOpenWindowEx(URL, WindowName, netscapeWidth, netscapeHeight, width, height, scrollbars)
{
	var AppName = navigator.appName;
	var w = screen.width;
	var h = screen.height;

	if (document.all) {
	   w = document.body.clientWidth;
	   h = document.body.clientHeight;
	}
	else if (document.layers) {
	   w = window.innerWidth;
	   h = window.innerHeight;
	}

   w = document.body.clientWidth;
   h = document.body.clientHeight;

	var leftPos = (w-width)/2+self.screenLeft, topPos = (h-height)/2+self.screenTop;
	
	var isIE    = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	
	if (!isIE) 
	{
		leftPos = (w-netscapeWidth)/2+self.screenLeft;
		topPos = (h-netscapeHeight)/2+self.screenTop;
		NewWindow = window.open("",WindowName,"directories=0,innerHeight=" + netscapeHeight + ",innerWidth=" + netscapeWidth + ",location=0,menubar=0,resizeable=1,screenX=" + topPos + ",screenY=" + leftPos + ",scrollbars=" + scrollbars + ",status=0,titlebar=0,toolbar=0");
	}
	else
	{
		NewWindow = window.open("",WindowName,"height=" + height + ",menubar=0,toolbar=no,resizable=no,scrollbars=" + scrollbars + ",status=0,location=0,width=" + width + ",top=" + topPos + ",left=" + leftPos );
	}
		
	NewWindow.location = URL;
	NewWindow.focus();
}

function openWindow(URL, WindowName, width, height)
{	
	var isIE    = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	
	if (!isIE) 
	{
		NewWindow = window.open("",WindowName,"directories=0,innerHeight=" + height + ",innerWidth=" + width + ",location=0,menubar=0,resizeable=1,scrollbars=1,status=0,titlebar=0,toolbar=0");
	}
	else
	{
		NewWindow = window.open("",WindowName,"height=" + height + ",menubar=0,toolbar=no,resizable=1,scrollbars=1,status=0,location=0,width=" + width );
	}
		
	NewWindow.location = URL;
	NewWindow.focus();
}

//function openGame(gameID,genreID,roomID) {
//	MyOpenWindow('/Games/Launcher.aspx?gameID='+gameID+'&GenreID='+genreID+'&RoomID='+roomID,'Game_Page',800,590,800,590);
//}
function openGame(gameID,roomID) {
	MyOpenWindow('/Games/Launcher.aspx?gameID='+gameID+'&RoomID='+roomID,'Game_Page',800,590,800,590);
}

function launchGameFromLobby(gameID, roomID, overrideRoomID, overrideChatRoomID) {
    MyOpenWindow('/Games/Launcher.aspx?lobby=1&passed=1&detect=1&gameID='+gameID+'&RoomID='+roomID+'&overrideRoomID='+overrideRoomID+'&overrideChatRoomID='+overrideChatRoomID,'Game_Page',810,610,800,600);
}

function showMinDotPopup(minDots) {
    MyOpenWindow('/messagePopup.aspx?popupType=minDots&minDots='+minDots,'MessagePopup',350,250,350,250);
}

function load_Flash(swfFile,width,height,params) {
 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"');
 document.write(' width="'+width+'" height="'+height+'">');
 document.write(' <param name="movie" value="'+swfFile+'?'+params+'">');
 document.write(' <param name="menu" value="false"> '); 
 document.write(' <param name="quality" value="high">'); 
 document.write(' <embed src="'+swfFile+'?'+params+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" menu=false></embed></object>');
}

function load_Flash_ex(swfFile,width,height,params,reqMajorVer,reqMinorVer,reqRevVer) {
 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+reqMajorVer+','+reqMinorVer+','+reqRevVer+',0"');
 document.write(' width="'+width+'" height="'+height+'">');
 document.write(' <param name="movie" value="'+swfFile+'?'+params+'">');
 document.write(' <param name="menu" value="false"> '); 
 document.write(' <param name="quality" value="high">'); 
 document.write(' <embed src="'+swfFile+'?'+params+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" menu=false></embed></object>');
}

function load_director_ex(url,width,height,params,ver,min,rev) {
  document.write('    <object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"\r\n'); 
  document.write('      codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version='+ver+','+min+','+rev+',0"\r\n'); 
  document.write('      ID=GameObject \r\n');
  document.write('       width="'+width+'"\r\n'); 
  document.write('       height="'+height+'">\r\n');
  document.write('        <param name="src" value="'+url+'">\r\n');
  document.write('        <PARAM NAME=swStretchStyle VALUE=meet>\r\n');
  document.write('       <param name=swRemote value="swSaveEnabled=\'true\' \r\n');
  document.write('                                   swVolume=\'false\'\r\n'); 
  document.write('                                   swRestart=\'false\' \r\n');
  document.write('                                   swPausePlay=\'false\' \r\n');
  document.write('                                   swFastForward=\'false\' \r\n');
  document.write('                                   swContextMenu=\'false\' "> \r\n');
  document.write('        <PARAM NAME=bgColor VALUE=#FE9900> \r\n');
  document.write('       <PARAM NAME=logo VALUE=FALSE> \r\n');
  document.write('       <PARAM NAME=swStretchHAlign VALUE=Left> \r\n');
  document.write('       <PARAM NAME=swStretchVAlign VALUE=Top> \r\n');
  document.write('       <PARAM name="swList" value=\''+params+'\'> \r\n');
  document.write('       <embed src="'+url+'" \r\n');
  document.write('            pluginspage="http://www.macromedia.com/shockwave/download/" \r\n');
  document.write('            width="'+width+'" \r\n'); 
  document.write('           height="'+height+'" \r\n');
  document.write('            swList=\''+params+'\' \r\n');
  document.write('            swRemote="swSaveEnabled=\'true\' \r\n');  
	document.write('				    swVolume=\'false\' \r\n');
  document.write('					    swRestart=\'false\' \r\n');
  document.write('					    swPausePlay=\'false\' \r\n');
	document.write('				    swFastForward=\'"false\' \r\n');
	document.write('				    swContextMenu=\'false\'" \r\n');
  document.write('            bgcolor=#FE9900 \r\n');
	document.write('         swStretchStyle=meet \r\n');
	document.write('		 logo=false \r\n');
  document.write('	         type="application/x-director" \r\n');
  document.write('	         pluginspage="http://www.macromedia.com/shockwave/download/">  \r\n');
  document.write('       </embed> \r\n');
  document.write('     </object> \r\n');
}
