var ALLY=ALLY||{version:"0.6.1",ns:function(d){var e=d.split("."),a,c=ALLY,b;if(e[0].toUpperCase()=="ALLY"){e.splice(0,1)}a=e.length;for(b=0;b<a;b++){(!c[e[b]]&&(c[e[b]]={}));c=c[e[b]]}},init:function(){ALLY.globalDrivers.init();ALLY.util.dejargonator.initDJ();ALLY.util.enableInlinePNG24();ALLY.util.enhanceZebraTables();ALLY.util.enhanceInputButtons();ALLY.util.bindOpenAccountLinks();$("a.popup").makePopups();ALLY.ui.shadowbox.init();ALLY.util.enhanceTextResizer();ALLY.util.consoleLinks();if(ALLY.pageState.isAllyHost){var c=new RegExp(".*setredirect=(.*)[&]?","i");var b=location.search.match(c);if(b!=null&&b.length>0){var a=b[1];if(a!=""){jQuery.cookie("redirect",a,{path:"/",expires:7})}}}ALLY.globalDrivers.modalRedirectController.init()},util:{dejargonator:{prepDJ:function(a){a=a||"";$("a.dejargonator",a).hoverIntent({over:function(d){$(this).data("mouseout",false);if($(".dj-layer").length>0){$(".dj-layer").remove()}if($(this).attr("href")!=""&&$(this).attr("href")!="#"&&$(this).attr("href")!=location.href+"#"){var b=this;if(typeof $("body").data("glossaryContent")=="undefined"||$("body").data("glossaryContent")==null){var c=$(this).attr("href").split("#");var e=$.ajax({type:"GET",url:c[0]+"?type=content",success:function(f){$("body").data("glossaryContent",f);ALLY.util.dejargonator.createDJBubble(b,d)}})}else{ALLY.util.dejargonator.createDJBubble(b,d)}}},out:function(){$(this).data("mouseout",true)}}).removeAttr("title").filter('[target="_new"]').attr("target","_blank")},createDJBubble:function(b,e){if($(b).data("mouseout")!==true){var a=$('<div class="dj-layer"><div class="dj-inner"></div><div class="dj-point"></div></div>').children(".dj-inner");if($($("body").data("glossaryContent")).filter("#"+$(b).attr("href").split("#")[1]).length){a.append($($("body").data("glossaryContent")).filter("#"+$(b).attr("href").split("#")[1]));var d=a.parent();d.appendTo($("body"));var g=e.pageX-65;var f=e.pageY-d.height()+22;d.css({left:g,top:f});var c=function(){return{x:parseInt($(window).scrollLeft(),10),y:parseInt($(window).scrollTop(),10),cx:parseInt($(window).width(),10),cy:parseInt($(window).height(),10)}}();if(c.x+c.cx<g+d.width()){g=e.pageX-250;d.css({left:g+"px"}).addClass("viewport-right")}if(f-c.y<d.height()){f=e.pageY-14;d.css({top:f+"px"}).addClass("viewport-top").children(".dj-point").prependTo(d)}if(d.hasClass("viewport-top")&&d.hasClass("viewport-right")){d.addClass("viewport-both")}d.stop(true).fadeIn().mouseleave(function(h){$(this).stop(true).fadeOut("fast",function(){$(this).remove()})})}}},initDJ:function(a,b){ALLY.util.dejargonator.prepDJ();$(window).resize(function(){$(".dj-layer").remove()})}},enhanceZebraTables:function(){$("table.zebra").each(function(){$(this).find("tr").filter("tr:odd").addClass("rowa").end().filter("tr:even").addClass("rowb")})},enableInlinePNG24:function(g){var h=navigator.appVersion.split("MSIE"),j=parseFloat(h[1]);if(((j>=5.5)&&(j<7))&&(document.body.filters)){var e=g?[g]:document.images;for(var c=0;c<e.length;c++){var d=e[c],l=d.src.toUpperCase();if(l.substring(l.length-3,l.length)=="PNG"){var f=(d.id)?"id='"+d.id+"' ":"";var m=(d.className)?"class='"+d.className+"' ":"";var b=(d.title)?"title='"+d.title+"' ":"title='"+d.alt+"' ";var k="display:inline-block;"+d.style.cssText;if(d.align=="left"){k="float:left;"+k}if(d.align=="right"){k="float:right;"+k}if(d.parentElement.href){k="cursor:hand;"+k}var a="<span "+f+m+b+' style="width:'+d.width+"px; height:"+d.height+"px;"+k+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d.src+"', sizingMethod='scale');\"></span>";d.outerHTML=a}}}},enhanceInputButtons:function(a){$(a?a:"body").find(".btn-link").each(function(){var c=$(this),b=c.text()||c.attr("value"),f=(c.attr("id").length>0)?c.attr("id")+"_link":"",d=c.attr("class"),e=c.attr("href")?c.attr("href"):"#";c.addClass("btn-hide").removeClass("btn-link");c.attr({tabindex:"-1",hidefocus:"true"});$('<a href="'+e+'" id="'+f+'" class="'+d+'"><span>'+b+"</span></a>").each(function(){if(!$(this).hasClass("btn")){$(this).attr("class","btn "+$(this).attr("class"))}}).removeClass("btn-link").addClass("btn-set").insertAfter(c).click(function(){c.click();return c.attr("href")})})},bindOpenAccountLinks:function(){$(".btn_open_account").live("click",function(){var o=this,h=$(this).closest(".ui-tabs-panel"),m=(h.length>0)?h:$(this).closest("#article"),l=m.find(".calculator"),n=l[0],d=$(n.category).val(),f="INTCMPID",k=o.href.indexOf(f),g=d,e=50000,p="https://secure.ally.com/allyWebClient/customerCreation.do",c=false;if(l.length>0&&k>=0){productId=o.href.substr(k+f.length+1);if(productId.indexOf("&")>=0){productId=productId.substr(0,productId.indexOf("&"))}$('<form name="new_account_redirect" class="new_account_redirect" method="POST" action="'+p+'">						   <input type="hidden" name="'+f+'" value="'+productId+'" />	                       <input type="hidden" name="OAP" value="'+g+'" />	                       <input type="hidden" name="OAF" value="'+e+'" />						</form>').insertAfter(o);var b=$(o).siblings(".new_account_redirect"),j=b[0],a=$(n.product).val(),i=$(n.deposit).val();if(productId.indexOf("Compare")>=0||productId.indexOf("Calculator")>=0){if(d=="CD"&&a!=0){a=d+"-"+a}$(j.OAP).val(a)}if(productId.indexOf("Rates")>=0||productId.indexOf("Calculator")>=0){$(j.OAF).val(i)}c=true}if(c){b.submit();return false}else{return true}})},enhanceTextResizer:function(){$("ul#textsize-tools a").click(function(){$("ul#textsize-tools").trigger("textsizechange",[$(this).attr("id")])})},updateWebClientLinks:function(c){var b=ALLY.util.user.isLoggedIn(),d=b?/customerCreation.do/:/accountCreation.do/,a=b?"accountCreation.do":"customerCreation.do",e=b?/login.do/:/accountList.do/,f=b?"accountList.do":"login.do";$("a[href*=customerCreation.do],a[href*=accountCreation.do]",c).each(function(){$(this).attr("href",$(this).attr("href").replace(d,a))});$("#globalnav li a[href*=login.do],#globalnav li a[href*=accountList.do]",c).each(function(){$(this).attr("href",$(this).attr("href").replace(e,f))})},getNextTabbableItem:function(a){var b=null;var c=function(e){var d=$(e);d.nextAll().each(function(){var g=$(this);if(g.is(":tabbable")){b=g.get(0);return false}else{var f=g.find(":tabbable");if(f.length>0){b=f.get(0);return false}}});if(!b){c(d.parent().get(0))}};return function(){c(a);return b}()},getPreviousTabbableItem:function(a){var b=null;var c=function(e){var d=$(e);d.prevAll().each(function(){var f=$(this);if(f.is(":tabbable")){b=f.get(0);return false}else{var g=f.find(":tabbable");if(g.length>0){b=g.get(0);return false}}});if(!b){getprevTabStop(d.parent().get(0))}};return function(){c(a);return b}()},consoleLinks:function(){$("a[rel^=pc], a[rel^=PC]").each(function(a){$(this).click(function(c){var b=this.rel.split(":")[1];if(b!=""||typeof b!="undefined"){$("a#"+b).click()}return false})})},getHrefForAjax:function(c,a){var b=c.jquery?c.attr("href"):c.nodeType?$(c).attr("href"):c,d={competitorrates:{cd:"/classic-cd/competitorrates.json",ncd:"/no-penalty-cd/competitorrates.json",osav:"/online-savings-account/competitorrates.json",dda:"/checking/competitorrates.json",mmda:"/money-market-account/competitorrates.json"},productrates:{cd:"/classic-cd/productrates.json",ncd:"/no-penalty-cd/productrates.json",osav:"/online-savings-account/productrates.json",mmda:"/money-market-account/productrates.json"},calculatorrates:{cd:"/classic-cd/getcalculatorrates.json",ncd:"/no-penalty-cd/getcalculatorrates.json",osav:"/online-savings-account/getcalculatorrates.json",dda:"/checking/getcalculatorrates.json",mmda:"/money-market-account/getcalculatorrates.json"},saveprefdata:{def:"/saveprefdata.json"}};if(b in d&&!(b in Object.prototype)){return d[b][b!="saveprefdata"&&a&&a.toLowerCase()||"def"]}return b.indexOf("#")>-1?b:(b.indexOf("?")>-1?b.replace("?","?type=content&"):b+"?type=content")},getWebClientHost:function(){return"secure.ally.com"}},browser:{cookiesEnabled:(function(){var a=false,d=jQuery.cookie,b="ally_checkCookies";d(b,1);a=!!d(b);d(b,null);return a})()},globalDrivers:{resetPCTabUrls:function(a){var b=window.setInterval(function(){if(!a.find(".tabs li .tabs-loader").length){clearInterval(b);$pcCopy=a.clone();var c=$pcCopy.find(".tabs li a");a.find(".tabs li a").each(function(e){var d=this,f=$(c[e]);f.attr("href",$(d).data("load.tabs").replace("?type=content",""));f.attr("style","")});$pcCopy.find(".ui-tabs-panel").removeClass("ui-tabs-offscreen ui-tabs-minheight");a.data(a.data("consoleHref"),$pcCopy.html());$pcCopy.remove()}},25)},tabifyContentLink:function(j,i,b,l){var k=j,g=ALLY.globalDrivers.isPCActive(i,j),m=(g)?i.find(".tabs"):$("#"+b),d=(g)?m.attr("id"):b,f=(g)?"pc "+k.title.toLowerCase():k.title.toLowerCase(),a=m.find('a[title="'+f+'"]');if(a.length){var c=a.parent().index(),e=a[0],h=e.rel;m.tabs("select",c);if(!g){h=h.substr(h.indexOf(d+"=")+(d.length+1))||l;location.hash=d+"="+h}return false}return true},isPCActive:function(a,b){return(a.length>0&&a.data("active")!=null&&$(b).closest("#pc").length>0)},useTruePanelHeight:function(a){a.siblings().each(function(){$(this).removeClass("ui-tabs-minheight")});a.removeClass("ui-tabs-minheight")},manualTabSelect:function(b,a,c){$(b).siblings().each(function(){$(this).removeClass("ui-tabs-selected ui-tabs-toggled ui-state-active ui-tabs-offscreen ui-tabs-minheight")});$(a).siblings().each(function(){$(this).addClass("ui-tabs-hide")});$(b).addClass("ui-tabs-selected ui-tabs-toggled ui-state-active");$(a).removeClass("ui-tabs-hide ui-tabs-offscreen ui-tabs-minheight");if(typeof c!="undefined"){if(typeof c.showCallback!="undefined"){c.showCallback.call()}}},toggleTabState:function(b,c,a){var d=$(b).parent();if(c){d.find(".tabs-loader").remove().end().addClass("ui-tabs-toggled").siblings().removeClass("ui-tabs-toggled")}else{d.removeClass("ui-tabs-toggled")}if(typeof a=="function"){a()}},fadeInPanel:function(a){$(a).hide().removeClass("ui-tabs-offscreen").css("opacity",0.01).css("display","").fadeTo(400,1,function(){if($.browser.msie){this.style.removeAttribute("filter")}})},animateTabColor:function(c,a){ALLY.globalDrivers.animTabText=true;var d=ALLY.globalDrivers.isPCActive($("#pc"),a),e=function(){$(c).animate({color:"#bbb"},{duration:200,complete:function(){if(!ALLY.globalDrivers.animTabText){b(this)}}}).animate({color:"#006899"},{duration:800,complete:function(){if(ALLY.globalDrivers.animTabText){e()}else{b(this)}}})},b=function(f){$(f).css("color","");if($(a).hasClass("ui-tabs-offscreen")){if(!d){ALLY.globalDrivers.fadeInPanel(a)}}ALLY.globalDrivers.toggleTabState(c,true)};window.setTimeout(function(){$(c).append('<div class="tabs-loader"></div>');ALLY.globalDrivers.toggleTabState(c,false);e()},25)},initUITabs:function(b){ALLY.pageState.bind("ready",function(c){$(".tabs").not(".noinit").each(function(e,f){var g=$(f),h=g.attr("id"),d=false;g.find(">ul>li>a").ajaxifyHref().end();g.allytabs({panelContainer:".tab-content:first",load:function(i,j){try{$("#"+j.panel.id).find(".tabs > ul").remove();$(".ui-tabs-panel:has(#ctbl)").css("padding","1em 0");ALLY.util.dejargonator.prepDJ(j.panel);ALLY.util.enhanceZebraTables();ALLY.util.enhanceInputButtons(j.panel)}catch(k){}},select:function(i,j){if($(j.panel).children().length){ALLY.globalDrivers.manualTabSelect($(j.tab).parent(),j.panel);return false}g.data("allytabs").abort();g.data("allytabs").element.queue("tabs",[]);g.find("> ul li.ui-state-processing").removeClass("ui-state-processing");$(j.tab).stop();ALLY.globalDrivers.animTabText=true;ALLY.globalDrivers.animateTabColor(j.tab,j.panel)},show:function(i,j){ALLY.globalDrivers.animTabText=false;$(j.tab).stop(true,true);ALLY.globalDrivers.manualTabSelect(j.tab,j.panel);ALLY.globalDrivers.fadeInPanel(j.panel)},ajaxOptions:{error:function(){d=false;$(ui.tab).stop(true,true);g.find("> ul li.ui-state-processing").removeClass("ui-state-processing");g.data("allytabs").element.queue("tabs",[])}},selected:function(){var i=g.find("> ul:first");var j=0;if(h){j=i.find("a").index(a(h,ALLY.pageState.get(h)||"default"))}else{if(i.find("li#tab-default").length>0){j=i.find("li").index($("#tab-default"))}else{j=0}}return j}(),spinner:false,cache:true});if(h){ALLY.pageState.register({name:h,stateChange:function(i){i=i||"default";g.data("allytabs").select(a(h,i).attr("href"))}})}});$(".tabs .ui-tabs-panel:not(.localtab)").css("display","none");$(".ui-tabs-nav li").each(function(d){$(this).css("z-index",200+-(d))})});function a(d,c){return $("> ul:first a[rel=pageState:"+d+"="+c+"]","#"+d)}},setupTextSizeTools:function(){$("#textsize-tools a").click(function(){var b=$(this).attr("id").replace("textsize-","");var a="font"+b;$("body").not("."+a).removeClass("fontsmall fontmedium fontlarge").addClass("font"+b).each(function(){ALLY.prefs.set(this,"categoryCode","FONT",1);ALLY.prefs.set(this,"sitePreference","font"+b,1)});return false})},setupPrintTool:function(){$("#print").click(function(){var a=window.open("/print.html","printWin","width=700,height=550,location=0,menubar=0,status=0,scrollbars=1");return false})},fixBackgroundImgs:function(){if(jQuery.browser.msie&&jQuery.browser.version<7){try{document.execCommand("BackgroundImageCache",false,true)}catch(a){}}},externalLinks:function(){$("a[rel='external'],a[rel='fdic']").live("click",function(b){var e=$(this);var a=e.attr("href");var f=/fdic.gov/i.test(a);var d=$("body");var c={title:"Leaving Ally.com",modal:true};c.content=(f?"/bank/fdic/bridge.html":"/system/leaving.html")+"?type=content";c.height=f?450:300;c.width=700;if(d.hasClass("fontmedium")){c.height*=1.25}if(d.hasClass("fontlarge")){c.height*=1.42}c.options={};c.options.onFinish=function(h){var g=$("#sb-body-inner");g.find("a.btn-cta").bind("click.ally",function(i){i.preventDefault();window.open(a);ALLY.ui.shadowbox.close()})};b.preventDefault();ALLY.ui.shadowbox.show(c)})},survey:function(){if(!jQuery.browser.msie){return}$(window).bind("load",function(){$.ajax({type:"GET",url:"/files/pres/js/ally.util.survey.js",dataType:"script",cache:true})})},adjustBreadcrumbs:function(){$("#breadcrumbs").find("li a[href='/bank/']").attr("href","/bank/savings/")},setupCallWaitTime:function(){$("#cwt").each(function(){$(this).removeClass("cwt");var a=$(this).attr("class")!=""?"."+$(this).attr("class"):"",b="/system/cwt"+a+".xml";$(this).addClass("cwt");$.ajax({type:"GET",url:b,dataType:"xml",cache:false,success:function(d,c){$(d).find("callwaittime").each(function(){var e=parseInt($(this).text()),i=$("#cwt").html(),g=(i.indexOf(":")>0)?i.split(":")[0]:"Call Wait Time",f=(i.indexOf(":")>0)?i.split(":")[1].replace(/[0-9]/g,"").replace(/\s/g,""):"min",h=g+": "+((e>60*24)?Math.floor(e/60/24)+" days":(e>60)?Math.floor(e/60)+" hours":e+" "+f);if(e>=0&&e<60*24*7){$("#cwt").css({opacity:0}).addClass("active").html(h).animate({opacity:1},800,function(){$(this).removeAttr("style")})}else{$("#cwt").remove()}})}})})},modalRedirectController:{register:function(a,b){this.redirects.push(a);this.handlers[a]=b},launch:function(c){var a=this;var b="";$.ajax({url:"/apps/global/xml/redirects.xml",dataType:($.browser.msie)?"text":"xml",success:function(g){var h;if(typeof g=="string"){h=new ActiveXObject("Microsoft.XMLDOM");h.async=false;h.loadXML(g)}else{h=$(g.childNodes[0])}var l=$(h).find("site");var k=triggerCallback=false;var d,n,m,f,e,j;var o=ALLY.pageState.getReferrerPath();if(l.length==0){return}l.each(function(){if(a.isValidModal(k,b)){return}n=$(this);d=n.attr("base");f=n.find("redirect");f.each(function(q){if(a.isValidModal(k,b)){return}e=$(this);j=e.attr("type")||"redirect";xmlRedirectTarget=e.attr("target")||"";if(c){var t=c.split("="),r=t[0],p=t[1];if(typeof j!="undefined"&&j==r&&xmlRedirectTarget==p){b=e.find("message").text();k=triggerCallback=true}}else{if(ALLY.pageState.referrerDomain.indexOf(d)>=0){if(j!="specific"&&q<f.length-1){return}else{e.find("urlset url").each(function(){if(a.isValidModal(k,b)){return}m=$(this).text();if(o==m){b=e.find("message").text();k=true;return}})}if(!k){e=n.find("redirect[type='default']");if(e.length>0){b=e.find("message").text();k=true}}}}})});if(k&&b!=""){var i={title:"Entering Ally.com",modal:true};i.content=b,i.height=200;i.width=400;i.player="html";i.options={};i.options.onFinish=function(){return false};ALLY.ui.shadowbox.show(i);if(triggerCallback&&typeof(a.handlers[c])=="function"){a.handlers[c].call()}}},error:function(){}})},isValidModal:function(b,a){return(b&&a!="")},isValidRedirect:function(a){return true},getRedirectType:function(){var e=this;var b=false;var a=$.cookie("redirect");if(a!=null&&a!=""){b=a;$.cookie("redirect",null)}else{var f=location.href;var h="(redirect|message)";var d=ALLY.pageState.getQuerystringHashes(h,f);if(d!=null){var c=d.length;if(c>0){for(var g=c-1;g>=0;g--){b=d[g].replace(h+"=","");if(this.isValidRedirect(b)){break}else{b=false}}}}}return b},init:function(){var a=this;a.redirects=new Array();a.handlers={};a.fromAffiliatedDomain=(ALLY.pageState.isAllyHost&&ALLY.pageState.fromAffiliatedDomain);a.redirectType=a.getRedirectType();if((!a.fromAffiliatedDomain&&!a.redirectType)||location.search.indexOf("?INTCMPID=FS_Hero_Default")>-1){return}a.register("message");a.register("canada",function(){window.setTimeout(function(){},2000)});a.launch(a.redirectType)}},loadChat:function(a){if($("body").is("#home")||$("#page").is(".nochat, .auto")){return}$.ajax({type:"GET",url:"/files/pres/js/mtagconfig.js",dataType:"script",cache:true,success:function(){$(function(){if(typeof lpAddVars=="function"){if(s&&!!s.pageName){lpAddVars("page","PageName",s.pageName);lpAddVars("page","Section","Products")}if($("#page").is(".help-center")){lpAddVars("page","HelpInvoked","y")}}else{setTimeout(arguments.callee,100)}})}})},init:function(){this.loadChat(location.pathname);if(!$("#pageOverlay").length){$('<div id="pageOverlay"/>').append('<b style="display:none"/>').appendTo("body")}this.setupTextSizeTools();this.setupCallWaitTime();this.setupPrintTool();this.animTabText=false;this.initUITabs();this.adjustBreadcrumbs();this.fixBackgroundImgs();this.externalLinks();this.survey()}}};$(ALLY.init);$.fn.makePopups=function(){return this.click(function(){var e="",b,a,c,d;if($(this).hasClass("feedback")){b=720,a=690,c=(screen.width)?(screen.width-b)/2:100,d=(screen.height)?(screen.height-a)/2:100,e="status=0,toolbar=0,location=0,menubar=0,dependent=1,top="+d+",left="+c+",directories=0,resizable=0,scrollbars=1,height="+a+",width="+b}window.open(this.href,"_blank",e);return false})};$.fn.ajaxifyHref=function(){return this.filter("a").each(function(a,b){$(b).attr("href",ALLY.util.getHrefForAjax(b))})};ALLY.ns("prefs");ALLY.prefs.interval=10000;ALLY.prefs.set=function(g,d,e,b){var f=g,a=$(g),c=a.data("preferences")||{};clearTimeout(a.data("timer"));if(typeof b=="undefined"){b=ALLY.prefs.interval}else{b=parseInt(b)*1000}c[d]=e;a.data("preferences",c).data("timer",setTimeout(function(){$.post(ALLY.util.getHrefForAjax("saveprefdata","default"),a.data("preferences"))},b));return this};ALLY.ns("ui");ALLY.ui={Container:(function(a){return function(b){var e=b.id||"uiContainerId_"+(a++),d=b.parent||"body",c=jQuery("<div/>").attr({id:e});if(b.injectNow){c.hide()[b.prepend?"prependTo":"appendTo"](d)}c.bind("onbeforeshow",function(){if(!jQuery("#"+e).length){c.hide()[b.prepend?"prependTo":"appendTo"](d)}});return c}})(0),Overlay:{make:function(){var a=jQuery("#"+ALLY.ui.Overlay.id);if(a.length){return a}a=jQuery("<div/>").attr("id",ALLY.ui.Overlay.id).css({backgroundColor:"#222",height:"100%",left:0,position:"fixed",top:0,width:"100%",zIndex:1001,opacity:ALLY.ui.Overlay.opacity}).hide();if(jQuery.browser.msie&&jQuery.browser.version<7){a.css({position:"absolute",zoom:1}).append('<iframe class="bgiframe" frameborder="0" tabindex="-1" src="/files/pres/blank.txt" style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\'); width:100%; height:100%; left:0px; top:0px"/>');jQuery("body").css("height","100%");a.bind("onbeforeshow",function(){a.css("height",$(document).height());$(window).bind("resize.overlayResizer, scroll.overlayResizer",function(){a.css("height",$(document).height())})}).bind("onafterhide",function(){$(window).unbind("resize.overlayResizer, scroll.overlayResizer")})}return a.prependTo("body")},id:"ALLYoverlay",opacity:0.5}};(function(){var a,c,b;ALLY.ns("ui");ALLY.ui.lightbox={_config:{overlayOpacity:0.7},element:function(){return c},update:function(e,d){if(e){c.find(".con-body").empty().append(e)}if(d&&d.className){c.addClass(d.className)}},append:function(d){if(d){c.find(".con-body").append(d)}},show:function(e,d){var f=ALLY.ui.lightbox;if(b){f.hide({complete:g})}else{g()}function g(){b=true;$(f).triggerHandler("show");if(!a){f._make()}a.bind("click.lightboxOverlay",f.hide).css({opacity:f._config.overlayOpacity});$(document).bind("keydown.lightboxOverlay",function(h){(jQuery.ui.keyCode.ESCAPE==h.keyCode&&f.hide())});c.removeClass();f.update(e,d);a.fadeIn(100,function(){var h=jQuery.browser.msie&&jQuery.browser.version<7;c.css(f._getCenter());if(h){c.find(".bgiframe")[0].style.setExpression("height","this.parentNode.offsetHeight+19+'px'")}c.show("blind",function(){if(h){c.find(".bgiframe")[0].style.removeExpression("height")}d&&d.complete&&d.complete()});$(window).bind("resize.lightbox, scroll.lightbox",f._dampenCenter);$(document).bind("scroll.lightbox",f._dampenCenter)})}},hide:function(d){if(!b){return}$(ALLY.ui.lightbox).triggerHandler("hide");$(document).unbind("keydown.lightboxOverlay");a.unbind("click.lightboxOverlay");$(window).unbind("resize.lightbox, scroll.lightbox");$(document).unbind("scroll.lightbox");c.hide("blind",null,200,function(){a.fadeOut(400,function(){b=false;d&&d.complete&&d.complete()})})},center:function(){c.stop().animate(ALLY.ui.lightbox._getCenter(),1000)},_dampenCenter:function(){var d=ALLY.ui.lightbox;window.clearTimeout(d._dampenCenter.t);d._dampenCenter.t=window.setTimeout(d.center,500)},_getCenter:function(){var f=$(window),d=f.height(),i=$(document),j=i.scrollTop(),e={top:d/2+j},k=c.height(),g={height:k/2+10},l=e.top-g.height,h=Math.max(j,l)-10;return k+30>d?{top:h-(k+30-d)}:{top:h}},_make:function(){c=ALLY.ui.Container({id:"ALLYlightbox",injectNow:true,parent:"#pageOverlay"});c[0].innerHTML='<div class="con"><div class="bmp">&nbsp;</div><div class="con-body"></div></div><a href="#" class="close">Close Window</a>';if(jQuery.browser.msie&&jQuery.browser.version<7){var d='<iframe class="bgiframe" frameborder="0" tabindex="-1" src="/files/pres/blank.txt" style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\'); width:574px;left:17px;"/>';c[0].insertBefore(document.createElement(d),c[0].firstChild)}c.find("> a.close").bind("click",function(){ALLY.ui.lightbox.hide();return false});a=ALLY.ui.Overlay.make();c.css({zIndex:1002})}}})();(function(){ALLY.ns("ui");ALLY.ui.shadowbox={_config:{innerPadding:{t:32,r:5,b:5,l:5},handleOversize:"drag",displayNav:true,handleUnsupported:"link",flashParams:{bgcolor:"#ffffff"},animateFade:($.browser.msie&&$.browser.version<7)?false:true,players:["ajax"]},_enableCloseButtons:function(){this.$sbContainer.find("a[rel='close']").bind("click.ally",function(a){a.preventDefault();ALLY.ui.shadowbox.close()})},init:function(){var a=this;Shadowbox.init(a._config)},show:function(c){var a=this,d={},e,g=function(){},f={content:"<h2>Default Shadowbox Content</h2><p>Override the content option to change what you see in this window.</p>",title:"Ally Shadowbox",handleOversize:"resize",player:"ajax",options:{}};if(typeof c.options.onFinish=="function"){g=c.options.onFinish;c.options.onFinish=function(){a._enableCloseButtons();g.call()}}else{f.options.onFinish=a._enableCloseButtons}$.extend(d,f,c);var b=window.setInterval(function(){e=$("#sb-container");if(e.length>0){a.$sbContainer=e;window.clearInterval(b);Shadowbox.open(d)}},25)},close:function(){Shadowbox.close()}}})();ALLY.ns("pageState");ALLY.pageState=(function(f){var c,o,n={},a=false,p=100,i="=",q=(function(){var u="scroll",t=0;return{gen:function(){return u+(++t)},get:function(){return u+t}}})(),g=f.browser.msie&&!!document.documentMode&&document.documentMode==8,j=function(){var t=top.location.href,u=t.indexOf("#");return u>=0?t.substr(u+1):""},k=function(x,w){if(!x){return{}}var t=x.split("&"),z=t.length,u,y,v={};for(u=0;u<z;u++){y=t[u].split(i);if(w){v[decodeURIComponent(y[0])]=decodeURIComponent(y[1]||"");continue}v[y[0]]=y[1]||""}return v},d=function(w){var v,u,t=k(w),y={},x=false;for(v in n){u=n[v];if(!(v in t)){t[v]=""}if(t[v]!==u.state){y[v]=u.state=t[v];l(u);if(u.state==q.get()&&!x){x=true;f(ALLY.pageState).triggerHandler("scrollTo",u.name)}}}m(y,t)},l=function(t){(t.stateChange&&t.stateChange.call(t,decodeURIComponent(t.state)||""))},m=function(){f(ALLY.pageState).triggerHandler("stateChange",arguments)},b=function(u){var t=c[0].contentWindow.document;t.open("javascript:'<html></html>'");t.write("<html><body>"+u+"</body></html>");t.close();t=null},r=function(){var u=j(),t;t=c[0].contentWindow.document.body.innerText;window.setInterval(function(){var w=j(),v=c[0].contentWindow.document.body.innerText;if(v!==t){t=v;d(v);u=v;top.location.hash=v}else{if(w!==u){u=w;b(w)}}},p);f(window).bind("unload",function(){c=null})},h=function(){c=f("#"+o).attr({frameBorder:"0",scrolling:"no",hidefocus:"true",tabindex:"-1"}).css({position:"absolute",left:"-9999em",top:"-9999em"});if(f.browser.msie&&!g&&!c.is("iframe")){throw new Error("Invalid ALLY.pageState histFrame argument")}var x=j(),C=x.split("&"),B=x.length>0?C.length:0,w,y,z,u,t,v;for(y=0;y<B;y++){w=C[y].split(i);u=decodeURIComponent(w[0]);z=n[u]||{};z.name=u;z.state=decodeURIComponent(w[1]);n[u]=z}jQuery("a[rel*=pageState:]").bind("click.pageState",e).live("click",e);jQuery("a[href*=#]").live("click.pageState",e);function A(){a=true;f(ALLY.pageState).triggerHandler("ready")}if(g){f(window).bind("hashchange",function(){d(j())});A()}else{if(f.browser.msie&&(!document.documentMode||document.documentMode<8)){v=function(){if(!c[0].contentWindow||!c[0].contentWindow.document||!c[0].contentWindow.document.body){window.setTimeout(v,10);return}r();A()};v()}else{window.setInterval(function(){var D=j();if(x!==D){x=D;d(D)}},p);A()}}},e=function(x){x.stopImmediatePropagation();var w=f(this),t=w.attr("rel"),u=w[0].href,y,v;if(/^pageState:/.test(t)){if(t.indexOf(i)>-1){y=t.replace(/^pageState:/,"").split(i);ALLY.pageState.set(y[0],y[1]||"");return false}}else{if((v=u.split("#"))&&v[0]==top.location.href.split("#")[0]){if(v[1]){ALLY.pageState.set(v[1],q.gen())}return false}}};f.fn.pageState=function(){this.filter("a").bind("click",e)};return{version:"1.1.0",init:function(t){if(a){return}this.referrerDomain=this.getReferrer();this.fromGMACFS=this.isReferrer("gmacfs.com/");this.hasCountry=this.checkCountry();this.hasAdvert=this.checkAdvert();this.fromGMACFS_CA=this.isReferrer("gmacfs.ca/");this.fromAffiliatedDomain=((this.fromGMACFS&&!this.hasCountry&&!this.hasAdvert)||this.fromGMACFS_CA);this.isAllyHost=(/ally.com/i.test(location.host)||/gmacrescap.com/i.test(location.host)||/corporate-rebrand/i.test(location.host)||/rebrand-ally/i.test(location.host)||/10.130.145.31/i.test(location.host));o=t;f(h)},register:function(t){if(!t.name||!t.stateChange){throw new Error("ALLY.pageState.register error: invalid component property detected")}if(n[t.name]){if(n[t.name].stateChange){return ALLY.pageState}n[t.name].stateChange=t.stateChange;l(t);return ALLY.pageState}t.name=window.encodeURIComponent(t.name);t.state="";n[t.name]=t;return ALLY.pageState},unregister:function(t){if(t in n){delete n[t]}return ALLY.pageState},set:function(u,v){if(typeof u!=="string"){throw new Error("ALLY.pageState.store error: key must be a string")}var t={};t[u]=v||"";return ALLY.pageState.setAll(t)},setAll:function(x){if(typeof x!=="object"){return ALLY.pageState}var z,y,t,v,w,u;for(u in x){break}if(!u){return ALLY.pageState}z=k(j(),true);t=f.extend(z,x);var w=[];for(v in t){w[w.length]=encodeURIComponent(v)+i+encodeURIComponent(t[v])}y=w.join("&");if(f.browser.msie&&(!document.documentMode||document.documentMode<8)){b(y)}else{top.location.hash=y}return ALLY.pageState},get:function(t){var u=encodeURIComponent(t);if(!n[u]){return null}return decodeURIComponent(n[u].state)},bind:function(u,t){if(u=="ready"&&a){t()}else{f(ALLY.pageState).bind(u,t)}return ALLY.pageState},getReferrer:function(){var u=document.referrer;var t=/http[s]?:\/\//i;u=u.replace(t,"");var w=/[a-z0-9_\.\-]*/i;var v=u.match(w);if(v.length==1){return v[0]+"/"}else{return false}},isReferrer:function(t){return(this.referrerDomain!==false&&this.referrerDomain.indexOf(t)>=0)},checkCountry:function(){var u=/http[s]?:\/\//i,w=document.referrer.replace(u,"");if(w.indexOf("/")>-1){var x=w.split("/")[1];var t=["ca","ar","br","cl","co","ec","mx","ve","cn","in","nz","at","hr","cz","fi","fr","de","gr","hu","it","nl","no","pl","pt","sk","es","se","ch","uk"];for(var v=0;v<t.length;v++){if(x==t[v]){return true}}}return false},checkAdvert:function(){var v=window.location.href;if(v.indexOf("?")>-1){var u=v.split("?")[1],t=Array();if(u.indexOf("&")){t=u.split("&")}else{t.push(u)}for(var w=0;w<t.length;w++){if(t[0].indexOf("CP=")>-1){return true}}}return false},getReferrerPath:function(){var w=document.referrer;var t=/http[s]?:\/\//i;w=w.replace(t,"");w=w.substr(w.indexOf("/"));var u=w.lastIndexOf("/");if(u!=w.length-1){var x=w.indexOf("?");var v=w.indexOf(".");if(x>=0||v>=0){if(x>=0){w=w.substr(0,x)}if(v>=0){w=w.substr(0,v)}u=w.lastIndexOf("/");if(u>=0){w=w.substr(0,u+1)}else{w+="/"}}}return w},getQuerystringHashes:function(u,t){var v=new RegExp(u+"=[^&]*","gi");return t.match(v)}}})(jQuery);ALLY.pageState.init("jshistory-frame");