function checkLogin(loginForm){
	if (trim(loginForm.member_id.value) == "") {
		alert("Please type your login name.");
		loginForm.member_id.focus();
		return false;
	}
	if (trim(loginForm.member_password.value) == "") {
		alert("Please type your password.");
		loginForm.member_password.focus();
		return false;
	}
	return true;
}

// This function is for stripping leading and trailing spaces
function trim(str) {
	if (str != null) {
		var i;

		for (i=0; i<str.length; i++) {
			if (str.charAt(i)!=" ") {
				str=str.substring(i,str.length);
				break;
			}
		}

		for (i=str.length-1; i>=0; i--) {
			if (str.charAt(i)!=" ") {
				str=str.substring(0,i+1);
				break;
			}
		}

		if (str.charAt(0)==" ") {
			return "";
		} else {
			return str;
		}
	}
}

//Minimize Window
function Minimize()  {
	window.innerWidth = 100;
	window.innerHeight = 100;
	window.screenX = screen.width;
	window.screenY = screen.height;
	alwaysLowered = true;
}

//Maximize Window
function Maximize() {
	window.innerWidth = screen.width;
	window.innerHeight = screen.height;
	window.screenX = 0;
	window.screenY = 0;
	alwaysLowered = false;
}

function setTable(what){
	if(document.getElementById(what).style.display=="none"){
		document.getElementById(what).style.display="block";
	}
	else if(document.getElementById(what).style.display=="block"){
		document.getElementById(what).style.display="none";
	}
}

//Open URL
function openUrl(URL_file) {
	window.open(URL_file , '_blank', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=1024,height=768,left=0,top=0',false);
}

function confirm_delete(recja) {
	if (confirm("Do you want to delete " + recja + " ?")) {
		return true;
	}
	else {
		return false;
	}
}