function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		about_over = newImage("images/menu_buttons/about-over.gif");
		menu_over = newImage("images/menu_buttons/menu-over.gif");
		why_over = newImage("images/menu_buttons/why-over.gif");
		find_over = newImage("images/menu_buttons/find-over.gif");
		accounts_over = newImage("images/menu_buttons/accounts-over.gif");
		news_over = newImage("images/menu_buttons/news-over.gif");
		talk_over = newImage("images/menu_buttons/talk-over.gif");
		preloadFlag = true;
	}
}

//----------------------------------------------------------
// GENERIC POPUP SCRIPT WITH scroll,width,height PARAMETERS
//----------------------------------------------------------
function popup(url, name, width, height, scroll)
{

// center the window
var toppos = (screen.availHeight-height)/2;
var leftpos = (screen.availWidth-width)/2;

// screen resolution
var scrheight = screen.availHeight;
var scrwidth = screen.availWidth;

// where to position the window
var toppos = scrheight * 0.1;
var leftpos = scrwidth * 0.1;

// create the window command
command = "aWindow=window.open('" + url + "', '" + name +"', 'width=" + width + ",height=" + height + ",scrollbars=" + scroll + ",toolbar=no,menubar=no,top=" + toppos +",left="+ leftpos +",screenX="+ toppos +",screenY="+ leftpos +",resizable=yes')";
// execute the command
eval(command);
}

function open_window(param){	
	var url = "" + param;
	var name = "new_window";
	var width = 475;
	var height = 400;
	var toppos = (screen.height-height)/2;
	var leftpos = (screen.width-width)/2;	
	command = "aWindow=window.open('" + url + "', '" + name +"', 'width=" + width + ",height=" + height + ",scrollbars=no,toolbar=no,menubar=no,top=" + toppos +",left="+ leftpos +",screenX="+ toppos +",screenY="+ leftpos +",resizable=yes')";
	eval(command);
}

function open_window2(param){	
	var url = "" + param;
	var name = "new_window";
	var width = 490;  
	var height = 420;
	var toppos = "0";
	var leftpos = "0";	
	command = "aWindow=window.open('" + url + "', '" + name +"', 'width=" + width + ",height=" + height + ",scrollbars=no,toolbar=no,menubar=no,top=" + toppos +",left="+ leftpos +",screenX="+ toppos +",screenY="+ leftpos +",resizable=yes')";
	eval(command);
}