
function getCookieValue(cookieName){var cookieValue=document.cookie;var cookieStartsAt=cookieValue.indexOf(" "+cookieName+"=");if(cookieStartsAt==-1){cookieStartsAt=cookieValue.indexOf(cookieName+"=");}
if(cookieStartsAt==-1){cookieValue=null;}else{cookieStartsAt=cookieValue.indexOf("=",cookieStartsAt)+1;var cookieEndsAt=cookieValue.indexOf(";",cookieStartsAt);if(cookieEndsAt==-1){cookieEndsAt=cookieValue.length;}
cookieValue=unescape(cookieValue.substring(cookieStartsAt,cookieEndsAt));}
return cookieValue;}
function setCookie(cookieName,cookieValue,cookiePath,cookieDomain){cookieExpires=new Date();today=cookieExpires;cookieExpires.setYear(cookieExpires.getYear()+1);cookieValue=escape(cookieValue);if(cookieExpires==""||cookieExpires==null){var nowDate=new Date();nowDate.setMonth(nowDate.getMonth()+1);cookieExpires=nowDate.toGMTString();}
if(cookiePath==""||cookiePath==null){cookiePath="";}else{cookiePath="; path="+cookiePath;}
if(cookieDomain==""||cookieDomain==null){cookieDomain="";}else{cookieDomain="; domain="+cookieDomain;}
document.cookie=cookieName+"="+cookieValue+"; expires="+cookieExpires+cookiePath+cookieDomain;}
homePgValue=getCookieValue('homePage');function validateAppNum(){var appString=document.form1.AppNumber.value;var tmp=appString.charAt(appString.length-1);if(document.form1.AppNumber.value==""){alert("Application Number is required.");return;}
else if(document.form1.AppNumber.value.length!=14){alert("Application Number must be 14 characters in length.");return;}
else if(tmp=="D"||tmp=="d"){document.form1.action="https://www.bmolending.com/b2c/english/ApplicationCentre.html";document.form1.submit();}
else if(tmp=="f"||tmp=="F"||tmp=="w"||tmp=="W"){document.form1.action="https://mortgageapply.bmo.com/webmortgage/mortgage/english/jsp/Mortgage.jsp";document.form1.submit();}
else{alert("Application number is not valid. Please re-enter.");document.form1.AppNumber.focus();}}
function imgOn(imgName){if(document.images){document.images[imgName].src=eval(imgName+"on.src");}}
function imgOff(imgName){if(document.images){document.images[imgName].src=eval(imgName+"off.src");}}
function loadFramesBS(form){myPick=form.bsSelect.options[form.bsSelect.selectedIndex].value;if(myPick!="default"){window.parent.location=myPick;}}
function loadFramesIS(form){myPick=form.isSelect.options[form.isSelect.selectedIndex].value;if(myPick!="default"){window.parent.location=myPick;}}
function loadFramesSB(form){myPick=form.sbSelect.options[form.sbSelect.selectedIndex].value;if(myPick!="default"){window.parent.location=myPick;}}
function loadFramesCO(form){myPick=form.coSelect.options[form.coSelect.selectedIndex].value;if(myPick!="default"){window.parent.location=myPick;}}
function openSitemap(){top.name="mainWindow";popup=window.open('site_map.html','popup','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=518,height=318');if(navigator.appVersion.substring(0,1)!='2'){popup.focus()}}
function new_window_count(new_url){window.parent.location="http://www.bmo.com/cgi-bin/count/counter?count_url="+new_url+"&action=plus";}
function create(){this.width=''
this.height=''
this.src=''
this.href=''
this.border=''}
var maxIndex=1;ads=new Array()
for(var i=0;i<=maxIndex;i++){ads[i]=new create()}
ads[0].width="468"
ads[0].height="60"
ads[0].src="/vgn/images/portal/SYSTEM (Site)_84/BMO (Site)_3102/PCCG (Site)_3201/Mortgages (Site)_3550/Mortgages Files_14811/18727mortgage_1b.gif"
ads[0].href="http://www.bmo.com/mortgage/products/four_percent.html"
ads[0].border="0"
ads[1].width="468"
ads[1].height="60"
ads[1].src="/vgn/images/portal/SYSTEM (Site)_84/BMO (Site)_3102/PCCG (Site)_3201/Mortgages (Site)_3550/Mortgages Files_14811/18742mortgage_dude.gif"
ads[1].href="http://www.bmo.com/mortgage/products/six_year.html"
ads[1].border="0"
var n=Math.round(Math.random()*maxIndex)
var image=ads[n]
var ad=""
ad+='<a href="'+image.href+'" \n'
ad+='onMouseOut="self.status=\'\'"> \n'
ad+='<img src="'+image.src+'" width='+image.width
ad+='\n height='+image.height+' border='+image.border
ad+='\n></a>'
function vbiPopup(myUrl){window.open(myUrl,'vbiPopup',' toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=775,height=480');}
function customPopup(url,features){window.open(url,'',features);}
function openWindow(whereto,whoami){top.name="mainwindow";self.name="spawningWindow";popup=window.open(whereto,whoami,"width=790,height=550,top=30,left=100,scrollbars=1,toolbar=1,status=1,resizable=1,menubar=1,location=1,directories=1");}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function openContact(path)
{top.name="mainWindow"
myPopup=window.open(path+"contactus/selfserv.html",'myPopup',' toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,width=772,height=450');if(navigator.appVersion.substring(0,1)>='3')
{myPopup.focus()}}
if(window!=top){var locationURL=top.location.href;if(locationURL.indexof("vgn-ext-links")==-1){top.location.href=location.href;}}
function NewWindow(mypage,myname,w,h,scroll){var winl=(screen.width-w)/2;var wint=(screen.height-h)/2;winprops='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+''
win=window.open(mypage,myname,winprops)
if(parseInt(navigator.appVersion)>=4){win.window.focus();}}
function noCache() {var now = new Date();var result = now.getTime();return result;}
function mediaTrack(itemURL, linkmeta, opener){var baseURL = itemURL;var pixelID = document.getElementById("omnitag1");pixelID.src = "https://csvt002.harrisbank.com/harrisbank/zag2.gif?log1=&linkmeta="+linkmeta+"&num="+noCache(); if (opener == "yes"){window.open(baseURL);}else{window.location.href = baseURL;}}
