
var weekdays=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");var months=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');var holidays=new Array();var today=new Date();holidays[0]=new Array(3,7,today.getFullYear());holidays[1]=new Array(4,7,today.getFullYear());holidays[2]=new Array(4,9,today.getFullYear());holidays[3]=new Array(27,11,today.getFullYear());holidays[4]=new Array(25,12,today.getFullYear());holidays[5]=new Array(1,1,today.getFullYear()+1);holidays[6]=new Array(1,1,today.getFullYear());function closeDropdown(e,ele){$(ele.id).hide();}
function closeOpenWindows(e,ele){var clickedOutside=true;if(ele.id){$(ele.id).childElements().each(function(child){if(e.target==child){clickedOutside=false;}})}
if(clickedOutside){ele.hide();if(document.body.removeEventListener){document.body.removeEventListener('click',function(e){closeOpenWindows(e,ele);},true);}
else if(document.body.detachEvent){document.body.detachEvent('onclick',function(e){closeOpenWindows(e,ele);});}}}
function registerCloser(type,action){if(window.event){window.event.cancelBubble=true;}
if(window.addEventListener){document.body.addEventListener(type,action,true);}else if(window.attachEvent){document.body.attachEvent('on'+type,action);}}
function isHoliday(date){for(i=0;i<holidays.length;i++){if((date.getDate()==holidays[i][0])&&((date.getMonth()+1)==holidays[i][1])&&(date.getFullYear()==holidays[i][2])){return true;}}
return false;}
function getDeliveryDays(bdays){var days=0;var thisDate=new Date();var thisday=thisDate.getDay();while(bdays){days++;thisday++;thisDate.setDate(thisDate.getDate()+1);if(thisday>6){thisday=0;}
if((thisday!=6)&&(thisday!=0)&&!isHoliday(thisDate)){bdays--;}}
return days;}
function handleShipping(selectedShipMethod){if($F('stateAbbrv')){for(shipMethod in shipMethodDataJSON){var shippingDays=shippingDataJSON[$F('stateAbbrv')][shipMethod];if(shippingDays==0){if(shipMethod==selectedShipMethod){var radios=document.getElementsByName('shipMethod');var shipMethod;for(var i=0;i<radios.length;i++){radios[i].checked=false;}}
$('shipMethod'+shipMethod).disabled=true;$('shipMethod'+shipMethod+'Name').addClassName('faded');$('shipMethod'+shipMethod+'Price').addClassName('faded');$('shipMethod'+shipMethod+'Date').addClassName('faded');$('shipMethod'+shipMethod+'Date').update('---');}
else{var vendorDays=0;if($F('rush')==1){vendorDays=vendorProcessingJSON['rushProcessing'];}
else{vendorDays=vendorProcessingJSON['processing'];}
var dd=getDeliveryDays(shippingDays+vendorDays);var ldd=new Date();ldd.setDate(ldd.getDate()+dd);$('shipMethod'+shipMethod).disabled=false;$('shipMethod'+shipMethod+'Name').removeClassName('faded');$('shipMethod'+shipMethod+'Price').removeClassName('faded');$('shipMethod'+shipMethod+'Date').removeClassName('faded');$('shipMethod'+shipMethod+'Date').update(weekdays[ldd.getDay()]+' '+months[ldd.getMonth()]+' '+ldd.getDate()+', '+ldd.getFullYear());}}}}
function pricify(num)
{if(num==null)
return;else
return(parseFloat(num).toFixed(2));}
function swapPanelsColors(){var i=0;var j=0;for(panel in productPanelsJSON){for(color in productColorsJSON){$(''+color+panel+'image').hide();$(''+color+panel+'innerPanelBox').removeClassName('selectedBoxHolder');$(''+color+'colorBox').removeClassName('selectedBorder');$(''+color+'colorBoxP').removeClassName('selectedBorder');}}
$$('div.panelListItem').each(function(t){t.hide();});if(collectionPidListJSON){for(pid in collectionPidListJSON){$(pid+''+currentColor+'panelBox').show();}}
$('personalizeLink').href=personalizePrefix+productId+''+currentColor+personalizeSuffix;$('personalizeLink2').href=personalizePrefix+productId+''+currentColor+personalizeSuffix;if($('personalizeLink3')){$('personalizeLink3').href=personalizePrefix+productId+''+currentColor+personalizeSuffix;}
for(panel in productPanelsJSON){$(currentColor+''+panel+'panelBox').show();}
if(productColorsJSON[currentColor]){$('colorName').update('&nbsp;:&nbsp;'+productColorsJSON[currentColor]['displayName']);}
$(currentColor+''+currentPanel+'image').show();$(currentColor+'colorBox').addClassName('selectedBorder');$(currentColor+'colorBoxP').addClassName('selectedBorder');$(''+currentColor+currentPanel+'innerPanelBox').addClassName('selectedBoxHolder');$('mainPanelImage').setStyle({height:'auto',width:'auto'});$('mainPanelImage').src=imgPrefix+'/panel/'+currentPanel+'/color/'+currentColor+imgSuffix;}
function zoomMainImageIn(){if(currentZoom>=4){return;}
else{currentZoom++;new Effect.Scale('mainPanelImage',125,{duration:0.1});return;}}
function zoomMainImageOut(){if(currentZoom<=-2){return;}
else{currentZoom--;new Effect.Scale('mainPanelImage',80,{duration:0.1});return;}}
function showMainImagePanel(){mainPanel.show();currentZoom=0;mainPanel.render("mainPanelAnchor");$('mainPanel_mask').onclick=function(){mainPanel.hide();};}
function showLayoutsPanel(){layoutsPanel.show();layoutsPanel.render("mainPanelAnchor");$('layoutsPanel_mask').onclick=function(){layoutsPanel.hide();};}
function showRecentlyViewedPopup(){recentlyViewedPopup.show();recentlyViewedPopup.setHeader('Recently Viewed Products');recentlyViewedPopup.render();$('recentlyViewedPopup_mask').onclick=function(){recentlyViewedPopup.hide();};return false;}
function calculatePrices(){var productPrice=0;var papersPrice=0;var envelopePrice=0;var quantity=$F('productQuantity');var envelopeId=$F('envelopeId');var paperId=$F('paperId');for(papId in papersListJSON){if($('paper_'+papId+'_total')){var papTotal=quantity*papersListJSON[papId]['price'];if(papTotal>0){$('paper_'+papId+'_total').update('$'+pricify(papTotal));}
else{$('paper_'+papId+'_total').update('---');}}}
if($('paper_total')){var papTotal=quantity*papersListJSON[papId]['price'];if(papTotal>0){$('paper_total').update('$'+pricify(papTotal));}
else{$('paper_total').update('---');}}
for(envId in envelopeListJSON){if($('envelope_'+envId+'_total')){var envTotal=quantity*envelopeListJSON[envId]['price'];if(envTotal>0){$('envelope_'+envId+'_total').update('$'+pricify(envTotal));}
else{$('envelope_'+envId+'_total').update('---');}}}
productPrice=productPricesJSON[quantity];papersPrice=(paperCount>0)?(quantity*papersListJSON[paperId]['price']):0;envelopePrice=(envelopeCount>1)?(quantity*envelopeListJSON[envelopeId]['price']):0;setCookie('q'+occasionId,quantity);if(papersListJSON[paperId]){setCookie('tprc',papersListJSON[paperId]['isRecycled']);}
var subtotal=productPrice+papersPrice+envelopePrice;if(collectionPidListJSON){var collectionsFlag=($('collectionsRadioYes').checked)?1:0;if(collectionsFlag==1){var collectionQuantities=new Array();for(cpid in collectionPidListJSON){subtotal+=collectionPricesJSON[cpid][$F(cpid+'collectionQuantity')];setCookie('q'+collectionPidListJSON[cpid],$F(cpid+'collectionQuantity'));}
cData['addCollections']=1;}
else{cData['addCollections']=0;}}
$('subtotalPrice').update('$'+pricify(subtotal));$('subtotalAmount').value=subtotal;$('subtotalPrice2').update('$'+pricify(subtotal));$('subtotalAmount2').value=subtotal;var rush=0;if($F('stateAbbrv')){cData['stateAbbrv']=$F('stateAbbrv');}
else{cData['stateAbbrv']='';}
if($F('rush')==1){rush=rushPrice;cData['rushFlag']=1;}
else{cData['rushFlag']=0;}
var radios=document.getElementsByName('shipMethod');var shipMethod;for(var i=0;i<radios.length;i++){if(radios[i].checked){shipMethod=radios[i].value;}}
handleShipping(shipMethod);shipMethod=null;for(var i=0;i<radios.length;i++){if(radios[i].checked){shipMethod=radios[i].value;cData['shipMethodId']=shipMethod;}}
var shipTotal=0;if(shipMethod){if($F('stateAbbrv')){shipTotal=shipMethodDataJSON[shipMethod]['price'];}}
var taxTotal=0;if($F('stateAbbrv')){if($F('stateAbbrv')=='CA'){taxTotal=(subtotal+rush)*0.0825;}}
var grandTotal=subtotal+shipTotal+taxTotal+rush;$('shippingTotal').update('$'+pricify(shipTotal));$('taxTotal').update('$'+pricify(taxTotal));$('grandTotal').update('$'+pricify(grandTotal));cookieDataUpdate();}
function toggleCollections(){var collectionsFlag=($('collectionsRadioYes').checked)?1:0;if(collectionsFlag==1){$('calculatorCollectionItems').show();$('sub1').hide();$('sub2').show();}
else{$('calculatorCollectionItems').hide();$('sub1').show();$('sub2').hide();}
calculatePrices();}
function toggleShippingCalculator(flag){if(flag){$('shippingShow').hide();$('shippingCalculator').show();$('shippingHide').show();}
else{$('shippingShow').show();$('shippingCalculator').hide();$('shippingHide').hide();}}
function patchCrumb(){var catalogContext=getCookie("catalogContext")||"";var categoryName=getCookie("categoryName")||"";if(catalogContext&&categoryName){$('secondCrumb').update(categoryName);$('secondCrumb').href=catalogContext;}}
var PrettySelect=Class.create();PrettySelect.prototype={initialize:function(options){this.container=$(options.container);this.button=$(options.button);this.selected=$(options.selected);this.list=$(options.list);if(!window.XMLHttpRequest){this.ie=true;this.listShim=document.createElement('iframe');this.listShim.style.display='none';this.listShim.style.position='absolute';this.listShim.style.left='0';this.listShim.style.top='0';this.listShim.src='javascript:false;';this.listShim.frameBorder='0';this.listShim.scrolling='no';this.list.parentNode.insertBefore(this.listShim,this.list);}else{this.ie=false;}
this.itemPrefix=options.itemPrefix;this.selectionId=options.selectionId;this.input=$(options.input);this.onselect=options.onselect;this.container.addClassName("prettySelect");this.button.addClassName("prettySelectButton");this.selected.addClassName("prettySelectSelected");this.list.addClassName("prettySelectList");var prettySelect=this;this.button.onclick=this.selected.onclick=function(){prettySelect.buttonPress();prettySelect.showList();};this.items=this.list.getElementsByClassName("prettySelectItem");for(var i=0;i<this.items.length;i++){var currentItem=this.items[i];var currentBgColor=currentItem.style.backgroundColor;currentItem.onclick=function(){prettySelect.select(this);};currentItem.onmouseover=function(){if(prettySelect.parseItemId(this.id)!=prettySelect.selectionId)this.style.backgroundColor="#A9D1FF";};currentItem.onmouseout=function(){if(prettySelect.parseItemId(this.id)!=prettySelect.selectionId)this.style.backgroundColor=currentBgColor;};}
var listItems=this.list.getElementsByTagName("li");this.updateSelected();this.updateListActive();},buttonPress:function(){},updateSelected:function(){var selection=document.getElementById(this.itemPrefix+this.selectionId);if(selection!=null){this.selected.innerHTML=selection.innerHTML;var dividers=this.selected.getElementsByClassName("prettySelectDivider");for(var i=0;i<dividers.length;i++){var currentDivider=dividers[i];currentDivider.parentNode.removeChild(currentDivider);}}},showList:function(){this.list.show();if(window.event){var prettySelectListObject=this.list;registerCloser('click',function(e){prettySelectListObject.hide();});}
if(this.ie==true){this.listShim.style.display=this.list.style.display;this.listShim.style.width=this.list.offsetWidth;this.listShim.style.height=this.list.offsetHeight;this.listShim.style.top=this.list.style.top;this.listShim.style.left=this.list.style.left;this.listShim.style.zIndex=this.list.style.zIndex-1;}},hideList:function(){this.list.hide();if(this.ie==true){this.listShim.style.display=this.list.style.display;this.listShim.style.width=this.list.offsetWidth;this.listShim.style.height=this.list.offsetHeight;this.listShim.style.top=this.list.style.top;this.listShim.style.left=this.list.style.left;this.listShim.style.zIndex=this.list.style.zIndex-1;}},select:function(element){this.selectionId=this.parseItemId(element.id);this.buttonPress();this.updateSelected();this.updateListActive();this.hideList();this.input.value=this.selectionId;this.onselect(this.selectionId);},updateListActive:function(){for(var i=0;i<this.items.length;i++){var currentItem=this.items[i];if(this.parseItemId(currentItem.id)==this.selectionId){currentItem.style.backgroundColor="#A9D1FF";}
else{if(i%2==1){currentItem.style.backgroundColor="#EDF5FF";}
else{currentItem.style.backgroundColor="#FFFFFF";}}}},parseItemId:function(itemId){var chunks=itemId.split("_");return(chunks[1])?chunks[1]:null;}};function populateRecentlyViewed(response){var recentlyViewedContent='';rpidCount=0;for(rpid in response['recentPids']){if(rpidCount==3){break;}
if(rpid!=productId){$('extraContainer').show();$('recentlyViewedHeader').show();recentlyViewedContent+='<div class="thumbOuterBox floatLeft">';recentlyViewedContent+=' <div id="'+rpid+'" class="highlightBox">';recentlyViewedContent+='  <table><tr><td>';if(response['recentPids'][rpid]['mintTin']){recentlyViewedContent+='   <a href="/products/ProductView_'+rpid+'.htm"><img src="'+imgHost+'product/'+rpid+'/width/100/height/80.jpg"/><br/></a>';}
else{recentlyViewedContent+='   <a href="/products/ProductView_'+rpid+'.htm"><img src="'+imgHost+'product/'+rpid+'/width/100/height/80.jpg"/><br/></a>';}
recentlyViewedContent+='  </td></tr></table>';recentlyViewedContent+=' </div>';recentlyViewedContent+=' <a href="/products/ProductView_'+rpid+'.htm">'+response['recentPids'][rpid]['productName']+'</a><br/>';if(response['recentPids']['itemsPerSet']>0){recentlyViewedContent+='<font class="subTextBrown">*as low as $'+pricify(response['recentPids'][rpid]['lowestUnitPrice'])+' per set</font>';}
else{recentlyViewedContent+='<font class="subTextBrown">*as low as $'+pricify(response['recentPids'][rpid]['lowestUnitPrice'])+' each</font>';}
recentlyViewedContent+='</div>';rpidCount++;}}
$('recentlyViewedContent').update(recentlyViewedContent);recentlyViewedContent='';rpidCount=0;for(rpid in response['recentPids']){if(rpidCount==10){break;}
if(rpidCount==5){recentlyViewedContent+='<br/>'}
if(rpid!=productId){recentlyViewedContent+='<div class="thumbOuterBox floatLeft">';recentlyViewedContent+=' <div id="'+rpid+'" class="highlightBox">';recentlyViewedContent+='  <table><tr><td>';if(response['recentPids'][rpid]['mintTin']){recentlyViewedContent+='   <a href="/products/ProductView_'+rpid+'.htm"><img src="'+imgHost+'product/'+rpid+'/width/100/height/80.jpg"/><br/></a>';}
else{recentlyViewedContent+='   <a href="/products/ProductView_'+rpid+'.htm"><img src="'+imgHost+'product/'+rpid+'/width/100/height/80.jpg"/><br/></a>';}
recentlyViewedContent+='  </td></tr></table>';recentlyViewedContent+=' </div>';recentlyViewedContent+=' <a href="/products/ProductView_'+rpid+'.htm">'+response['recentPids'][rpid]['productName']+'</a><br/>';if(response['recentPids']['itemsPerSet']>0){recentlyViewedContent+='<font class="subTextBrown">*as low as $'+pricify(response['recentPids'][rpid]['lowestUnitPrice'])+' per set</font>';}
else{recentlyViewedContent+='<font class="subTextBrown">*as low as $'+pricify(response['recentPids'][rpid]['lowestUnitPrice'])+' each</font>';}
recentlyViewedContent+='</div>';rpidCount++;}}
recentlyViewedContent+='<br/>';if(rpidCount>3){$('recentlyViewedPopupContent').update(recentlyViewedContent);$('recentlyViewedSeeMore').show();}}
function handleRequest(transport){var response=transport.responseText.evalJSON();switch(response.type){case'getRecentlyViewed':populateRecentlyViewed(response);break;default:break;}}
function getRecentlyViewed(params){new Ajax.Request('/productView/tools.html',{method:'post',parameters:params,onSuccess:function(transport){handleRequest(transport);},onFailure:function(transport){}});}
function handleRecentlyViewedCookie(){var recentProducts=getCookie("recentProducts")||"";recentArray=new Array();recentArray=recentProducts.split(",");var newRecentArray=new Array();var cookieCount=0;while(cookieCount<recentArray.length){if(recentArray[cookieCount]==productId){cookieCount++}
else if(cookieCount<30){newRecentArray.push(recentArray[cookieCount]);cookieCount++;}
else{break;}}
newRecentArray.reverse();newRecentArray.push(productId);newRecentArray.reverse();setCookie("recentProducts",newRecentArray.join(","));}
function paperHelp(anchor){var paperContent;paperContent="<h3>Paper</h3><br/>";paperContent+="Our premium 110lb. Matte Card Cardstock features a smooth and silky surface that is easily impressionable and provides a unique and luxurious feel.<br/>";paperContent+="<br/>";paperContent+="Tiny Prints recycled paper consists of 50% recycled content of which 30% is post-consumer waste. All cards printed on recycled paper also come with recycled, white envelopes.";paperContent+='<table width="100%" align="center">';paperContent+=' <tr>';paperContent+='  <td align="center" style="padding:10px;">';paperContent+='    <img src="/images/help-paper-100bpaper.jpg"/><br/>100lb cardstock<br>vs office paper<br/><small>(50 sheets of paper)</small>';paperContent+='  </td>';paperContent+='  <td align="center" style="padding:10px;">';paperContent+='   <img src="/images/help-paper-110bpaper.jpg"/><br/>110lb cardstock<br>vs office paper<br/><small>(50 sheets of paper)</small>';paperContent+='  </td>';paperContent+=' </tr>';paperContent+='</table>';paperHelpPanel=new YAHOO.widget.Panel("paperHelpPanel",{width:"320px",visible:true,draggable:false,close:true});paperHelpPanel.setHeader("<b>?</b> Help");paperHelpPanel.setBody(paperContent);var kl=new YAHOO.util.KeyListener(document,{keys:27},{fn:paperHelpPanel.hide,scope:paperHelpPanel,correctScope:true},"keyup");paperHelpPanel.cfg.queueProperty("keylisteners",kl);paperHelpPanel.render(anchor);registerCloser('click',function(e){closeOpenWindows(e,paperHelpPanel);});return false;}
function envelopeHelp(anchor){var envelopeContent;envelopeContent="<h3>Envelopes</h3><br/>";envelopeContent+="White envelopes are included with your order at no additional cost. All recycled cards come with recycled white envelopes at no extra charge. Colored envelopes and envelopes with colored liners are also available for a small fee per envelope. Check below for some examples of the different kinds of envelopes we offer.<br/>";envelopeContent+="<br/>";envelopeContent+="<small>(Colored envelopes are not made from recycled paper)</small>";envelopeContent+='<table width="100%" align="center">';envelopeContent+=' <tr>';envelopeContent+='  <td align="center" style="padding:10px;">';envelopeContent+='    <img src="/images/help-envelope-thumbnail.png"/><br/><small>White Envelopes</small>';envelopeContent+='  </td>';envelopeContent+='  <td align="center" style="padding:10px;">';envelopeContent+='   <img src="/images/help-envelope-lining-thumbnail.png"/><br/><small>White Envelopes<br/>with colored liners</small>';envelopeContent+='  </td>';envelopeContent+=' </tr>';envelopeContent+='</table>';envelopeHelpPanel=new YAHOO.widget.Panel("envelopeHelpPanel",{width:"320px",visible:true,draggable:false,close:true,zIndex:1000});envelopeHelpPanel.setHeader("<b>?</b> Help");envelopeHelpPanel.setBody(envelopeContent);var kl=new YAHOO.util.KeyListener(document,{keys:27},{fn:envelopeHelpPanel.hide,scope:envelopeHelpPanel,correctScope:true},"keyup");envelopeHelpPanel.cfg.queueProperty("keylisteners",kl);envelopeHelpPanel.render(anchor);registerCloser('click',function(e){closeOpenWindows(e,envelopeHelpPanel);});return false;}
function collectionsHelp(anchor){var collectionsContent;collectionsContent="<h3>Add a Collection</h3><br/>";collectionsContent+="Like this design? Check out some coordinating products with the same look! Please note that we can only guarantee that the colors of different products will match if all of the items are placed within the same order.";collectionsHelpPanel=new YAHOO.widget.Panel("collectionsHelpPanel",{width:"320px",visible:true,draggable:false,close:true,zIndex:1000});collectionsHelpPanel.setHeader("<b>?</b> Help");collectionsHelpPanel.setBody(collectionsContent);var kl=new YAHOO.util.KeyListener(document,{keys:27},{fn:collectionsHelpPanel.hide,scope:collectionsHelpPanel,correctScope:true},"keyup");collectionsHelpPanel.cfg.queueProperty("keylisteners",kl);collectionsHelpPanel.render(anchor);registerCloser('click',function(e){closeOpenWindows(e,collectionsHelpPanel);});return false;}
function shippingHelp(anchor){var shippingContent;shippingContent="<h3>Shipping Options</h3><br/>";shippingContent+="Tiny Prints offers four options for delivery within the continental United States, including Ground, 3-Day, 2-Day and Next Day Air shipping. For customers in Hawaii and Alaska, we offer either 2-Day or Next Day Air delivery.<br/>";shippingContent+="<br/>";shippingContent+="We also welcome international orders, but we do not ship sample orders or pre-shipped envelopes to addresses outside of the U.S. All of our packages are shipped via UPS, FedEx or USPS. Sample orders are shipped exclusively through the U.S. Postal Service. All of our shipping rates are extremely competitive, reflecting the cost of the carriers' fees.";shippingContent+='<br/><a href="/orderinfo.htm#shiptime" target="_blank">>See our shipping timeline.</a>';shippingHelpPanel=new YAHOO.widget.Panel("shippingHelpPanel",{width:"320px",visible:true,draggable:false,close:true});shippingHelpPanel.setHeader("<b>?</b> Help");shippingHelpPanel.setBody(shippingContent);var kl=new YAHOO.util.KeyListener(document,{keys:27},{fn:shippingHelpPanel.hide,scope:shippingHelpPanel,correctScope:true},"keyup");shippingHelpPanel.cfg.queueProperty("keylisteners",kl);shippingHelpPanel.render(anchor);registerCloser('click',function(e){closeOpenWindows(e,shippingHelpPanel);});return false;}
function rushHelp(anchor){var rushContent;rushContent="<h3>Rush Options</h3><br/>";rushContent+="Because we carry an extensive selection of products, processing times will vary for each of the items in your order. You can find an estimated processing time on each product description page.<br/>";rushContent+="<br/>";rushContent+="Please note, however, that this timeframe does not include shipping transit time, which can take anywhere from one to six business days. If you need your products sooner than their estimated arrival, you can add Rush Processing to your order for a small fee.<br/>";rushContent+="<br/>";rushContent+="The rush feature cuts processing times in half for most orders. Coupled with Next Day Air shipping, rush processing will get your products to you as soon as possible.  PS. Sample orders are shipped exclusively through the U.S. Postal Service. All of our shipping rates are extremely competitive, reflecting the cost of the carriers' fees.<br/>";rushContent+='<a href="/orderinfo.htm#ordproc" target="_blank">>See our rush options schedule.</a>';rushHelpPanel=new YAHOO.widget.Panel("rushHelpPanel",{width:"320px",visible:true,draggable:false,close:true});rushHelpPanel.setHeader("<b>?</b> Help");rushHelpPanel.setBody(rushContent);var kl=new YAHOO.util.KeyListener(document,{keys:27},{fn:rushHelpPanel.hide,scope:rushHelpPanel,correctScope:true},"keyup");rushHelpPanel.cfg.queueProperty("keylisteners",kl);rushHelpPanel.render(anchor);registerCloser('click',function(e){closeOpenWindows(e,rushHelpPanel);});return false;}
function typeHelp(anchor){var typeContent;typeContent="<h3>Card Types</h3><br/>";typeContent+="<b>Flat Card:</b> This is a one-sided card featuring the Tiny Prints logo printed on the back.<br/>";typeContent+="<br/>";typeContent+="<b>Folded Card:</b> This style of card features a design on the front, and often text or images on the inside of the card as well. The Tiny Prints logo is printed on the back of the last page of the card.<br/>";typeContent+='<table width="100%" align="center">';typeContent+=' <tr>';typeContent+='  <td align="center" style="padding:10px;">';typeContent+='    <img src="/images/help-type-flat.png"/><br/><small>Flat Card</small>';typeContent+='  </td>';typeContent+='  <td align="center" style="padding:10px;">';typeContent+='   <img src="/images/help-type-folded.png"/><br/><small>Folded Card</small>';typeContent+='  </td>';typeContent+=' </tr>';typeContent+='</table>';typeHelpPanel=new YAHOO.widget.Panel("typeHelpPanel",{width:"320px",visible:true,draggable:false,close:true});typeHelpPanel.setHeader("<b>?</b> Help");typeHelpPanel.setBody(typeContent);var kl=new YAHOO.util.KeyListener(document,{keys:27},{fn:typeHelpPanel.hide,scope:typeHelpPanel,correctScope:true},"keyup");typeHelpPanel.cfg.queueProperty("keylisteners",kl);typeHelpPanel.render(anchor);registerCloser('click',function(e){closeOpenWindows(e,typeHelpPanel);});return false;}
function photoHelp(anchor){var photoContent;photoContent="<h3>Photos</h3><br/>";photoContent+='Photos can be uploaded and edited during the personalization process. To do so, please navigate to the Personalize page (page two) of the personalization process and click on the button that says, "Click Here to Add Picture".<br/>';photoContent+="<br/>";photoContent+="Follow the on-screen instructions to add photos to your photo tray. Then, you can drag and drop the picture into the photo area on the card of your choice. To edit the picture, click on a photo area on your card to interact with our photo editing options.<br/>";photoHelpPanel=new YAHOO.widget.Panel("photoHelpPanel",{width:"320px",visible:true,draggable:false,close:true});photoHelpPanel.setHeader("<b>?</b> Help");photoHelpPanel.setBody(photoContent);var kl=new YAHOO.util.KeyListener(document,{keys:27},{fn:photoHelpPanel.hide,scope:photoHelpPanel,correctScope:true},"keyup");photoHelpPanel.cfg.queueProperty("keylisteners",kl);photoHelpPanel.render(anchor);registerCloser('click',function(e){closeOpenWindows(e,photoHelpPanel);});return false;}
function printingHelp(anchor){var printingContent;printingContent="<h3>Printing Process</h3><br/>";printingContent+='At Tiny Prints, we print all of our designs on the highest quality digital printing press available. Unlike some digital printers, which use toner like an average laser printer, our digital press uses liquid ink for high resolution digital color that rivals even the best traditional offset printing presses available.<br/>';printingContent+="<br/>";printingContent+="This type of on-demand digital offset printing represents the hottest technology in color printing, providing the quality of traditional printing while capitalizing on the efficiency of a digital workflow.<br/>"
printingContent+='<a href="/printingprocesses.htm" target="_blank">>Visit our printing processes guide.</a>';printingHelpPanel=new YAHOO.widget.Panel("printingHelpPanel",{width:"320px",visible:true,draggable:false,close:true});printingHelpPanel.setHeader("<b>?</b> Help");printingHelpPanel.setBody(printingContent);var kl=new YAHOO.util.KeyListener(document,{keys:27},{fn:printingHelpPanel.hide,scope:printingHelpPanel,correctScope:true},"keyup");printingHelpPanel.cfg.queueProperty("keylisteners",kl);printingHelpPanel.render(anchor);registerCloser('click',function(e){closeOpenWindows(e,printingHelpPanel);});return false;}
function inkColorHelp(anchor,button){var inkColorContent;inkColorContent="<h3>Ink Colors</h3><br/>";inkColorContent+="You can change the color of your text as a part of the personalization process. All you have to do is visit the Personalize page (page two) and click on the text area that you want to change. A pop-up screen will appear with a drop down menu that offers ink color options for you to choose from.<br/>";inkColorContent+='<a href="/tiny-prints-design-creation-preview-suite-for-holidays.htm" target="_blank">>Visit our personalization tutorial.</a>';inkColorHelpPanel=new YAHOO.widget.Panel("inkColorHelpPanel",{width:"320px",visible:true,draggable:false,close:true});inkColorHelpPanel.setHeader("<b>?</b> Help");inkColorHelpPanel.setBody(inkColorContent);var kl=new YAHOO.util.KeyListener(document,{keys:27},{fn:inkColorHelpPanel.hide,scope:inkColorHelpPanel,correctScope:true},"keyup");inkColorHelpPanel.cfg.queueProperty("keylisteners",kl);inkColorHelpPanel.ownerButton=$(button);inkColorHelpPanel.render(anchor);registerCloser('click',function(e){closeOpenWindows(e,inkColorHelpPanel);});return false;}
function typeStyleHelp(anchor){var typeStyleContent;typeStyleContent="<h3>Type Styles</h3><br/>";typeStyleContent+="You can change the type style of your products during the personalization process. Simply navigate to the Personalize page (page two) and click on a text area. A pop-up window will appear featuring a drop down menu that allows you to choose the perfect type style to complete your design.";typeStyleHelpPanel=new YAHOO.widget.Panel("typeStyleHelpPanel",{width:"320px",visible:true,draggable:false,close:true});typeStyleHelpPanel.setHeader("<b>?</b> Help");typeStyleHelpPanel.setBody(typeStyleContent);var kl=new YAHOO.util.KeyListener(document,{keys:27},{fn:typeStyleHelpPanel.hide,scope:typeStyleHelpPanel,correctScope:true},"keyup");typeStyleHelpPanel.cfg.queueProperty("keylisteners",kl);typeStyleHelpPanel.render(anchor);registerCloser('click',function(e){closeOpenWindows(e,typeStyleHelpPanel);});return false;}
function openemailwin(productId){var newWin=window.open("/tellafriendform.php?pid="+productId,"tellfriend","scrollbars,resizable,width=432,height=470");newWin.focus();}
function sendFavorite(productId){new Ajax.Request('/insert_favorite_service.php',{method:'post',parameters:{pid:productId},onSuccess:function(transport){var response=transport.responseText;if(response.substr(0,3)=="url"){window.location.href=response.substring(4,response.length);}
else{$('savedFavorite').update("Saved Favorite");$('savedFavorite').removeClassName("clickable");$('savedFavorite').addClassName("inactive");$('savedFavorite').onclick=function(){return false;};$('savedFavoriteIcon').removeClassName("clickable");$('savedFavoriteAnchor').addClassName("inactive");$('savedFavoriteAnchor').onclick=function(){return false;};}},onFailure:function(transport){}});}
function checkFavorite(productId){new Ajax.Request('/check_favorite_service.php',{method:'get',parameters:{pid:productId},onSuccess:function(transport){var response=transport.responseText;if(response.substr(0,3)=="YES"){$('savedFavorite').update("Saved Favorite");$('savedFavorite').removeClassName("clickable");$('savedFavorite').addClassName("inactive");$('savedFavorite').onclick=function(){return false;};$('savedFavoriteIcon').removeClassName("clickable");$('savedFavoriteAnchor').addClassName("inactive");$('savedFavoriteAnchor').onclick=function(){return false;};}},onFailure:function(transport){}});}
function parseCookies(){if(collectionPidListJSON){for(cpid in collectionPidListJSON){var collectionQuantity=getCookie('q'+collectionPidListJSON[cpid]);if(collectionQuantity>0){$(cpid+'collectionQuantity').value=collectionQuantity;}}}
if(getCookie('q'+occasionId)>0){$('productQuantity').value=getCookie('q'+occasionId);}
var cookieCData=getCookie('cData');if(cookieCData){cData=cookieCData.evalJSON();var radios=document.getElementsByName('shipMethod');for(var i=0;i<radios.length;i++){if(radios[i].value==cData['shipMethodId']){radios[i].checked=true;}}
$('rush').value=cData['rushFlag'];$('stateAbbrv').value=cData['stateAbbrv'];if(cData['addCollections']==1){if($('collectionsRadioYes')){$('collectionsRadioYes').checked=true;toggleCollections();}}}}
function cookieDataUpdate(){var cookieData=Object.toJSON(cData);setCookie('cData',cookieData);}
function initPage(){$('mainPanel').show();$('layoutsPanel').show();handleRecentlyViewedCookie();getRecentlyViewed({type:'getRecentlyViewed'});patchCrumb();checkFavorite(productId);swapPanelsColors();calculatePrices();var imgPreloader=new Image();for(panels in productPanelsJSON){for(colors in productColorsJSON){imgPreloader.src=imgPrefix+'/panel/'+panels+'/color/'+colors+imgSuffix;}}}
