    function taLimit() {
    	var taObj=event.srcElement;
    	if (taObj.value.length==255*1) return false;
    }
    
    function taCount(visCnt) { 
    	var taObj=event.srcElement;
    	if (taObj.value.length>255*1) taObj.value=taObj.value.substring(0,255*1);
    	if (visCnt) visCnt.innerText=255-taObj.value.length;
    }

	function checkIt(string)
	{
		place = detect.indexOf(string) + 1;
		thestring = string;
		return place;
	}

	function ValidateExtEvetns(){
		if (document.frm.action.value=="") {
			alert("Please select an action to perform, from the menu.")
			document.frm.action.focus()
		return false }
	}
	function ValidateUpload2(){
		if (document.frm2.FILE1.value=="") {
			alert("Please select a file to upload from your computer.")
			document.frm2.FILE1.focus()
		return false }
	}
    function ValidReminderMain(){
        if (document.frm.username.value=="") {
        	alert("Please enter your username.")
        	document.frm.username.focus()
        return false }
    }    
    function ValidateMainLogin(){
        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 ValidSettings(){
    if (document.frm.msg.value=="") {
    	alert("Please enter SUGGEST email content.")
    	document.frm.msg.focus()
    return false }
    }

    function ValidProfileCal(){
    if (document.frm.name.value=="") {
    	alert("Please enter calendar name.")
    	document.frm.name.focus()
    return false }
    if (document.frm.password.value=="") {
    	alert("Please enter calendar password.")
    	document.frm.password.focus()
    return false }
    if (document.frm.reminder.value=="") {
    	alert("Please enter calendar reminder.")
    	document.frm.reminder.focus()
    return false }
    }

    function DeleteUplFile(ID, CID) {
    	if (confirm("Delete this file ?" )) {
    		window.location.replace("upl_del_file.asp?ID=" + ID + "&cid=" + CID);
    	}
    }

    function DeleteUplCate(ID,CATE_NAME) {
    	if (confirm("Delete Category: " + CATE_NAME + " ?\n\nAll associated files will be deleted as well." )) {
    		window.location.replace("upl_del.asp?ID=" + ID );
    	}
    }    

    function ValidateUpload(){
    if (document.frm.FILE1.value=="") {
    	alert("Please select file to upload.")
    	document.frm.FILE1.focus()
    return false }
    }
    
    
    function ValidateUPLCate(){
    if (document.frm.name.value=="") {
    	alert("Please enter category name.")
    	document.frm.name.focus()
    return false }
    if (document.frm.des.value=="") {
    	alert("Please enter description.")
    	document.frm.des.focus()
    return false }
    }
    
    function ValidEvent(){
	    if (document.frm.title.value=="") {
	    	alert("Please enter event title.")
	    	document.frm.title.focus()
	    return false }
    }
    
    function ExportEvent(ID) {
    	if (confirm("Export this event ?")) {
    		window.location.replace("export_ics.asp?ID=" + ID );
    	}
    }
    
    function LogOut() {
    	if (confirm("Would you like to log out ?")) {
    		window.location.replace("index.asp?Logout=True");
    	}
    }
    
    function ValidTemplate(){
    if (document.frm.name.value=="") {
    	alert("Please enter template name.")
    	document.frm.name.focus()
    return false }
    }
    
    
    function ValidSIGN(){
    if (document.frm.sign.value=="") {
    	alert("Please enter sign.")
    	document.frm.sign.focus()
    return false }
    if (document.frm.img.value=="") {
    	alert("Please enter image URL.")
    	document.frm.img.focus()
    return false }
    }
    
    function CateAddEdit(){
    if (document.frm.name.value=="") {
    	alert("Please enter category name.")
    	document.frm.name.focus()
    return false }
    }
    
    function CateDel(ID,NAME) {
    	if (confirm("Delete Category " + NAME + " ?\n\nDeleting a category causes all associated events to be deleted as well." )) {
    		window.location.replace("cate_del.asp?ID=" + ID );
    	}
    }
    
    function EventDel(ID,NAME,TYPE,rM,rY,rC,sC) {
    	if (confirm("Delete Event: " + NAME + " ?" )) {
    		window.location.replace("event_del.asp?ID=" + ID + "&type=" + TYPE + "&m=" + rM + "&y=" + rY + "&cate=" + rC + "&sC=" + sC);
    	}
    }
    
    function SignDel(ID,NAME) {
    	if (confirm("Delete Sign: " + NAME + " ?" )) {
    		window.location.replace("sign_del.asp?ID=" + ID );
    	}
    }
    
    function TemplateDel(ID,NAME) {
    	if (confirm("Delete Template: " + NAME + " ?" )) {
    		window.location.replace("template_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(); }
    }