
//Handles window close
//--------------------
function closeWindow(){
	window.close();
}

//Page clear box
//--------------
function clearBox(passedBox) {
	if ((document.getElementById(passedBox).value=="Insert title of link here") || (document.getElementById(passedBox).value=="Insert external url here")) {
		document.getElementById(passedBox).value = '';
	}
}

//histry back button
//-------------------
function goBackPage() {
	history.go(-1);
}

//Default status name
//--------------------------------
defaultStatus ="MAS Diagnostic Builder - Developed by Creative Jar Ltd"

//changes main window location - acts as popup remote
//---------------------------------------------------
function remotePageCall(sendPage) {
	//alert(sendPage);
	window.opener.location.href=sendPage; 
	window.close();
}

//PopUp Window Function
//---------------------
var win = ""

function openPopUpWindow(mypage,myname,w,h,scroll,resizable) {
	if (mypage!="") {
		if (win!="") {
		win.close();
		}
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
		var settings  ='height='+h+',';
			settings +='width='+w+',';
			settings +='top='+wint+',';
			settings +='left='+winl+',';
			settings +='scrollbars='+scroll+',';
			settings +='resizable='+resizable;
		win=window.open(mypage,myname,settings);
		if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
	}
}