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) {
		ff_menu_03_over = newImage("images/ff_menu_03-over.gif");
		ff_menu_04_over = newImage("images/ff_menu_04-over.gif");
		ff_menu_06_over = newImage("images/ff_menu_06-over.gif");
		p_close89 = newImage("images/p_con.gif");
		aboutus_13_over = newImage("images/aboutus_13-over.gif");
		hirefleet1_03_over = newImage("images/hirefleet1_03-over.gif");
		preloadFlag = true;
	}
}

function openWindow(url,winname,features) {
	winWidth = "363";
	winHeight = "373";
	if (features) {
		features = features.toLowerCase();
		if (features.indexOf("resizable") == -1) features += ",resizable";
		if (features.indexOf("width") != -1) {
			width = features.slice(features.indexOf("width=") + 6);
			width = width.substr(0, width.indexOf(","));
			winWidth = width;
		}
		if (features.indexOf("height") != -1) {
			height = features.slice(features.indexOf("height=") + 7);
			height = height.substr(0, height.indexOf(","));
			winHeight = height;
		}
		winOptions = features + ",";
	} else {		
		features = "width="+winWidth+",height="+winHeight+",resizable";
	}
	if (screen) y = (screen.availHeight - winHeight) / 2; x = (screen.availWidth - winWidth) / 2;
	if (screen.availWidth > 1800) x = ((screen.availWidth / 2) - winWidth) / 2; 
	winOptions += "screenX=" + x + ",screenY=" + y + ",top=" + y + ",left=" + x;
	window.open(url,winname,winOptions);
}
