﻿var cycler=(function(){var a=false;var e=false;var c=function(){clearInterval(a);$("#JA_testimonials").data("autoCycle",false);a=false};var h=function(){clearInterval(e);$("#JA_expertProfiles").data("autoCycle",false);e=false};var b=function(){if(!e){h();clearInterval(window.profInt);if($("#JA_expertProfilesAll").children().length>1){e=setInterval(function(){f(1,1)},10000)}}$("#JA_expertProfiles").data("autoCycle",true)};var g=function(){if(!a){c();if($("#JA_simpleTestimonialsOthers").children().length>1){a=setInterval(function(){i(1,1)},10000)}}$("#JA_testimonials").data("autoCycle",true)};var d=function(l){var p=$("#"+l.showing);if(p.data("idx")==null){p.data("idx",0)}var n=$("#"+l.hidden);var j=p.children("li");var k=n.children();var o=l.direction||1;var m=l.replace||function(r,q){r.html(q.clone(true).html())};j.each(function(q){var r=(p.data("idx")+o)%(k.length);if(r==-1){r=(k.length-1)}var s=k.eq(r);if(l.fade){j.fadeOut(500,function(){m($(this),s);j.fadeIn(500)})}else{m($(this),s)}p.data("idx",r)})};var i=function(j,k){j=j||1;d({direction:j,showing:"JA_simpleTestimonialsShowing",hidden:"JA_simpleTestimonialsOthers",fade:k,replace:function(m,l){m.find(".JA_testimonialName").text(l.find(".JA_testimonialName").text());m.find(".JA_testimonialQuote").text(l.find(".JA_testimonialQuote").text());m.find(".JA_testimonialLocation").text(l.find(".JA_testimonialLocation").text())}})};var f=function(j,k){j=j||1;d({direction:j,showing:"JA_expertProfilesShowing",hidden:"JA_expertProfilesAll",fade:k,replace:function(n,m){var l=n.find(".JA_avatarHolder img");l.attr("src",m.find(".JA_avatarURI").text());l.attr("title",m.find(".JA_avatarTitle").text());l.attr("alt",m.find(".JA_avatarTitle").text());l.show();n.find(".JA_profileInfo").html(m.find(".JA_profileInfo").html())}})};return{nextTestimonial:function(j){i(1,j)},nextProfile:function(j){f(1,j)},lastTestimonial:function(){i(-1,fade)},lastProfile:function(j){f(-1,j)},startTestimonials:function(){g()},startProfiles:function(){b()},start:function(){b();g()},stop:function(){h();c()},startStaggered:function(){b();setTimeout(g,5000)},bindControls:function(){$(".JA_cycleControls").show();$(".JA_lastCycler, .JA_nextCycler").css("display","inline");$("#JA_nextTestimonial").click(function(j){if($("#JA_testimonials").data("autoCycle")){g()}i(1,0)});$("#JA_lastTestimonial").click(function(j){if($("#JA_testimonials").data("autoCycle")){g()}i(-1,0)});$("#JA_nextProfile").click(function(j){if($("#JA_expertProfiles").data("autoCycle")){b()}f(1,0)});$("#JA_lastProfile").click(function(j){if($("#JA_expertProfiles").data("autoCycle")){b()}f(-1,0)})}}})();var jefferson=(function(){return{setView:function(a){if(a=="newUser"){$(".JA_detailRow").show();$(".JA_newUser").show();$(".JA_returningUser").css("display","none");$("#JA_newUser").blur();$("#JA_newUserLabel").blur();if(!$(document).data("titleFixed")){document.title=jsVars.RegisterPageTitle}}else{if(a=="returning"){$(".JA_detailRow").show();$(".JA_returningUser").show();$(".JA_newUser").css("display","none");$("#JA_returningUser").click().blur();$("#JA_returningUserLabel").blur();if(!$(document).data("titleFixed")){document.title=jsVars.LoginPageTitle}}else{$(".JA_subTextRow").hide();$(".JA_detailRow").css("display","none");$(".JA_returningUser").hide();if(!$(document).data("titleFixed")){document.title=jsVars.UnChosenPageTitle}}}$(".JA_subText").hide()}}})();$(document).ready(function(a){jaUtils.toggleJSElements();jaUtils.bindButtonHovers();jaUtils.setupHtmlTooltips();cycler.bindControls();cycler.startTestimonials();if(!jsVars.RadioButtonHack){$(".JA_switcher").hide()}jefferson.setView($("input[name=sign_in_type]:checked").val());if(!$("#JA_emailError").text().length&&$("input[name=sign_in_type]:checked").val()!="returning"){$("#JA_emailSubText").show();$("#JA_email").focus();$("#JA_email").addClass("JA_focus")}$(".JA_field").focus(function(b){$(this).addClass("JA_focus");$("#"+this.id+"Error").hide();if($("input[name=sign_in_type]:checked").val()=="newUser"){$("#"+this.id+"SubText").show()}$("#JA_whySignUp").hide()});$(".JA_field").change(function(b){if($("#"+this.id+"Error").text().length){$("#"+this.id+"Error").remove()}$(this).parents("tr").removeClass("JA_errorRow")});$(".JA_field").blur(function(b){$(this).removeClass("JA_focus");if($("input[name=sign_in_type]:checked").val()=="newUser"){$("#"+this.id+"SubText").hide()}if($("#"+this.id+"Error").text().length){$("#"+this.id+"Error").show()}});$(".JA_viewTriggers").click(function(b){$(".JA_error").remove();$(".JA_errorRow").removeClass("JA_errorRow");jefferson.setView($(this).children("input").val());$(this).children("input").attr("checked","checked");$(this).blur();$(this).children().blur();return true});$(".JA_popWindowLink").click(function(b){jaUtils.openPopWindow(this.href,700,400,"toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=700,height=400");b.preventDefault();return false});$("form").submit(go.convert);$("#JA_emailList").click(function a(){pageTracker._trackEvent("Registration_Email",$("#JA_emailList").attr("checked"))})});var go=(function(){var b=function(c){if($(c).data("built")==true){return $(c)}var d="<img ";$(c+" .JA_imageMeta").children("dt").each(function(e){var g=$(this);var f=g.next("dd");d+=g.text()+'="'+f.text()+'" ';if(g.text()=="alt"){d+='title="'+f.text()+'" '}});d+=" />";$(c).data("built",true);$(c+" .JA_imageMeta").replaceWith($(d));return $(c)};var a=function(){$(".JA_module, .JA_logo:not(#JA_bbbLogoLink)").appendTo("#JA_optimizerFodder");$("#JA_expertProfiles").appendTo("#JA_sidePane .JA_moduleContainer:eq(0)");$("#JA_testimonials").appendTo("#JA_sidePane .JA_moduleContainer:eq(1)");$("#JA_pageTitles h2 .JA_newUser").text(jsVars.DefaultNewSubTitle);$("#JA_emailSignup").hide()};return{setOptimizerNum:function(c){a();if($("#JA_optimizerNum").length){$("#JA_optimizerNum option[value="+c+"]").attr("selected","selected")}switch(parseInt(c)){case 0:break;case 1:$("#JA_whySignUp").hide().prependTo("#JA_formContent");if(!(typeof(jsVars)!="undefined"&&"PostBack" in jsVars&&jsVars.PostBack)){$("#JA_whySignUp").show()}break;case 2:b("#JA_trustELogoLarge").appendTo("#JA_bodyRightLogo");break;case 3:jefferson.setView("newUser");$("#JA_emailSignup").show();break;case 4:$("#JA_expertProfiles").appendTo("#JA_optimizerFodder");$("#JA_whyJoinJA").appendTo("#JA_sidePane .JA_moduleContainer:eq(0)");break;case 5:$("#JA_testimonials").appendTo("#JA_optimizerFodder");$("#JA_whyJoinJA").appendTo("#JA_sidePane .JA_moduleContainer:eq(1)");break;case 6:$("#JA_whyJoinJA").appendTo("#JA_sidePane .JA_moduleContainer:eq(0)");b("#JA_trustELogoLarge").appendTo("#JA_bodyRightLogo");$("#JA_expertProfiles").appendTo("#JA_belowFormLeft");$("#JA_testimonials").appendTo("#JA_belowFormRight");break;case 7:b("#JA_trustELogoLarge").appendTo("#JA_formLogo");break;case 8:b("#JA_trustELogoLarge").appendTo("#JA_bodyRightLogo");$("#JA_whyJoinJA").appendTo("#JA_sidePane .JA_moduleContainer:eq(1)");$("#JA_testimonials").appendTo("#JA_optimizerFodder");$("#JA_expertProfiles").appendTo("#JA_optimizerFodder");break;case 9:$("#JA_pageTitles h2 .JA_newUser").text(jsVars.OptimizerNewSubTitle);break;default:break}},convert:function(){if(typeof(jsVars)!="undefined"&&jsVars&&jsVars.Optimizer){_uacct=jsVars.OptimizerAccount;urchinTracker("/"+jsVars.OptimizerExperiment+"/goal")}}}})();