
   if(!dbugScripts("commerce",["commerce.tron.macfixit.js"])) {
   /*	commerce.tron.macfixit.js - packed	*/
       var ModalForm=new Class({Implements:Options,options:{modalId:"",popupContents:"default",counterFields:null,resetOnClose:false,clearOnReset:false,useCaptcha:false,onFormSubmitSuccess:"",onFormSubmitFail:"",requireLogin:false,captchaURL:"/8708-5_1-0.html?CAPTCHA=id&nomesh&refresh="},initialize:function(B,A){this.setOptions(A);this.element=$$(B);this.initModalForm();},initModalForm:function(){dbug.log("init modal");this.modalForm=new GlobalModal({id:this.options.modalId,content:$(this.options.popupContents).toggleClass("globalModal"),onClose:function(){if(this.options.resetOnClose){this.resetForm();}}.bind(this)});this.form=$(this.options.modalId).getElement("form");this.modalFormValidator=new ModalFormValidator(this.form,{evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false,evaluateOnSubmit:false});this.form.addEvent("submit",function(A){A.stop();if(!this.modalFormValidator.validate()){return ;}new ModalFormRequest({url:this.form.get("action"),data:this.form.toQueryString(),onSuccess:this.options.onFormSubmitSuccess.bind(this),onFailure:this.options.onFormSubmitFail.bind(this)}).send();}.bind(this));if(this.options.counterFields!=null){this.options.counterFields.field.each(function(B,A){this.fieldCounter(this.form.getElement(B),this.form.getElement(this.options.counterFields.counter[A]));}.bind(this));}$$(this.element).addEvent("click",function(){dbug.log("click");if(this.options.requireLogin){if(!UserVars.isLoggedIn()){CURS.Manager.checkLogin({loginHed:"Log in to CNET to report this profile",registerHed:"Join CNET to report this profile",appId:103,nextAction:function(){new Jlogger({tag:"ropProfile",element:false,ctype:"overlay;source",cval:"login;rop"}).ping();this.showModalForm.bind(this);}.bind(this)});}else{this.showModalForm();}}else{this.showModalForm();}}.bind(this));},showModalForm:function(){if(this.options.useCaptcha){this.getCaptcha();}this.modalForm.show();},resetForm:function(){this.modalFormValidator.reset();this.modalFormValidator.paused=false;this.form.setStyle("display","block");this.form.getParent().getElements(".emailSuccess, .emailFail").dispose();if(this.form.getElement("p span")){this.form.getElement("p span").set("text","0");this.form.getElement("p span").removeClass("validation-advice");}if(this.options.clearOnReset){this.form.reset();}},getCaptcha:function(){new Request({method:"get",url:this.options.captchaURL+new Date().getTime(),onComplete:function(A){if(A){var B=A.trim();$exec(B);var C=new Element("a",{href:"javascript:void(0);","class":"refreshCaptcha",id:"getCaptchaCode"}).set("text","Try a new code");C.addEvent("click",function(){this.getCaptcha();}.bind(this));C.inject($$("#captcha input")[0],"after");$("captcha").getElement("input[name=CAPTCHA_RESPONSE]").addClass("required");}}.bind(this)}).send();},fieldCounter:function(A,C){var B=A.get("validatorProps");if(!B){return ;}B=JSON.decode(B);if(!B&&!B.maxLength){return ;}this.updateCounter(A,B,C);A.addEvent("keyup",function(){this.updateCounter(A,B,C);}.bind(this));},updateCounter:function(B,C,D){var A=B.value.trim().length;D.set("text",A);if((A<(C.minLength||0))||(A>C.maxLength)){D.addClass("validation-advice");}else{D.removeClass("validation-advice");}}});var ModalFormRequest=new Class({Extends:Request,processScripts:function(A){if(this.options.evalResponse){return $exec(A);}return A.stripScripts(this.options.evalScripts);}});var ModalFormValidator=new Class({Extends:FormValidator,makeAdvice:function(D,F,C,G){var E=(G)?this.options.warningPrefix:this.options.errorPrefix;E+=(this.options.useTitles)?F.title||C:C;var B=this.getAdvice(D,F);if(!B){var A=(G)?"warning-advice":"validation-advice";B=new Element("div",{text:E,styles:{display:"none"},id:"advice-"+D+"-"+this.getFieldId(F)}).addClass(A);}else{B.set("text",E);}return B;}});window.addEvent("domready",function(){var B=new Element("div",{id:"emailMacFIForm"}).set("html",'<h2>MacFixIt Feedback<a class="closeModal"></a></h2><form action="/8731-1_1-0.xml?nomesh&viewType=json" method="post"><p>Your e-mail address: <input type="text" name="userEmail" size="30" class="validate-email minLength" validatorProps="{minLength:1}" /></p><p>Subject: <input type="text" name="subject" size="30" autocomplete="off" class="minLength maxLength" validatorProps="{minLength:5, maxLength:150}"/><span class="subjectCount">0</span> <span>of 150 characters</span></p><p>Submit your comment here: <textarea rows="4" cols="30" name="body" class="minLength maxLength" validatorProps="{minLength:10, maxLength:1500}"></textarea><span class="bodyCount">0</span> <span>of 1500 characters</span></p><input type="hidden" name="aboutUs" value="true"/><input type="hidden" name="ursRegId" value=""/><input type="hidden" name="tag" value=""/><span id="captcha"></span><b class="flexButton"><input type="submit" class="submit" value="Send E-mail"/></b></form>');var C=new ModalForm("div.feedbackform .emailLink",{reauthenticate:false,counterFields:{field:["input[name=subject]","textarea[name=body]"],counter:[".subjectCount",".bodyCount"]},popupContents:B,modalId:"emailMacFI",resetOnClose:true,clearOnReset:true,useCaptcha:true,onFormSubmitSuccess:function(E){if(E){var G=JSON.decode(E).response;if(G.result["$"]=="failure"){if($$(".emailFail").length>0){var F=$$(".emailFail")[0];}else{var F=new Element("div",{"class":"validation-advice emailFail"});}F.set("html","<b>Error: </b>"+G.message["$"]);if(G.message["$"]=="You did not successfully enter the characters in the verification box."){F.inject($("captcha"),"before");}else{F.inject($("emailMacFI").getElement("form"),"before");}this.getCaptcha();}else{if(G.result["$"]=="success"){var D=new Element("div",{"class":"emailSuccess"}).set("html","Thank you. "+G.message["$"]);D.inject($("emailMacFI").getElement("form"),"before");if($$(".emailFail").length>0){$$(".emailFail").dispose();}$("emailMacFI").getElements("form, p").setStyle("display","none");this.modalForm.hide.delay(4000,this.modalForm);}}}},onFormSubmitFail:function(){dbug.log("form not sent");}});$$("div.feedbackform").each(function(D){D.getElements(".emailLink").each(function(E){E.addEvent("click",function(F){$("emailMacFIForm").getElement("input[name=ursRegId]").set("value",this.getProperty("regId"));if(this.getProperty("tag")){$("emailMacFIForm").getElement("input[name=tag]").set("value",this.getProperty("tag"));$$("#emailMacFIForm h2")[0].childNodes[0].textContent="MacFixIt "+this.getProperty("tag");}});});});var A=new Class({initialize:function(D,E){this.tab=$(D);this.dropdown=$(E);this.shim=(Browser.Engine.trident4)?new IframeShim(this.dropdown):null;this.tab.addEvent("mouseenter",this.show.bind(this));this.tab.addEvent("mouseleave",this.hide.bind(this));},show:function(){this.tab.addClass("active");this.dropdown.setStyle("display","block");if(this.shim){this.shim.show();}this.tab.getParent().addClass("dropDownShow");},hide:function(){this.tab.removeClass("active");this.dropdown.setStyle("display","none");if(this.shim){this.shim.hide();}this.tab.getParent().removeClass("dropDownShow");}});new A("allHelpTab","allHelpDropDown");new A("allArchivesTab","allArchivesDropDown");new A("allUtilitiesTab","allUtilitiesDropDown");$("contact").cloneEvents($$("div.feedbackform .emailLink")[0]);$("contact").getElement("a").addEvent("click",function(){$("emailMacFIForm").getElement("input[name=ursRegId]").set("value",this.getProperty("regId"));if(this.getProperty("tag")){$("emailMacFIForm").getElement("input[name=tag]").set("value",this.getProperty("tag"));$$("#emailMacFIForm h2")[0].childNodes[0].textContent="MacFixIt "+this.getProperty("tag");}});});
   }
       
