function submit_page() { var passed = ''; frm = document.frm_poster; passed = frm.passed.value; if (passed == 0) { alert('Please select a product to continue.'); return false; } else { document.frm_poster.submit(); } } function set_border() { frm = document.frm_poster; border = frm.border.checked; if (border) { frm.add_border.value = 1; } else { frm.add_border.value = 0; } get_price_newdb_posters(); } function set_grommet() { frm = document.frm_poster; grommet = frm.grommets.checked; frm.add_grommet.value = 1; compute_grommet(); } function compute_grommet() { grommet_spacing_in_ft = 2; grommet_price_per_pc = 2; frm = document.frm_poster; grommet_flag = frm.add_grommet.value; grommet_qty = 0; grommet_price = 0; width = frm.width.value; height = frm.height.value; quantity = frm.quantity.value; if (grommet_flag == 1) { if (width> 0 && height> 0 && quantity> 0) { width_spacing = Math.floor((width / 12) / grommet_spacing_in_ft); if (width_spacing < 1) { width_spacing = 1; } width_grommets = (width_spacing + 1) * 2; //width_grommets = (Math.floor((width / 12) / grommet_spacing_in_ft) + 1) * 2; height_spacing = Math.floor((height / 12) / grommet_spacing_in_ft); if (height_spacing < 1) { height_spacing = 1; } height_grommets = ((height_spacing + 1) - 2) * 2; //height_grommets = ((Math.floor((height / 12) / grommet_spacing_in_ft) + 1) - 2) * 2; grommet_qty = (width_grommets + height_grommets); if (grommet_qty < 4) { grommet_qty = 4; } grommet_qty = grommet_qty * quantity; grommet_price = grommet_qty * grommet_price_per_pc; } else if (width> 0 && height> 0 && quantity == 0) { width_spacing = Math.floor((width / 12) / grommet_spacing_in_ft); if (width_spacing < 1) { width_spacing = 1; } width_grommets = (width_spacing + 1) * 2; //width_grommets = (Math.floor((width / 12) / grommet_spacing_in_ft) + 1) * 2; height_spacing = Math.floor((height / 12) / grommet_spacing_in_ft); if (height_spacing < 1) { height_spacing = 1; } height_grommets = ((height_spacing + 1) - 2) * 2; //height_grommets = ((Math.floor((height / 12) / grommet_spacing_in_ft) + 1) - 2) * 2; grommet_qty = (width_grommets + height_grommets); if (grommet_qty < 4) { grommet_qty = 4; } //grommet_qty = grommet_qty * quantity; grommet_price = grommet_qty * grommet_price_per_pc; } } if(frm.grommets.checked==true) { if(document.getElementById('grommet_div')) { document.getElementById('grommet_div').style.display = ''; document.getElementById('grommet_div').innerHTML = '($'+grommet_price+')'; //document.getElementById('grommet_div').innerHTML = '('+grommet_qty+' x $'+grommet_price_per_pc+')'; } if(document.getElementById('total_grommets')) document.getElementById('total_grommets').innerHTML = grommet_qty; if(document.getElementById('total_grommets_price')) document.getElementById('total_grommets_price').innerHTML = grommet_price; frm.grommet_qty.value = grommet_qty; frm.grommet_price.value = grommet_price; } else { if(document.getElementById('grommet_div')) { document.getElementById('grommet_div').style.display = 'none'; document.getElementById('grommet_div').innerHTML = 0; } if(document.getElementById('total_grommets')) document.getElementById('total_grommets').innerHTML = grommet_qty; if(document.getElementById('total_grommets_price')) document.getElementById('total_grommets_price').innerHTML = grommet_price; frm.grommet_qty.value = 0; frm.grommet_price.value = 0; } } function compute_area() { var area = 0; var border_size = 4; frm = document.frm_poster; height_temp = parseFloat(frm.height_temp.value); width_temp = parseFloat(frm.width_temp.value); border_value = frm.add_border.value; //if (border_value == 0) { // uncomment this if you need to charge the cost of the borders width = width_temp; height = height_temp; //} else if(border_value == 1) { // uncomment this if you need to charge the cost of the borders // width = width_temp + border_size; // uncomment this if you need to charge the cost of the borders // height = height_temp + border_size; // uncomment this if you need to charge the cost of the borders //} // uncomment this if you need to charge the cost of the borders frm.width.value = width; frm.height.value = height; area = height * width / 144; frm.area.value = area; inner_string = width+'" x '+height+'"'; if(document.getElementById('final_size')) document.getElementById('final_size').innerHTML = inner_string; quantity = frm.quantity.value; } function get_price_newdb_posters() { frm = document.frm_poster; poster_id = frm.poster_id.value; if (poster_id==14) { var sizetemp = frm.size_temp.value.split('x'); var widthTemp = sizetemp[0]; var heightTemp = sizetemp[1]; var areaComputed = (widthTemp*heightTemp) / 144; frm.width.value = widthTemp; frm.height.value = heightTemp; frm.area.value = areaComputed; } else { compute_area(); } if (poster_id==18) { if(frm.grommets) { set_grommet(); } } quantity = frm.quantity.value; area = frm.area.value; turnaround = frm.turnaround.value; //wt_per_sq_ft = frm.wt_per_sq_ft.value; //total_weight = parseFloat(wt_per_sq_ft)*parseFloat(area)*parseFloat(quantity); //frm.total_weight.value = total_weight; x_get_price_newdb_posters(poster_id, area, quantity, display_price_newdb_posters); } function display_price_newdb_posters(returned_array) { //alert(returned_array); eval(returned_array); var handling_fee = 5.0; var total_with_handling_fee = 0; frm = document.frm_poster; if (error_msg == '') { frm.passed.value = 1; frm.unit_price.value = unit_price; frm.total_price.value = total_price; frm.turnaround.value = turnaround; frm.wt_per_sq_ft.value = wt_per_sq_ft; frm.total_weight.value = weight; if(frm.grommet_price.value) { grommet_price = frm.grommet_price.value; var disp_grommet_price = parseFloat(grommet_price); disp_grommet_price = disp_grommet_price.toFixed(0); total_price = parseFloat(total_price) + parseFloat(grommet_price); total_with_handling_fee = parseFloat(total_price) + handling_fee + parseFloat(grommet_price); } else { total_with_handling_fee = parseFloat(total_price) + handling_fee; } // 2in Border quantity = frm.quantity.value; border_value = frm.add_border.value; var border_2in_price = quantity * 8; if(border_value==1) { total_price = total_price+border_2in_price; total_with_handling_fee = total_with_handling_fee+border_2in_price; } if (frm.poster_id.value==18) { var disp_unit_price = parseFloat(unit_price); disp_unit_price = disp_unit_price.toFixed(0); } else { var disp_unit_price = parseFloat(total_price/quantity); disp_unit_price = disp_unit_price.toFixed(0); } var disp_handling_fee = handling_fee.toFixed(0); disp_total_with_handling_fee = total_with_handling_fee.toFixed(0); nf = new NumberFormat(total_price); nf.setPlaces(0); var total_price_temp = nf.toFormatted(); var total_price = total_price_temp; nf = new NumberFormat(disp_total_with_handling_fee); nf.setPlaces(0); var disp_total_with_handling_fee = nf.toFormatted(); nf = null; if(document.getElementById('disp_grommet_price')) document.getElementById('disp_grommet_price').innerHTML = '$'+disp_grommet_price; if(document.getElementById('disp_handling_fee')) document.getElementById('disp_handling_fee').innerHTML = '$'+disp_handling_fee; if(document.getElementById('disp_unit_price')) document.getElementById('disp_unit_price').innerHTML = '$'+disp_unit_price; if(document.getElementById('disp_total')) document.getElementById('disp_total').innerHTML = '$'+total_price; if(document.getElementById('disp_total_with_handling_fee')) document.getElementById('disp_total_with_handling_fee').innerHTML = '$'+disp_total_with_handling_fee; if(document.getElementById('disp_discount')) document.getElementById('disp_discount').innerHTML = '$'+discountPrice; } else { alert(error_msg); frm.passed.value = 0; if(document.getElementById('disp_grommet_price')) document.getElementById('disp_grommet_price').innerHTML = '$0.00'; if(document.getElementById('disp_handling_fee')) document.getElementById('disp_handling_fee').innerHTML = '$0.00'; if(document.getElementById('disp_unit_price')) document.getElementById('disp_unit_price').innerHTML = '$0.00'; if(document.getElementById('disp_total')) document.getElementById('disp_total').innerHTML = '$'+total_price; if(document.getElementById('disp_total_with_handling_fee')) document.getElementById('disp_total_with_handling_fee').innerHTML = '$0.00'; if(document.getElementById('disp_discount')) document.getElementById('disp_discount').innerHTML = '$0.00'; } } var tabNames = new Array(); function showTab(tabName) { tabNames[0] = 'tabPosterProductDetails'; tabNames[1] = 'tabPosterDigitalPrintGuide'; for(var i=0;i'+i+'\n'; } htmlWidthHeight += '\n'; htmlWidthHeight += 'x\n'; htmlWidthHeight += '\n'; htmlWidthHeight += 'in\n'; } else { htmlWidthHeight += 'Size:\n'; htmlWidthHeight += '\n'; htmlWidthHeight += 'x\n'; htmlWidthHeight += '\n'; htmlWidthHeight += 'in\n'; } document.getElementById('divWidthHeight').innerHTML = htmlWidthHeight; } get_price_newdb_posters(); } function highLight(valLength,valName,valNode) { if(valName=='radioTurn') { for(i=0;i'; if(document.getElementById('shippingCalculatorTD')) document.getElementById('shippingCalculatorTD').className = 'shippingCalculatorTDHidden'; if(document.getElementById('shippingCalculatorRes')) document.getElementById('shippingCalculatorRes').className = 'shippingCalculatorTDVisibleNoBg'; } else { if(document.getElementById('shippingTitle')) document.getElementById('shippingTitle').innerHTML = 'Shipping Options'; if(document.getElementById('divSpinLoader')) document.getElementById('divSpinLoader').innerHTML = ''; if(document.getElementById('shippingCalculatorTD')) document.getElementById('shippingCalculatorTD').className = 'shippingCalculatorTDVisible'; if(document.getElementById('shippingCalculatorRes')) document.getElementById('shippingCalculatorRes').className = 'shippingCalculatorTDHidden'; //document.getElementById('quoteRatesDisplayExpand').className = 'shippingCalculatorTDHidden'; } } function updatePricingDisplay(upsRate) { var upsRate = upsRate; var printingRate = document.frm_poster.total_price.value; var handlingFee = 5; if(PROMO && PROMO=='y') { if(PROMO_CODE_PERCENTAGE && PROMO_CODE_PERCENTAGE!='') { nf = new NumberFormat(PROMO_CODE_PERCENTAGE/100); nf.setPlaces(2); var promo_code_percent = nf.toFormatted(); nf = null; nf = new NumberFormat(printingRate*promo_code_percent); nf.setPlaces(2); var discountPrice = nf.toFormatted(); nf = null; } else if(PROMO_CODE_AMOUNT && PROMO_CODE_AMOUNT!='') { nf = new NumberFormat(PROMO_CODE_AMOUNT); nf.setPlaces(2); var discountPrice = nf.toFormatted(); nf = null; } if(PROMO_CODE_MAX && PROMO_CODE_MAX!='') { if(discountPrice>PROMO_CODE_MAX) { nf = new NumberFormat(PROMO_CODE_MAX); nf.setPlaces(2); var discountPrice = nf.toFormatted(); nf = null; } } var totalRate = parseFloat(upsRate) + parseFloat(printingRate) - discountPrice + handlingFee; } else { var totalRate = parseFloat(upsRate) + parseFloat(printingRate) + handlingFee; } nf = new NumberFormat(totalRate); nf.setPlaces(2); var totalRate = nf.toFormatted(); nf = null; nf = new NumberFormat(upsRate); nf.setPlaces(2); var upsRate = nf.toFormatted(); nf = null; if(document.getElementById('disp_total')) document.getElementById('disp_total').innerHTML = '$'+printingRate; if(document.getElementById('disp_total_with_handling_fee')) document.getElementById('disp_total_with_handling_fee').innerHTML = '$'+totalRate; if(upsRate!=0) { if(document.getElementById('disp_shipping_rate')) document.getElementById('disp_shipping_rate').innerHTML = '$'+upsRate; } else { if(document.getElementById('disp_shipping_rate')) document.getElementById('disp_shipping_rate').innerHTML = 'FREE GROUND'; } } function getLfpUpsxmlRates() { var oForm = document.frm_poster; var shippingZip = oForm.zip_code.value; var totalWeight = oForm.total_weight.value; x_get_ups_xml_methods_lfp(shippingZip, totalWeight, displayLfpUpsxmlRates); } function displayLfpUpsxmlRates(returnedValue) { var oForm = document.frm_poster; var qtyValue = oForm.quantity.value; var shippingZip = oForm.zip_code.value; if(document.getElementById('result_shippingRates')) document.getElementById('result_shippingRates').innerHTML = ''; if(qtyValue!=0 && shippingZip!='' && shippingZip!='Enter Zip Code') { if(document.getElementById('result_shippingRates')) document.getElementById('result_shippingRates').innerHTML = returnedValue; } else { if(document.getElementById('disp_shipping_rate')) document.getElementById('disp_shipping_rate').innerHTML = 'FREE GROUND'; setVisibility(false); } } function highLightDiscount(divId) { if(document.getElementById(divId)) document.getElementById(divId).className='upsDiscountHighLight'; } function highLightDiscountOff(divId) { if(document.getElementById(divId)) { document.getElementById(divId).className='upsDiscount'; } } function changeZipcode(valueFlag) { if (valueFlag=='y') { if(!document.getElementById('zip_code').value || document.getElementById('zip_code').value=='' || document.getElementById('zip_code').value=='Enter Zip Code') { document.getElementById('zip_code').maxLength = 14; document.getElementById('zip_code').value = 'Enter Zip Code'; } } else { if(!document.getElementById('zip_code').value || document.getElementById('zip_code').value=='' || document.getElementById('zip_code').value=='Enter Zip Code') { document.getElementById('zip_code').maxLength = 5; document.getElementById('zip_code').value = ''; } } } function setWrapping(inputValue) { var museumWraps = document.frm_poster.museum_wrap; var poster_id = document.frm_poster.poster_id.value; if(poster_id==14) { document.getElementById('side_wrap').disabled = false; if(inputValue=='Gallery Wrap') { for(var i=0; i