function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function login(ap) {
	if (ap.U.value == "") {
		alert("Please enter your username or email address");
		ap.U.focus();
		return false;
	}
	if (ap.P.value == "") {
		alert("Please enter your password");
		ap.P.focus();
		return false;
	}
	var myindex=document.forms[0].menu.selectedIndex;
	if (myindex==0) {
		alert("\nYou must make a selection from the drop-down menu.");
		return false;
	}
  if (myindex==1) {
		var U1 = ap.U.value;
		var P1 = ap.P.value;
		ap.UserName.value = U1;
		ap.Password.value = P1;
    ap.password.value = P1;
	}
	if (myindex==2) {
		var U2 = ap.U.value;
		var P2 = ap.P.value;
		ap.email.value = U2;
		ap.pword.value = P2;
	}
	if (myindex==3) {
		var U3 = ap.U.value;
		var P3 = ap.P.value;
		ap.username.value = U3;
		ap.password.value = P3 ;
	}
}

function logEbill(ef) {
    // set the action.  this could be hard-coded into the html but
    // its also nice to keep it all separated
  ef.action = "https://ebill.molalla.net/eaccount/eaccount.asp?WCI=WIAccount&WCT=eAccountSummary&WCA=ValidateLogin";

    // just a couple of required field validations on username & password
  if(ef.ebName.value == "") {
    alert("Please enter your eBill username");
    ef.ebName.focus();
    return false;
  }
  if(ef.ebPass.value == "") {
    alert("Please enter your eBill password");
    ef.ebPass.focus();
    return false;
  }

  ef.UserName.value = ef.ebName.value;
  ef.Password.value = ef.ebPass.value;
}

function logMail(mf) {
  mf.action = "http://webmail.molalla.net/atmail.php";
  if(mf.mailUser.value == "") {
    alert("Enter WebMail name");
    mf.mailUser.focus();
    return false;
  }
  if(mf.mailPass.value == "") {
    alert("Enter WebMail password");
    mf.mailPass.focus();
    return false;
  }
  
  mf.username.value = mf.mailUser.value;
  mf.password.value = mf.mailPass.value;
}

function mousedIn(frm) {
  var theobj = getRawObject(frm);
  theobj.src = "./images/" + frm + "_on.jpg";
}

function mousedOut(frm) {
  var theobj = getRawObject(frm);
  theobj.src = "./images/" + frm + "_off.jpg";
}

function displayHide(obj) {
  var theObj = getObject(obj);
  var cdisp = theObj.display;
  if(cdisp == "block") {
    theObj.display="none";
  }
  else {
    theObj.display="block";
  }
}
