// The following code is intellectual property of Ifworld, Inc.
// d/b/a/ Interface Computer Center, and may not be used without
// proper authorization. Copyright 2000 Ifworld, Inc. (501) 582-5100.




// Public Notice for loan applications
// implementation example:
// <a href="link.html" onClick="return publicNotice();">Loan Application</a></div>

function publicNotice ()
	{
	alert ("PUBLIC NOTICE\n\nIMPORTANT INFORMATION ABOUT IDENTIFICATION PROCEDURES WHEN OBTAINING A LOAN\n\nTo help the government fight the funding of terrorism and money laundering activities, Federal law requires all government program lenders to obtain, verify, and record information that identifies each person who applies for a loan under a federal government program.\n\nWhat this means for you: When you apply for a loan under a federal government program, we will ask for your name, address, date of birth, and other information that will allow us to identify you.  We may also ask to see your driver's license or other identifying documents.");
	}






var onImg = new Array();
var offImg = new Array();

// Preload images on based on a name array
//var imageDir = "http://assets.arcapital.com/graphics/";
var imageDir = graphics_url;
var imageNames = new Array('iflogo');
if (document.images) {
  for (var i = 0; i < imageNames.length; i++) {
    refName = imageNames[i];
    imgName = imageDir + refName + "_off.gif";
	imgHLName = imageDir + refName + "_on.gif";
	onImg[refName] = new Image();
	offImg[refName] = new Image();
	onImg[refName].src = imgHLName;
	offImg[refName].src = imgName;
  };
};

// Swap images on based on a name array
function imageOn(name) {
   if (document.images) {
    document.images[name].src = onImg[name].src
   };
};

// Swap images off based on a name array
function imageOff(name) {
   if (document.images) {
    document.images[name].src = offImg[name].src
   };
};



// Real Browser Detect Script
IF_NS4 = (document.layers) ? true:false;         // netscape 4
IF_IE4 = (document.all) ? true:false;            // ie4+
IF_DOM = (document.getElementById) ? true:false; // ns6 etc.



// Redirect to URL.
// Usage: onMouseEvent="getURL('URL')" 
function getURL(linkURL){window.location=linkURL};



// Expand and Collapse specific elements. 4.x browsers redirect to Optional URL.
// Usage: onMouseEvent="IF_ECMenu('Element ID turned on','Element ID turned off','Optional URL')" 
function IF_ECMenu(elemIDon,elemIDoff,linkURL){
	if(IF_DOM){
		if(elemIDon){
			e=document.getElementById(elemIDon);
			e.style.display='block';
		};
		if(elemIDoff){
			e=document.getElementById(elemIDoff);
			e.style.display='none';
		};
	} else if(IF_IE4){if(linkURL){window.location=linkURL;}else{return true;};
	} else if(IF_NS4){if(linkURL){window.location=linkURL;}else{return true;};
	};
};



// Show/Hide element. Switches visibility of the specied element.
// Usage: onMouseEvent="IF_ShowHide('Element ID','Optional hide|show')" 
function IF_ShowHide(elemID,doThis){
	if(IF_DOM){
		e=document.getElementById(elemID);
		if(doThis=='hide'){e.style.visibility='hidden';
		}else if(doThis=='show'){e.style.visibility='visible';
		}else{		
			if(e.style.visibility=='visible'){e.style.visibility='hidden';
			}else if(e.style.visibility=='hidden'){e.style.visibility='visible';
			};
		};
	}else if(IF_IE4){
		e=document.all[elemID];
		if(doThis=='hide'){e.style.visibility='hidden';
		}else if(doThis=='show'){e.style.visibility='visible';
		}else{		
			if(e.style.visibility=='visible'){e.style.visibility='hidden';
			}else if(e.style.visibility=='hidden'){e.style.visibility='visible';
			};
		};
	}else if(IF_NS4){
		e=document.layers[elemID];
		if(doThis=='hide'){e.visibility='hide';
		}else if(doThis=='show'){e.visibility='show';
		}else{		
			if(e.visibility=='show'){e.visibility='hide';
			}else if(e.visibility=='hide'){e.visibility='show';
			};
		};
	};
};



// Change browser status.
// Usage: onMouseEvent="IF_changeStatus('your message');return true;" onMouseOut="IF_unChangeStatus();return true;" 
var oldMsg;
function IF_changeStatus(msg){
	oldMsg = self.status;
	self.status=msg;
};
function IF_unChangeStatus(){self.status=oldMsg;};



// Swap this object's background color
// Usage: onMouseOver="IF_swapThisBGColor(this,'Hex color value');return true;" onMouseOut="IF_unSwapThisBGColor(this);return true;" 
var ifUnSwapColor;
function IF_swapThisBGColor(whatItIs,swapColor){
	ifUnSwapColor=whatItIs.style.backgroundColor;
	if(IF_DOM){whatItIs.style.backgroundColor=swapColor;
	}else if(IF_IE4&&whatItIsem==this){whatItIs.style.backgroundColor=swapColor;
	};
};
function IF_unSwapThisBGColor(whatItIs){
	if(IF_DOM){whatItIs.style.backgroundColor=ifUnSwapColor;
	}else if(IF_IE4&&whatItIs==this){whatItIs.style.backgroundColor=ifUnSwapColor;
	};
};


// Title: Launch PopUp window with printable content.
// Desc: Gets document.location, removes named anchors and adds HTTP_GET_VARS print layout commands to a URL in a new window.
// Usage: onEvent="printmePopup();"
function printmePopup() {
	var theURL = document.location.toString();
	var dl = document.location.toString();
	var iop = dl.indexOf('#');
	var ioq = dl.indexOf('?');

	if (iop != -1) {
		theURL = dl.substring (0, iop);
	};

	if (ioq != -1) {
		theURL = theURL + '&layout=print';
	} else {
		theURL = theURL + '?layout=print';
	};

	window.open(theURL,'printme','toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=670');
};


// Title: Launch Generic window
// Desc: Launches a named, generic window with the arguments specified below.
// Usage: onEvent="popup('theURL','windowName');"
function popup(theURL,windowName)
	{
	var openerArgs = 'scrollbars=1,toolbar=1,status=1,resizable=1,height=413,width=706';
	window.open(theURL,windowName,openerArgs);
	}



// Title: Clear values of all form elements except buttons for all forms.
// Desc: Loops through all document.forms[] and clears all cheks and values if !submit || !button || !reset.
// Usage: onEvent="clearAllForms();"
function clearAllForms () {
	// find how many forms there are in the doument
	var f = document.forms.length;
	// if there is a form...
	if (f >= 1) {
		//loop through all the forms in the document
		for (var i = 0; i < f; i++) {
			// find out how many elements there are in the form
			var el = document.forms[i].elements.length;
			// if there are elements in this form...
			if (el >= 1){
				//loop through all the elements in the form
				for (var n = 0; n < el; n++) {
					// clear all checks and values
					var e = document.forms[i].elements[n];
					if ((e.type != 'submit') && (e.type != 'button') && (e.type != 'reset')) e.value = "";
					if ((e.type == 'checkbox') || (e.type == ('radio'))) {
						if (e.checked) e.checked = false;
					};
				};
			};
		};
	};
};



// Title: Hide all form buttons.
// Desc: Loops through all document.forms[] and hides all bypes that == button || submit || reset.
// Usage: onEvent="clearAllForms();"
function disableAllFormButtons() {
	if (IF_DOM) {
		var f = document.forms.length;
		if (f >= 1) {
			for (var i = 0; i < f; i++) {
				var el = document.forms[i].elements.length;
				if (el >= 1){
					for (var n = 0; n < el; n++) {
						var e = document.forms[i].elements[n];
						if (e.type == 'button') if (IF_DOM) e.style.display = 'none';
						if (e.type == 'submit') if (IF_DOM) e.style.display = 'none';
						if (e.type == 'reset') if (IF_DOM) e.style.display = 'none';
					};
				};
			};
		};
	};
};



// Title: Form Lock/Unlock
// Desc: makes it necessarry to manually activate the form submit button to submit a form. Enter key will not work on first press. Note: Enter key will work on 2nd press.
/* Usage:
			<form name="" method="" action="" onSubmit="return formSubmit();">
			<input type="submit" value="" class="" onMouseOver="formUnlock();" onMouseOut="formLock();" onFocus="formUnlock();" onBlur="formLock();">
*/
var isFormLocked = 1; //1 == locked, 0 == unlocked
function formUnlock () {
	isFormLocked = 0;
};

function formLock () {
	isFormLocked = 1;
};

function formSubmit (whichForm) {
	if (isFormLocked == 0) {
		return true;
	} else {
		return false;
	};
};
