// Login scripts
// --------------------------------------------------
function ValidateLogin() {
    // validate a login form with form name "loginForm" and "username" and "password" fields
	if (document.loginForm.username.value == '') {
		alert("Please enter your username.");
		return false;
	}
	if (document.loginForm.password.value == '') {
		alert("Please enter your password.");
		return false;
	}
	return true;
}

// Macromedia scripts 
// --------------------------------------------------


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

// Miscellaneous scripts
// --------------------------------------------------
var newWindow2 = null;
function MakeNewWindow2(winTarget,winName,winTop,winLeft,winWidth,winHeight) {
   // create a new popup window with the parameters (more options than MakeNewWindow(x,y)
   newWindow = window.open(winTarget,winName,"status=yes,menubar=no,toolbar=no,scrollbars=yes,resizeable=yes,width=" + winWidth + ",height=" + winHeight + ",top=" + winTop + ",left=" + winLeft)
   newWindow.focus()
}

var newWindow = null;
function MakeNewWindow(x,y) {
   // create a new popup window with the parameters
	newWindow = window.open(x,y,"status=0,menubar=no,toolbar=no,scrollbars=yes,resizeable=yes,width=730,height=530,top=15,left=15")
	newWindow.focus()
}

function PrintThisWindow() {
   // print the current window
   window.print()
}

function CloseThisWindow() {
   // try to close the current window
   window.close()
}

function CloseFocus() {
   // try to close the current window and refresh the parent window as well
	top.opener.focus();
	window.opener.location.href = window.opener.location;
	parent.close();
}

function openLostPassword(prefix) {
    var lost = window.open('/' + prefix + '/private/employees/lost_password.php', 'lost', 'width=400,height=300,scrollbars=no,status=no');
}