var purchase_online={tmp:window.location.toString(),button_link:function(){plan_type="";option_code="";current_location=window.location.toString();if((current_location.indexOf("maximum_care")>0)||(current_location.indexOf("pricing_max"))>0){plan_type="max";}else{if((current_location.indexOf("added_care_plus")>0)||(current_location.indexOf("pricing_added"))>0){plan_type="added";}else{if((current_location.indexOf("convenience_packages")>0)||(current_location.indexOf("pricing_conv"))>0){plan_type="conv";}}}if($defined($("plan_code"))){plan_code_arr=$("plan_code").getText().split(": ");option_code=(plan_code_arr[1]);}var d=this.tmp.split(".")[0];var c=d.split("//");if(d!="http://iwov-prod"&&d!="http://test"){if(plan_type==""&&option_code==""){newUrl="https://"+c[1]+"."+brand+".com/en/service_contracts/purchase_online/?disable_ssl_redirect=true/";}else{newUrl="https://"+c[1]+"."+brand+".com/en/service_contracts/purchase_online/?disable_ssl_redirect=true/#/"+plan_type+"/"+option_code+"/";}}else{newUrl="/en/service_contracts/purchase_online/#/"+plan_type+"/"+option_code+"/";}setTimeout(function(){window.location.href=newUrl;},0);}};var glbdbg;var utils={initAccordion:function(name,content_selector,toggler_selector,argShow,argAlwaysHide,myFunction){argShow=(argShow!=null)?Number(argShow):-1;argAlwaysHide=argAlwaysHide||false;myFunction=myFunction||function(){};if(typeof(accordions)=="undefined"){accordions=new Array();}accordions[name]=new Fx.Accordion($$(toggler_selector),$$(content_selector),{show:argShow,alwaysHide:argAlwaysHide,transition:Fx.Transitions.quadOut,opacity:false,wait:false,onComplete:eval(myFunction)});accordions[name].togglers=$$(toggler_selector);this.setTogglerEvents(name,accordions[name].togglers);},setTogglerEvents:function(e,f){if(e){accordions[e].togglers.each(function(a){a.addEvent("click",function(){var b="";b+=this.firstChild.innerHTML;linkTrack("content",b);});});}var d="";if(e=="ip"){accordions[e].togglers.each(function(a){a.getFirst().addClass("togglerOff");a.addClass("togglerIpOff");a.addEvent("click",function(){if(d!=""){d.getLast().setStyle("visibility","visible");d.removeClass("togglerIpOn");d.getFirst().removeClass("togglerOn");d.addClass("togglerIpOff");d.getFirst().addClass("togglerOff");}d=this;d.getLast().setStyle("visibility","hidden");d.removeClass("togglerIpOff");d.getFirst().removeClass("togglerOff");d.addClass("togglerIpOn");d.getFirst().addClass("togglerOn");var c=a.getParent();var b=c.getProperty("id");var j=$("p_plan").getCoordinates().height;var i=$("m_plan").getCoordinates().height;if($(b).getCoordinates().height>200){a.getLast().setStyle("visibility","visible");a.removeClass("togglerIpOn");a.getFirst().removeClass("togglerOn");a.addClass("togglerIpOff");a.getFirst().addClass("togglerOff");}});});}},makeTips:function(g,h,f){if(window.ie||navigator.appVersion.indexOf("Mac")!=-1){var e=new Tips($$(h),{className:f,offsets:g});}else{var e=new Tips($$(h),{className:f,offsets:g,initialize:function(){this.fx=new Fx.Style(this.toolTip,"opacity",{duration:500,wait:false}).set(0);},onShow:function(a){this.fx.start(1);},onHide:function(a){this.fx.start(0);}});}},phoneTab:function(b){if(b.name!="phoneLineNumber"){if(b.value&&b.value.length==b.getAttribute("maxlength")){$(b).getNext("input").focus();}}},initHeaderRotator:function(){this.imageRotator("sc_header_nav_container",3,"/shared/images/service_contracts/");},imageRotator:function(f,e,d){f=$(f);if(f){f.setStyle("background","transparent url('"+d+"header_"+(Math.floor(Math.random()*e)).toString()+".jpg') no-repeat right top");}}};
