<!-- $Revision:   1.11  $  Project: NetTeller60 -->
<!-- ©2004 Jack Henry & Associates, Inc.  All Rights Reserved -->
<!-- hide this script from non-javascript-enabled browsers
var newWindow; //function testBrow
var customerWindow; //function OpenCustomerWindow
var ppViewPaymentDetailsWindow; //function openppViewPaymentDetails
var viewWindow; //function openViewWindow
var mailWindow; //function openSendMailwin
var loadingWindow;

var screenX, screenY;
if(navigator.appName == "Microsoft Internet Explorer") {
	screenY = window.screen.availHeight;
	screenX = window.screen.availWidth;
}
else {
	screenY = window.outerHeight;
	screenX = window.outerWidth;
}


function testBrow()
{	
	newWindow = window.open("https://www.banksafe.com/check.cfm?ProductName=<cfoutput>#UrlEncodedFormat(Request.apps.BankQuery.ProductName)#</cfoutput>", "browTest", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=350,height=350");
}

function varobject() 
{
    this.loaded = false;
}

var varHolder = new varobject();
if(document.body.onload){
	var temp_function = document.body.onload;
	//alert(temp_function);
}
document.body.onload = function(){
	varHolder.loaded = true;
	if(temp_function){
		temp_function();
	}
};


function openLoadingWindow(msg)
{
	var newWindowURL = "hbLoadingPage.cfm?message="+msg;
	varHolder.loaded = false;
	if (!TestWindowOpen(loadingWindow))		
	{
		var w = 350; //pop-up window width
		var h = 300; //pop-up window height
		var top =  screenY/2 - h/2;  //positions pop-up window in center of browser
		var left =  screenX/2 - w/2;
		loadingWindow = window.open(newWindowURL,"loadingWin","resizable=yes,scrollbars=no,top="+top+",left="+left+",height="+h+",width="+w);
	}
	else
	{
		loadingWindow.location = newWindowURL;
		loadingWindow.focus();
	}
}
	
function OpenCustomerWindow(newWindowURL) 
{
	if (!TestWindowOpen(customerWindow))		
	{
		var w = 840; //pop-up window width
		var h = 500; //pop-up window height
		var top =  screenY/2 - h/2;  //positions pop-up window in center of browser
		var left =  screenX/2 - w/2;
		customerWindow = window.open(newWindowURL,"","resizable=yes,scrollbars=yes,top="+top+",left="+left+",height="+h+",width="+w);
	}
	else
	{
		customerWindow.location = newWindowURL;
		customerWindow.focus();
	}
}
function checkforSymbols(formname,dblClickmsg) 
{
	var notdblClicked=true;
	if(dblClickmsg){
		 notdblClicked = CheckDoubleClickWithMessage(dblClickmsg);
	}
	var illchar=false;	
	
	if(notdblClicked){
		var f= document.forms[formname];
		var tempstring;
		var illegalchar = new Array('>', '<', '"');
		for(var i = 0; i< f.length; i++){
			if(f[i].type == "text"){
				tempstring = f[i].value;
				 for(var u = 0; u < illegalchar.length; u++){
				 	if (tempstring.indexOf(illegalchar[u], 0)>=0){									
						alert('Illegal character entered. The following characters are not allowed: >, <, ". Please choose another character.');
									
						f[i].focus();
						illchar=true;
						submitMsgCheck = false;		
						break;	
					}
				 }
				}
			}	
		}
		if(!notdblClicked || illchar){
			return false;
		} else {
			return true;
		}
	
}		
		
function openppViewPaymentDetails(url)
{
	if (!TestWindowOpen(ppViewPaymentDetailsWindow))		
	{
		var w = 550; //pop-up window width
		var h = 300; //pop-up window height
		var top =  screenY/2 - h/2;  //positions pop-up window in center of browser
		var left =  screenX/2 - w/2;
		ppViewPaymentDetailsWindow = window.open(url,'PaymentDetails',"resizable=no,scrollbars=no,status=yes,top="+top+",left="+left+",height="+h+",width="+w);
	}	
	else			
	{
		ppViewPaymentDetailsWindow.location = url;
		ppViewPaymentDetailsWindow.focus();
	}	
}	

function openViewWindow(url)
{
	if (!TestWindowOpen(viewWindow))
	{
		var w = 440; //pop-up window width
		var h = 400; //pop-up window height
		var top =  screenY/2 - h/2;  //positions pop-up window in center of browser
		var left =  screenX/2 - w/2;
		viewWindow = window.open(url,'viewWindow',"resizable=no,scrollbars=no,status=yes,top="+top+",left="+left+",height="+h+",width="+w);
	}
	else
	{
		viewWindow.location = url;
		viewWindow.focus();
	}
}	

function TestWindowOpen(windowhandle)
{
	if (windowhandle && windowhandle.open && !windowhandle.closed)
		return true
	else
		return false
}			

function doReset()
{
	this.reset();
}		

function openSendMailwin(mailurl,warning)
{
	if (!TestWindowOpen(mailWindow))
	{
		openMailWindow = true;
		if(warning.length > 0)
		{
			openMailWindow = confirm(warning);
		}
		if(openMailWindow)
		{
			var w = 620; //pop-up window width
			var h = 500; //pop-up window height
			var top =  screenY/2 - h/2;  //positions pop-up window in center of browser
			var left =  screenX/2 - w/2;
			mailWindow = window.open(mailurl,'sendmessage',"resizable=yes,scrollbars=yes,status=yes,top="+top+",left="+left+",height="+h+",width="+w);
		}
	}
	else
	{
		mailWindow.focus();
	}
}


function ResetSubmitButton(){
	if(submitMsgCheck){
	 submitMsgCheck = false;
	}
}


//Do not allow the user to double click the submit button as this will cause double transfers/stop payments
var submitCheck = false
function CheckDoubleClick()
{
	if (submitCheck == false)
	{
		submitCheck = true
		return true
	}
	else
	{
		alert("You have clicked the Submit button more than once for the same transaction.  After one click the Submit button is disabled to prevent double-posting.");
		return false
	}
}

//This generic version was created to not conflict with pages using the function above 
var submitMsgCheck = false
function CheckDoubleClickWithMessage(DisplayMessage)
{
	if (submitMsgCheck == false)
	{
		submitMsgCheck = true
		return true
	}
	else
	{
		alert(DisplayMessage);
		return false
	}
}	



function OpenHelp(strURL)
{
	var w = 512; //pop-up window width
	var h = 480; //pop-up window height
	var top =  screenY/2 - h/2;  //positions pop-up window in center of browser
	var left =  screenX/2 - w/2;
	helpWindow = window.open(strURL, "help", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top="+top+",left="+left+",height="+h+",width="+w);
	if (helpWindow.focus)
	{
		helpWindow.focus();
	}
}

function OpenLookup(strURL, abanumber, bankname, address1, address2)
{
	var w = 650; //pop-up window width
	var h = 480; //pop-up window height
	var top =  screenY/2 - h/2;  //positions pop-up window in center of browser
	var left =  screenX/2 - w/2;
	ABALookupWindow = window.open(strURL, "ABALookup", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yestop="+top+",left="+left+",height="+h+",width="+w);
	if (abanumber)
	{
		window.abanumber = abanumber;
	}
	if (bankname)
	{
		window.bankname = bankname;
	}
	if (address1)
	{
		window.address1 = address1;
	}
	if (address2)
	{
		window.address2 = address2;
	}
	ABALookupWindow.focus();
}

function check_date(field){
var checkstr = "0123456789";
var DateField = field;
var Datevalue = "";
var DateTemp = "";
var day;
var month;
var year;
var leap = 0;
var err = 0;
var i;
   err = 0;
   DateValue = DateField.value;
   /* Delete all chars except 0..9 */
   for (i = 0; i < DateValue.length; i++) {
	  if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
	     DateTemp = DateTemp + DateValue.substr(i,1);
	  }
   }
   DateValue = DateTemp;
 
   year = DateValue.substr(0,2);
   if (year == 0) {
      err = 20;
   }
   /* Validation of month*/
   month = DateValue.substr(2,2);
   if ((month < 1) || (month > 12)) {
      err = 21;
   }
   /* Validation of day*/
   day = DateValue.substr(0,2);
   if (day < 1) {
     err = 22;
   }
   /* Validation leap-year / february / day */
   if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
      leap = 1;
   }
   if ((month == 2) && (leap == 1) && (day > 29)) {
      err = 23;
   }
   if ((month == 2) && (leap != 1) && (day > 28)) {
      err = 24;
   }
   /* Validation of other months */
   if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
      err = 25;
   }
   if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
      err = 26;
   }
   /* if 00 ist entered, no error, deleting the entry */
   if ((day == 0) && (month == 0) && (year == 00)) {
      err = 0; day = ""; month = ""; year = "";
   }
   /* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
   if (err == 0) {
      DateField.value = day + month + year;
   }
}
//  End -->

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}



function checkfornumbers(formname,dblClickmsg) 
{
	var notdblClicked=true;
	if(dblClickmsg){
		 notdblClicked = CheckDoubleClickWithMessage(dblClickmsg);
	}
	var illchar=false;	
	
	if(notdblClicked){
		var f= document.forms[formname];
		var tempstring;
		var illegalchar = new Array('.', '<', '"', '>', '!','@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '+', '=', ':', '{', '}', '|', ';', ',', '?');
		for(var i = 0; i< f.length; i++){
			if(f[i].type == "text"){
				tempstring = f[i].value;
				 for(var u = 0; u < illegalchar.length; u++){
				 	if (tempstring.indexOf(illegalchar[u], 0)>=0){									
						alert('Illegal character entered. Please enter the date as an integer form.');									
						f[i].focus();
						illchar=true;
						submitMsgCheck = false;		
						break;	
					}
				 }
				}
			}	
		}
		if(!notdblClicked || illchar){
			return false;
		} else {
			return true;
		}
	
}		
	
function validateNumber(object_value, message)
{	
	var valequal = true;
    if (object_value.length == 0)		
	{
        valequal = true;
	}
	var number_format = "0123456789";
	var check_char;
	for (var i = 0; i < object_value.length; i++)
	{
		check_char = number_format.indexOf(object_value.charAt(i));
		if (check_char < 0)
		{
			alert(message);
			submitMsgCheck = false;
			valequal = false;
		}
	}
    return valequal;
}


// stop hiding -->