
var imgdir = "../../images/"

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (((browserName == "Netscape") && (browserVer >= 3)) || ((browserName =="Microsoft Internet Explorer") && (browserVer >= 4)))
{
version = "ok";
home_on = new Image(46,17);
home_on.src = imgdir + "nav-home-on.gif";

home_off = new Image(46,17);
home_off.src = imgdir + "nav-home-off.gif";

personalbanking_on = new Image(104,17);
personalbanking_on.src = imgdir + "nav-personalbanking-on.gif";

personalbanking_off = new Image(104,17);
personalbanking_off.src = imgdir + "nav-personalbanking-off.gif";

busagricultbanking_on = new Image(151,17);
busagricultbanking_on.src = imgdir + "nav-busagricultbanking-on.gif";

busagricultbanking_off = new Image(151,17);
busagricultbanking_off.src = imgdir + "nav-busagricultbanking-off.gif";

investments_on = new Image(77,17);
investments_on.src = imgdir + "nav-investments-on.gif";

investments_off = new Image(77,17);
investments_off.src = imgdir + "nav-investments-off.gif";

ourcommunity_on = new Image(94,17);
ourcommunity_on.src = imgdir + "nav-ourcommunity-on.gif";

ourcommunity_off = new Image(94,17);
ourcommunity_off.src = imgdir + "nav-ourcommunity-off.gif";

loancenter_on = new Image(77,17);
loancenter_on.src = imgdir + "nav-loancenter-on.gif";

loancenter_off = new Image(77,17);
loancenter_off.src = imgdir + "nav-loancenter-off.gif";

aboutolb_on = new Image(71,17);
aboutolb_on.src = imgdir + "nav-aboutolb-on.gif";

aboutolb_off = new Image(71,17);
aboutolb_off.src = imgdir + "nav-aboutolb-off.gif";


}
else
version = "x";

function img_act(imgName)
{
if (version == "ok")
{
imgOn = eval(imgName + "_on.src");
document [imgName].src = imgOn;
}
}

function img_inact(imgName)
{
window.status = "";
 if (version == "ok")
{
imgOff = eval(imgName + "_off.src");
document [imgName].src = imgOff;
}
}

// ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE
// ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE
// ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE

function showCalc(calc)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 275)
var pHeight = (((parseInt(screen.height) / 2)) -240)
window.open(calc,"hello","width=550,height=480,left=" + pWidth + ",top=" + pHeight + ",resizable=1,scrollbars=1");

}
function tabover(howmuch)
{
var farover = '';
farover += '<img src="../images/clearpix.gif" width="' + howmuch + '" height="1" alt="" border="0">';
document.write(farover);
}

function open_apps(nameofapp)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 350)
var pHeight = (((parseInt(screen.height) / 2)) - 300)
aWindow = window.open('https://www.centerabank.com/Forms/OnlineForm.cgi?form=' + nameofapp,'application',"toolbar=0,location=0,directories=0,status=0,menubar=0,width=700,height=600,top=" + pHeight + ",left=" + pWidth + ",scrollbars=1,resizable=1,status=1");
}



//be sure to make tab names match the image names that go with the tabs...
var tabs = new Array();
tabs[0] = "home";
tabs[1] = "personalbanking";
tabs[2] = "busagricultbanking";
tabs[3] = "investments";
tabs[4] = "ourcommunity";
tabs[5] = "loancenter";
tabs[6] = "aboutolb";


var on_or_off = new Array();
var on_mouse_out = new Array();

for (var i = 0; i < tabs.length; i++)
	{
	if (parent.whichlit == tabs[i])
		{
		on_or_off[i] = 'on';
		on_mouse_out[i] = '';
		}
	else
		{
		on_or_off[i] = 'off';
		on_mouse_out[i] = 'onMouseOut="img_inact(\'' + tabs[i] + '\');"';
		}		
	//alert(' tab= ' + tabs[i] + '\n onoroff= ' + on_or_off[i] + '\n onmouseout= ' + on_mouse_out[i]);
	}


function makeMainNav()
{
var mainnav=""

//--------------------------------HOME TAB GOES HERE--------------------------------

mainnav+='<a href="../frame_set/home.html" target="_top" onMouseOver="img_act(\'home\'); window.status=\'Home\'; javascript:changetext(content[1]); return true"  ' + on_mouse_out[0] + '><img src="../../images/nav-home-' + on_or_off[0] + '.gif" width="46" height="17" alt="Home" border="0" name="home"></a>';

//--------------------------------PERSONAL TAB GOES HERE--------------------------------

mainnav+='<a href="../frame_set/personal.html" target="_top" onMouseOver="img_act(\'personalbanking\'); window.status=\'Personal Banking\'; javascript:changetext(content[2]); return true" ' + on_mouse_out[1] + '><img src="../../images/nav-personalbanking-' + on_or_off[1] + '.gif" width="104" height="17" alt="Personal Banking" border="0" name="personalbanking"></a>';

//----------------------------------BUSINESS TAB GOES HERE--------------------------------

mainnav+='<a href="../frame_set/business.html" target="_top" onMouseOver="img_act(\'busagricultbanking\'); window.status=\'Business and Agricultural Banking\'; javascript:changetext(content[3]); return true"  ' + on_mouse_out[2] + '><img src="../../images/nav-busagricultbanking-' + on_or_off[2] + '.gif" width="151" height="17" alt="Business and Agricultural Banking" border="0" name="busagricultbanking"></a>';

//----------------------------------INVESTMENTS TAB GOES HERE--------------------------------

mainnav+='<a href="../frame_set/investments.html" target="_top" onMouseOver="img_act(\'investments\'); window.status=\'Investments\'; javascript:changetext(content[4]); return true"  ' + on_mouse_out[3] + '><img src="../../images/nav-investments-' + on_or_off[3] + '.gif" width="77" height="17" alt="Investments" border="0" name="investments"></a>';

//----------------------------------OUR COMMUNITY TAB GOES HERE--------------------------------

mainnav+='<a href="../frame_set/community.html" target="_top" onMouseOver="img_act(\'ourcommunity\'); javascript:changetext(content[5]); window.status=\'Our Community\'; return true"  ' + on_mouse_out[4] + '><img src="../../images/nav-ourcommunity-' + on_or_off[4] + '.gif" width="94" height="17" alt="Our Community" border="0" name="ourcommunity"></a>';

//----------------------------------LOAN CENTER TAB GOES HERE--------------------------------

mainnav+='<a href="../frame_set/loans.html" target="_top" onMouseOver="img_act(\'loancenter\'); javascript:changetext(content[6]); window.status=\'Loan Center\'; return true"  ' + on_mouse_out[5] + '><img src="../../images/nav-loancenter-' + on_or_off[5] + '.gif" width="77" height="17" alt="Loan Center" border="0" name="loancenter"></a>';

//----------------------------------ABOUT OLB TAB GOES HERE--------------------------------

mainnav+='<a href="../frame_set/about.html" target="_top" onMouseOver="img_act(\'aboutolb\'); javascript:changetext(content[7]); window.status=\'About OLB\'; return true" ' + on_mouse_out[6] + '><img src="../../images/nav-aboutolb-' + on_or_off[6] + '.gif" width="71" height="17" alt="About OLB" border="0" name="aboutolb"></a>';

//----------------------------------COMMUNITY LINKS TAB GOES HERE-------------------


return (mainnav);
}

function delCookie (NameOfCookie) 
{

// The function simply checks to see if the cookie is set.
// If so, the expiration date is set to Jan. 1st 1970.

if (getCookie(NameOfCookie)) {
document.cookie = NameOfCookie + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
} 

function getCookie(NameOfCookie)
{

// First we check to see if there is a cookie stored.
// Otherwise the length of document.cookie would be zero.

if (document.cookie.length > 0) 
{ 

// Second we check to see if the cookie's name is stored in the
// "document.cookie" object for the page.

// Since more than one cookie can be set on a
// single page it is possible that our cookie
// is not present, even though the "document.cookie" object
// is not just an empty text.
// If our cookie name is not present the value -1 is stored
// in the variable called "begin".

begin = document.cookie.indexOf(NameOfCookie+"="); 
if (begin != -1) // Note: != means "is not equal to"
{ 

// Our cookie was set. 
// The value stored in the cookie is returned from the function.

begin += NameOfCookie.length+1; 
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); } 
}
return null; 

// Our cookie was not set. 
// The value "null" is returned from the function.

}

function setCookie(NameOfCookie, value, expiredays) 
{

// Three variables are used to set the new cookie. 
// The name of the cookie, the value to be stored,
// and finally the number of days until the cookie expires.
// The first lines in the function convert 
// the number of days to a valid date.

var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

// The next line stores the cookie, simply by assigning 
// the values to the "document.cookie" object.
// Note the date is converted to Greenwich Mean time using
// the "toGMTstring()" function.

document.cookie = NameOfCookie + "=" + escape(value) + 
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

