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/small.jpg";
	 document.getElementById('button_medium').src="images/medium.jpg";
	 document.getElementById('button_large').src="images/large.jpg";
	 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.cfm'){
		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';
}
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';
}
