


var quickLinkLabel =new Array();
var quickLinkLink =new Array();

function addQuickLink(theLabel,theLink){

	if (theLabel && theLink){
		quickLinkLabel[quickLinkLabel.length]=theLabel;
		quickLinkLink[quickLinkLink.length]=theLink;
	}


}
/*
addQuickLink("Bank of Ireland Group","http://www.boi.com/")
addQuickLink("BoI Asset Mgt","http://www.biam.ie/")
addQuickLink("BoI Finance","http://www.bif.ie/")
addQuickLink("BoI Isle of Man","http://www.boiiom.com/")
addQuickLink("BoI Mortgages","personal/borrowing/mortgages/index.html")
addQuickLink("BoI Securities Services","http://www.boiss.ie/")
addQuickLink("Branch Network","html/gws/locator/index.html")
addQuickLink("Bristol &amp; West Financial","http://www.bristol-west.co.uk/")
addQuickLink("Business &amp; Retail Banking NI","http://www.bankofireland.co.uk/")
addQuickLink("Business Banking Ireland","html/gws/business/index.html")
addQuickLink("Business Banking UK","http://www.bank-of-ireland.co.uk/")
addQuickLink("Capital Markets","html/gws/capital_markets/index.html")
addQuickLink("Corporate Communications","http://www.bankofireland.com/press_room/index.html")
addQuickLink("First Rate","http://www.bankofireland.com/about_us_new/about_the_group/our_businesses/retail_financial_services_roi/index.html")
addQuickLink("Global Markets","html/gws/capital_markets/treasury/index.html")
addQuickLink("IBI Corporate Finance","http://www.ibicorporatefinance.ie/")
addQuickLink("Insurance Business","personal/day_to_day/insurance/index.html")
addQuickLink("Iridian","http://www.iridian.com/")
addQuickLink("New Ireland","http://www.newireland.ie/")
addQuickLink("NIIB","http://www.niibfinance.com/")
addQuickLink("Northridge","http://www.northridgefinance.com/")
addQuickLink("Personal Lending UK","http://www.bank-of-ireland.co.uk/")
addQuickLink("Personal Lending","personal/index.html")
addQuickLink("Private Banking","http://www.privatebanking.ie/")
*/

function init() {
	//populateDropDown()
}

window.onload = init;


function populateDropDown(){

	selectObject=document.getElementById("group_a");
	selectObject.options.length = 0;

	for (var i = 0; i < quickLinkLabel.length; i++) {
		var option = document.createElement('option');
		option.setAttribute('value',quickLinkLink[i]);
		option.appendChild(document.createTextNode(quickLinkLabel[i]));
		selectObject.appendChild(option);
	}
}




//Function called with onsubmit
//the select dropdown is expected to be called "href"
function redirectToQuicklinkUrl(formObj) {
	if (formObj.href) {
		if (formObj.href.options) {
			if (formObj.href.options[formObj.href.selectedIndex].value!="") {
				if (formObj.href.options[formObj.href.selectedIndex].value.indexOf("index.html") == -1) {
					document.location.href=formObj.href.options[formObj.href.selectedIndex].value;
				} else {
					openPopWindow(formObj.href.options[formObj.href.selectedIndex].value,"","");
				}
			}
		}
	}
	return false;
}

function openPopWindow(windowUrl, windowIdentifier, windowProperties) {
	var nWindow = window.open(windowUrl, windowIdentifier, windowProperties);
}




/*function checkForm(form) {
var count=1;
alertText="Please fill in the following fields:\n--------------------------------------------------------------------------------\n";
	for (var i=0; i<form.elements.length; i++) {
	  	if ((form.elements[i].value=="") &&(form.elements[i].type!="select")) {

					alertText+=replace(count+": "+form.elements[i].name+":\n");
					count++;
		}
	}
	if (alertText=="Please fill in the following fields:\n--------------------------------------------------------------------------------\n") {
		return true;
	}
	else {
		alert(alertText+"\n--------------------------------------------------------------------------------\n");
		return false;
	}
}*/
function checkForm(form) {
var count=1;
alertText="Please fill in the following fields:\n--------------------------------------------------------------------------------\n";
	for (var i=0; i<form.elements.length; i++) {
	  	if ((form.elements[i].value=="") &&(form.elements[i].type!="select") && (form.elements[i].name!="Email_Address")&& (form.elements[i].name!="extension")&& (form.elements[i].name!="evening_tel_no")&& (form.elements[i].name!="homeaddressline3")&& (form.elements[i].id!="eru_name")&& (form.elements[i].id!="eru_surname")&& (form.elements[i].id!="eru_companyname")&& (form.elements[i].id!="eru_address")&& (form.elements[i].id!="eru_towncity")&& (form.elements[i].id!="eru_county")&& (form.elements[i].id!="eru_country")) {
		alertText+=replace(count+": "+form.elements[i].name+":\n");
		count++;
		}
	}
	if (alertText=="Please fill in the following fields:\n--------------------------------------------------------------------------------\n") {
		return true;
	}
	else {
		alert(alertText+"\n--------------------------------------------------------------------------------\n");
		return false;
	}
}


function popprod(wname) {
	prodwin=window.open(wname,"Item","Toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=0,width=650,height=500")
	setTimeout('prodwin.focus()',500);
}



function replace(str) {
var ret="";
	for (var i=0; i<str.length; i++) {
		if (str.charAt(i)!="_") {
			ret+=str.charAt(i);
		}
		else {
			ret+=" ";
		}
	}
return ret;
}


function SiteStat365(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?365OnlineClickin";
ns_l+="&ns__t="+(new Date()).getTime();ns_pixelUrl=ns_l;
var netstatImage = document.createElement("<img src='"+ns_l+"' width='1' height='1' alt=''>");
document.body.appendChild(netstatImage);
return true;
}


function SiteStatLife(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?clickout.BOILIFE&amp;ns_type=clickout";
ns_l+="&ns__t="+(new Date()).getTime();ns_pixelUrl=ns_l;
var netstatImage = document.createElement("<img src='"+ns_l+"' width='1' height='1' alt=''>");
document.body.appendChild(netstatImage);
return true;
}



	function showPopUpCC() {
			w = window.open("applications/creditcard_app/creditcard_app.html","formCCWindow", "height=600,width=745,toolbar=no,scrollbars=yes,resizable=0");
			return false;
		}
		function showPopUpLoan() {
			w = window.open("applications/loan_app/loan_app.html","formLoanWindow", "height=600,width=745,toolbar=no,scrollbars=yes,resizable=0");
			return false;
		}
		function showPopUpSavings() {
			w = window.open("applications/savings_app/savings_app.html","formSavingsWindow", "height=600,width=745,toolbar=no,scrollbars=yes,resizable=0");
			return false;
		}
