// CENTRAL POPUP
function popup(url,winname,w,h,feat)
{
	if (!(isNaN(w) || isNaN(h)))
	{
		var adjust = 20;
		var x=parseInt((screen.width-w)/2);
		var y=parseInt(((screen.height-h)/2-adjust));
		if (x<0)	x=0;
		if (y<0)	y=0;
		
		if (feat!=null && feat!="")
		{
			feat=","+feat;
		}
		else
		{
			feat="";
		}
		feat="left="+x+",top="+y+",width="+w+",height="+h+feat;
	}
	var this_win = window.open(url,winname,feat);
	this_win.focus();
}

// CHECKS FIELDS ARE FILLED IN BEFORE SUBMITTING FORM FOR CURRENCY CONVERSION
function currency_check() {
	if (document.f.amount.value=="") {
		return false;
	} else if (document.f.convert.value=="") {
		return false;
	} else if (document.f.into.value=="") {
		return false;
	} else {
		return;
	}
}

// LAUNCHES TOOLS
function tools (dotdotpath, section)	{
	var width = 742;
	var height = 410;
	var screenX = screen.width
	var screenY = screen.height

	var x = (screenX - width)/2;
	var y = (screenY - height)/2;

	var tools = window.open("http://www.moneycorp.co.uk/tools/?section=undefined","tools","width=" + width + ",height=" + height + ", top=" + y + ", left=" + x + ",resizable=yes, scrollbars=yes");
	tools.focus();
}

// LAUNCHES CELTICINTERNET.COM MID-SCREEN
function celtic()	{
	var width = 790;
	var height = 520;
	var screenX = screen.width
	var screenY = screen.height

	var x = (screenX - width)/2;
	var y = (screenY - height)/3;

	var celtic = window.open("http://www.celticinternet.com","celticinternet","status=yes,scrollbars=yes,resizable=yes,location=yes,toolbar=yes,menubar=yes,width=" + width + ",height=" + height + ", top=" + y + ", left=" + x);
	celtic.focus();
}

function Calendar() {
	var width = 248;
	var height = 224;
	var screenX = screen.width
	var screenY = screen.height

	var x = (screenX - width)/2;
	var y = (screenY - height)/2;

	var calendar = window.open("calendar.htm","calendar","width=" + width + ",height=" + height + ", top=" + y + ", left=" + x);
	calendar.focus();
}
// OPENS DEMO FULLSCREEN
function fullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}

// BOOKMARK
var url = "http://www.moneycorp.com";
var title = "Moneycorp Commercial Foreign Exchange";
function makeLink(){
if(document.all)
window.external.AddFavorite(url,title)
}

// BOOKMARK FOR CURRENCY CHARTS
var chart = "http://www.moneycorp.com/chart/charts_new.cfm";
var titlename = "Moneycorp Currency Charts";
function makeLinkChart(){
if(document.all)
window.external.AddFavorite(chart,titlename)
}

// BOOKMARK FOR CURRENCY CONVERTER
var urlname = "http://www.moneycorp.com/tools/currency_converter/convert_new.cfm";
var titledescription = "Moneycorp Currency Converter";
function makeLinkConverter(){
if(document.all)
window.external.AddFavorite(urlname,titledescription)
}

// SPREADS PICKER
var windowDoPop

function go(whichURL) {
    windowDoPop=window.open(whichURL[whichURL.selectedIndex].value,'doPop','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=510,height=500');
    windowDoPop.focus();
}
//SHOW AND HIDE
 
function showdiv() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow').style.display = 'block'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow.visibility = 'block'; 
} 
else { // IE 4 
document.all.hideshow.style.visibility = 'block'; 
} 
} 
}

