function getObj(el)
{
	if(document.all) return document.all[el];
	else if(document.layers) return document.layers[el];
	else return document.getElementById(el);
}

function menu_over(id,ord)
{
	getObj("m_td"+ord+id).className="menu"+ord+"_on";
	getObj("a_m"+ord+id).className="menu"+ord;
}
function menu_out(id,ord)
{
	getObj("m_td"+ord+id).className="menu"+ord+"_off";
	getObj("a_m"+ord+id).className="menu"+ord;
}

function add_favorites(page, title)
{
	window.external.AddFavorite(page,title);
}
function set_homepage(page)
{
	document.body.style.behavior='url(#default#homepage)';
	document.body.setHomePage(page);
}


function popup(img, w, h)
{
	w=640;h=480;
	if(3*w>=4*h && w>640)
	{
		h=640*h/w;
		w=640;
	}
	else if(3*w<4*h && h>480)
	{
		w=480*w/h;
		h=480;		
	}
	var x,y;
	x=(screen.width-w)/2;
	y=(screen.height-h)/2;
	if(x<0) x=0;
	if(y<0) y=0;
	window.open(img,'','left='+x+',top='+y+',width='+w+',height='+h+',toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes');
}

function replaceAll(src, text, rep)
{
	a=0;
	while((a=src.indexOf(text,a))>=0)
	{
		src=src.replace(text,rep);
		a+=rep.length;
	}
	return src;
}

function print_addtofavorites()
{
var IEstring = '<a href="#" onClick='+"'javascript:add_favorites(location.href,"+'"GameDep - The True Game Department"); return false;'+"'>Add to Favorites</a>";
var NSstring = "Add to Favorites - Click [Ctrl + D]";
var OPstring = "Add to Favorites - Click [Ctrl + T]";
var OTHstring = "Bookmark this page!" 
var whichString = OTHstring ; 
var agt = navigator.userAgent.toLowerCase(); 
var app = navigator.appName.toLowerCase(); 
var ieAgent = agt.indexOf('msie'); 
var nsAgent = app.indexOf('netscape'); 
var opAgent = app.indexOf('opera'); 
if (ieAgent!= -1) whichString = IEstring;
else if (nsAgent!= -1) whichString = NSstring;
else if (opAgent!= -1) whichString = OPstring;
else whichString = IEstring;
document.write(whichString);
}
