function Trim(TRIM_VALUE){
if(TRIM_VALUE.length < 1){
return"";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){
return "";
}
else{
return TRIM_VALUE;
}
} //End Function

function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length < 0){
return"";
}
var iTemp = v_length -1;

while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;

} //End While
return strTemp;

} //End Function

function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length < 1){
return"";
}
var v_length = VALUE.length;
var strTemp = "";

var iTemp = 0;

while(iTemp < v_length){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function

function change_size(whatstyle) {	
	 document.getElementById('button_small').src="images/textsizer.png";
	 document.getElementById('button_medium').src="images/img3.png";
	 document.getElementById('button_large').src="images/img4.png";
	 document.getElementById('current_style').href="css/zs_fonts_"+whatstyle+".css";
	// alert(document.getElementById('current_style').href);
	 set_size_button(whatstyle);
}

function set_size_button(new_style) {
 	document.getElementById('button_'+new_style).src="images/"+new_style+"_1.jpg";
}
//drop down refresh
var firstselect;
function resetOptionList(what) {
    if (firstselect=='yes') {
        document.getElementById(what).selectedIndex=0;
        firstselect='no';
    }
    if (document.getElementById(what).selectedIndex!=0) firstselect='yes';
}
//form submission without setting any parameter
function submitForm(aform_name){
		var aform = document.getElementById(aform_name);
		aform.submit();
}
//open links
function openlink(aform_name,url){
	var aform = document.getElementById(aform_name);
	aform.action=url;
	if(url == 'http://isecurity.zenithsecuritiesng.com/symbols/'){
		aform.target="_blank";
	}
	if(url == 'adps_login.html'){
		aform.target="_blank";
	}
	aform.submit();
}
//Mouse Overs effects
function changeImage(obj,url){
	//obj.src="http://"+domain+url;
}
function setTextColor(obj,color){
	obj.style.color=color;
}
function setBackgroundColor(obj,color){
	obj.style.backgroundColor=color;
}
function setTopBorderColorAndSize(obj,color,size){
	//alert(obj);
	obj.style.borderTopStyle="solid";
	obj.style.borderTopWidth="1px";
	obj.style.borderTopColor=color;
}
function setRightBorderColorAndSize(obj,color,size){
	//alert(obj);
	obj.style.borderRightStyle="solid";
	obj.style.borderRightWidth="1px";
	obj.style.borderRightColor=color;
}
function setDivHeight(divobj1,divobj2){
	//alert(divobj2.style.height);
	//divobj1.style.top = divobj2.style.height;
}
function spaceOutChars1px(obj){
	//alert(obj.style.textTransform);
	//obj.style.fontWeight = "bold";
	//alert(obj.style.fontSize);
	obj.style.letterSpacing = "1px";
}
function unSpaceOutChars1px(obj){
	//alert(obj.style.textTransform);
	//obj.style.fontWeight = "normal";
	obj.style.letterSpacing = "0px";
}
function focusAndClearTextBox(obj){
	//alert('good');
	obj.value = "";
	obj.focus();
	//alert('bad');
}
function b_focus(obj, color){
	obj.style.backgroundColor = color;
}
function b_defocus(obj, color){
	obj.style.backgroundColor = color;
}
function prevent_link_underline(obj){
	//alert(obj);
	obj.style.color = '#ef0000';
}
/*
Check required form elements script-
By JavaScript Kit (http://javascriptkit.com)
Over 200+ free scripts here!
*/

function validateLoginForm(frmobj){
	if(frmobj.email.value==""){ 
		alert("please provide user name");
		frmobj.email.focus();
		return false;
		//frmobj.reset();
	}else{
		if(frmobj.password.value==""){ 
			alert("please provide password");
			frmobj.password.focus();
			return false;
		}else{
			return true;
		}
	}
}

function validateLocationsSearch(frmobj){
	if(frmobj.cities.value=="Z-Please Select"){ 
		alert("please select a City/Town/State");
		frmobj.branchname.focus();
		return false;
	}else{
		frmobj.submit();
		return true;
	}
}

function validateMailMyPassword(frmobj){
	if(frmobj.email.value==""){ 
		alert("please enter your email address");
		frmobj.email.focus();
		return false;
	}else{
		frmobj.submit();
		return true;
	}
}

function suw(){
	//window.open("thankyounigeria.cfm","Welcome to Zenith Bank Site Upgrade Information","menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,menubar=no,width=310,height=420,left=400,top=600");
	window.open("http://wwww.zenithbank.com/thankyounigeria.cfm","","menubar=no,scrollbars=no,resizable=yes,location=no,status=no,menubar=no,width=310,height=420,left=400,top=500");
}

function openNewWindow(link,file){
	window.open(file,link.title,"menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,menubar=no,width=520,height=650,left=10,top=10");
}
function openNewWindowIbank(link,file){
	window.open(file,link.title,"menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,menubar=no,width=800,height=400,left=10,top=10");
}
function showDetails(person,details){
	var person = document.getElementById(person);
	var details = document.getElementById(details);
	hideAll();
	show2(person);
	show(details);
}
function showDetailsCard(card,details){
	var card = document.getElementById(card);
	var details = document.getElementById(details);
	hideAllCards();
	show2(card);
	show(details);
}
function showDetailsTelMobileBanking(comtype,details){
	var comtype = document.getElementById(comtype);
	var details = document.getElementById(details);
	hideAllTelMobileBanking();
	show2(comtype);
	show(details);
}
function showDetailsInternetBanking(looks,details){
	var looks = document.getElementById(looks);
	var details = document.getElementById(details);
	hideAllInternetBanking();
	show2(looks);
	show(details);
}
function show(obj){
	
	obj.style.display='block';
}
function show2(obj){
	obj.style.backgroundColor='#cccccc';
}
function showAnswer(answerId){
	document.getElementById(answerId).style.display='block';
}
function hideAnswer(answerId){
	document.getElementById(answerId).style.display='none';
}
function hideAll(){
	var person = document.getElementById('jo');
	var details = document.getElementById('jo1');
	person.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	person = document.getElementById('ge');
	details = document.getElementById('ge1');
	person.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	person = document.getElementById('pa');
	details = document.getElementById('pa1');
	person.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	/*person = document.getElementById('db');
	details = document.getElementById('db1');
	person.style.backgroundColor='#ffffff';
	details.style.display='none';*/
	
	person = document.getElementById('eia');
	details = document.getElementById('eia1');
	person.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	person = document.getElementById('ai');
	details = document.getElementById('ai1');
	person.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	person = document.getElementById('au');
	details = document.getElementById('au1');
	person.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	person = document.getElementById('py');
	details = document.getElementById('py1');
	person.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	person = document.getElementById('ue');
	details = document.getElementById('ue1');
	person.style.backgroundColor='#ffffff';
	details.style.display='none';
}
function hideAllCards(){
	var card = document.getElementById('mastercardb');
	var details = document.getElementById('mastercard');
	card.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	card = document.getElementById('valucardb');
	details = document.getElementById('valucard');
	card.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	card = document.getElementById('eazycardb');
	details = document.getElementById('eazycard');
	card.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	card = document.getElementById('websurferb');
	details = document.getElementById('websurfer');
	card.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	card = document.getElementById('visacardb');
	details = document.getElementById('visacard');
	card.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	card = document.getElementById('prepaidcardb');
	details = document.getElementById('prepaidcard');
	card.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	card = document.getElementById('mcucardb');
	details = document.getElementById('mcucard');
	card.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	card = document.getElementById('2020cardb');
	details = document.getElementById('2020card');
	card.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	card = document.getElementById('payrollcardb');
	details = document.getElementById('payrollcard');
	card.style.backgroundColor='#ffffff';
	details.style.display='none';

	card = document.getElementById('verifiedb');
	details = document.getElementById('verifiedcard');
	card.style.backgroundColor='#ffffff';
	details.style.display='none';
 
}
	
	
function hideAllTelMobileBanking(){
	var commtype = document.getElementById('telephonebankingb');
	var details = document.getElementById('telephonebanking');
	commtype.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	commtype = document.getElementById('mobilebankingb');
	details = document.getElementById('mobilebanking');
	commtype.style.backgroundColor='#ffffff';
	details.style.display='none';
}
function hideAllInternetBanking(){
	//var topic = document.getElementById('benefits');
	var looks = document.getElementById('benefits');
	var details = document.getElementById('benefits1');
	looks.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	looks = document.getElementById('faqs');
	details = document.getElementById('faqs1');
	looks.style.backgroundColor='#ffffff';
	details.style.display='none';
	
	looks = document.getElementById('ib');
	details = document.getElementById('ib1');
	looks.style.backgroundColor='#ffffff';
	details.style.display='none';
}
function makeHeightEqual(obj1name,obj2name){
	var obj1 = document.getElementById(obj1name);
	var obj2 = document.getElementById(obj2name);
	alert(obj1.style.height);
	obj2.style.height=obj1.style.height;
}
function clearMenuBarBorder(menubar,color){
	var obj1 = document.getElementById(menubar);
	obj1.style.borderColor=color;
	obj1.style.borderWidth='0px';
}
function unClearMenuBarBorder(menubar,color){
	var obj1 = document.getElementById(menubar);
	obj1.style.borderColor=color;
	obj1.style.borderWidth='1px';
}


/***********************************************
* Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent1{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent1(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent1")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate



/*mouseover for icons on inner pages*/
var a = new Image(); a.src = 'images/ehelp_2008.jpg';
var b = new Image(); b.src = 'images/download_2008.jpg';
var c = new Image(); c.src = 'images/faq_2008.jpg';
var d = new Image(); d.src = 'images/feedback_2008.jpg';


var e= new Image(); e.src = 'images/ehelpnew.jpg';
var f = new Image(); f.src = 'images/download.html';
var g = new Image(); g.src = 'images/faqnew.jpg';
var h = new Image(); h.src = 'images/feedbacknew.jpg';