function Toggle(item)
{
obj=document.getElementById(item);
visible=(obj.style.display!="none")
if (visible)
{obj.style.display="none";}
else
{obj.style.display="block";}
}


function Expand()
{
divs=document.getElementsByTagName("DIV");
for (i=0;i<divs.length;i++) {
divs[i].style.display="block";
key=document.getElementById("x" + divs[i].id);
}
}

function Collapse()
{
divs=document.getElementsByTagName("DIV");
for (i=0;i<divs.length;i++) {
divs[i].style.display="none";
key=document.getElementById("x" + divs[i].id);
}
}

/*****************************************************************************/
var currentLocation = "loanrates"; 
function displayLocation(location)
{if (currentLocation !== "")
{document.getElementById(currentLocation).style.display = "none";}
document.getElementById(location).style.display = "block";
currentLocation = location;
}
function displayBlock(location)
{if (currentLocation !== "")
{document.getElementById(currentLocation).style.display = "none";}
document.getElementById(location).style.display = "block";
currentLocation = location;
}

/*****************************************************************************/
function open_apps_lsi(nameofapp)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 410)
var pHeight = (((parseInt(screen.height) / 2)) - 300)
aWindow = window.open('../en/loans_disclosure.asp','application',"toolbar=0,location=0,directories=0,status=0,menubar=0,width=820,height=600,top=" + pHeight + ",left=" + pWidth + ",scrollbars=1,resizable=1,status=1");
}

/*****************************************************************************/
//redirect to external links
function redir(theURL)
{
	var theURL = theURL;
	var redirect = "../en/redirect.asp";
	var send = redirect + "?" + theURL;
	window.open(send);
//	document.location = send;
}

/*****************************************************************************/
function showWarning(URL)
{
var content=""
content+='<HTML>';
content+='<head>';
content+='<TITLE>You are leaving our website</TITLE>';
content+='<link href="style.css" TYPE=text/css REL=stylesheet>';
content+='</style>';
content+='</HEAD>';
content+='<BODY>';
content+='<div align="center">';
content+='<table WIDTH="80%" BORDER="0" CELLSPACING="10" CELLPADDING="10">';
content+='<tr><td><H1>Third Party Site Disclaimer</H1></td></tr>';
content+='<tr><td><p>By accessing the noted link you will be leaving our website and entering a website hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, our privacy and security policies. We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than ours.</p></td></tr>';
content+='<tr><td><p align="center"><a href="'+URL+'" TARGET="_blank" ONCLICK="setTimeout(\'self.close()\',1000)">Continue</a> |  <a href="javascript:self.close()">Cancel & Return</a></p></td></tr>';
content+='</table>';
content+='</div>';
content+='</BODY>';
content+='</HTML>';

//centering popup code
outsideURL=URL;
var pWidth = (((parseInt(screen.width) / 2)) - 300);
var pHeight = (((parseInt(screen.height) / 2)) -150);
var w=screen.width;
var h=screen.height;
newwin = window.open("","newwin", "width=600,height=300,left="+pWidth+",top="+pHeight+",resizable=1,scrollbars=1");
newwin.document.write(content);
newwin.document.close();	
}	

/*****************************************************************************/
// Generic Popup Window Script (no resize)
function popup1(URL, width, height) {
popupWin = window.open(URL, 'popupWin', 'width=' + width + ',height=' + height + ',menubar=0,scrollbars=0,resizable=0');
popupWin.focus();
}

function popUp2(url) {
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}

/*****************************************************************************/
function MM_jumpMenu(targ,selObj,restore){ //v3.0
if(selObj.selectedIndex != 0){
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
}
if (restore) selObj.selectedIndex=0;
}

function validateform(loginform){
if(isAllSpaces(loginform.SignOnID.value)){
alert("Please enter your account number.");
loginform.SignOnID.focus();
return false;
}
if(isAllSpaces(loginform.Password.value)){
alert("Please enter your password.");
loginform.Password.focus();
return false;
}
loginform.action = "https://secure.lafinancial.org/LAF_50/Common/SignOn/SignOn.asp";
return true;
}  

function isAllSpaces(inputValue) {
if(inputValue.search(/^\s*$/) != -1) {
// the string contains just spaces or is empty
return true;
}
else
{
// valid input
return false;
}
}