﻿function doBusinessLogin() { 
    // Business (ecorp) login - both access ID and password are required
    if (document.forms[0].BusAccessIDVisible.value != ""  && document.forms[0].BusAccessIDVisible.value != "Access ID") {
        document.forms[0].nmUID.value = document.forms[0].BusAccessIDVisible.value;
        document.forms[0].nmPWD.value = "" // document.forms[0].BusPasswordVisible.value;
        document.forms[0].action = 'https://ecorp.mbandt.com/EBC_EBC1961/EBC1961.asp?WCI=Process&WCE=RemoteLogon&IRL=T';

        // Required by FireFox for autopostback.
        __CMS_CurrentUrl = 'https://ecorp.mbandt.com/EBC_EBC1961/EBC1961.asp?WCI=Process&WCE=RemoteLogon&IRL=T';

        document.forms[0].BusAccessIDVisible.value = "";
        document.forms[0].PasswordVisible.value = "";
        document.forms[0].submit();
    } else {
        alert("\n Please Enter a valid Access ID.  Thank you!\n\n\t"); 
    }
}

function doPersonalLogin()
{
    // Personal (ecom) login - only access ID is required
    if (document.forms[0].AccessIDVisible.value != "" && document.forms[0].AccessIDVisible.value != "Access ID") {
        document.forms[0].AccessID.value = document.forms[0].AccessIDVisible.value;
        document.forms[0].action = 'https://elink.mbandt.com/Pbi1961.asp?WCI=RemoteLogin&Rt=072402157&LogonBy=connect3&PRMACCESS=account';

        // Required by FireFox for autopostback.
        __CMS_CurrentUrl = 'https://elink.mbandt.com/Pbi1961.asp?WCI=RemoteLogin&Rt=072402157&LogonBy=connect3&PRMACCESS=account';

        document.forms[0].AccessIDVisible.value = "";
        document.forms[0].submit();
    } else {
        alert("\n Please enter a valid Access ID.  Thank you!\n\n\t"); 
    }		
}

function LoginAutoPostBack(clientID, event){
	if ( typeof( document.getElementById ) != 'undefined' ) {
		var b = document.getElementById(clientID);
		if(event.keyCode == 13){
			event.cancel = true;
			event.returnValue=false;
			b.click();
		}
	}
}

function hidePasswordRow() {
	var passwordRow = document.getElementById("passwordRow")
	if(passwordRow)	passwordRow.style.display = "none";
}

function showPasswordRow() {
	var passwordRow = document.getElementById("passwordRow")
	if(passwordRow)	passwordRow.style.display = "block";
}       

function toggleLayer(whichLayer){
    document.getElementById("lpl_panel").style.display = 'none';
    document.getElementById("lbl_panel").style.display = 'none';
    document.getElementById("lwl_panel").style.display = 'none';
                    
    if (document.getElementById){
    
        // this is the way the standards work
        var style2 = document.getElementById(whichLayer).style;
        style2.display = style2.display? "":"block";
    }else if (document.all){
        // this is the way old msie versions work
        var style2 = document.all[whichLayer].style;
        style2.display = style2.display? "":"block";
    }else if (document.layers){
        // this is the way nn4 works
        var style2 = document.layers[whichLayer].style;
        style2.display = style2.display? "":"block";
    }
}