$(document).ready(function(){
/*Defect 107: Added null check before using the veribale*/
var hashObject=location.hash;var hashString=hashObject.toString();var hashSubString=hashString.substring(1);var linkableItemRef='#linkableItem_'+hashSubString;$(linkableItemRef).show();if(typeof(newsList)!="undefined" && newsList.length>0){var currentNewsListPos=0;var headline_interval;var newsListSize=newsList.length;function populateNewsDiv()
{$("#newsTitle").text(newsList[currentNewsListPos].newsTitle);$("#newsDate").text(newsList[currentNewsListPos].newsDate);$("#newsAbstract").text(newsList[currentNewsListPos].newsAbstract);var newsDetailPage=newsList[currentNewsListPos].newsDetailPage;var locationString="/ub/web/who-we-are/news-detail?content.nodePath="+newsDetailPage;var anchorLocation=(locationString+"article"+currentNewsListPos.toString());$("#newsTitle").attr({href:locationString});}
populateNewsDiv();function previousNewsItem(){if(currentNewsListPos==0){currentNewsListPos=newsListSize-1;}
else{currentNewsListPos--;}
populateNewsDiv();}
function nextNewsItem(){if(currentNewsListPos<(newsListSize-1)){currentNewsListPos++;}
else{currentNewsListPos=0;}
populateNewsDiv();}
function headline_rotate(){nextNewsItem();}
$("#prevNewsItem").click(function(){previousNewsItem();});$("#nextNewsItem").click(function(){nextNewsItem();});headline_interval=setInterval(headline_rotate,5000);$(".ddNewsContent").hover(function(){clearInterval(headline_interval);},function(){headline_interval=setInterval(headline_rotate,5000);});}
var currentWebisodePos=0;if($("#hWebisodeArrayPos").val()!="")
{}
/*Defect 107: Added null check before using the veribale.Start*/
if(typeof(webisodeList)!="undefined"){
        webisodeListSize=webisodeList.length;
}
/*Defect 107: Added null check before using the veribale.End*/
populateMoneyBoxDiv();$("#prevMoneyBoxItem").click(function(){previousMoneyBoxItem();});$("#nextMoneyBoxItem").click(function(){nextMoneyBoxItem();});function nextMoneyBoxItem(){if(currentWebisodePos==0){currentWebisodePos=webisodeListSize-1;}
else{currentWebisodePos--;}
populateMoneyBoxDiv();}
function previousMoneyBoxItem(){if(currentWebisodePos<(webisodeListSize-1)){currentWebisodePos++;}
else{currentWebisodePos=0;}
populateMoneyBoxDiv();}
/*Defect 107: Added null check before using the veribale.*/
function populateMoneyBoxDiv(){if(typeof(webisodeList)!="undefined" && webisodeList[currentWebisodePos]!=undefined){$("#webisodeId").text(webisodeList[currentWebisodePos].webisodeId);$("#webisodeIntroPassage").text(webisodeList[currentWebisodePos].webisodeIntroPassage);$("#webisodePoint3").text(webisodeList[currentWebisodePos].webisodePoint3);if(webisodeList[currentWebisodePos].webisodePoint1==undefined||webisodeList[currentWebisodePos].webisodePoint1.length==0)
{$("#webisodePoint4").hide();}
else
{$("#webisodePoint1").show();$("#webisodePoint1").text(webisodeList[currentWebisodePos].webisodePoint1);}
if(webisodeList[currentWebisodePos].webisodePoint2==undefined||webisodeList[currentWebisodePos].webisodePoint2.length==0)
{$("#webisodePoint2").hide();}
else
{$("#webisodePoint2").show();$("#webisodePoint2").text(webisodeList[currentWebisodePos].webisodePoint2);}
if(webisodeList[currentWebisodePos].webisodePoint3==undefined||webisodeList[currentWebisodePos].webisodePoint3.length==0)
{$("#webisodePoint3").hide();}
else
{$("#webisodePoint3").show();$("#webisodePoint3").text(webisodeList[currentWebisodePos].webisodePoint3);}
if(webisodeList[currentWebisodePos].webisodePoint4==undefined||webisodeList[currentWebisodePos].webisodePoint4.length==0)
{$("#webisodePoint4").hide();}
else
{$("#webisodePoint4").show();$("#webisodePoint4").text(webisodeList[currentWebisodePos].webisodePoint4);}
$("#webisodeInstruction").text(webisodeList[currentWebisodePos].webisodeInstruction);var strHTML="";strHTML+="<object width='336' height='270'>\n";strHTML+="<param name='movie' value="+webisodeList[currentWebisodePos].youTubeValue+"><\/param>\n";strHTML+="<param name='allowFullScreen' value='true'><\/param>\n";strHTML+="<param name='allowscriptaccess' value='always'><\/param>\n";strHTML+="<embed src="+webisodeList[currentWebisodePos].youTubeSrc+"type='application\/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='336' height='270'><\/embed>\n";strHTML+="<\/object>\n";$(".webisodeLink").text(webisodeList[currentWebisodePos].webisodeLink);var webisodeDetailPage=webisodeList[currentWebisodePos].webisodeDetailPage;var locationString="/ub/web/money-box/money-box-detail?content.nodePath="+webisodeDetailPage;$(".webisodeLink").attr({href:locationString});}}
$("table#tdrates tbody tr:eq(0) td ").addClass("greenRowTD");
$("table#tdrates tbody tr:eq(1) td ").addClass("lightGreenRow");$(".helpArticle h3").toggle(function(){$("#"+$(this).attr("id")+" ~ div").attr({style:"display:block"});},function(){$("#"+$(this).attr("id")+" ~ div").attr({style:"display:none"});});$(".browserType").click(function(){$("#q9"+" ~ div").attr({style:"display:block"});});$("table.oddEven thead th td").css("background-color","none");$("table.oddEven tbody tr:even").css("background-color","#efefef");$("table.oddEven tbody tr:odd").css("background-color","#ffffff");$("table.oddEvenTermDeposit thead th td").css("background-color","none");$("table.oddEvenTermDeposit tbody tr:even").css("background-color","#efefef");$("table.oddEvenTermDeposit tbody tr:odd").css("background-color","#ffffff");

$("table.largeOddEven thead th td").css("background-color","none");
$("table.largeOddEven thead th").css("width","58px");
$("table.largeOddEven tbody tr:even").css("background-color","#efefef");
$("table.largeOddEven tbody tr:odd").css("background-color","#ffffff");
$("table.largeOddEven tbody tr:first").css("background-color","#004942");
$("table.largeOddEven tbody tr:first").css("color","#ffffff");
$("table.largeOddEven tbody tr:first").css("font-weight","bold");

$("table.largeOddEvenAllRates thead th").css("background-color","#004942");
$("table.largeOddEvenAllRates thead th").css("color","#ffffff");
$("table.largeOddEvenAllRates thead th").css("width","58px");
$("table.largeOddEvenAllRates tbody tr:even").css("background-color","#efefef");
$("table.largeOddEvenAllRates tbody tr:odd").css("background-color","#ffffff");

$("table.largeOddEvenLBRates thead th").css("background-color","#afcf33");
$("table.largeOddEvenLBRates thead th").css("color","#004942");
$("table.largeOddEvenLBRates thead th").css("width","58px");
$("table.largeOddEvenLBRates tbody tr:even").css("background-color","#efefef");
$("table.largeOddEvenLBRates tbody tr:odd").css("background-color","#ffffff");

$(":radio").css({background:"none",border:"none"});$(":checkbox").css({background:"none",border:"none"});$(window).load(function(){placeElement($("#topDivider"),$("#whoFeature"),700,-322);if($("#dropFAQ").hasClass("ddTitle"))
{$("#dropFAQContent").hide();}
else
{$("#dropFAQContent").show();}
if($("#dropCalc").hasClass("ddTitle"))
{$("#dropCalcContent").hide();}
else
{$("#dropCalcContent").show();}
if($("#dropNews").hasClass("ddTitle"))
{$("#dropNewsContent").hide();}
else
{$("#dropNewsContent").show();}
if($("#dropAlerts").hasClass("ddTitle"))
{$("#dropAlertsContent").hide();}
else
{$("#dropAlertsContent").show();}
if($("#dropGoalTracker").hasClass("ddTitle"))
{$("#dropGoalTrackerContent").hide();}
else
{$("#dropGoalTrackerContent").show();}
if($("#dropMoneyMatters").hasClass("ddTitle"))
{$("#dropMoneyMattersContent").hide();}
else
{$("#dropMoneyMattersContent").show();}
if($("#dropMoney").hasClass("ddTitle"))
{$("#dropMoneyContent").hide();}
else
{$("#dropMoneyContent").show();}
if($("#dropInterestRates").hasClass("ratestitleBgCollapsed"))
{$("#dropInterestRatesContent").hide();}
else
{$("#dropInterestRatesContent").show();}
if($("#goaltrackeronhome").hasClass("goalTrackerBgCollapsed"))
{$("#goalTrackerContent").hide();}
else
{$("#goalTrackerContent").show();}
if($("#dropOSCalculator").hasClass("ostitleBgCollapsed"))
{$("#dropOSCalculatorContent").hide();}
else
{$("#dropOSCalculatorContent").show();}
if($("#dropTDCalculator").hasClass("titleBgCollapsed"))
{$("#dropTDCalculatorContent").hide();}
else
{$("#dropTDCalculatorContent").show();}});$(window).resize(function(){placeElement($("#topDivider"),$("#whoFeature"),700,-322);});function placeElement(relEl,movingEl,extraX,extraY)
{if(relEl.attr("id")!=undefined)
{var xPos=(relEl.offset().left+extraX);var yPos=(relEl.offset().top+extraY);movingEl.css({left:xPos+"px",top:yPos+"px"});}}
$("ul#topNav li.active").attr({style:"background-position: 0px -70px"});$("ul#tabs li.tabActive").attr({style:"background-position: 0px -35px"});$("ul#tabsHelp li.tabActive").attr({style:"background-position: 0px -35px"});$("#buttonMagazine .active").attr({style:"background-position: 0px -35px"});$("ul#topNav li").hover(function(){$(this).attr({style:"background-position: 0px -35px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$("ul#topNav li.active").hover(function(){$(this).attr({style:"background-position: 0px -70px"});},function(){$(this).attr({style:"background-position: 0px -70px"});});$("ul#tabs li").hover(function(){$(this).attr({style:"background-position: 0px -27px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$("ul#tabsHelp li").hover(function(){$(this).attr({style:"background-position: 0px -27px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$("ul#tabs li.tabActive").hover(function(){$(this).attr({style:"background-position: 0px -27px"});},function(){$(this).attr({style:"background-position: 0px -27px"});});$("ul#tabsHelp li.tabActive").hover(function(){$(this).attr({style:"background-position: 0px -27px"});},function(){$(this).attr({style:"background-position: 0px -27px"});});$("#buttonMagazine div").hover(function(){$(this).attr({style:"background-position: 0px -35px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$(".btnMore").hover(function(){$(this).attr({style:"background-position: 0px -21px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$("#bannerApplyBtn").hover(function(){$(this).attr({style:"background-position: 0px -26px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$(".ddContent .floatL").hover(function(){$(this).attr({style:"background-position: 0px -30px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$(".ddContent .floatR").hover(function(){$(this).attr({style:"background-position: 0px -30px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$(".formStep3Btn").hover(function(){$(this).attr({style:"background-position: 0px -19px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$("#printConfirmBtn").hover(function(){$(this).attr({style:"background-position: 0px -21px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$("#downloadConfirmBtn").hover(function(){$(this).attr({style:"background-position: 0px -21px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$("#printPageBtn").hover(function(){$(this).attr({style:"background-position: 0px -21px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$("#backHomeBtn").hover(function(){$(this).attr({style:"background-position: 0px -21px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$("#btnInstall").hover(function(){$(this).attr({src:"../img/btnInstallOver.gif"});},function(){$(this).attr({src:"../img/btnInstall.gif"});});$("#downloadPrintedAppBtn").hover(function(){$(this).attr({style:"background-position: 0px -26px"});},function(){$(this).attr({style:"background-position: 0px 0px"});});$(".helpPreferredPhoneNumber").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">Please provide either a landline (include an area code) or a mobile phone number</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$("#helpInvestmentAmount").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">You can deposit between $10,000 and $2 million</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$("#helpChooseTerm").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">If you take out a 12-month term deposit, you can choose to have your interest paid to your chosen bank account every month, three months, six months, or at the end of the term</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$("#helpInterestPaid").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">You can decide whether the interest is paid into your chosen bank account every month, once a quarter, every 6 months or at maturity</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$("#helpMaturityInst").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">If you select 'No', we'll be in touch with you about a month before your maturity date to confirm what you want to do.</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$("#helpInvestmentAmount").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">You can deposit between $10,000 and $2 million</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$("#helpMaturity").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">Maturity help goes here.</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$("#helpDeposit").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">You can choose how you'd like to make your deposit - either BPAY, funds transfer or by cheque.</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$(".helpSecQuestion").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">We'll ask you this question to identify you when you call, so if you choose 'Other' it's important to be sure it's a question and answer that no-one else can easily guess.</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$(".helpSecAnswer").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">This is the answer to your security question that you'll need to give us when you call</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$(".helpResAddr").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">This must be your current Australian residential address, not a PO Box</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$(".helpPrevAddr").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">This must an Australian residential address, not a PO Box</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$("#helpRolloverFull").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">Rollover my full deposit (or more) at the current rate and get my Loyalty Bonus of 0.10% p.a.</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$("#helpRolloverPart").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">Rollover into another UBank Term Deposit, but with a reduced amount or different term</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$("#helpClose").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">Transfer my deposit (plus interest) to my chosen bank account and close my UBank Term Deposit</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});$(".helpSrcCode").hover(function(){var yPos=($(this).offset().top-10);var xPos=($(this).offset().left+22);$("#helpBubble").css({left:xPos+"px",top:yPos+"px"});$("#helpText").html("<p style=\"text-align:left;\">If you can see a 4 digit code on the back of your printed application form or on your downloaded application form please enter it here.</p>");$("#helpBubble").show();},function(){$("#helpBubble").hide();});var dropArrayBar=new Array($("#dropCalc"),$("#dropNews"),$("#dropFAQ"),$("#dropAlerts"),$("#dropMoneyMatters"),$("#dropMoney"))
var dropArrayContent=new Array($("#dropCalcContent"),$("#dropNewsContent"),$("#dropFAQContent"),$("#dropAlertsContent"),$("#dropMoneyMattersContent"),$("#dropMoneyContent"))
var dropInterestBar=new Array($("#dropInterestRates"),$("#dropOSCalculator"),$("#dropTDCalculator"),$("#goaltrackeronhome"))
var dropInterestContent=new Array($("#dropInterestRatesContent"),$("#dropOSCalculatorContent"),$("#dropTDCalculatorContent"),$("#goalTrackerContent"))
$("#dropCalc").click(function(){toggleFunction($(this));});$("#buttonMagazine .active").hover(function(){$(this).attr({style:"background-position: 0px -35px"});},function(){$(this).attr({style:"background-position: 0px -35px"});});$("#dropNews").click(function(){toggleFunction($(this));});$("#dropFAQ").click(function(){toggleFunction($(this));});$("#dropAlerts").click(function(){toggleFunction($(this));});$("#dropMoneyMatters").click(function(){toggleFunction($(this));});$("#dropInterestRates").click(function(){togglePerPortlet($(this),"ratestitleBg","ratestitleBgCollapsed");});$("#goaltrackeronhome").click(function(){togglePerPortlet($(this),"goalTrackerTitleBg","goalTrackerBgCollapsed");});$("#dropOSCalculator").click(function(){togglePerPortlet($(this),"ostitleBg","ostitleBgCollapsed");});$("#dropTDCalculator").click(function(){togglePerPortlet($(this),"titleBg","titleBgCollapsed");});$("#dropMoney").click(function(){toggleFunction($(this));});function toggleFunction(el)
{for(var i=0;i<dropArrayBar.length;i++)
{if((dropArrayBar[i].attr("id")!=undefined))
{if(dropArrayBar[i].attr("id")!=el.attr("id"))
{dropArrayBar[i].removeClass("ddActive");dropArrayBar[i].addClass("ddTitle");dropArrayContent[i].slideUp();}
else
{if(el.hasClass("ddActive"))
{el.removeClass("ddActive");el.addClass("ddTitle");dropArrayContent[i].slideUp();}
else
{el.removeClass("ddTitle");el.addClass("ddActive");dropArrayContent[i].slideDown();}}}}}
function togglePerPortlet(el,activeClass,inactiveClass)
{for(var i=0;i<dropInterestBar.length;i++)
{if((dropInterestBar[i].attr("id")!=undefined))
{if(dropInterestBar[i].attr("id")!=el.attr("id"))
{}
else
{if(el.hasClass(activeClass))
{el.removeClass(activeClass);el.addClass(inactiveClass);dropInterestContent[i].slideUp();if(inactiveClass=='ratestitleBgCollapsed'){$("#dropInterestRates").attr({title:document.getElementById('UBankRates:maximise').value});}else if(inactiveClass=='titleBgCollapsed'){$("#dropTDCalculator").attr({title:document.getElementById('UBankRates:maximise').value});}else if(inactiveClass=='ostitleBgCollapsed'){$("#dropOSCalculator").attr({title:document.getElementById('OSCalculator:maximise').value});}else if(inactiveClass=='goalTrackerBgCollapsed'){$("#goaltrackeronhome").attr({title:document.getElementById('GoalTracker:maximise').value});}}
else
{el.removeClass(inactiveClass);el.addClass(activeClass);dropInterestContent[i].slideDown();if(activeClass=='titleBg'){$("#dropTDCalculator").attr({title:document.getElementById('TDCalculator:minimise').value});}else if(activeClass=='ratestitleBg'){$("#dropInterestRates").attr({title:document.getElementById('UBankRates:minimise').value});}else if(activeClass=='ostitleBg'){$("#dropOSCalculator").attr({title:document.getElementById('OSCalculator:minimise').value});}else if(activeClass=='goalTrackerTitleBg'){$("#goaltrackeronhome").attr({title:document.getElementById('GoalTracker:minimise').value});}}}}}}
$("table.dottedLines tr td label").each(function(){var re=new RegExp("[0-9]+\.[0-9]+[%]");var reLambda=new RegExp("&#955;");if($(this).text().indexOf("3 months")>0)
{$(this).html("3 months <strong style=\"padding-left:10px;\">"+$(this).text().match(re)+" p.a.</strong>");}
else if($(this).text().indexOf("6 months")>0)
{$(this).html("6 months <strong style=\"padding-left:10px;\">"+$(this).text().match(re)+" p.a.</strong>");}
else if($(this).text().indexOf("9 months")>0)
{$(this).html("9 months <strong style=\"padding-left:10px;\">"+$(this).text().match(re)+" p.a.</strong>");}
else if($(this).text().indexOf("12 months")>0)
{$(this).html("12 months <strong style=\"padding-left:10px;\">"+$(this).text().match(re)+" p.a.</strong>");}});});function toggleFormDisable(checkBoxValue,elementname1,elementname2)
{if(checkBoxValue==true)
{document.getElementById(elementname1).disabled=true;document.getElementById(elementname2).disabled=true;}
else
{document.getElementById(elementname1).disabled=false;document.getElementById(elementname2).disabled=false;}}
function toggleFormDivs(inputVal,triggerVal,containerDivId)
{if(inputVal==triggerVal)
{document.getElementById(containerDivId).style.display='block';}
else
{document.getElementById(containerDivId).style.display='none';}}