var elements = { company_info:{ ci0:{name:'Name, Phone, and Email', icon: 'company_info.jpg', special:'form_company_info()', enabled:'true'} }, canopy_details:{ cd0:{name:'Dimensions / Measurements', icon: 'icon-measurements.gif', special:'form_canopy_details()', enabled:'true'} }, quote_attachments:{ qa0:{name:'Additional Documents', icon: 'icon-attachment.gif', special:'form_quote_attachments()', enabled:'true'} }, complete_quote: { cq0:{name:'Completed Quote', icon: 'company_info.jpg', special:'form_complete_quote()', enabled:'true'} }, support_type:{ st0:{name:'Hanger Rod Supported', icon: 'icon-type-hr-superlumideck.gif', thumb: 'thumb-type-hr-superlumideck.gif', enabled:'true'}, st2:{name:'Cantilever', icon: 'icon-type-hr-superlumideck-cantilever.gif', thumb: 'thumb-type-hr-superlumideck-cantilever.gif', enabled:'true'}, st1:{name:'Post Supported', icon: 'icon-type-postsupport.gif', thumb: 'thumb-type-postsupport.gif', enabled:'true'} }, canopy_type:{ ct0:{name:'Lumishade', icon: 'icon-type-hr-lumishade.gif', thumb: 'thumb-type-hr-lumishade.gif', enabled:'true'}, ct1:{name:'Super Lumideck HR', icon: 'icon-type-hr-superlumideck.gif', thumb: 'thumb-type-hr-superlumideck.gif', enabled:'true'}, ct2:{name:'Custom Curved', icon: 'icon-type-hr-custom.gif', thumb: 'thumb-type-hr-custom.gif', enabled:'true'}, ct3:{name:'SuperShade', icon: 'icon-type-hr-supershade.gif', thumb: 'thumb-type-hr-supershade.gif', enabled:'true'}, ct4:{name:'Super Lumideck (Post Supported)', icon: 'icon-type-postsupport.gif', thumb: 'thumb-type-postsupport.gif', enabled:'true'}, ct5:{name:'Custom Arched', icon: 'icon-type-hr-custom-arched.gif', thumb: 'thumb-type-hr-custom-arched.gif', enabled: 'true'}, ct6:{name:'Super Lumideck', icon: 'icon-type-superlumideck.gif', thumb: 'thumb-type-superlumideck.gif', enabled:'true'} }, canopy_orientation:{ co0:{name:'Wall mounted on the long side', icon: 'icon-canopy-orientation-co0.jpg', thumb: 'thumb-canopy-orientation-co0.jpg', enabled:'true'}, co1:{name:'Wall mounted on the short side', icon: 'icon-canopy-orientation-co1.jpg', thumb: 'thumb-canopy-orientation-co1.jpg', enabled:'true'}, co2:{name:'Free standing (post supported)', icon: 'icon-canopy-orientation-co2.jpg', thumb: 'thumb-canopy-orientation-co2.jpg', enabled:'true'} }, decking_type:{ dt0:{name:'2 3/4"', icon: 'icon-decking-234.gif', thumb: 'thumb-decking-234.gif', template_text:'a 2 3/4" Extruded .078" Decking.', enabled:'true'}, dt1:{name:'.5"', icon: 'icon-decking-5.gif', thumb: 'thumb-decking-5.gif', template_text:' extruded aluminum (.5"), alloy 6063-T6, in profile and thickness shown in current Mapes brochures.', enabled:'true'}, dt2:{name:'Flat Soffit', icon: 'icon-decking-flatsoffit.gif', thumb: 'thumb-decking-flatsoffit.gif', template_text:'3" extruded flat soffit .078 decking.', enabled:'true'}, dt3:{name:'.032', icon: 'icon-decking-032.gif', thumb: 'thumb-decking-032.gif', template_text:'an interlocking roll-form 2 1/2 W style pan (.032" aluminum).', enabled:'true'}, dt4:{name:'.040', icon: 'icon-decking-040.gif', thumb: 'thumb-decking-040.gif', template_text:'an interlocking roll-form 2 1/2 W style pan (.040" aluminum).', enabled:'true'}, dt5:{name:'2 3/4" Perp', icon: 'icon-decking-234.gif', thumb: 'thumb-decking-234.gif', template_text:'a 2 3/4" Extruded .078 Decking.', enabled:'true'}, dt6:{name:'2 3/4" Para', icon: 'icon-decking-234.gif', thumb: 'thumb-decking-234.gif', template_text:'a 2 3/4" Extruded .078 Decking.', enabled:'true'}, dt7:{name:'8" Louver', icon: 'icon-decking-8inch-louver.gif', thumb: 'thumb-decking-8inch-louver.gif', template_text:'louvered blades (.110" extruded aluminum).', enabled:'true'}, dt8:{name:'3" "U" Channel', icon: 'icon-decking-3inch-uchannel.gif', thumb: 'thumb-decking-3inch-uchannel.gif', template_text:'3" "U" Channel (.125" extruded aluminum).', enabled:'true'}, dt9:{name:'1/4" Acrylic', icon: 'icon-decking-14acrylic.gif', thumb: 'thumb-decking-14acrylic.gif', enabled:'true'} }, beam_type:{ bt0:{name:'4"x7"', icon: 'icon-beam-4x7.gif', thumb: 'spacer.gif', enabled:'true'}, bt1:{name:'6"x6"', icon: 'icon-beam-6x6.gif', thumb: 'spacer.gif', enabled:'true'}, bt2:{name:'6"x10"', icon: 'icon-beam-6x10.gif', thumb: 'spacer.gif', enabled:'true'} }, post_type:{ pt0:{name:'4"x4"', icon: 'icon-post-4x4.gif', thumb: 'spacer.gif', enabled:'true'}, pt1:{name:'4"x6"', icon: 'icon-post-4x6.gif', thumb: 'spacer.gif', enabled:'true'}, pt2:{name:'6"x6"', icon: 'icon-post-6x6.gif', thumb: 'spacer.gif', enabled:'true'} }, fascia_type:{ ft0:{name:'8" J', icon: 'thumb-fascia-8j.jpg', thumb: 'icon-fascia-8j.jpg', enabled:'true'}, ft1:{name:'8" C-Channel', icon: 'thumb-fascia-8c.jpg', thumb: 'icon-fascia-8c.jpg', enabled:'true'}, ft2:{name:'10" C-Channel', icon: 'thumb-fascia-10c.jpg', thumb: 'icon-fascia-10c.jpg', enabled:'true'}, ft3:{name:'12" C-Channel', icon: 'thumb-fascia-12c.jpg', thumb: 'icon-fascia-12c.jpg', enabled:'true'}, ft4:{name:'8" J with 3" extension', icon: 'thumb-fascia-j3.jpg', thumb: 'icon-fascia-j3.jpg', enabled:'true'}, ft5:{name:'8" J with 4" extension', icon: 'thumb-fascia-j4.jpg', thumb: 'icon-fascia-j4.jpg', enabled:'true'}, ft6:{name:'6"', icon: 'icon-fascia-6.gif', thumb: 'thumb-fascia-6.gif', enabled:'true'}, ft7:{name:'12" Smooth Face', icon: 'thumb-fascia-12smooth.jpg', thumb: 'icon-fascia-12smooth.jpg', enabled:'true'} }, finish_type:{ fit0:{name:'-- Class II Clear Anodized', icon: 'icon-finish-clearanodized.gif', thumb: 'spacer.gif', enabled:'true'}, fit1:{name:'-- Bronze Baked Enamel', icon: 'icon-finish-bronzebakedenamel.gif', thumb: 'spacer.gif', enabled:'true'}, fit2:{name:'-- White Baked Enamel', icon: 'icon-finish-whitebakedenamel.gif', thumb: 'spacer.gif', enabled:'true'}, fit3:{name:'2-Coat Kynar Finish', icon: 'icon-finish-2coatkynar.gif', thumb: 'spacer.gif', enabled:'true'}, fit4:{name:'Custom Anodized', icon: 'icon-finish-customanodized.gif', thumb: 'spacer.gif', enabled:'true'}, fit5:{name:'Standard Finish', icon: 'spacer.gif', thumb: 'spacer.gif', enabled:'true'} }, drainage_type:{ drt0:{name:'Front Scupper', icon: 'icon-drain-frontscrupper.gif', thumb: 'spacer.gif', enabled:'true'}, drt1:{name:'Downspout From Fascia', icon: 'icon-drain-downspoutfromfascia.gif', thumb: 'spacer.gif', enabled:'true'}, drt2:{name:'Downspout From Rear Gutter', icon: 'icon-drain-downspoutfromreargutter.gif', thumb: 'spacer.gif', enabled:'true'}, drt3:{name:'Rear Gutter - Leader By Others', icon: 'icon-drain-reargutter.gif', thumb: 'spacer.gif', enabled:'true'}, drt4:{name:'Standard Post Drain', icon: 'icon-drain-standardpost.gif', thumb: 'spacer.gif', enabled:'true'}, drt5:{name:'Fascia Drain', icon: 'icon-drain-fasciadrain.gif', thumb: 'spacer.gif', enabled:'true'}, drt6:{name:'None', icon:'spacer.gif', thumb:'spacer.gif', enabled:'true'} }, stamped_calcs_type:{ sct0:{name:'No', icon: 'icon-calcs-no.gif', thumb: 'spacer.gif', template_text:'are not required', enabled:'true'}, sct1:{name:'Yes', icon: 'icon-calcs-yes.gif', thumb: 'spacer.gif', template_text:'are required and must be signed and sealed by an engineer licensed within the state canopy is installed', enabled:'true'} } }; var layout = { start:'company_info', company_info:{ main_text: 'Company Information', summary_text: 'Company Information', display:'company_info', default_dest:'canopy_support' }, canopy_support:{ main_text: 'Select Canopy Support', summary_text: 'Support', display:'support_type', default_dest:'canopy_type', hide_steps: { st0:['beam_type','post_type'], st2:['beam_type','post_type'] } }, canopy_type:{ main_text: 'Select Canopy Type', summary_text: 'Canopy', display:'canopy_type', filters:{ st0:['ct0','ct1','ct2','ct5','ct3'], st1:['ct4'], st2:['ct0', 'ct6', 'ct3'] }, default_dest:'canopy_orientation' }, canopy_orientation: { main_text: 'Select Canopy Orientation', sub_text: '(Plan View)', summary_text: 'Canopy Orientation', display:'canopy_orientation', filters:{ ct0:['co0','co1'], ct3:['co0','co1'] }, default_dest:'decking_type' }, decking_type:{ main_text: 'Select Decking Type', summary_text: 'Decking', display:'decking_type', filters:{ st1:['dt0','dt1','dt2'], ct0:['dt4'], ct1:['dt0','dt2'], ct2:['dt0','dt2'], ct5:['dt0','dt2'], ct3:['dt7','dt8'], ct6:['dt0','dt2'] }, default_dest:'fascia_type', special_dest:{ st1:'beam_type' } }, beam_type: { main_text: 'Select Beam Type', summary_text: 'Beam', display:'beam_type', default_dest:'post_type' }, post_type: { main_text: 'Select Post Type', summary_text: 'Post', display:'post_type', filters: { bt0:['pt0','pt1'], bt1:['pt1','pt2'], bt2:['pt1','pt2'] }, default_dest:'fascia_type' }, fascia_type: { main_text: 'Select Fascia Type', summary_text: 'Fascia', display:'fascia_type', filters: { st1:['ft0','ft1','ft2','ft3','ft4','ft5','ft6'], ct0:['ft0','ft1','ft2','ft3','ft4','ft5','ft7'], ct1:['ft0','ft1','ft2','ft3','ft4','ft5','ft7'], ct2:['ft0','ft1','ft2','ft3','ft4','ft5','ft7'], ct5:['ft0','ft1','ft2','ft3','ft4','ft5','ft7'], dt7:['ft0','ft1','ft2','ft3','ft4','ft5','ft7'], dt8:['ft0','ft1','ft2','ft3','ft4','ft5','ft7'], ct3:['ft0','ft1','ft2','ft3','ft4','ft5','ft7'] }, default_dest:'finish_type' }, finish_type: { main_text: 'Select Finish Type', summary_text: 'Finish', display:'finish_type', filters: { st1:['fit5','fit0','fit1','fit2','fit3'], ct0:['fit5','fit0','fit1','fit2','fit3'], ct1:['fit5','fit0','fit1','fit2','fit3'], ct2:['fit5','fit0','fit1','fit2','fit3'], ct5:['fit5','fit0','fit1','fit2','fit3'], ct3:['fit5','fit0','fit1','fit2','fit3'], ct6:['fit0','fit1','fit2','fit3','fit5'] }, default_dest:'drainage_type' }, drainage_type: { main_text: 'Select Drainage Type', summary_text: 'Drainage', display:'drainage_type', filters: { st1:['drt4','drt5'], ct0:['drt0','drt1','drt2','drt3'], ct1:['drt0','drt1','drt2','drt3'], ct2:['drt0','drt1','drt2','drt3'], ct5:['drt0','drt1','drt2','drt3'], ct3:['drt6'], ct4:['drt0'] }, default_dest:'stamped_calcs' }, stamped_calcs: { main_text: 'Are PE Stamped Calcs Required?', summary_text: 'PE Stamped Calcs', display:'stamped_calcs_type', default_dest:'canopy_details' }, canopy_details: { main_text: 'Canopy Details', summary_text: 'Canopy Details', display:'canopy_details', default_dest:'quote_attachments' }, quote_attachments: { main_text: 'Attach specs and/or drawing', summary_text: 'File Attachments', display:'quote_attachments', default_dest:'complete_quote' }, /* captcha: { main_text: 'Are you human?', summary_text: 'CAPTCHA', display:'captcha', default_dest:'complete_quote' }, */ complete_quote: { main_text: 'Your Quote is Complete', summary_text:'Complete Quote', display:'complete_quote' }, history:[] }; var selection_history = []; var step_starting_idx = 'nonentry'; var image_preload_cache = []; // Preload images to help make things snappier. var formData = {}; function preload_images() { window.setTimeout(function() { var ele; for (ele in elements) { var sub; for (sub in elements[ele]) { var item = elements[ele][sub]; var icon = document.createElement('img'); icon.src = "images/" + item.icon; var thumb = document.createElement('img'); thumb.src = "images/" + item.thumb; image_preload_cache.push(icon); image_preload_cache.push(thumb); } } }, 2000); } function display_init() { var output = []; preload_images(); // Get all of our main items (steps) var step; for(step in layout) { if(step !== 'start') { // Avoid the meta-elements. add_step(step); layout[step]['selection_idx'] = -1; } } $('#specleftside').append(output.join('')); display_details(layout.start); $('#' + layout.start).addClass('overview-sect-active'); layout.history.push(layout.start); } jQuery(document).ready(function() { display_init(); }); function btn_next_click() { // Lookup the active step var step_name = layout.history[layout.history.length - 1]; var oStep = layout[step_name]; if(step_starting_idx !== 'nonentry' && step_starting_idx !== selection_history[oStep.selection_idx]) { clear_history(oStep.selection_idx); } if(oStep) { if(oStep.default_dest) { var destination = oStep.default_dest; // Check if we need to go anywhere special. if(oStep.special_dest) { $.each(oStep.special_dest, function(key, value) { if($.inArray(key, selection_history) > -1) { destination = value; return false; // breaks out of each loop. } }); } highlight_step(destination); // Push our destination onto the history queue. layout.history.push(destination); display_details(destination); } else { display_finish(); } } } function btn_back_click() { // Throw out the active step. if(layout.history.length > 1) { layout.history.pop(); } var step_name = layout.history[layout.history.length -1]; if(step_name) { highlight_step(step_name); display_details(step_name); } } function highlight_step(step) { $('.overview-sect-active').removeClass('overview-sect-active'); $('#' + step).addClass('overview-sect-active'); } function display_details(val) { var step = layout[val]; step_starting_idx = 'nonentry'; if(step.selection_idx > -1 && step.selection_idx < selection_history.length) { step_starting_idx = selection_history[step.selection_idx]; } // Show our main text. $('#spec-step').html('

' + step.main_text + '

' + (typeof step.sub_text !== "undefined" ? ('

' + step.sub_text + '

') : '')); var elems = []; // This will hold our elements. if(step.filters && selection_history.length > 0) { var match; // Check if we have a filter, and if we need to apply it. var filter; for (filter in step.filters) { var idx = $.inArray(filter, selection_history); if(idx > -1) { match = filter; break; } } // If we found the match then we need to filter our display element. if (match) { $.merge(elems, step.filters[filter]); } } // If we didn't have a filter, or our filter didn't apply we need // to display all elements. if(elems.length === 0) { var oElem = elements[step.display]; var elem; for(elem in oElem) { elems.push(elem); } } // Check for special forms if(elems.length > 0 && elements[step.display][elems[0]].special) { eval(elements[step.display][elems[0]].special); } else { var output = []; // Finally lets display some details... output.push(''); $('#step-wrapper').html(output.join('')); } $('#step-wrapper li').each(function() { $(this).click(function(event) { event.stopPropagation(); select_step_item(val,step,this); btn_next_click(); }) }); if(is_step_selection_made(step)) { $('#' + selection_history[step.selection_idx]).addClass('selected-item'); } set_button_display(step); } function display_finish() { var result = selection_history.join('|'); result = escape(result); // Show our main text. $('#spec-step').html('

Your Spec is complete

'); $('#step-wrapper').html(''); } function disable_back_button() { var back = $('#btnBack'); back.addClass('disabled'); back.unbind(); } function enable_back_button() { var back = $('#btnBack'); back.unbind(); back.removeClass('disabled'); back.click(function(event){ event.stopPropagation(); btn_back_click();}); } function set_button_display(step) { if(layout.history.length <= 1) { disable_back_button(); $('#btnBack').hide(); } else if(!step.default_dest) { disable_back_button(); $('#btnBack').hide(); } else { enable_back_button(); $('#btnBack').show(); } } function is_step_selection_made(step) { // Since selection_idx can be zero we need to use typeof. return (step.selection_idx > -1); } function select_step_item(name,step,item) { var itm_id = $(item).attr('id'); if(selection_history[step['selection_idx']] === itm_id) { return; } else { make_step_selection(name, itm_id); } if(step.hide_steps) { // Check if our selection history should hide anything, if not, show things that could be hidden from a previous selection. var elm; for (elm in step.hide_steps) { var idx = $.inArray(elm, selection_history); if(idx > -1) { $.each(step.hide_steps[elm], function(){$("#" + this).hide();}); } else { $.each(step.hide_steps[elm], function(){$("#" + this).show();}); } } } set_button_display(step); $(item).siblings().removeClass('selected-item').end().addClass('selected-item'); var element = elements[step.display][itm_id]; // Find ye olde section on the left, and set it as selected. var main_div = $('#' + name); // Switch all the overview stuff to the right main_div.find(' > .overview-sect-full').addClass('overview-sect-right').removeClass('overview-sect-full'); // Now we re-look this up because people need to be able to switch their selected item. Since we swapped everything above, // we won't be able to find it the next time though. So look up the right section, and plop in the items. main_div.find('.overview-sect-right').find('p').remove().end().append('

' + element.name + '

'); main_div.find('.selected-item').removeClass('selected-item'); main_div.find('.overview-sect-left').remove(); main_div.append($('
').html('')); } function make_step_selection(name, itm_id) { var step = layout[name]; // if we have an item in our history already, we swap it out. if(is_step_selection_made(step)) { selection_history[step.selection_idx] = itm_id; } else { var len = selection_history.push(itm_id); step['selection_idx'] = len - 1; } } function clear_history(after_num) { selection_history = selection_history.slice(0,after_num + 1); $.each(layout, function(key, value) { if(value['selection_idx'] > after_num) { value['selection_idx'] = -1; $('#' + key).empty().html('

' + value.summary_text + '

'); } }); } function add_step(name) { var output = []; output.push('

'); output.push(layout[name].summary_text); output.push('

'); $('#specleftside').append(output.join('')); } var company_info_children = null; function form_company_info() { var company_info = $('#spec-step-company-info'); var next_btn = $('#btnNextCompanyInfo', company_info); next_btn.unbind(); next_btn.click(function(event){ event.stopPropagation(); form_company_info_next();}); $('#step-wrapper').empty(); if(company_info_children === null) { company_info_children = company_info.children(); } company_info_children.detach().prependTo('#step-wrapper'); } function form_company_info_validate() { var summary = $('#company-info-errors'); summary.hide(); var details = $('#company-info-errors .errordetails'); details.empty(); formData = {}; formData.project_name = jQuery.trim($("input#project_name").val()); formData.user_name = jQuery.trim($("input#user_name").val()); formData.company_name = jQuery.trim($("input#company_name").val()); formData.addr = jQuery.trim($("input#company_address").val()); formData.city = jQuery.trim($("input#company_city").val()); formData.state = jQuery.trim($("input#company_state").val()); formData.zip = jQuery.trim($("input#company_zipcode").val()); formData.phone = jQuery.trim($("input#phone").val()); formData.email = jQuery.trim($("input#email").val()); var output = []; if(formData.project_name.length === 0 || formData.project_name === "Project Name") { output.push('Project Name
'); } if(formData.user_name.length === 0 || formData.user_name === "Name") { output.push('Name
'); } if(formData.company_name.length === 0 || formData.company_name === "Company Name") { output.push('Company Name
'); } if(formData.addr.length === 0 || formData.addr === "Address") { output.push('Address
'); } if(formData.city.length === 0 || formData.city === "City") { output.push('City
'); } if(formData.state.length === 0 || formData.state === "State") { output.push('State
'); } if(formData.zip.length === 0 || formData.zip === "Zip") { output.push('Zip
'); } if(formData.phone.length === 0 || formData.phone == "Phone w/area code") { output.push('Phone w/area code
'); } if(formData.email.length === 0 || formData.email == "Email") { output.push('Email
'); } details.html(output.join('')); if(output.length == 0) { return true; } else { summary.show(); return false; } } function form_company_info_next() { if(form_company_info_validate()){ company_info_children.detach().prependTo('#spec-step-company-info'); select_step_item('company_info',layout['company_info'],$('#ci0')); btn_next_click(); } } function form_company_info_change_text(txtBox) { if(txtBox.value === txtBox.defaultValue) { txtBox.value = ''; } else if(txtBox.value === '') { txtBox.value = txtBox.defaultValue; } } var canopy_details_children = null; function form_canopy_details() { var canopy_details = $('#spec-step-canopy-details'); var finish_btn = $('#btnFinish', canopy_details); var next_btn = $('#btnNextCanopyDetails', canopy_details); finish_btn.unbind(); finish_btn.click(function(event){ event.stopPropagation(); form_canopy_details_finished();}); next_btn.unbind(); next_btn.click(function(event){ event.stopPropagation(); form_canopy_details_next();}); $('#step-wrapper').empty(); if(canopy_details_children === null) { canopy_details_children = canopy_details.children(); } canopy_details_children.detach().prependTo('#step-wrapper'); } function form_canopy_details_validate() { var summary = $('#canopy-details-errors'); summary.hide(); var tempData = {}; tempData.quantity = jQuery.trim($("input#1_quantity").val()); tempData.projection_ft = jQuery.trim($("input#1_projection_ft").val()); tempData.projection_in = jQuery.trim($("input#1_projection_in").val()); tempData.width_ft = jQuery.trim($("input#1_width_ft").val()); tempData.width_in = jQuery.trim($("input#1_width_in").val()); if(tempData.quantity.length === 0 || tempData.projection_ft.length === 0 || tempData.projection_in.length === 0 || tempData.width_ft.length === 0 || tempData.width_in.length === 0) { summary.show(); return false; } else { return true; } } function form_canopy_details_next() { if(form_canopy_details_validate()){ $('input:text', canopy_details_children).each(function(index, elem) { var itm = $(elem); var val = jQuery.trim(itm.val()); if(val.length > 0) { formData[itm.attr("name")] = val; } }); var result = selection_history.join('|'); $('#quote_details').val(result); canopy_details_children.detach().prependTo('#spec-step-canopy-details'); select_step_item('canopy_details',layout['canopy_details'],$('#cd0')); btn_next_click(); } } var quote_attachment_children = null; var uploadifive_init = false; function form_quote_attachments() { $('#step-wrapper').empty(); form_quote_attachment_enable_buttons(); var quote_attachment = $('#spec-step-attach-files'); if(quote_attachment_children === null) { quote_attachment_children = quote_attachment.children(); } quote_attachment_children.detach().prependTo('#step-wrapper'); console.log(quote_attachment, quote_attachment_children, uploadifive_init); if(!uploadifive_init) { $("#attachedFileInput").uploadifive({ 'buttonClass' : 'specBtn', 'auto' : false, 'uploadScript' : 'uploadifive/uploadifive.php', 'cancelImg' : 'uploadifive/uploadifive-cancel.png', 'formData' : {'session_name': 'ffd1ce05a6d5110872eece0f9436197e', 'timestamp' : '1714383472', 'token' : '2f733bd0129a408d9f9dc41e9fe9217e'}, 'wmode' : 'transparent', 'queueID' : 'attachedFileQueue', 'multi' : true, 'fileDesc' : 'PDF Files (*.pdf), CAD Files (*.dwg), Office Documents (*.doc, *.docx, *.xls, *.xlsx), Plain Text (*.txt), Image Files (*.jpg, *.jpeg, *.gif, *.png)', 'fileExt' : '', 'simUploadLimit': '2', 'queueSizeLimit': '10', 'onUploadComplete' : form_quote_attachment_file_complete, 'onQueueComplete' : form_quote_attachment_all_complete }); //var $buttonWrapper = $(quote_attachment_children).children(".uploadifiveButtonWrapper"); //var $objectWrapper = $(quote_attachment_children).children(".uploadifiveObjectWrapper"); //var $object = $('object', quote_attachment_children); //var $fakeButton = $(quote_attachment_children).children(".uploadifiveButtonWrapper > a").first(); //var width = $fakeButton.outerWidth(); //var height = $fakeButton.outerHeight(); //$object.attr("width", width).attr("height", height); //$objectWrapper.attr("width", width).attr("height", height); //$buttonWrapper.css("width", width + "px").css("height", height + "px"); //$objectWrapper.hover(function() { // $fakeButton.addClass("Hover"); //}, function() { // $fakeButton.removeClass("Hover"); //}); uploadifive_init = true; } } var attachments_uploaded = 0; function form_quote_attachment_file_complete(fileObj, data) { //$('#attachedFileInput' + queueID).children('.cancel').css('display','none'); var details = $('input[id="quote_attachments"]').val() || ''; if(details != '') { details += '|'; } details += fileObj['name']; $('input[id="quote_attachments"]').val(details); attachments_uploaded++; //elements['quote_attachments']['qa0']['name'] = attachments_uploaded + ' Attached'; return false; } function form_quote_attachment_disable_buttons() { disable_back_button(); $('object',quote_attachment_children).css('visibility', 'hidden'); $('[class*=uploadifiveButtonWrapper]').children('a').addClass('disabled'); $('#btnNextAttachFiles').unbind().addClass('disabled'); } function form_quote_attachment_enable_buttons() { enable_back_button(); $('object',quote_attachment_children).css('visibility', 'visible'); $('[class*=uploadifiveButtonWrapper]').children('a').removeClass('disabled').text('Attach File'); $('#btnNextAttachFiles').removeClass('disabled').unbind().click(function(event){ event.stopPropagation(); form_quote_attachment_next();}); } function form_quote_attachment_all_complete(event, data) { form_quote_attachment_enable_buttons(); form_quote_attachment_proceed(); } function form_quote_attachment_next() { // We have uploads that need to happen. if($('#attachedFileQueue').children('div').length > attachments_uploaded) { $('.uploadifiveProgress').css('display','block'); $('#attachedFileInput').uploadifive('upload'); //$('[class*=uploadifiveButtonWrapper]').children('a').text('Uploading...'); form_quote_attachment_disable_buttons(); } else { form_quote_attachment_proceed(); } } function form_quote_attachment_proceed() { quote_attachment_children.detach().prependTo('#spec-step-attach-files'); select_step_item('quote_attachments',layout['quote_attachments'],$('#qa0')); btn_next_click(); } function form_complete_quote() { var result = selection_history.join('|'); $('#quote_details').val(result); $('#quote_session').val('ffd1ce05a6d5110872eece0f9436197e'); result = escape(result); $('#spec-step').html('

' + "Quote Request Received" + '

'); $('#step-wrapper').empty(); $('#btnBack').hide(); $.ajax({ type: "POST", url: "quote-create.php", data: $('#companyinfo').serialize(), success: function(data) { if(data == "true"){ $('#step-wrapper').empty().html("
"); $('#message').html("

THE EMAIL REQUEST WAS SENT AND RCVD.
Thanks for requesting a quote from Mapes Canopies. Quotes are normally returned the next business day. If you have not heard from us by close of business the next day, please call 888.273.1132 and ask for the sales department.

") .append("

 

") .append("

Additional details and attachments should be emailed to canopy@mapes.com.

") .append("

 

") .append("

Please contact Mapes if you would like to be added to your Master Spec System.

Note: Final material sizes and shapes may vary based on load and design requirements in your area.

"); }else{ $('#catcha_message').text("Captcha entered incorrectly. Please try again."); btn_back_click(); }; } }); }