// Universal Popup Window (Centred)
function popup(url,winname,w,h,feat)
{
	if (!(isNaN(w) || isNaN(h)))
	{
		var x=parseInt((screen.width-w)/2);
		var y=parseInt((screen.height-h)/2);
		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 my_win = window.open(url,winname,feat);
	my_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 = 715;
	var height = 395;
	var screenX = screen.width
	var screenY = screen.height

	var x = (screenX - width)/2;
	var y = (screenY - height)/2;

	var tools = window.open(dotdotpath + "tools/?section=" + section,"tools","width=" + width + ",height=" + height + ", top=" + y + ", left=" + x);
	tools.focus();
}

// LAUNCHES LIGHTMAKER.COM MID-SCREEN
function lightmaker()	{
	var width = 790;
	var height = 500;
	var screenX = screen.width
	var screenY = screen.height

	var x = (screenX - width)/2;
	var y = (screenY - height)/3;

	var lightmaker = window.open("http://www.lightmaker.com","lightmaker","status=yes,scrollbars=yes,resizable=yes,location=yes,toolbar=yes,menubar=yes,width=" + width + ",height=" + height + ", top=" + y + ", left=" + x);
	lightmaker.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();
}