	function ValidLogin(){
		if (document.frm.username.value=="") {
			alert("Please enter your username.")
			document.frm.username.focus()
		return false }
		if (document.frm.password.value=="") {
			alert("Please enter your password.")
			document.frm.password.focus()
		return false }
	}
	
	function DeleteFile(ID,I_NAME) {
		if (confirm("Delete File ?")) {
			window.location.replace("file_del.asp?ID=" + ID );
		}
	}

    function NewWindow(mypage, myname, w, h, scroll) {
    	var winl = (screen.width - w) / 2;
    	var wint = (screen.height - h) / 2;
    	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll
    	win = window.open(mypage, myname, winprops)
    	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
    }
	
	function DeleteArticle(ID,I_NAME) {
		if (confirm("Delete Article: "+ I_NAME )) {
			window.location.replace("del.asp?ID=" + ID );
		}
	}
	
	function ValidArticle(){
		if (document.frm.cate.value=="") {
			alert("Please select article category(ies).")
			document.frm.cate.focus()
		return false }
		if (document.frm.title.value=="") {
			alert("Please enter article title.")
			document.frm.title.focus()
		return false }
		if (document.frm.summary.value=="") {
			alert("Please enter article summary.")
			document.frm.summary.focus()
		return false }
	}
	
	function ValidCate(){
		if (document.frm.name.value=="") {
			alert("Please enter name.")
			document.frm.name.focus()
		return false }
	}

	function AskCATE(ID,I_NAME) {
		if (confirm("Delete Category: "+ I_NAME )) {
			window.location.replace("del.asp?ID=" + ID );
		}
	}
	
	function checkIt(string)
	{
		place = detect.indexOf(string) + 1;
		thestring = string;
		return place;
	}

	function AskAgent(ID,I_NAME) {
		if (confirm("Delete agent: "+ I_NAME )) {
			window.location.replace("del.asp?ID=" + ID );
		}
	}
	
	function ValidEditAgent(){
		if (document.frm.name.value=="") {
			alert("Please enter name.")
			document.frm.name.focus()
		return false }
		if (document.frm.password.value=="") {
			alert("Please enter password.")
			document.frm.password.focus()
		return false }
		if (document.frm.email.value=="") {
			alert("Please enter email address.")
			document.frm.email.focus()
		return false }
	}
	
	function ValidAgent(){
		if (document.frm.name.value=="") {
			alert("Please enter name.")
			document.frm.name.focus()
		return false }
		if (document.frm.username.value=="") {
			alert("Please enter username.")
			document.frm.username.focus()
		return false }
		if (document.frm.password.value=="") {
			alert("Please enter password.")
			document.frm.password.focus()
		return false }
		if (document.frm.email.value=="") {
			alert("Please enter email address.")
			document.frm.email.focus()
		return false }
	}
