function MovePage(url) {
	location.href = url;
}

function ListFrm(param) {
	location.href = "online.asp" + param;
}

function ReSet(param) {
		if(confirm("ReSet?")) {
			//location.href = "WriteFrm.asp" + param;
			window.location.reload(true)
		}
}

function EditFrm(param) {
		location.href = "onlineEdit.asp" + param;
}

function DelFrm(param) {
			location.href = "onlineDel.asp" + param;
}

function WriteFrm(param) {
	location.href = "WriteFrm.asp" + param;
}

function ReplyFrm(param) {
	location.href = "ReplyFrm.asp" + param;
}

function ReplyEditFrm(param) {
	location.href = "ReplyEditFrm.asp" + param;
}

function ReplyDelFrm(param) {
	if(confirm("Would you really like to delete it?")) {
		location.href = "ReplyDelAct.asp" + param;
	}
}

function Write() {
	var obj;
	obj = document.form1;


	if(obj.name != null){
		if(ckNull(obj.name,"Please insert your name.")) return;
		if(ckLength(obj.name, "Name", 1, 10)) return;
	}
	
	if(obj.email != null){
		if(ckNull(obj.email,"Please insert your email address.")) return;
		if(ckLength(obj.email, "EMail", 1, 50)) return;
		var hstr = obj.email.value;
		var t=escape(hstr.replace("-",""));
			if (t.match(/^(\w+)@(\w+)[.](\w+)$/ig) == null && t.match(/^(\w+)@(\w+)[.](\w+)[.](\w+)$/ig) ==null && t.match(/^(\w+)[.](\w+)@(\w+)[.](\w+)$/ig) == null && t.match(/^(\w+)[.](\w+)[.](\w+)@(\w+)[.](\w+)$/ig) == null && t.match(/^(\w+)[.](\w+)@(\w+)[.](\w+)[.](\w+)$/ig) == null && t.match(/^(\w+)[.](\w+)[.](\w+)@(\w+)[.](\w+)[.](\w+)$/ig) == null)
		{
			alert ("Please insert your correct email address.");
			obj.email.focus();
			return;
		}		
	}

	if(obj.title != null){
		if(ckNull(obj.title,"Please insert the subject.")) return;
		if(ckLength(obj.title, "Subject", 1, 100)) return;
	}

	if(obj.content != null){
		if(ckNull(obj.content,"Please insert the body.")) return;
	}
	
	if(obj.pwd != null){
		if(ckNull(obj.pwd,"Please insert your password.")) return;
	}
	
	obj.action = "onlineWrite_ok.asp";

	obj.submit();
	
}

function Edit() {
	var obj;
	obj = document.form1;

	if(obj.name != null){
		if(ckNull(obj.name,"Please insert your name.")) return;
		if(ckLength(obj.name, "Name", 1, 10)) return;
	}
	
	if(obj.email != null){
		if(ckNull(obj.email,"Please insert your email address.")) return;
		if(ckLength(obj.email, "EMail", 1, 50)) return;
		var hstr = obj.email.value;
		var t=escape(hstr.replace("-",""));
			if (t.match(/^(\w+)@(\w+)[.](\w+)$/ig) == null && t.match(/^(\w+)@(\w+)[.](\w+)[.](\w+)$/ig) ==null && t.match(/^(\w+)[.](\w+)@(\w+)[.](\w+)$/ig) == null && t.match(/^(\w+)[.](\w+)[.](\w+)@(\w+)[.](\w+)$/ig) == null && t.match(/^(\w+)[.](\w+)@(\w+)[.](\w+)[.](\w+)$/ig) == null && t.match(/^(\w+)[.](\w+)[.](\w+)@(\w+)[.](\w+)[.](\w+)$/ig) == null)
		{
			alert ("Please insert your correct email address.");
			obj.email.focus();
			return;
		}		
	}

	if(obj.title != null){
		if(ckNull(obj.title,"Please insert the subject.")) return;
		if(ckLength(obj.title, "Subject", 1, 100)) return;
	}

	if(obj.content != null){
		if(ckNull(obj.content,"Please insert the body.")) return;
	}
	
	if(obj.pwd != null){
		if(ckNull(obj.pwd,"Please insert your password.")) return;
	}
	
	obj.action = "onlineEdit_ok.asp";
	//ShowProgress();
	obj.submit();
	
}

function Reply() {
	var obj;
	obj = document.form1;

	if(obj.content != null){
		if(ckNull(obj.content,"Please insert the body.")) return;
	}
	obj.action = "ReplyAct.asp";
	//ShowProgress();
	obj.submit();
	
}

function ReplyDel() {
	var obj;
	obj = document.form1;

	if(obj.pwd != null){
		if(ckNull(obj.pwd,"Please insert your password.")) return;
	}
	
	obj.action = "ReplyDelAct.asp";
	ShowProgress();
	obj.submit();
	
}

function ReplyEdit() {
	var obj;
	obj = document.form1;

	if(obj.content != null){
		if(ckNull(obj.content,"Please insert the body.")) return;
	}
	obj.action = "ReplyEditAct.asp";
	obj.submit();
	
}

function Delete() {
	var obj;
	obj = document.form1;

	if(obj.pwd != null){
		if(ckNull(obj.pwd,"Please insert your password.")) return;
		if(ckLength(obj.pwd, "Password", 1, 12)) return;
	}
	obj.action = "onlineDel_ok.asp";
	obj.submit();
}

function Permit() {
	var obj;
	obj = document.form1;

	if(obj.pwd != null){
		if(ckNull(obj.pwd,"Please insert your password.")) return;
		if(ckLength(obj.pwd, "Password", 1, 12)) return;
	}
	obj.action = "PermitAct.asp";
	obj.submit();
}

function Search(obj,url) {
	
	if(obj.SearchKey != null){
		if(ckNull(obj.SearchKey,"Select SearchKey")) return;
	}

	if(obj.SearchWord != null){
//		if(ckNull(obj.SearchWord,"Insert Search Word")) return;
//		if(ckLength(obj.SearchWord, "SearchWord", 1, 20)) return;
	}
	obj.action = url;
	obj.submit();
}