function showDashboard(){showDiv("dashBoardBack");showDiv("popup_outer");}function stristr(haystack,needle,bool){var pos=0;haystack+="";pos=haystack.toLowerCase().indexOf((needle+"").toLowerCase());if(pos==-1){return false;}else{if(bool){return haystack.substr(0,pos);}else{return haystack.slice(pos);}}}function hideDashboard(){hideDiv("dashBoardBack");hideDiv("popup_outer");}function hideDiv(div){document.getElementById(div).style.display="none";}function showDiv(div){document.getElementById(div).style.display="inline";}function setVisible(id,visible){document.getElementById(id).style.display=visible;}function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else{var expires="";}document.cookie=name+"="+value+expires+"; path=/";}function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;ilimitNum){limitField.value=limitField.value.substring(0,limitNum);}else{limitCount.value=limitNum-limitField.value.length;}}function setcookie(name,value,expires,path,domain,secure){expires instanceof Date?expires=expires.toGMTString():typeof(expires)=="number"&&(expires=(new Date(+(new Date)+expires*1000)).toGMTString());var r=[name+"="+escape(value)],s,i;for(i in s={expires:expires,path:path,domain:domain}){s[i]&&r.push(i+"="+s[i]);}return secure&&r.push("secure"),document.cookie=r.join(";"),true;}function getcookie(check_name){var a_all_cookies=document.cookie.split(";");var a_temp_cookie="";var cookie_name="";var cookie_value="";var b_cookie_found=false;for(i=0;i1){cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,""));}return cookie_value;break;}a_temp_cookie=null;cookie_name="";}if(!b_cookie_found){return null;}}function setAddtionalOptsVisible(id,visible,plus){document.getElementById(id).style.display=visible;if(visible=="none"){document.getElementById(plus).innerHTML='';}else{document.getElementById(plus).innerHTML='';}}function setJobVisible(idList,plus){var ids=idList.split(",");for(var i=0;i';}else{document.getElementById(plus).innerHTML='';}}}function openJobVisible(idList,plus){var ids=idList.split(",");for(var i=0;i';}}function closeJobVisible(idList,plus){var ids=idList.split(",");for(var i=0;i';}}function setFolderItemVisible(id,plus){var item=document.getElementById(id);var visible=item.style.display;var visStyle="";if(visible!=""){visStyle="";}else{visStyle="none";}document.getElementById(id).style.display=visStyle;if(visible!=""){document.getElementById(plus).innerHTML='';}else{document.getElementById(plus).innerHTML='';}}function removeTextInput(form_name,id){document.forms[form_name].removeChild(document.getElementById(id));document.forms[form_name].removeChild(document.getElementById("remove_"+id));}function checkShipping(select,zip,get_prices){document.getElementById(get_prices).disabled=!((document.getElementById(select).value!="")&&(document.getElementById(zip).value!=""));}function showHideUpload(detailDiv,imageDiv){var detail=document.getElementById(detailDiv);var image=document.getElementById(imageDiv);if(detail.style.display=="none"){detail.style.display="";image.innerHTML='';}else{detail.style.display="none";image.innerHTML='';}}function popUp(URL){day=new Date();id=day.getTime();eval("page"+id+" = window.open(URL, '"+id+"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 0,top = 0');");}function checkoutPayment(){var a=document.createElement("a");a.setAttribute("href",SERVER_NAME+"store/pre-process-payment.html?ajax=true");a.appendChild(document.createTextNode("Checkout"));Shadowbox.open(a);}function paymentTypeChange(select,showAlerts){for(var i=0;i
To receive the override code please call the office!","warning");}}else{if(select.value=="Purchase Order"){$("#purchase_order_num").attr("cancelValidate","");$("#purchase_order_override_code").attr("cancelValidate","");$("#checkFields").hide();$("#ccFields").hide();$("#purchaseorderFields").show();$("#cashFields").hide();if(showAlerts){swal("Notice!","Your order will not begin production until the purchase order has been confirmed with your sales rep.

To receive the override code please call the office!","warning");}}else{if(select.value=="Cash"){$("#cash_override_code").attr("cancelValidate","");$("#ccFields").hide();$("#checkFields").hide();$("#cashFields").show();$("#purchaseorderFields").hide();if(showAlerts){swal("Notice!","Your order will not begin production until payment is received in full.

To receive the override code please call the office!","warning");}}else{if(select.value=="PayPal"){$("#cash_override_code").attr("cancelValidate","true");$("#ccFields").hide();$("#checkFields").hide();$("#cashFields").hide();$("#purchaseorderFields").hide();}else{if(select.value!=""){for(var i=0;i';}function openUploadDiv(key){var detail=document.getElementById("details"+key);var image=document.getElementById("arrow"+key);detail.style.display="";image.innerHTML='';}function updateCartProduct(key,name,value){makeRequest(SERVER_NAME+"store/update-cart-product.html?ajax=true&update="+name+"^"+key+"&value="+value,"aResult");}function newButtonClicked(key){var a=document.createElement("a");a.setAttribute("href",SERVER_NAME+"store/edit-shipping-address.html?ajax=true&product_key="+key);a.appendChild(document.createTextNode("New"));a.rel="width=465;height=400;";Shadowbox.open(a);return false;}function editButtonClicked(id,key){var a=document.createElement("a");a.setAttribute("href",SERVER_NAME+"store/edit-shipping-address.html?ajax=true&id="+id+"&product_key="+key);a.appendChild(document.createTextNode("Edit"));a.rel="width=465;height=450;";Shadowbox.open(a);return false;}function dropshipButtonClicked(){var a=document.createElement("a");a.setAttribute("href",SERVER_NAME+"store/edit-dropship-address.html?ajax=true");a.appendChild(document.createTextNode("Dropship"));a.rel="width=690;height=420;";Shadowbox.open(a);return false;}function shippingAddressOnChange(select,key){$("#tr2"+key).get(0).style.height="200px";if(select.selectedIndex==0){$("#btnEdit"+key).hide();}if(select.selectedIndex>0){$("#btnEdit"+key).show();}if(select.value=="New"){eval("newButtonClicked("+key+");");$("#btnEdit"+key).hide();select.selectedIndex=0;}else{eval("updateShippingOptions"+key+"();");}makeRequest(SERVER_NAME+"store/get-shipping-more-info-ajax.html?ajax=true&value="+select.value+"&key="+key,"shippingInfo"+key);}function shippingProviderOnChange(select,key){if(select.selectedIndex==0||select.value=="New"){$("#shippingAddress"+key).hide();$("#shippingAddress"+key+"_icon").hide();$("#shippingAddress"+key+"_icon_text").hide();$("#shippingInfo"+key).hide();}if(select.selectedIndex>0&&select.value!="New"){$("#shippingAddress"+key).show();$("#shippingAddress"+key+"_icon").show();$("#shippingAddress"+key+"_icon_text").show();$("#shippingInfo"+key).show();}if(select.options[select.selectedIndex].text=="UPS"){$("#shippingInsurance"+key).show();}else{$("#shippingInsurance"+key).hide();}if(select.options[select.selectedIndex].text=="My Ship Account"){$("#shipping_account_span").show();$("#shipping_account").attr("validate","isEmpty");$("#shipping_account").attr("vmessage","");}else{$("#shipping_account_span").hide();$("#shipping_account").removeAttr("validate");$("#shipping_account").removeAttr("vmessage");}if(select.options[select.selectedIndex].text=="Pickup"){if($("#shippingAddress"+key).get(0).options.length>2){$("#shippingAddress"+key).get(0).selectedIndex=1;makeRequest(SERVER_NAME+"store/update-cart-product.html?ajax=true&update=shipping_address^"+key+"&value="+$("#shippingAddress"+key).val(),"aResult");$("#shippingAddress"+key).change();}}if($("#shippingAddress"+key).get(0).selectedIndex==0){$("#btnEdit"+key).hide();}if(($("#shippingAddress"+key).get(0).selectedIndex>0)&&($("#shippingAddress"+key).val()!="New")){$("#btnEdit"+key).show();}eval("updateShippingOptions"+key+"();");if(select.selectedIndex>0){makeRequest(SERVER_NAME+"store/get-shipping-provider-tooltip.html?ajax=true&id="+select.value,"tooltip"+key);}else{$("#tooltip"+key).html("");}}function isRadioChecked(rbName,formName){var isAnyChecked=false;for(var ratiosI=0;(ratiosI3?j%3:0;return s+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+Math.abs(n-i).toFixed(c).slice(2):"");}function showHideUVCoatingOption(mailing,uv,key){var uv_select=$(uv);var mailing_select=$(mailing);var exact_size=$("Must_Be_Exact_Trim_Size");if(exact_size==null){exact_size=$("Must_Be_Exact_Trim_Size^"+key);}if(uv_select!=null){if(mailing_select.options[mailing_select.selectedIndex].text=="Yes Mailing Services"){uv_select.options[1].setAttribute("disabled","disabled");if(uv_select.selectedIndex==1){uv_select.selectedIndex=2;}if(exact_size!=null){for(var i=0;i1){scoring.options[0].setAttribute("disabled","disabled");if(scoring.selectedIndex==0){scoring.selectedIndex=1;}}}else{scoring.options[0].removeAttribute("disabled");}scoring.onchange();}}function showHideExactSize(key){if((key=="")){var papertype=$("Paper_Type");var exactsize=$("Must_Be_Exact_Trim_Size");}else{var papertype=$(key);var parts=key.split("^");var exactsize=$("Must_Be_Exact_Trim_Size^"+parts[1]);}if((papertype!=null)&&(exactsize!=null)){var selected_papertype=papertype.options[papertype.selectedIndex].text;if((selected_papertype=="100# Gloss Text")&&(papertype.selectedIndex!=0)){exactsize.options[0].setAttribute("disabled","disabled");if(exactsize.selectedIndex==0){exactsize.selectedIndex=1;}}else{exactsize.options[0].removeAttribute("disabled");}exactsize.onchange();}}function urlencode(str){var histogram={},histogram_r={},code=0,tmp_arr=[];var ret=str.toString();var replacer=function(search,replace,str){var tmp_arr=[];tmp_arr=str.split(search);return tmp_arr.join(replace);};histogram["!"]="%21";histogram["%20"]="+";ret=encodeURIComponent(ret);for(search in histogram){replace=histogram[search];ret=replacer(search,replace,ret);}return ret.replace(/(\%([a-z0-9]{2}))/g,function(full,m1,m2){return"%"+m2.toUpperCase();});return ret;}function ccNumKeyPress(e){if(window.event){if((window.event.keyCode==8)||(window.event.keyCode==127)){return true;}}else{if((e.which==8)||(e.which==127)){return true;}}return(this.getAttribute("my_maxlength")>this.value.length);}function toggle_visibility(id){var e=document.getElementById(id);if(e.style.display==""){e.style.display="none";}else{e.style.display="";}}function nl2br(text){text=escape(text);if(text.indexOf("%0D%0A")>-1){re_nlchar=/%0D%0A/g;}else{if(text.indexOf("%0A")>-1){re_nlchar=/%0A/g;}else{if(text.indexOf("%0D")>-1){re_nlchar=/%0D/g;}else{return text;}}}return unescape(text.replace(re_nlchar,"|||"));}function SaveInstructions(key){var Value=$("special_instructions"+key).value;Value=nl2br(uni2ent(Value));makeRequest(SERVER_NAME+"store/update-cart-product.html?ajax=true&update=special_instructions^"+key+"&value="+Value,"save_instructions_result"+key);}function clearText(key){if(key.defaultValue==key.value){key.value="";}}function uni2ent(snippet){var uSnip="";for(var c=0,val;val=snippet.charCodeAt(c);c++){if((val<256)&&(val!=35)){uSnip+=snippet.charAt(c);}else{if(val==35){uSnip+="%23";}else{uSnip+="&#"+val+";";}}}return uSnip;}