


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.bankofireland.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 Life","http://www.bankofirelandlife.ie")
addQuickLink("BoI Mortgages","/personal/borrowing/mortgages/index.html")
addQuickLink("BoI Securities Services","http://www.boiss.ie")
addQuickLink("Branch Network","http://www.bankofireland.ie/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","http://www.bankofireland.com/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("http:") == -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 echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Please enter a valid email address eg. yourname@company.com")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter a valid email address eg. yourname@company.com")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter a valid email address eg. yourname@company.com")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid email address eg. yourname@company.com")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid email address eg. yourname@company.com")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid email address eg. yourname@company.com")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please enter a valid email address eg. yourname@company.com")
		    return false
		 }
		 
                 document.MainForm.submit.disabled=false;
 		 return true	
		 				
	}

function ValidateForm(){
	var emailID=document.MainForm.Email
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }


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 isNumber(inputStr) {
    for (var i = 0; i < inputStr.length; i++) {
        var oneChar = inputStr.substring(i, i + 1)
        if (oneChar < "0" || oneChar > "9") {
            alert("Please ensure the telephone details are numbers only, with no spaces,dashes or brackets.")
            return false
        }
    }
    return true
}
function test()
{
//alert("inside test");
}

function checkIt(objInput) {
//alert(inputStr);
   // var inputStr1 = inputStr.value;
//alert("inside check it method "+inputStr);

    if (isNumber(objInput.value)) {
        // statements if true
    } else {
        //alert("test"+document.getElementById('Telephone'));
document.getElementById('Telephone').focus();
	//document.MainForm.objInput.focus();
        //document.MainForm.objInput.select();

}
}

function checkIt2(objInput) {
    //inputStr = MainForm.Work_phone.value
    if (isNumber(objInput.value)) {document.MainForm.submit.disabled=false;
        // statements if true
    } else {
document.getElementById('work_tel').focus();
        //MainForm.Work_phone.focus()
        //MainForm.Work_phone.select()

}
}

function checkIt3(form) {

   if (document.MainForm.AccNumber.value.length < 8 || document.MainForm.AccNumber.value.length > 8){
alert("You account number must contain 8 digits");
document.MainForm.AccNumber.focus();
document.MainForm.submit.disabled=false;
return (false);}


// only allow numbers to be entered
var checkOK = "0123456789";
var checkStr = MainForm.AccNumber.value;
var allValid = true;
var allNum = "";
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter numbers only in this field");
MainForm.AccNumber.focus();
document.MainForm.submit.disabled=false;
return (false);
}

}

function checkIt4(form) {
   if (document.MainForm.Accept_Terms.value == 'No' ){
alert("You must accept our Terms & Conditions in order to register");
document.MainForm.Accept_Terms.focus();
return (false);}
else{
document.MainForm.submit.disabled=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")) {

					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") && (form.elements[i].id!="over18") && (form.elements[i].id!="guardian_name") && (form.elements[i].id!="guardian_phone") && (form.elements[i].id!="guardian_address") && (form.elements[i].id!="work_tel") ) {
		alertText+=replace(count+": "+form.elements[i].name+":\n");
		count++;
		}
	}
	if (alertText=="Please fill in the following fields:\n--------------------------------------------------------------------------------\n") {
		document.MainForm.submit.disabled=true;
		return true;
	}
	else {
		alert(alertText+"\n--------------------------------------------------------------------------------\n");
		document.MainForm.submit.disabled=false;
		return false;
	}
}

function jsf_checkdate(inputdate){
	// check date is in the correct format

	var bln_returnres = true;

	if (inputdate != null){
		var pos1, pos2;
		var indate = inputdate.value;
		refstring = '1234567890./';
		for (count=0; count < indate.length; count++){
			tempchar = indate.substring(count, count+1);
			if (refstring.indexOf(tempchar, 0)==-1)
				break;
		}

		pos1 = indate.indexOf('.');
		if (pos1==-1)
			pos1 = indate.indexOf('/');
		if (pos1==1){
			tempchar = '0';
			indate=tempchar.concat(indate);
			pos1=2;
			count++;
		}

		pos2 = indate.indexOf('.', pos1+1);
		if (pos2==-1)
			pos2 = indate.indexOf('/', pos1+1);
		if (pos2==4)
		{
			tempchar = '0';
			tempchar=(indate.substring(0,3)).concat(tempchar);
			indate=tempchar.concat(indate.substring(3,indate.length));
			pos2=5;
			count++;
		}

		if (( indate.length != 10) || ( pos1 != 2 ) || ( pos2 != 5 ) || (count != indate.length)){
			alert('The date you have entered is not of the format   \n\tdd/mm/yyyy');
			inputdate.focus();
			//inputdate.select();
			inputdate.value = "";
document.getElementById('date_birth').focus();		
			bln_returnres = false;
		}

		//inputdate.value = indate;
  	}
	document.MainForm.submit.disabled=false;

	return bln_returnres;

}



function popprod(wname) {
	prodwin=window.open(wname,"Item","Toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=0,width=700,height=550")
	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?hp.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 SiteStatBOL(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.BOLClickin";
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 SiteStatsecurity(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.security";
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 SiteStatmorenews(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.morenews";
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 SiteStat365BUS(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.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 SiteStatBOBUSL(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.BOLClickin";
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 SiteStatsecurityBUS(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.security";
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 SiteStatmorenewsBUS(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.morenews";
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 SiteStatFinancial(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.feature.financial";
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 SiteStatHomeInsurance(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.feature.homeinsurance";
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 SiteStatOnlineBanking(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.feature.onlineBanking";
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 SiteStat2in1(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.feature.2in1";
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 SiteStat2ndlevel(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.feature.2ndlevel";
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 SiteStatTravelIns(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.feature.travelinsurance";
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 SiteStatPOPLINK1(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.feature.poplink1";
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 SiteStatPOPLINK2(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.feature.poplink2";
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 SiteStatPOPLINK3(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?hp.feature.poplink3";
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 SiteStatPOPLINK1BUS(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.feature.poplink1";
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 SiteStatPOPLINK2BUS(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.feature.poplink2";
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 SiteStatPOPLINK3BUS(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.feature.poplink3";
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 SiteStatBusinessAdvice(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.feature.advice";
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 SiteStatBulletin(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.feature.Bulletin";
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 SiteStatcoaching(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.feature.coaching";
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 SiteStatevents(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.feature.events";
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 SiteStatOnline(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.feature.Online";
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 SiteStatgreenloan(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?bushp.feature.greenloan";
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 SiteStat365com(){
alert();
var ns_l = "http://int.sitestat.com/boigroup/boi/s?365OnlineClickinCom";
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&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 SiteStatBusLoan(){
var ns_l = "http://int.sitestat.com/boigroup/boi/s?clickout.bus.hp.busloan&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 showPopUpCC1() {
			w = window.open("https://www.bankofireland.ie/applications/creditcard_app/creditcard_app1.html","formCCWindow", "height=250,width=480,toolbar=no,scrollbars=yes,resizable=0");
			return false;
		}
	function showPopUpCC() {
			w = window.open("https://www.bankofireland.ie/applications/creditcard_app/creditcard_app.html","formCCWindow", "height=600,width=745,toolbar=no,scrollbars=yes,resizable=0");
			return false;
		}
		function showPopUpLoan() {
			w = window.open("http://www.bankofireland.ie/applications/loan_app/loan_app.html","formLoanWindow", "height=600,width=745,toolbar=no,scrollbars=yes,resizable=0");
			return false;
		}
		function showPopUpSavings() {
			w = window.open("https://www.bankofireland.ie/applications/savings_app/savings_app.html","formSavingsWindow", "height=600,width=745,toolbar=no,scrollbars=yes,resizable=0");
			return false;
		}

function showPopUpOverdraft() {
	w = window.open("https://www.bankofireland.ie/applications/overdraft_app/overdraft_app.html","formOverdraftWindow", 	"height=600,width=745,toolbar=no,scrollbars=yes,resizable=0");
	return false;
}

function showPopUpCarkTalkRules() {
	w = window.open("http://www.bankofireland.ie/includes/personal/pdfs/cardtalk_terms_conditions_0709.pdf", "formcardtalkrulesWindow", 	"height=600,width=745,toolbar=no,scrollbars=yes,resizable=0");
	return false;
}


function showPop365() {
			w = window.open("https://www.bankofireland.ie/personal/day_to_day/form_1000017.html","365onlineWindow", "height=600,width=745,toolbar=no,scrollbars=yes,resizable=1");
			return false;
		}

function showmortRates() {
			w = window.open("http://www.bankofireland.ie/includes/calculators/mortgage/dialog_mortgage_calculator_select_rate1.html","", "height=300,width=400,toolbar=no,scrollbars=yes,resizable=1");
			return false;
		}

