var myFormManager={init:function(){this.form=document.getElementById("logobriefform");this.logoFUM={select:document.getElementById("logoselect"),progress:document.getElementById("logo_upload_prog")};this.printImgFUM={select:document.getElementById("printimg_select"),progress:document.getElementById("printimg_prog")};this.printDocFUM={select:document.getElementById("printdoc_select"),progress:document.getElementById("print_doc_prog")};this.setFUMS();this.setOnSubmit()},setFUMS:function(){this.logos=
new FileUploadManager(this.logoFUM.select,"/logoupload",this.logoFUM.progress,"temp","uploadedlogos",!0);this.printimgs=new FileUploadManager(this.printImgFUM.select,"/printimageupload",this.printImgFUM.progress,"temp","printimageuploads",!0);this.printdocs=new FileUploadManager(this.printDocFUM.select,"/printdocupload",this.printDocFUM.progress,"temp","printdocuploads")},setOnSubmit:function(){var a=this;this.form.onsubmit=function(){myFormManager.logos.supported&&(a.logoFUM.select.disabled=!0);
myFormManager.printimgs.supported&&(a.printImgFUM.select.disabled=!0);myFormManager.printdocs.supported&&(a.printDocFUM.select.disabled=!0);return!0}}},serviceSelector={};serviceSelector.services={web:document.getElementById("webservice"),logo:document.getElementById("logoservice"),print:document.getElementById("printservice")};
serviceSelector.init=function(){function a(a,b,d){a.addEventListener?a.addEventListener(b,d,!0):a.attachEvent&&a.attachEvent("on"+b,d)}serviceSelector.form_select=document.getElementById("brief_type_select");serviceSelector.currentValue=parseInt(serviceSelector.form_select.value)||0;a(this.services.web,"click",serviceSelector.selectService);a(this.services.logo,"click",serviceSelector.selectService);a(this.services.print,"click",serviceSelector.selectService)};
serviceSelector.selectService=function(a){function c(a){0<a.className.indexOf("unchosen")?a.className="service-select":a.className="service-select unchosen"}console.log(a);a=a.currentTarget||a.srcElement;if(""===a.id)if(""===a.parentNode.id){var b=a.parentNode.parentNode.id;a=a.parentNode.parentNode}else b=a.parentNode.id,a=a.parentNode;else b=a.id;"webservice"===b?(serviceSelector.updateSelect(1),c(a)):"logoservice"===b?(serviceSelector.updateSelect(2),c(a)):"printservice"===b&&(serviceSelector.updateSelect(3),
c(a))};
serviceSelector.updateSelect=function(a){switch(serviceSelector.currentValue){case 0:1===a?serviceSelector.setCurrentValue(2):2===a?serviceSelector.setCurrentValue(1):3===a&&serviceSelector.setCurrentValue(4);break;case 1:1===a?serviceSelector.setCurrentValue(3):2===a?serviceSelector.setCurrentValue(0):3===a&&serviceSelector.setCurrentValue(5);break;case 2:1===a?serviceSelector.setCurrentValue(0):2===a?serviceSelector.setCurrentValue(3):3===a&&serviceSelector.setCurrentValue(6);break;case 3:1===a?
serviceSelector.setCurrentValue(1):2===a?serviceSelector.setCurrentValue(2):3===a&&serviceSelector.setCurrentValue(7);break;case 4:1===a?serviceSelector.setCurrentValue(6):2===a?serviceSelector.setCurrentValue(5):3===a&&serviceSelector.setCurrentValue(0);break;case 5:1===a?serviceSelector.setCurrentValue(7):2===a?serviceSelector.setCurrentValue(4):3===a&&serviceSelector.setCurrentValue(1);break;case 6:1===a?serviceSelector.setCurrentValue(4):2===a?serviceSelector.setCurrentValue(7):3===a&&serviceSelector.setCurrentValue(2);
break;case 7:1===a?serviceSelector.setCurrentValue(5):2===a?serviceSelector.setCurrentValue(6):3===a&&serviceSelector.setCurrentValue(3)}};serviceSelector.setCurrentValue=function(a){serviceSelector.form_select.value=a;serviceSelector.currentValue=a;briefSelector.select()};
var briefSelector={init:function(a){briefSelector.el=a;var c=briefSelector.select;a.addEventListener?a.addEventListener("change",c,!1):a.attachEvent&&a.attachEvent("onchange",c)},select:function(){switch(briefSelector.el.value){case "0":$("#general_brief").hide("slow");$("#logo_brief").hide("slow");$("#website_brief").hide("slow");$("#print_brief").hide("slow");$("#brief_submit_container").hide("slow");break;case "1":$("#general_brief").show("slow");$("#logo_brief").show("slow");$("#website_brief").hide("slow");
$("#print_brief").hide("slow");$("#brief_submit_container").show("slow");break;case "2":$("#general_brief").show("slow");$("#logo_brief").hide("slow");$("#website_brief").show("slow");$("#print_brief").hide("slow");$("#brief_submit_container").show("slow");break;case "3":$("#general_brief").show("slow");$("#logo_brief").show("slow");$("#website_brief").show("slow");$("#print_brief").hide("slow");$("#brief_submit_container").show("slow");break;case "4":$("#general_brief").show("slow");$("#logo_brief").hide("slow");
$("#website_brief").hide("slow");$("#print_brief").show("slow");$("#brief_submit_container").show("slow");break;case "5":$("#general_brief").show("slow");$("#logo_brief").show("slow");$("#website_brief").hide("slow");$("#print_brief").show("slow");$("#brief_submit_container").show("slow");break;case "6":$("#general_brief").show("slow");$("#logo_brief").hide("slow");$("#website_brief").show("slow");$("#print_brief").show("slow");$("#brief_submit_container").show("slow");break;case "7":$("#general_brief").show("slow"),
$("#logo_brief").show("slow"),$("#website_brief").show("slow"),$("#print_brief").show("slow"),$("#brief_submit_container").show("slow")}}};briefSelector.init(document.getElementById("brief_type_select"));