Array.prototype.inArray = function (value) { var i; for(i=0; i < this.length; i++){ if(this[i] == value){ return true; } } return false; }; Array.prototype.shift=function(){ var i=0, b=this[0]; for(i;i 1){ if(td_label) td_label.className = labelClassName; return true; } if(td_label && errorClassName) td_label.className = errorClassName; return false; } function getSelect(SelectField, bln_text){ var answer = ''; for(var i=0; i'+attr_val_label+''; } } if(optGroupIds.inArray(productNameId) && attributeName=='Quantity') values += ''; document.getElementById('td_58_options').innerHTML = ''; } function setException1(){ var attributeName = 'Size'; var productNameId = 76; var arr_ids = []; var obj = setException1.arguments; for(var i=0; i'+attr_val_label+''; } } if(optGroupIds.inArray(productNameId) && attributeName=='Quantity') values += ''; document.getElementById('td_1_options').innerHTML = ''; } function setException25(){ var attributeName = 'Stock'; var productNameId = 76; var arr_ids = []; var obj = setException25.arguments; for(var i=0; i'+attr_val_label+''; } } if(optGroupIds.inArray(productNameId) && attributeName=='Quantity') values += ''; document.getElementById('td_25_options').innerHTML = ''; } function setException26(){ var attributeName = 'Color'; var productNameId = 76; var arr_ids = []; var obj = setException26.arguments; for(var i=0; i'+attr_val_label+''; } } if(optGroupIds.inArray(productNameId) && attributeName=='Quantity') values += ''; document.getElementById('td_26_options').innerHTML = ''; } function setException30(){ var attributeName = 'Quantity'; var productNameId = 76; var arr_ids = []; var obj = setException30.arguments; for(var i=0; i'+attr_val_label+''; } } if(optGroupIds.inArray(productNameId) && attributeName=='Quantity') values += ''; document.getElementById('td_30_options').innerHTML = ''; } function setException27(){ var arr_ids = []; var obj = setException27.arguments; for(var i=0; i'; values += ' '; values += ''; } else { values += ''; } has_checked = true; j++; }else{ if(turnaround_id == attr_val_id){ turnaround_id = 0; } } } document.getElementById('td_27_options').innerHTML = values; } function checkOrderPageForm(Form, compute_price, is_turnaround){ //alert('test'); var validated = true; if(!checkSelect(Form.attr58))validated = false; if(!checkSelect(Form.attr1))validated = false; if(!checkSelect(Form.attr25))validated = false; if(!checkSelect(Form.attr26))validated = false; if(!checkSelect(Form.attr30))validated = false; if(!checkRadio(Form, 'attr27'))validated = false; if(!validated && !compute_price){ alert('Please select a product before placing an order'); //return false; } //alert(validated); return validated; } var turnaround_id = 1837; function computePrice(Form, is_turnaround, effect_flag){ if(!Form) var Form = document.orderPageForm; if(!effect_flag) var effect_flag = false; //if(is_turnaround) FloatingCostVisible = true; if(is_turnaround) { if(document.getElementById('is_turnaround')) document.getElementById('is_turnaround').value = 1; } else { if(document.getElementById('is_turnaround')) document.getElementById('is_turnaround').value = 0; } if(document.getElementById('qty_price')) document.getElementById('qty_price').innerHTML = ''; if(document.getElementById('reg_price')) document.getElementById('reg_price').innerHTML = ''; var _effect_flag = (typeof(effect_flag) == 'undefined' ? true : effect_flag); if(navigator.appName!='Microsoft Internet Explorer' && !is_turnaround && _effect_flag) { if(document.getElementById('qty_price')) { document.getElementById('qty_price').innerHTML = ' '; new Effect.Opacity('qty_price', { from: 0, to: 1, duration: 1 }); } } var param_str = ''; var width = 0; var height = 0; var qty = 0; if(!is_turnaround) Form.total_price.value = 0; setTurnaround(); if(checkOrderPageForm(Form, true, is_turnaround)){ param_str += (param_str ? '|' : '')+getSelect(Form.attr58); param_str += (param_str ? '|' : '')+getSelect(Form.attr1); param_str += (param_str ? '|' : '')+getSelect(Form.attr25); param_str += (param_str ? '|' : '')+getSelect(Form.attr26); param_str += (param_str ? '|' : '')+getSelect(Form.attr30); param_str += (param_str ? '|' : '')+getRadio(Form, 'attr27'); is_turnaround = (is_turnaround && Form.compute_flag.value == '1') ? true : false; x_get_price_by_stock_ver2(76, param_str, width, height, qty, '', displayPrice); if(!is_turnaround){ if(document.getElementById('div_attr27_1837_price')){ x_get_price_by_stock_ver2(76, param_str, width, height, qty, '27|'+getRadio(Form, 'attr27')+'|1837', displayPrice); } } if(!is_turnaround){ if(document.getElementById('div_attr27_1838_price')){ x_get_price_by_stock_ver2(76, param_str, width, height, qty, '27|'+getRadio(Form, 'attr27')+'|1838', displayPrice); } } Form.compute_flag.value = 1; }else{ Form.compute_flag.value = 0; if(document.getElementById('disp_printing_text')) document.getElementById('disp_printing_text').innerHTML = 'Print Cost'; if(document.getElementById('disp_printing_price')) document.getElementById('disp_printing_price').innerHTML = '0'; if(document.getElementById('disp_unit_price')) document.getElementById('disp_unit_price').innerHTML = '0'; if(document.getElementById('disp_total_price')) document.getElementById('disp_total_price').innerHTML = '0'; if(document.getElementById('floating_cost')) document.getElementById('floating_cost').innerHTML = '
Total Cost $' + 0 + '
'; if(document.getElementById('qty_price')) document.getElementById('qty_price').innerHTML = '0'; if(document.getElementById('reg_price')) document.getElementById('reg_price').innerHTML = '0'; } //if(CURRENT_PAGE=='catalog_offset_jun') // setDefaultValues('final'); } function displayPrice(returned_value){ var returned_value = returned_value.replace('+:',''); returned_value = returned_value.replace(':+',''); //alert(returned_value); eval(returned_value); if(document.getElementById('div_attr27_1837_price')){ document.getElementById('div_attr27_1837_price').innerHTML = ''; document.getElementById('div_attr27_1837_price_curr').innerHTML = ''; } if(document.getElementById('div_attr27_1838_price')){ if(document.getElementById('div_attr27_1838_price_temp') && document.getElementById('div_attr27_'+turnaround_id+'_price_temp')) { var turnaround_diff = parseFloat(document.getElementById('div_attr27_1838_price_temp').innerHTML) - parseFloat(document.getElementById('div_attr27_'+turnaround_id+'_price_temp').innerHTML); } else { var turnaround_diff = 0; } if(!isNaN(turnaround_diff)){ var nf = new NumberFormat(turnaround_diff); nf.setPlaces(2); nf.setCommas(false); document.getElementById('div_attr27_1838_price').innerHTML = (nf.toFormatted() > 0 ? (CURRENT_PAGE=='order_confirm_details' || CURRENT_PAGE=='portal_confirm_details' || CURRENT_PAGE=='catalog_newdb_newudesign' ? 'Add $' : '+ $') + nf.toFormatted() : ''); document.getElementById('div_attr27_1838_price_curr').innerHTML = ''; }else{ document.getElementById('div_attr27_1838_price_curr').innerHTML = '$'; } } // mailing :: commented 08282009 -rEanNe- //var mailing_flag = 0; var added_price = 0; if(typeof(exit_flag) != 'undefined'){ if(exit_flag){ return true; } } if(document.getElementById('qty_text')){ if(typeof(is_digital) != 'undefined' && is_digital != 0){ document.getElementById('qty_text').innerHTML = 'Printed on Digital Press.
No additional coating.'; } else { document.getElementById('qty_text').innerHTML = 'Printed on Offset Press.'; } } //setProofingHours(); frm = document.orderPageForm; if(frm.weight) frm.weight.value = weight; if(frm.total_price){ //frm.total_price.value = total_price_overwrite > 0 ? total_price_overwrite : total_price; frm.total_price.value = total_price; } if(frm.unit_price) { //frm.unit_price.value = total_price_overwrite > 0 ? unit_price_overwrite : unit_price; frm.unit_price.value = unit_price; } if(frm.width && !frm.width.disabled && (frm.width.tagName == 'input' || width % 0.25 == 0)) frm.width.value = width; if(frm.height && !frm.height.disable && (frm.height.tagName == 'input' || height % 0.25 == 0)) frm.height.value = height; if(frm.is_digital) frm.is_digital.value = is_digital; if(frm.qty) frm.qty.value = qty; var promo = PROMO; var promo_code_percentage = PROMO_CODE_PERCENTAGE; var promo_code_amount = PROMO_CODE_AMOUNT; var promo_code_max = PROMO_CODE_MAX; var coupon_field_code = document.orderPageForm.coupon_field_code.value; var coupon_field_discount_percentage = parseFloat(document.orderPageForm.coupon_field_discount_percentage.value); var coupon_field_discount_amount = parseFloat(document.orderPageForm.coupon_field_discount_amount.value); var coupon_field_max_discount = parseFloat(document.orderPageForm.coupon_field_max_discount.value); if(coupon_field_code){ if( (!promo_code_percentage && !isNaN(coupon_field_discount_percentage) && coupon_field_discount_percentage ) || (promo_code_percentage && !isNaN(coupon_field_discount_percentage) && coupon_field_discount_percentage > promo_code_percentage) || (!promo_code_amount && !isNaN(coupon_field_discount_amount) && coupon_field_discount_amount) || (promo_code_amount && !isNaN(coupon_field_discount_amount) && coupon_field_discount_percentage > promo_code_amount)){ promo = 'y'; promo_code_percentage = coupon_field_discount_percentage; promo_code_amount = coupon_field_discount_amount; promo_code_max = coupon_field_max_discount; } } //if(promo && promo=='y' && (typeof(total_price_overwrite) == 'undefined' || total_price_overwrite == 0 || (typeof(has_markdown != 'undefined') && has_markdown))) { if(promo && promo=='y') { if(promo_code_percentage && promo_code_percentage!='') { nf = new NumberFormat(promo_code_percentage/100); nf.setCommas(false); nf.setPlaces(2); var promo_code_percent = nf.toFormatted(); nf = null; /*if(typeof(has_markdown != 'undefined') && has_markdown){ total_price = total_price_overwrite; }*/ nf = new NumberFormat(total_price*promo_code_percent); nf.setCommas(false); nf.setPlaces(2); var discount_price = nf.toFormatted(); nf = null; if(document.getElementById('div_discount_text')){ document.getElementById('div_discount_text').innerHTML = promo_code_percentage+'% OFF'; } } else if(promo_code_amount && promo_code_amount!='') { nf = new NumberFormat(promo_code_amount); nf.setCommas(false); nf.setPlaces(2); var discount_price = nf.toFormatted(); nf = null; if(document.getElementById('div_discount_text')){ document.getElementById('div_discount_text').innerHTML = promo_code_amount+' Off'; } } if(promo_code_max && promo_code_max!='') { if(discount_price>promo_code_max) { nf = new NumberFormat(promo_code_max); nf.setCommas(false); nf.setPlaces(2); var discount_price = nf.toFormatted(); nf = null; } } nf = new NumberFormat(added_price+discount_price); nf.setCommas(false); nf.setPlaces(2); var added_price = -nf.toFormatted(); nf = null; nf = new NumberFormat((parseFloat(total_price)-parseFloat(discount_price)) / parseInt(qty)); nf.setCommas(false); nf.setPlaces(3); var new_unit_price = nf.toFormatted(); nf = null; if(document.getElementById('disp_discount_price')) document.getElementById('disp_discount_price').innerHTML = discount_price; if(document.getElementById('discount_field')) document.getElementById('discount_field').style.display = ''; if(document.getElementById('disp_unit_price')) document.getElementById('disp_unit_price').innerHTML = new_unit_price; if(promo_code_max && document.getElementById('disp_max_discount')) document.getElementById('disp_max_discount').innerHTML = 'Up to $'+promo_code_max; if(document.getElementById('disp_printing_text')){ document.getElementById('disp_printing_text').innerHTML = 'Regular Print Cost'; } /*} else if(typeof(total_price_overwrite) != 'undefined' && total_price_overwrite > 0) { nf = new NumberFormat(total_price-total_price_overwrite); nf.setCommas(false); nf.setPlaces(5); var discount_price = nf.toFormatted(); nf = null; nf = new NumberFormat(added_price+discount_price); nf.setCommas(false); nf.setPlaces(5); var added_price = -nf.toFormatted(); nf = null; unit_price = unit_price_overwrite; //total_price = total_price_overwrite; if(document.getElementById('div_discount_text')){ document.getElementById('div_discount_text').innerHTML = 'Economic Relief Discount'; } if(document.getElementById('disp_discount_price')) document.getElementById('disp_discount_price').innerHTML = total_price_overwrite; if(document.getElementById('discount_field')) document.getElementById('discount_field').style.display = 'none'; //document.getElementById('discount_field').style.display = ''; if(document.getElementById('disp_printing_text')){ document.getElementById('disp_printing_text').innerHTML = 'Regular Print Cost'; }*/ } else { if(document.getElementById('discount_field')) document.getElementById('discount_field').style.display = 'none'; if(document.getElementById('disp_printing_text')){ document.getElementById('disp_printing_text').innerHTML = 'Print Cost'; } } if(CURRENT_PAGE=='catalog_newdb_newudesign') { nf = new NumberFormat(total_price); nf.setCommas(false); nf.setPlaces(2); printing_price = nf.toFormatted(); nf = null; if(document.getElementById('disp_printing_text')) document.getElementById('disp_printing_text').innerHTML = 'Print Cost'; if(document.getElementById('disp_printing_price')) document.getElementById('disp_printing_price').innerHTML = total_price; if(document.getElementById('qty_price')) { var tempPrice = ((promo && promo=='y') ? (total_price-discount_price) : total_price); nf = new NumberFormat(tempPrice); nf.setPlaces(2); //animatePrice(); //new Effect.Opacity('qty_price', { from: 0, to: 1, duration: 0.5 }); document.getElementById('qty_price').innerHTML = '$'+nf.toFormatted(); } } if(document.getElementById('disp_unit_price')) document.getElementById('disp_unit_price').innerHTML = unit_price; if(document.getElementById('disp_total_price')) { if(promo && promo=='y') { if(document.getElementById('disp_discount_price')) { document.getElementById('disp_discount_price').innerHTML = discount_price; } } nf = new NumberFormat(parseFloat(total_price) + parseFloat(added_price)); nf.setCommas(false); nf.setPlaces(2); var disp_total_price = nf.toFormatted(); nf = null; if(CURRENT_PAGE == 'cal_design_wizard_preview'){ var cal_design_service_fee = 99; nf = new NumberFormat(parseFloat(disp_total_price) + parseFloat(cal_design_service_fee)); nf.setCommas(false); nf.setPlaces(2); disp_total_price = nf.toFormatted(); nf = null; } nf = new NumberFormat(total_price); nf.setCommas(false); nf.setPlaces(2); printing_price = nf.toFormatted(); nf = null; if(document.getElementById('disp_printing_price')) document.getElementById('disp_printing_price').innerHTML = printing_price; if(document.getElementById('disp_total_price')) document.getElementById('disp_total_price').innerHTML = disp_total_price; if(document.getElementById('floating_cost')) document.getElementById('floating_cost').innerHTML = '
Total Cost $' + disp_total_price + '
'; if(document.getElementById('qty_price')) { var tempPrice = ((promo && promo=='y') ? (total_price-discount_price) : total_price); /* var turnOpts = document.orderPageForm.attr27; if(typeof(turnOpts.length)=='undefined') { var turnOptsValId = turnOpts.value; } else { for(var i=0; i'; if(document.getElementById('result_shippingRates')) document.getElementById('result_shippingRates').innerHTML = ''; if(document.getElementById('qty_price')) document.getElementById('qty_price').innerHTML = '0'; } else { if(document.getElementById('is_turnaround')) { if(document.getElementById('is_turnaround').value==0) { do_call_ups_xml(); } } } } function do_call_ups() { frm = document.orderPageForm; if(frm.weight && frm.weight.value > 0){ compute_shipping(); } } function do_call_ups_xml(){ frm = document.orderPageForm; param_str = 'product_id='+ frm.product_id.value; param_str += (param_str ? '|' : '')+'attr58='+ getSelect(frm.attr58); param_str += (param_str ? '|' : '')+'attr1='+ getSelect(frm.attr1); param_str += (param_str ? '|' : '')+'attr25='+ getSelect(frm.attr25); param_str += (param_str ? '|' : '')+'attr26='+ getSelect(frm.attr26); param_str += (param_str ? '|' : '')+'attr30='+ getSelect(frm.attr30); param_str += (param_str ? '|' : '')+'attr27='+ getRadio(frm, 'attr27'); if(document.getElementById('zip_code')) { if(document.getElementById('zip_code').value && document.getElementById('zip_code').value!='Enter' && document.getElementById('zip_code').value!='Enter Zip Code') { if(document.getElementById('divSpinLoader')) document.getElementById('divSpinLoader').innerHTML = ''; if(document.getElementById('result_shippingRates').innerHTML != '') document.getElementById('result_shippingRates').innerHTML = '
'; x_call_ups_xml(param_str, frm.zip_code.value, list_shipping); } else { if(document.getElementById('result_shippingRates')) document.getElementById('result_shippingRates').innerHTML = ''; } } } function list_shipping(returnedValue){ var returnedValue = returnedValue.replace('+:', ''); if(document.getElementById('disp_total_price').innerHTML=='0') { alert('Please select a product to calculate shipping.'); setVisibility(false); } else if(document.getElementById('zip_code').value=='' || document.getElementById('zip_code').value=='Enter' || document.getElementById('zip_code').value=='Enter Zip Code') { alert('Please enter zipcode to calculate shipping.'); setVisibility(false); } else if(document.getElementById('zip_code').value.length!=5) { alert('Invalid Zipcode'); setVisibility(false); } else { if(document.getElementById('divZipCode')) document.getElementById('divZipCode').style.display = 'none'; if(document.getElementById('result_shippingRates')) document.getElementById('result_shippingRates').innerHTML = 'Ship to '+document.getElementById('zip_code').value+' Change'+returnedValue; if(document.getElementById('default_shipping')) updatePricingDisplay(document.getElementById('default_shipping').value); if(document.getElementById('divShippingPrice')) document.getElementById('divShippingPrice').style.display = ''; } } function display_shipping(returned_array){ returned_array = returned_array.replace('+:',''); returned_array = returned_array.replace(':+',''); eval(returned_array); //alert(returned_array); //document.getElementById('result_shippingRates').innerHTML = quote; if(document.getElementById('disp_total_price').innerHTML=='0') { alert('Please select a product to calculate shipping.'); } else if(document.getElementById('zip_code').value=='' || document.getElementById('zip_code').value=='Enter' || document.getElementById('zip_code').value=='Enter Zip Code') { if(document.getElementById('result_shippingRates').innerHTML!='') { alert('Please enter zipcode to calculate shipping.'); } } else { quotes = quotes.split('|'); html_output = ''; for (var i=0;i'; html_output += '
UPS'+quotesText[0]+'
'; html_output += '
$'+quotesText[1]+'
'; html_output += ''; } else { html_output += '
'; html_output += '
UPS'+quotesText[0]+'
'; html_output += '
$'+quotesText[1]+'
'; html_output += '
'; } } } //alert(html_output); document.getElementById('result_shippingRates').innerHTML = html_output; } } function compute_shipping() { var ups_product = ''; frm = document.orderPageForm; var shipping_zip = frm.zip_code.value; var weight = frm.weight.value; if(document.getElementById('divZipCode')) { if(document.getElementById('divZipCode').style['display'] != 'none') { x_call_ups('GND', shipping_zip, weight, display_shipping); } else { if(document.getElementById('result_shippingRates')) document.getElementById('result_shippingRates').innerHTML = ''; } } } function import_data() { frm = document.orderPageForm; if (window.opener.document.jobForm) { p_frm = window.opener.document.jobForm; // reset job form fields p_frm.width.value = ''; p_frm.height.value = ''; p_frm.paper.value = ''; p_frm.fold.value = ''; p_frm.ink.value = ''; p_frm.print_page.value = ''; p_frm.coating.value = ''; p_frm.quantity.value = ''; p_frm.turnaround.value = ''; p_frm.description.value = ''; p_frm.weight.value = ''; p_frm.unit_price.value = ''; p_frm.price.value = ''; // set job form field values p_frm.category.value = 'Rounded Corner Business Cards'; p_frm.type_id.value = '1'; p_frm.width.value = frm.width.value; p_frm.height.value = frm.height.value; // description var description = ''; description += (description ? ', ' : '')+ 'die-cutting: '+getFieldValueText(document.getElementById('attr58'));description += (description ? ', ' : '')+ 'stock: '+getFieldValueText(document.getElementById('attr25'));description += (description ? ', ' : '')+ 'color: '+getFieldValueText(document.getElementById('attr26'));description += (description ? ', ' : '')+ 'quantity: '+getFieldValueText(document.getElementById('attr30'));description += (description ? ', ' : '')+ 'turnaround: '+getFieldValueText(document.getElementById('attr27')); frm.description.value = description; p_frm.description.value = frm.description.value; // weight and price p_frm.weight.value = frm.weight.value; p_frm.unit_price.value = frm.unit_price.value; p_frm.price.value = frm.total_price.value; window.close(); } } /*if(window.opener.document.jobForm){ if(window.opener.document.jobForm.category){ window.opener.document.jobForm.category.value = 'Rounded Corner Business Cards'; if(window.opener.document.jobForm.category.tagName.toLowerCase() == 'select') window.opener.get_product_pages(window.opener.document.jobForm.category); } }*/ function isNumberKey(evt){ var charCode = (evt.which) ? evt.which : event.keyCode if ((charCode >= 48 && charCode <= 57 && charCode != 46) || charCode == 8 || charCode == 13) return true; return false; } function checkValue(inputId,inputValue){ if (inputValue>500) document.getElementById(inputId).value = 500; } function computeDateEst(turnaround,transit_time,freight_flag){ if(typeof(freight_flag)=='undefined') var freight_flag = 'n'; var total_days = parseInt(turnaround) + parseInt(transit_time); if(freight_flag=='y') { if(document.getElementById('printArrival')) document.getElementById('printArrival').style.display = 'none'; } else { if(document.getElementById('printArrival')) document.getElementById('printArrival').style.display = ''; } x_compute_date_estimate(total_days, '', displayDateEst); } function displayDateEst(returnValue) { returnValue = returnValue.replace('+:',''); //document.getElementById('estDate').innerHTML = returnValue; //document.getElementById('estDate').innerHTML = returnValue.toUpperCase(); } function setTurnaround(){ var turnOpts = document.orderPageForm.attr27; if(typeof(turnOpts.length)=='undefined') { x_get_turnaround_text(turnOpts.value, displayTurnaround); } else { for(var i=0; i'; if(mailing_bulk_rate && mailing_bulk_rate!='') mailing_html += ''; if(mailing_first_class && mailing_first_class!='') mailing_html += ''; mailing_html += ''; if(document.getElementById('mailingOptions')) document.getElementById('mailingOptions').innerHTML = mailing_html; if(document.getElementById('disp_mailing_service_fee')) document.getElementById('disp_mailing_service_fee').innerHTML = mailing_service_fee; if(document.getElementById('disp_mailing_postage_estimate')) document.getElementById('disp_mailing_postage_estimate').innerHTML = mailing_postage_estimate; if(document.getElementById('disp_mailing_total_price')) document.getElementById('disp_mailing_total_price').innerHTML = total_mailing_charge; if(document.getElementById('disp_total_price')) document.getElementById('disp_total_price').innerHTML = sub_total_price; } if(getFieldValue(document.getElementById('attr58')) == '1818' ){setException('1', '2260');}if(getFieldValue(document.getElementById('attr58')) == '1819' ){setException('1', '2263,1813,2260');}if(getFieldValue(document.getElementById('attr58')) == '1820' ){setException('1', '2263,1813,2260');}if(getFieldValue(document.getElementById('attr58')) == '1821' ){setException('1', '2263,1813,2260');}if(getFieldValue(document.getElementById('attr58')) == '2261' ){setException('1', '2263,1813,1814');} //computePrice(document.orderPageForm); computePrice(document.orderPageForm); setDefaultValues('initial'); resetGallery(1,'76-1'); slideReviews(1); initIdeas(1,76); function showShipping() { document.getElementById('linkShippingOptions').style.display = 'none'; document.getElementById('divShippingOptions').style.display = ''; }