
<!--

function loadNonce()
{
	LoadSWFObject();
	var retrievedVal = GetNonces();       
    document.logon2.NONCE.value = retrievedVal;
    var machineAttr = GetClientParameters();
    document.logon2.MACHINEATTR.value = machineAttr; 
}

/* *
AddWinLoadEvent( function(){
		Browser.SetUp();
});
* */

// This function is used by the Drop-down menus to go to other sites/pages.
function DropGo(formNameIn, selNameIn) {
	var holdDomRef = eval("window.document." + formNameIn + "." + selNameIn);

	if (holdDomRef.options[holdDomRef.selectedIndex].value != "") {
		window.location.href = holdDomRef.options[holdDomRef.selectedIndex].value;
	}
}

/* *  Think this can all be commented-out
function logBrowserInfo(loginCounter) {
		var holdInfo = "Login timeout. Browser details:  ";
		holdInfo += "   userAgent:" + Browser.userAgent;
		holdInfo += ";  platform:" + Browser.platform;
		holdInfo += ";  name:" + Browser.name;
		holdInfo += ";  version:" + Browser.version;
		holdInfo += ";  ieDocMode:" + Browser.ieDocMode;
		holdInfo += ";  Nbr seconds trying:" + loginCounter;
	
		var holdDomain = "<cfoutput>#cgi.server_name#</cfoutput>";
		var holdPage = "/browserInfolog.cfm";
		var holdURL = "http://" + holdDomain + holdPage;
		
		new Ajax.Request(holdURL, {   method: 'get',   parameters: {msg: holdInfo}   }); 

}
* */

        var focusFlag = "";
        var imgID = "MKTTOKEN";
        var timerid = null;
		var mySrc = null;
		var ranNbr = null;
		var attemptCount = 0;
		var imgWidthBefore = 0;
		var imgWidthAfter = 0;
		
	// ----------------------------------------------------------------------------
	// FUNCTION checkEnter(e) 
	//
	//	This function facilitates submitting the form by pressing the enter key
	//  from within any text input field. 
	// ----------------------------------------------------------------------------

		function checkEnter(e)  {//e is event object passed from function invocation
			var characterCode; // literal character code will be stored in this variable
			
			if (e && e.which) { //if which property of event object is supported (NN4)
				e = e;
				characterCode = e.which; //character code is contained in NN4's which property
			}
			else {
				if (e.keyCode == 9) { // This is the TAB key, don't go any further
					return true;
				}
				else {
					e = event;
					characterCode = e.keyCode; //character code is contained in IE's keyCode property
				}
			}
			
			if (characterCode == 13) { //if generated character code is equal to ascii 13 (if enter key)
				this.continueLogin(); // validate and subsequently submit the form
				return false;
			}
			else {
				return true;
			}
		}
		
        /* *  Beg of code to comment-out
		function startLogin() {
			attemptCount = 1;

            if (window.document.logon2.doubleclick.value != "1") {
				return false;
			}

			if (!checkInput(document.logon2)) {
				return;
			}
			
			window.document.logon2.doubleclick.value = "2";
			ranNbr = "unqRequestor=" + Math.random();
			mySrc = "<cfoutput>#https_www4#</cfoutput>/internetBanking/LoginRouter?requestCmdId=SetupImage&" + ranNbr;
			imgWidthBefore = window.document.TOKIMG.width;
			imgWidthAfter = imgWidthBefore;
            
			if (window.document.images ) {
				document.getElementById('MKTTOKEN').src = mySrc;
				window.document.TOKIMG.src = mySrc;
        	}
        	else {
        		window.document.write('<IMG BORDER="0" NAME="TOKIMG" id="MKTTOKEN" WIDTH="1" HEIGHT="1" SRC="'+mySrc+'">');
        	}
			timerid = window.setTimeout('this.waitForSession()', 0);
        }

        function waitForSession() {
            if (timerid != null) {
				window.clearTimeout(timerid);
			}
			
			if (attemptCount > 20) {
				logBrowserInfo(attemptCount);
				alert("U.S. Bank Internet Banking is Temporarily Unavailable\n\n" + "U.S. Bank Internet Banking with Bill Pay is undergoing routine maintenance updates and is unavailable.\n" + "It will be available shortly.  We apologize for any inconvenience and appreciate your patience.\n\n" + "Please try again later or call our 24-Hour Banking and Financial Sales to access your accounts:  800-US BANKS (800-872-2657)");
				window.document.logon2.doubleclick.value = "1";
				attemptCount = 0;
				return false;
			}

			imgWidthAfter = window.document.TOKIMG.width;
			var browser = new BrowserDetect();
			
			if (browser.isNS6x) {
				attemptCount += 6;
				timerid = window.setTimeout('this.continueLogin()', 6000);
			}
			else if (imgWidthAfter != imgWidthBefore) {
				this.continueLogin();
            }
            else {        
				// Wait for 1 second and try again
				timerid = window.setTimeout('this.waitForSession()', 1000);
				attemptCount++;
				return;
            }
        }
		end of code to comment-out * */
        
        function continueLogin() {
			// Call login
			var dCurrent 	= new Date();
			DCS.dcsuri		= "riblogin.cfm";
			DCS.dcsdat 		= dCurrent.getTime();
			DCS.dcsqry      = "";
			WT.ti			= "US Bank Internet Banking";
			window.document.logon2.reqcrda.value = window.document.logon2.USERID.value;
            window.document.logon2.requestCmdId.value = "VALIDATEID";
	        window.document.logon2.submit();
        }
		
		function showDefaultImg() {
			window.document.TOKIMG.src = "/images/global/spacer.gif";
		}

-->    

