function checklogin() {
  if (document.login.userid.value == ""){
    alert("No Name?");
    document.login.flag.value="";
    document.login.userid.focus();
    return false;
  }
  else if (document.login.passwd.value == ""){
    /*if (document.admin.userid.value == "callages_guest")
      return true;*/
    alert("Password required");
    document.login.passwd.focus();
    return false;
  }
  else{
    //alert("We got to else");
    document.login.flag.value=1;
    return true;
  }
}
////////////////////////////////////////////////////////////////////
function checksearch(field) {
  var warn="";
  //alert("str=" +str);
  //if (document.search.string.value == ""){
  if (field.string.value == ""){
    alert("Please specify any part of the First or Last Name");
    field.string.focus();
    return false;
  }
  else
  	return true;
}
///////////////////////////////////////////////////////////////////////
function check_visitor(){
  if (document.visitor.fname.value == ""){
    alert("First Name?");
    document.visitor.fname.focus();
    return false;
  }
  else if (document.visitor.lname.value == ""){
    alert("Last Name?");
    document.visitor.lname.focus();
    return false;
  }
  else if (document.visitor.org.value == ""){
    alert("Your Organization Name?");
    document.visitor.org.focus();
    return false;
  }
  else{
    //alert("exiting check_visitor");
    //window.location="http://localhost/forum/myforum.php";
    return true;
  }
}
////////////////////////////////////////////////////////
function checkboxes(this_form){
	var foundcheckbox=0;
	var cnt=0;
	var i=0;
	var elem='';
	elem = this_form.elements;
	var form_name = this_form.name;
	for (i=0; i<elem.length; i++){
  		//alert(elem[i].type);
  		switch (elem[i].type){
    		case "checkbox":
      	if(elem[i].checked){
        		foundcheckbox=1;
        		//alert ("foundcheckbox=" + foundcheckbox + "f=" + f);
        		break;
			}
		}
	}
	if (foundcheckbox==0){
		alert ("Please make a selection first.");
		return false;
	}
	else{
	   //this_form.action="admin.php?f=" + f;
	   return true;
	}
}
////////////////////////////////////////////////////////////////////
function checkchars(field, max) {
  //var str=new String(field.value);
  var str=field.value;
  var warn="";
  //alert("str=" +str);
  if (str.length >= max) {
    warn = "Maximum number of character allowed for this field=" + max;
    field.value=str.substring(0,max-2);
    field.focus();
    alert(warn);
    return false;
   }
  //alert("str=" +str);
  if (str.indexOf('$') !=-1){
    warn = "[$] is reserved for internal use.\nPlease use a different character.";
    alert(warn);
    return false;
    /*if (confirm(warn))
      str = str.replace(/;/g,",");
    else
      return false;
    */
    }
  return true;
}
////////////////////////////////////////////////////////
//To disable the right-button menu, insert the following code in your
// page's <HEAD> section:
function mouseDown(e) {
 if (parseInt(navigator.appVersion)>3) {
  var clickType=1;
  if (navigator.appName=="Netscape") clickType=e.which;
  else clickType=event.button;
  if (clickType!=1) {
   alert ('Right mouse button is disabled.')
   return false;
  }
 }
 return true;
}
/*if (parseInt(navigator.appVersion)>3) {
 document.onmousedown = mouseDown;
 if (navigator.appName=="Netscape") 
  document.captureEvents(Event.MOUSEDOWN);
}*/
