// Web software by DavidRegier.com
function ShoppingCart(){this.addToCart=addToCart;this.changeQuan=changeQuan;this.deleteCart=deleteCart;this.exportCart=exportCart;this.getCart=getCart;this.getMoney=getMoney;this.getOtherInfo=getOtherInfo;this.getSaveCartWin=getSaveCartWin;this.getQuanGUI=getQuanGUI;this.getWarning=getWarning;this.importCart=importCart;this.initAddToCartPopUp=initAddToCartPopUp;this.initChangeQuanPopUp=initChangeQuanPopUp;this.itemFound=itemFound;this.msgNoCook="You have turned off Cookies! You must re-enable cookies to use our shopping cart.";this.quanValid=quanValid;this.removeItem=removeItem;this.reviewData=reviewData;this.saveCart=saveCart;this.setSub=setSub;this.showMsg=showMsg;this.writeBuyIt=writeBuyIt;this.writeCheckoutMsg=writeCheckoutMsg;this.writeItem=writeItem;this.writeOrderIt=writeOrderIt;this.writeOrderJamie=writeOrderJamie;this.reportErr=true;this.dataFile="data.js";this.checkOutPage="maui-wedding-order.aspx";this.viewCartPage="maui-wedding-cart.aspx";this.cartExpDate=GetCookie("saveCart")?expDateSaveCart:null;this.addToCartTimer=0;this.jamieOnly=true;this.jamieCerInCart=false;this.jamieCerHourInCart=false;this.jamieRecInCart=false;this.jamieAdditionalHrsRecMusic=0;this.wedServicesInCart=false;this.wedPkgInCart=false;this.WedLocKeysInCart=null;this.Msg=new Array();this.Msg["buyIt"]="Add this item to your shopping cart";this.Msg["closeWin"]="Close this pop-up window";this.Msg["viewCart"]="Review & edit your order";this.Msg["checkout"]="Submit your order";this.AddCartGUI=new Array();this.AddCartGUI.Beg="<form name='addCartForm' style='margin:10px 0px 0px 0px; text-align:left;' onSubmit='SC.addToCart( this ); return false;'><TABLE ALIGN='center' BORDER='0' CELLSPACING='0' CELLPADDING='0' class='fSize12 fColorGray204'>";this.AddCartGUI.Sub="<TR><TD NOWRAP ALIGN='right'><div style='margin:0px 4px 0px 0px;' class='fColorGray153'>Subtotal:</div></TD><TD NOWRAP><div style='margin:0px 2px 0px 10px;' id='cartRunSub'>$0.00</div></TD></TR>";this.AddCartGUI.End="<TR><TD NOWRAP VALIGN=top ALIGN='right'><div style='margin:6px 4px 0px 0px;' class='fColorGray153'>Price:</div></TD><TD><div style='margin:6px 2px 0px 10px;' id='scPrice'></div></TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right'><div style='margin:6px 4px 0px 0px;' class='fColorGray153'>Item:</div></TD><TD><div style='margin:6px 2px 0px 10px;' id='scItem'></div></TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right'><div style='margin:6px 4px 0px 0px;' class='fColorGray153'>Description:</div></TD><TD><div style='margin:6px 2px 0px 10px;' id='scDescription'></div></TD></TR><TR><TD colspan=2 ALIGN='center'><input name='add_to_cart_button' type='submit' value='Add to Shopping Cart' style='margin:10px 0px 0px 0px;' onMouseover='self.status=this.title; return true;' onMouseout='self.status=\"\"; return true;' title='Click to add this item to your order'><div style='margin:6px 2px 0px 10px;' id='cartItem' class='scBullets'><A HREF='javascript:DW.removeWin();' onMouseOver='this.title=SC.Msg.closeWin; self.status=this.title; return true;' onMouseOut='self.status = \"\"; return true;' class='scLink'>Close</A> &#149; <A HREF='"+this.viewCartPage+"' onClick='if( SF ) DW.removeWin(); return setURL( this );' onMouseOver='this.title=SC.Msg.viewCart; self.status=this.title; return true;' onMouseOut='self.status = \"\"; return true;' class='scLink'>View-Cart</A> &#149; <A HREF='"+this.checkOutPage+"' onClick='if( SF ) DW.removeWin(); return setURL( this );' onMouseOver='this.title=SC.Msg.checkout; self.status=this.title; return true;' onMouseOut='self.status = \"\"; return true;' class='scLink' target='_top'>Checkout</A></div></TD></TR></TABLE><INPUT TYPE='hidden' length='10' name='key'><INPUT TYPE='hidden' length='10' name='pkg'></form>";this.AddCartGUI.Title="Add To Cart";this.changeQuanGUI="<form name='changeQuanForm' style='margin:10px 0px 0px 0px; text-align:left;' onSubmit='SC.changeQuan( this ); return false;'><TABLE ALIGN='center' BORDER='0' CELLSPACING='0' CELLPADDING='0' class='fSize12 fColorGray204'><TR><TD NOWRAP VALIGN=top ALIGN='right'><div style='margin:6px 4px 0px 0px;' class='fColorGray153'>Item</div></TD><TD><div style='margin:6px 2px 0px 10px;' id='scItem'></div></TD></TR><TR><TD NOWRAP ALIGN='right'><div style='margin:6px 4px 0px 0px;' class='fColorGray153'>Old Quantity</div></TD><TD NOWRAP><div style='margin:6px 2px 0px 10px;' id='scOldQuan'></div></TD></TR><TR><TD NOWRAP ALIGN='right'><div style='margin:6px 4px 0px 0px;' class='fColorGray153'>New Quantity</div></TD><TD NOWRAP><INPUT TYPE='text' maxlength='4' name='quantity' onFocus='self.status = this.title;' onBlur='self.status = \"\";' STYLE='width:60px; margin:6px 2px 0px 12px;' autocomplete='off' title='Enter quantity as a number'></TD></TR><TR><TD colspan=2 ALIGN='center'><INPUT TYPE='submit' value='Change Quantity' STYLE='margin:10px 0px 0px 0px;' onMouseover='self.status=this.title; return true;' onMouseout='self.status=\"\"; return true;' title='Click to change quantity of this item'></TD></TR></TABLE><INPUT TYPE='hidden' length='10' name='indexNum'></form>";this.ChangeQuan=["Change Quantity",this.changeQuanGUI];this.TaxExplanation=["Hawaii State Tax","The State of Hawaii levies a "+DB.Cart.HawaiiTax+"% Gross Excise Tax on services rendered within the State of Hawaii. It is waived for merchandise (CD's) sold to non-hawaii residents."];function getWarning(key,pkg){var warning="";var cartData=GetCookie("cartData");if(cartData){var itemName=Item[key][1].replaceLiteral("^","\"");var maxQuan=(typeof Item[key][4]=="number")?Item[key][4]:-1;var maxQuanGroup=(typeof Item[key][5]=="number")?Item[key][5]:-1;var Records=cartData.split("_");var existingQuan=0;var existingQuanGroup=0;var existingPkg="";for(var i=0;i<Records.length;i++){var ExistingItem=Records[i].split("|");var existingKey=ExistingItem[1];if(existingKey.indexOf("&")>=0)existingKey=ExistingItem[1].split("&")[0];if(!existingPkg&&existingKey.indexOf("pkg")==0)existingPkg=existingKey;if(key==existingKey)existingQuan+=parseInt(ExistingItem[0]);if(key.substring(0,3)!="pkg"&&key.substring(0,3)==existingKey.substring(0,3)&&Item[key][5]&&Item[existingKey][5])existingQuanGroup+=parseInt(ExistingItem[0]);}
var newQuan=1+existingQuan;var newQuanGroup=1+existingQuanGroup;if(maxQuan!=-1&&newQuan>maxQuan)warning+="You cannot order \""+itemName+"\" because you already have the maximum allowable quantity of "+maxQuan+" for this item in your cart. ";else{if(pkg&&existingPkg&&existingPkg!=pkg){var change="change";if(existingPkg!="pkgMe"&&pkg=="pkgMe")change="downgrade";else if(existingPkg=="pkgMe"&&pkg!="pkgMe")change="upgrade";warning+="You presently have "+Item[existingPkg][1]+" for "+SC.getMoney(Item[existingPkg][0])+" in your cart. Adding this item will "+change+" it to "+Item[pkg][1]+" for "+SC.getMoney(Item[pkg][0])+". ";}
if(maxQuanGroup!=-1&&newQuanGroup>maxQuanGroup){var groupName="";switch(key.substring(0,3)){case "but":groupName="Butterflies";break;case "cak":groupName="Cake";break;case "can":groupName="Candlelight Dinner";break;case "dov":groupName="Doves";break;case "jcm":groupName="Jamie's Ceremony Music";break;case "jrm":groupName="Jamie's Reception Music";break;case "loc":groupName="a location";break;case "mus":groupName="music";break;case "pho":groupName="photography";break;case "pkg":groupName="a package";break;case "trn":groupName="Transportation";break;case "vid":groupName="video";break;default:alert("Switch/Case Error at SC.getWarning");}
warning+="You already have "+groupName+" in your cart. Go to <A HREF='"+this.viewCartPage+"' onClick='if( SF ) DW.removeWin(); return setURL( this );' onMouseOver='this.title=SC.Msg.viewCart; self.status=this.title; return true;' onMouseOut='self.status = \"\"; return true;' class='scLink' style='white-space:nowrap; color:rgb( 51,153,0 );'>View-Cart</A> at anytime to review and edit your order...";}}
if(warning){warning="<tr><td colspan='2'><div style='margin:0px 8px 10px 8px;' class='fColorGray204 fSize10'><span class='bold fColorWhite'>NOTE</span>: "+warning+"</div></td></tr>";}}
return warning;}
function importCart(){var qStr=unescape(document.location.search.substring(1));if(qStr){var qStrRE=/^order=\d+\|.+&end$/;if( qStrRE.test(qStr)){var cartData=qStr.getVal("order");var exp=(qStr.charAt(qStr.length-5)=="1")?expDate365:null;cartData=cartData.replaceLiteral(".^.","&");var existingCart=GetCookie("cartData");if((existingCart&&confirm("You already have an existing shopping cart but are about to import a new one.\n\n1) Click OK to import the new order and overwrite your existing cart OR;\n2) Click Cancel to preserve your existing cart"))||!existingCart)SetCookie("cartData",cartData,SC.cartExpDate,"/",cookieDomain);document.location.href="index.aspx?page=maui-wedding-cart.aspx";}
else
alert("ERROR: Were sorry but an error occurred while trying to import a shopping cart order from the query-string portion of the URL: \""+document.location.search.substring(1)+"\"\n\nTIP: If you clicked the link from an e-mail, verify that the e-mail program did not insert hard line break(s) within the URL. If it did, you may need to manually copy & paste the \"broken\" lines into the browser's address bar.\n\nNOTE: Properly formatted URL's will always end with \"&end\"");}}
function exportCart(eMail){var cartData=GetCookie("cartData");if(cartData){var sub="Tropical Maui Weddings Shopping Cart Order; click link to load cart";cartData=cartData.replaceLiteral(" ","%20");cartData=cartData.replaceLiteral("&",".^.");var msg="http://"+theHost+"/"+((local)?"tmw/":"")+this.viewCartPage+"?order="+cartData+"&end";if(eMail)msg+="\n\nTO RECEPIENT: If the above web address is not \"clickable\", you will need to copy and paste it starting from \"http...\" to \"&end\" into the address field of your web browser.";}
else
var msg="Empty";if(eMail)document.location.href="mailto:?subject="+escape(sub)+"&body="+escape(msg);else
return msg;}
function getCart(htm){var txt=!htm;var cartData=GetCookie("cartData");var Records=null;var nRecords=0;if(cartData){Records=cartData.split("_");nRecords=Records.length;}
var output=(htm)?"<div id='shopping_cart' style='margin:25px 0px 0px 0px;'>":"";output+=(htm)?"<table align=center border=0 cellpadding=5 cellspacing=3"+((nRecords>1)?" width=95%":" ")+"class='fSize12'>":"";var newCartData="";if(cartData){output+=(htm)?"<tr align=center><th colspan=6 class='fSize14'><div style='margin:0px 0px 10px 0px;'>My Shopping Cart</div></th></tr>":"";output+=(htm)?"<tr align=center class='bkgColorGray51'>":"";var showHeaderRow=(nRecords>1||cartData.indexOf("|pkg")==-1);if(htm)output+=(showHeaderRow)?"<th class='pfHide'>&nbsp;</th><th>Quantity</th><th>Item</th><th>Description</th><th>Cost Ea</th><th>Line Total</th></tr>":"";var lineTotal=0;var runningTotal=0;var rowNum=0;var pkgRowNum=0;var pkg="";var locTotal=0;var merDueNow=0;this.jamieOnly=true;this.jamieCerInCart=false;this.jamieCerHourInCart=false;this.jamieRecInCart=false;this.jamieAdditionalHrsRecMusic=0;this.wedServicesInCart=false;this.wedPkgInCart=false;this.WedLocKeysInCart=new Array();while(rowNum<nRecords){var ThisItem=Records[rowNum].split("|");var key=ThisItem[1];var otherInfo="";if(key.indexOf("&")>=0){key=ThisItem[1].split("&")[0];otherInfo=ThisItem[1].split("&")[1];}
var quantity=parseInt(ThisItem[0]);if(Item[key]){if(key.indexOf("pkg")!=0){var price=Item[key][0];var itemName=Item[key][1].replaceLiteral("^","\"");var description=Item[key][2].replaceLiteral("^","\"");output+=(htm)?"<tr align=center class='bkgColorGray51'>":"";output+=(htm)?"<td class='pfHide'><a href='javascript:SC.removeItem("+rowNum+");' onMouseOver=\"self.status=this.title; return true;\" onMouseOut=\"self.status=''; return true;\" title='Remove this item from order' style='text-decoration:underline;'>Remove</a></td>":"";output+=(htm)?"<td><a href=javascript:'javascript:void(0);' onClick='if( window.DW ) { DW.createWindow( SC.ChangeQuan, [1,300,0], this, event, 6 ); SC.initChangeQuanPopUp( \""+key+"\", "+quantity+", "+rowNum+" ); } return false;' onMouseOver=\"self.status=this.title; return true;\" onMouseOut=\"self.status=''; return true;\" title='Change quantity of this item' style='text-decoration:underline;'>"+quantity+"</a></td>":(output)?"\n\n"+quantity:quantity;output+=(htm)?"<td>"+itemName+"</td>":" of "+itemName;lineTotal=quantity*price;runningTotal+=lineTotal;if(key.substring(0,3)=="mer"){merDueNow+=lineTotal;description=DB.Cart.ShipCD;}
if(key.substring(0,3)!="jcm"&&key.substring(0,3)!="jrm")this.jamieOnly=false;if(key.substring(0,3)=="jcm")this.jamieCerInCart=true;if(key=="jcmHour")this.jamieCerHourInCart=true;if(key.substring(0,3)=="jrm")this.jamieRecInCart=true;if(key=="jrmAdditionalHours")this.jamieAdditionalHrsRecMusic=quantity/2;if(key.substring(0,3)!="mer"&&key.substring(0,3)!="jcm"&&key.substring(0,3)!="jrm")this.wedServicesInCart=true;output+=(htm)?"<td>"+description+otherInfo+"</td>":"\n"+description+otherInfo;var preecedingPeriod=((description+otherInfo).length>0)?". ":"";output+=(htm)?"<td>"+this.getMoney(price)+"</td>":preecedingPeriod+this.getMoney(price)+" each";output+=(htm)?"<td>"+this.getMoney(lineTotal)+"</td>":"; line total: "+this.getMoney(lineTotal);output+=(htm)?"</tr>":"";if(key.indexOf("loc")==0){locTotal+=Item[key][0];this.WedLocKeysInCart.push(key);}}
else{this.jamieOnly=false;this.wedPkgInCart=true;pkg=key;pkgRowNum=rowNum;}
newCartData+=(newCartData)?"_"+Records[rowNum]:Records[rowNum];}
else
output+=(htm)?"<tr align=center class='bkgColorGray51'><td> &nbsp;</td><td>-</td><td>-</td><td>-</td><td>-</td><td class='fSize10'>ERROR: The item referenced by primary key \""+key+"\" could not be found in our data-base. This is probably because it has been discontinued. However, if you feel you have received this message in error please <nobr><A HREF='javascript:reportErr( \"Web Site Problem - Data not found\", \"Primary key \\&#34;"+key+"\\&#34; not found in \\&#34;"+this.dataFile+"\\&#34;\", 1 );'><span class='fSize10'>report this problem</span></A></nobr> to our web site administrator.</td></tr>":"";rowNum++;}
SetCookie("cartData",newCartData,SC.cartExpDate,"/",cookieDomain);if(pkg){output+=(htm)?"<tr class='bkgColorGray51'><th colspan=5 align=right><a href='javascript:SC.removeItem("+pkgRowNum+");' onMouseOver=\"self.status=this.title; return true;\" onMouseOut=\"self.status=''; return true;\" title='Remove this item from order' style='text-decoration:underline; font-weight:normal; font-size:10pt;'>Remove</a>&nbsp;&nbsp;"+Item[pkg][1]+"</th><th align=center>"+this.getMoney(Item[pkg][0])+"</th></tr>":"\n\n"+Item[pkg][1]+": "+this.getMoney(Item[pkg][0]);runningTotal+=Item[pkg][0];}
var runningTotalOut=this.getMoney(runningTotal);output+=(htm)?"<tr class='bkgColorGray51'><th colspan=5 align=right>Your Running Total</th><th align=center>"+runningTotalOut+"</th></tr>":"\n\nSUB-TOTAL: "+runningTotalOut;var taxCost=(runningTotal-merDueNow)*DB.Cart.HawaiiTax/100;var taxOutput=this.getMoney(taxCost);output+=(htm)?"<tr class='bkgColorGray51'><th colspan=5 align=right><a href=javascript:'javascript:void(0);' onClick='if( window.DW ) DW.createWindow( SC.TaxExplanation, [0,300,0], this, event, 6 ); return false;' onMouseOver=\"self.status=this.title; return true;\" onMouseOut=\"self.status=''; return true;\" title='Learn more about Hawaii State Tax' class='qMark bkgColorGray40 pfHide'>&nbsp;?&nbsp;</a>&nbsp;&nbsp;"+DB.Cart.HawaiiTax+"% Hawaii State Tax </th><th align=center>"+taxOutput+"</th></tr>":"\n HAWAII TAX: "+taxOutput;var gTotalWithTax=runningTotal+taxCost;var gTotalOutput=this.getMoney(gTotalWithTax);output+=(htm)?"<tr class='bkgColorGray51'><td colspan=5 align=right>&nbsp;&nbsp;<b>Grand Total </b></td><th align=center>"+gTotalOutput+"</th></tr>":"\nGRAND TOTAL: "+gTotalOutput;if(this.wedServicesInCart||this.wedPkgInCart){if(merDueNow>0){var merDueNowOut=this.getMoney(merDueNow);output+=(htm)?"<tr class='bkgColorGray51'><td colspan=5 align=right>&nbsp;&nbsp;Cost CD(s) Payable Now </td><th align=center>"+merDueNowOut+"</th></tr>":"\nCOST CD(s) PAYABLE NOW: "+merDueNowOut;}
var deposit=(gTotalWithTax-merDueNow)*DB.Cart.Deposit.Percent/100;if(deposit<DB.Cart.Deposit.Floor)deposit=DB.Cart.Deposit.Floor;var depositOut=this.getMoney(deposit);var deferredPayable=gTotalWithTax-merDueNow-deposit;deferredPayable=(deferredPayable>0)?deferredPayable:0;var deferredPayableOut=this.getMoney(deferredPayable);output+=(htm)?"<tr class='bkgColorGray51'><td colspan=5 align=right>&nbsp;&nbsp;If this is a final order your wedding deposit payable on checkout today is</td><th align=center>"+depositOut+"</th></tr>":"\nDEPOSIT PAYABLE TODAY: "+depositOut+" (a)";if(merDueNow>0){var totalAtCheckout=this.getMoney(merDueNow+deposit);output+=(htm)?"<tr class='bkgColorGray51'><td colspan=5 align=right>&nbsp;&nbsp;If this is a final order your total payable on checkout today is</td><th align=center>"+totalAtCheckout+"</th></tr>":"\nTOTAL PAYABLE NOW: "+totalAtCheckout+" (b)";}
output+=(htm)?"<tr class='bkgColorGray51'><td colspan=5 align=right>&nbsp;&nbsp;Outstanding wedding balance due one month prior to wedding</td><th align=center>"+deferredPayableOut+"</th></tr>":"\nDEFERRED PAYABLE: "+deferredPayableOut+" (c)";if(txt){output+="\n\n(a) Wedding Deposit payable on checkout today should this be a final order";if(merDueNow>0)output+="\n(b) Total payable on checkout today should this be a final order";output+="\n(c) Outstanding wedding balance due 1 month prior to wedding";}}}
else if(!navigator.cookieEnabled)output+=(htm)?"<tr align=center class='bkgColorGray51'><th>"+SC.msgNoCook+"</th></tr>":SC.msgNoCook;else{var msgCartEmpty="Your Shopping Cart is Empty";output+=(htm)?"<tr align=center class='bkgColorGray51'><th>&nbsp;"+msgCartEmpty+"&nbsp;</th></tr>":msgCartEmpty;this.jamieOnly=false;this.wedServicesInCart=false;this.wedPkgInCart=false;}
output+=(htm)?"</table>":"";var siteLang="NOTE: An additional deposit will be required by the site provider to hold your location. Upon receipt of this order, we will inform you of this deposit amount and it shall be applied to your Total.";var wedWithoutPkg=(cartData&&this.wedServicesInCart&&!this.wedPkgInCart);if(wedWithoutPkg){var warning=(htm)?"<b class='fColorRed'>IMPORTANT</b>: ":"NOTE: ";warning+="You have wedding services in your order without a package. All final wedding orders must contain a package.";var noPkgTxt=warning+" You can resolve this by:<ol style='margin-top:0px; margin-bottom:0px;'><li>Loading our <a href='maui-wedding-packages.aspx' onClick='return setURL( this );'>package-page</a> and adding a package; OR</li><li><a href='maui-wedding-order.aspx' onClick='return setURL( this );'>Submitting this order</a> as \"non-final\" so that we can provide additional assistance.</li></ol>";output+=(htm)?"<div class='fSize9 fColorGray153' style='width:75%; text-align:left; margin:8px 0px 16px 0px;'>"+noPkgTxt+"</div>":"\n"+warning;}
if(locTotal)output+=(htm)?"<div class='fSize9 fColorGray153' style='width:75%; text-align:left; margin:8px 0px 16px 0px;'>"+siteLang+"</div>":"\n\n"+siteLang;if(htm){output+="<div id='scConsole' class='fSize12' class='pfHide' style='margin:18px 0px 0px 0px;'> &nbsp;<br></div><div class='fColorGray153 pfHide' style='margin:10px 0px 0px 0px;'>";var backLink="";try{var ref=document.referrer.toLowerCase();if(ref&&(ref.indexOf("tropicalmauiweddings.com")>=0||ref.indexOf("127.0.0.1/tmw")>=0||ref.indexOf("localhost/tmw")>=0||ref.indexOf("192.168.2")>=0))backLink="<a href='javascript:history.back();' onMouseover='try { SC.showMsg( 1 ); return true; } catch(e) {}' onMouseout='try { SC.showMsg(); return true; } catch(e) {}'>Back</a>&nbsp;&#149;&nbsp;"}
catch(Err){backLink="";}
output+=backLink;if(cartData){output+="<a href='javascript:SC.deleteCart();' onMouseover='try { SC.showMsg( 9 ); return true; } catch(e) {}' onMouseout='try { SC.showMsg(); return true; } catch(e) {}' return false;'>Empty Cart</a>&nbsp;&#149;&nbsp;<a href='javascript:SC.exportCart( 1 );' onMouseover='try { SC.showMsg( 3 ); return true; } catch(e) {}' onMouseout='try { SC.showMsg(); return true; } catch(e) {}' oncontextmenu='prompt( \"ADMIN: Copy (Ctrl+C) the URL for this order:\\nTIP: Left-click link to send via e-mail\", SC.exportCart( 0 ) ); return false;'>E-Mail Cart</a>&nbsp;&#149;&nbsp;<a href='javascript:void(0);' onMouseover='try { SC.showMsg( ( ( SC.cartExpDate ) ? 8 : 7 ) ); return true; } catch(e) {}' onMouseout='try { SC.showMsg(); return true; } catch(e) {}' onClick='SC.getSaveCartWin( this, event ); return false;'>Save-Cart</a>&nbsp;&#149;&nbsp;";if(window.print)output+="<a href='javascript:self.print();' onMouseover='try { SC.showMsg( 4 ); } catch(e) {}' onMouseout='try { SC.showMsg(); } catch(e) {}'>Printer-Friendly</a>&nbsp;&#149;&nbsp;";}
output+="<a href='"+this.checkOutPage+"' onClick='return setURL( this );' onMouseover='try { SC.showMsg( 6 ); return true; } catch(e) {}' onMouseout='try { SC.showMsg(); return true; } catch(e) {}' target='_top'>Checkout</a></div>";}
output+=(htm)?"</div>":"";if(txt)output=output.replace(/^\n+|\n+$/g, "" );
return output;}
function showMsg(index){if(!index)index=0;switch(index){case 1:var msg="Shortcut back to the last page you were on";break;case 2:var msg="Review & edit your shipping & tax profile";break;case 3:var msg="Send this order to your fiance, friend or yourself";break;case 4:var msg="Sends a printer-friendly version of this page to your printer";break;case 5:var msg="Reformat page back to default \"web\" layout...";break;case 6:var msg="Submit your completed order on our secure-server";break;case 7:var msg="Save is off: Click to save your order & display it on your next visit";break;case 8:var msg="Save is on: Your order is saved until "+expDateSaveCart.toLocaleString();break;case 9:var msg="Need a fresh start? Then empty all items from your cart!";break;}
if(index){clearTimeout(window.cartMsgTimer);try{document.getElementById("scConsole").innerHTML=msg;} catch(e){}}
else
window.cartMsgTimer=setTimeout("try{ document.getElementById( 'scConsole' ).innerHTML = ' &nbsp;<br>'; } catch( e ) {}",500);}
function saveCart(Form){var saveCart=(Form.saveCart[0].checked);var cartData=GetCookie("cartData");if(saveCart){SetCookie("showWelcome","no",null,"/",cookieDomain);SetCookie("cartData",cartData,expDateSaveCart,"/",cookieDomain);SetCookie("saveCart","yes",expDateSaveCart,"/",cookieDomain);SC.cartExpDate=expDateSaveCart;}
else{SetCookie("cartData",cartData,null,"/",cookieDomain);DeleteCookie("saveCart","/",cookieDomain);SC.cartExpDate=null;}
DW.removeWin();}
function getSaveCartWin(Link,evt){if(window.DW){var htm="<div class='fSize11'>To save your cart, make sure the \"Save-Cart\" radio button is checked & click OK. We will save your order as a cookie until "+expDateSaveCart.toLocaleString()+"<div style='margin:8px 0px 8px 0px;'><table align='center' border='0' cellspacing='0' cellpadding='0' style='border:1px solid rgb( 102,102,102 );'><tr><td class='fSize11 bkgColorGray51'><form style='margin:5px 12px 5px 8px;' onSubmit='SC.saveCart( this ); return false;'><input type='radio' name='saveCart' checked />Save-Cart;&nbsp;&nbsp;<input type='radio' name='saveCart' />Don't Save;&nbsp;&nbsp;&nbsp;<input type='submit' value=' OK ' /></form></td></tr></table></div><div class='fSize9'>Note that due to the limitations of cookies, you must use the same computer & browser that you are using now for this feature to work. Additionally, at the end of this session we suggest you e-mail your cart to yourself (click the \"E-Mail Cart\" link) and/or print your shopping cart for back-up.</div></div>";DW.createWindow(["Saving My Shopping Cart",htm],[1,500,0],Link,evt,6,[2,-250,-20]);}}
function changeQuan(Form){var Quantity=Form.quantity;var newQuan=parseInt(Quantity.value);var oldQuan=parseInt(document.getElementById("scOldQuan").innerHTML);if(newQuan!=oldQuan){var rowNum=parseInt(Form.indexNum.value);var cartData=GetCookie("cartData");var cartDataNew="";var Records=cartData.split("_");for(var k=0;k<Records.length;k++){if(k==rowNum){var key=Records[k].split("|")[1];if(quanValid(Quantity,key,oldQuan)){Records[k]=newQuan+"|"+key;}
else
return;}
cartDataNew+=(cartDataNew)?"_"+Records[k]:Records[k];}
SetCookie("cartData",cartDataNew,SC.cartExpDate,"/",cookieDomain);document.getElementById("shopping_cart").innerHTML=this.getCart(true);DW.removeWin();}
else{alert("You did not change the quantity");Quantity.value="";Quantity.focus();}}
function removeItem(rowNum){var cartData=GetCookie("cartData");var cartDataNew="";var Records=cartData.split("_");for(var k=0;k<Records.length;k++){if(k!=rowNum)cartDataNew+=(cartDataNew)?"_"+Records[k]:Records[k];}
SetCookie("cartData",cartDataNew,SC.cartExpDate,"/",cookieDomain);DW.removeWin();document.getElementById("shopping_cart").innerHTML=this.getCart(true);}
function setSub(showSuccess){var cartData=GetCookie("cartData");var runSub=0;if(cartData){var Records=cartData.split("_");for(i in Records){var ThisItem=Records[i].split("|");var quan=parseInt(ThisItem[0]);var key=ThisItem[1];if(key.indexOf("&")>=0)key=ThisItem[1].split("&")[0];var price=Item[key][0];runSub+=quan*price;}}
if(showSuccess){document.getElementById("cartRunSub").innerHTML="Calculating...";SC.runSub=runSub;setTimeout("try{ document.getElementById( 'cartRunSub' ).innerHTML = SC.getMoney( SC.runSub ); } catch( e ) {}",1000);}
else
document.getElementById("cartRunSub").innerHTML=SC.getMoney(runSub);}
function initAddToCartPopUp(key,pkg){clearTimeout(SC.addToCartTimer);setSub();var charLength=40;var theItem=Item[key][1].replaceLiteral("^","\"");if(theItem.length>charLength)theItem=theItem.substring(0,charLength)+"...";document.getElementById("scItem").innerHTML=theItem;var description=Item[key][2].replaceLiteral("^","\"");if(description.length>charLength)description=description.substring(0,charLength)+"...";document.getElementById("scDescription").innerHTML=description;document.getElementById("scPrice").innerHTML=this.getMoney(Item[key][0]);document.addCartForm.key.value=key;document.addCartForm.pkg.value=pkg;var QuanRow=document.getElementById("QuanRow");if(QuanRow.className!="off"){if(!document.addCartForm.quantity.value)setTimeout("document.addCartForm.quantity.focus()",(IE)?0:250);else
setTimeout("document.addCartForm.add_to_cart_button.focus()",(IE)?0:250);}
else
setTimeout("document.addCartForm.add_to_cart_button.focus()",(IE)?0:250);}
function initChangeQuanPopUp(key,oldQuan,indexNum){var charLength=15;var theItem=Item[key][1].replaceLiteral("^","\"");if(theItem.length>charLength)theItem=theItem.substring(0,charLength)+"...";document.getElementById("scItem").innerHTML=theItem;document.getElementById("scOldQuan").innerHTML=oldQuan;document.changeQuanForm.indexNum.value=indexNum;setTimeout("document.changeQuanForm.quantity.focus()",500);}
function quanValid(Quantity,key,oldQuan){if(key.indexOf("&")>=0)key=key.split("&")[0];function stop(){Quantity.value="";Quantity.focus();return false;}
if(!Quantity.value){alert("Please enter the quantity");return stop();}
else if(isNaN(Quantity.value)){alert("\""+Quantity.value+"\" is not a number - please enter numbers only");return stop();}
else if(parseInt(Quantity.value)<1){alert("Please enter a quantity of 1 or more");return stop();}
else{var quantity=parseInt(Quantity.value);var minQuan=(typeof Item[key][3]=="number")?Item[key][3]:1;var maxQuan=(typeof Item[key][4]=="number")?Item[key][4]:-1;var maxQuanGroup=(typeof Item[key][5]=="number")?Item[key][5]:-1;var itemName=Item[key][1].replaceLiteral("^","\"");if(quantity<minQuan){alert("Sorry. "+itemName+" has a minimum quantity of "+minQuan+".");return stop();}
else if(maxQuan!=-1&&quantity>maxQuan){alert(itemName+" has a maximum quantity of "+maxQuan+" per order.");return stop();}
else if(maxQuan!=-1||maxQuanGroup!=-1){var cartData=GetCookie("cartData");if(cartData){var Records=cartData.split("_");var existingQuan=0;var existingQuanGroup=0;for(var i=0;i<Records.length;i++){var ExistingItem=Records[i].split("|");var existingKey=ExistingItem[1];if(existingKey.indexOf("&")>=0)existingKey=ExistingItem[1].split("&")[0];if(key==existingKey)existingQuan+=parseInt(ExistingItem[0]);if(key.substring(0,3)!="pkg"&&key.substring(0,3)==existingKey.substring(0,3)&&Item[key][5]&&Item[existingKey][5])existingQuanGroup+=parseInt(ExistingItem[0]);}
var newQuan=(oldQuan)?quantity-oldQuan+existingQuan:quantity+existingQuan;if(maxQuan!=-1&&newQuan>maxQuan){alert("Sorry, but you already have the maximum allowable quantity of "+maxQuan+" for "+itemName+" in your cart");return stop();}}}}
return true;}
function addToCart(Form,key,pkg){var addDirect=(arguments.length==3);var otherInfo="";if(Form){var Quantity=Form.quantity;var key=Form.key.value,pkg=Form.pkg.value;var OtherInfo=Form.OtherInfo;if(OtherInfo){otherInfo=OtherInfo.value;if(!otherInfo){alert("Please provide "+document.getElementById("OtherInfoTitle").innerHTML.split(":")[0]);OtherInfo.focus();return false;}
otherInfo=otherInfo.replaceLiteral("_","");otherInfo=otherInfo.replaceLiteral("|","");otherInfo=otherInfo.replaceLiteral("&","and");otherInfo="&"+document.getElementById("OtherInfoTitle").innerHTML+" "+otherInfo;}}
var addingNonPkg=(key.indexOf("pkg")==-1),addingPkg=!addingNonPkg;if(addDirect||quanValid(Quantity,key)){if(navigator.cookieEnabled){var quantity=(addDirect)?1:parseInt(Quantity.value);var cartData=GetCookie("cartData");var newCookie="";if(cartData){var Records=cartData.split("_");var alreadyInCart=false;var pkgAbsent=true;for(var i=0;i<Records.length;i++){var ExistingItem=Records[i].split("|");var existingQuan=parseInt(ExistingItem[0]);var existingKey=ExistingItem[1];if(pkgAbsent&&(existingKey.indexOf("pkg")==0||addingPkg))pkgAbsent=false;var newCookieQuan;var existingItemIsPkg=(existingKey.indexOf("pkg")==0);if(existingItemIsPkg&&pkg){existingKey=pkg;newCookieQuan=1;if(addingPkg){alreadyInCart=true;}}
else{if(key==existingKey){newCookieQuan=quantity+existingQuan;alreadyInCart=true;}
else
newCookieQuan=existingQuan;}
newCookie+=newCookieQuan+"|"+existingKey+"_";}
if(pkg&&pkgAbsent)newCookie+=quantity+"|"+pkg+"_";if(!alreadyInCart)newCookie+=quantity+"|"+key+otherInfo+"_";}
else{if(pkg)newCookie+=quantity+"|"+pkg+"_";if(addingNonPkg)newCookie+=quantity+"|"+key+otherInfo+"_";}
newCookie=newCookie.substring(0,newCookie.length-1);SetCookie("cartData",newCookie,SC.cartExpDate,"/",cookieDomain);if(Form){setSub(1);SC.addToCartTimer=setTimeout("DW.removeWin();",5000);}}
else
alert(this.msgNoCook);}}
function getQuanGUI(key){var presetQuan=Item[key][6];var quan=(presetQuan)?Math.abs(presetQuan):"";var htm="<TR"+((presetQuan>0)?" class='off'":"")+" id='QuanRow'><TD NOWRAP ALIGN='right'><div style='margin:6px 4px 0px 0px;' class='fColorGray153'>Quantity:</div></TD><TD NOWRAP><INPUT TYPE='text' value='"+quan+"' maxlength='4' name='quantity' STYLE='width:60px; margin:6px 2px 0px 12px;' autocomplete='off' title='Enter quantity as a number'></TD></TR>";return htm;}
function getOtherInfo(otherInfo){var htm="";if(otherInfo){htm="<tr><td align='right'><div style='margin:6px 4px 0px 0px;' class='fColorGray153' id='OtherInfoTitle'>"+otherInfo+":</div></td><td><input type='text' name='OtherInfo' onFocus='self.status = this.title;' onBlur='self.status = \"\";' style='width:280px; margin:6px 2px 0px 12px;' autocomplete='off' title='Enter other info...'></td></tr>";}
return htm;}
function writeOrderIt(key,pkg,otherInfo){var nArgs=arguments.length;if(nArgs==3&&typeof arguments[0]=="string"&&typeof arguments[1]=="string"&&typeof arguments[2]=="string"){if(this.itemFound(key)){var htm="<A HREF='javascript:void(0);' onMouseOver='this.title=SC.Msg.buyIt; self.status=this.title; return true;' onMouseOut='self.status = \"\"; return true;' onClick='if( window.DW ) { DW.createWindow( [ SC.AddCartGUI.Title, SC.AddCartGUI.Beg + SC.getWarning( \""+key+"\", \""+pkg+"\" ) + SC.AddCartGUI.Sub + SC.getQuanGUI( \""+key+"\" ) + SC.getOtherInfo( \""+otherInfo+"\" ) + SC.AddCartGUI.End ], [1,450,0], this, event, 6, [2,20,-15] ); SC.initAddToCartPopUp( \""+key+"\", \""+pkg+"\" ); } return false;' oncontextmenu='return SC.reviewData( this, event, \""+key+"\", \""+pkg+"\" );' class='scOrderIt'>Order It</A>";document.write(htm);}}
else{var badArgs="";for(var i=0;i<nArgs;i++)badArgs+=arguments[i]+((i<nArgs-1)?", ":"");window.reportErr("ERROR: Bad call to method \"SC.writeOrderIt\"","Incorrect number of arguments OR Incorrect data types: "+badArgs,1);this.reportErr=false;}}
function writeBuyIt(key){var nArgs=arguments.length;if(nArgs==1&&typeof arguments[0]=="string"){if(this.itemFound(key)){var htm=Item[key][1]+": "+this.getMoney(Item[key][0])+"<br><A HREF='javascript:void(0);' onMouseOver='this.title=SC.Msg.buyIt; self.status=this.title; return true;' onMouseOut='self.status = \"\"; return true;' onClick='if( window.DW ) { DW.createWindow( [ SC.AddCartGUI.Title, SC.AddCartGUI.Beg + SC.getWarning( \""+key+"\", \"\" ) + SC.AddCartGUI.Sub + SC.getQuanGUI( \""+key+"\" ) + SC.AddCartGUI.End ], [1,450,0], this, event, 6, [2,10,-10] ); SC.initAddToCartPopUp( \""+key+"\", \"\" ); } return false;' oncontextmenu='return SC.reviewData( this, event, \""+key+"\", \"\" );' class='scBuyIt'>Buy It</A>";document.write(htm);}}
else{var badArgs="";for(var i=0;i<nArgs;i++)badArgs+=arguments[i]+((i<nArgs-1)?", ":"");window.reportErr("ERROR: Bad call to method \"SC.writeOrderIt\"","Incorrect number of arguments OR Incorrect data types: "+badArgs,1);this.reportErr=false;}}
function writeOrderJamie(key){var nArgs=arguments.length;if(nArgs==1&&typeof arguments[0]=="string"){if(this.itemFound(key)){var htm="<A HREF='javascript:void(0);' onMouseOver='this.title=SC.Msg.buyIt; self.status=this.title; return true;' onMouseOut='self.status = \"\"; return true;' onClick='if( window.DW ) { DW.createWindow( [ SC.AddCartGUI.Title, SC.AddCartGUI.Beg + SC.getWarning( \""+key+"\", \"\" ) + SC.AddCartGUI.Sub + SC.getQuanGUI( \""+key+"\" ) + SC.AddCartGUI.End ], [1,450,0], this, event, 6, [2,10,-10] ); SC.initAddToCartPopUp( \""+key+"\", \"\" ); } return false;' oncontextmenu='return SC.reviewData( this, event, \""+key+"\", \"\" );' class='scBuyIt'>Order It</A>: "+Item[key][1]+" - "+this.getMoney(Item[key][0]);document.write(htm);}}
else{var badArgs="";for(var i=0;i<nArgs;i++)badArgs+=arguments[i]+((i<nArgs-1)?", ":"");window.reportErr("ERROR: Bad call to method \"SC.writeOrderJamie\"","Incorrect number of arguments OR Incorrect data types: "+badArgs,1);this.reportErr=false;}}
function writeItem(key,pkg,otherInfo){var nArgs=arguments.length;if(nArgs==3&&typeof arguments[0]=="string"&&typeof arguments[1]=="string"&&typeof arguments[2]=="string"){if(this.itemFound(key)){var description=(Item[key][2])?". "+Item[key][2].replaceLiteral("^","\""):"";var htm="<A HREF='javascript:void(0);' onMouseOver='this.title=SC.Msg.buyIt; self.status=this.title; return true;' onMouseOut='self.status = \"\"; return true;' onClick='if( window.DW ) { DW.createWindow( [ SC.AddCartGUI.Title, SC.AddCartGUI.Beg + SC.getWarning( \""+key+"\", \""+pkg+"\" ) + SC.AddCartGUI.Sub + SC.getQuanGUI( \""+key+"\" ) + SC.getOtherInfo( \""+otherInfo+"\" ) + SC.AddCartGUI.End ], [1,450,0], this, event, 6, [2,20,-15] ); SC.initAddToCartPopUp( \""+key+"\", \""+pkg+"\" ); } return false;' oncontextmenu='return SC.reviewData( this, event, \""+key+"\", \""+pkg+"\" );' class='scOrderIt'>Order It:</A> "+Item[key][1]+description+" for "+this.getMoney(Item[key][0]);document.write(htm);}}
else{var badArgs="";for(var i=0;i<nArgs;i++)badArgs+=arguments[i]+((i<nArgs-1)?", ":"");window.reportErr("ERROR: Bad call to method \"SC.writeItem\"","Incorrect number of arguments OR Incorrect data types: "+badArgs,1);this.reportErr=false;}}
function getMoney(num){var fNum="";if(num.toFixed)fNum=""+num.toFixed(2);else{fNum=""+num;var theLength=fNum.length;var theDecLoc=fNum.lastIndexOf(".");if(theDecLoc==-1)fNum=fNum+".00";else{var theDollars=fNum.substring(0,theDecLoc);var theCents=fNum.substring(theDecLoc,theLength);var theCents=""+Math.round(theCents*100);if(theCents=="100"){theDollars=parseFloat(theDollars);theDollars+=1;fNum=theDollars+".00";}
else{var newCents=(theCents.length==1)?"0"+theCents:theCents;fNum=theDollars+"."+newCents;}}}
return(fNum.split(".")[1]=="00")?"$"+fNum.split(".")[0]:"$"+fNum;}
function itemFound(key){if(key==""){if(this.reportErr){window.reportErr("Web Site Problem - Primary Key is an empty string","All function calls to SC.writeBuyIt,  SC.writeOrderIt or SC.writeItem must pass the item's Primary Key as a text string.",1);this.reportErr=false;}
return false;}
else if(typeof Item[key]=="undefined"){if(this.reportErr){window.reportErr("Web Site Problem - Primary Key not found in data file","The Primary Key \""+key+"\" not found in data file: "+this.dataFile,1);this.reportErr=false;}
return false;}
else{var ThisItem=Item[key];if(ThisItem.length!=7){window.reportErr("Web Site Problem - Incorrect number of data members in Item Array","Item referenced by Primary Key \""+key+"\" in data file: "+this.dataFile,1);this.reportErr=false;}}
return true;}
function reviewData(Link,evt,key,pkg){var presetQuan=Item[key][6],presetQuanExp="";if(presetQuan>0)presetQuanExp="; Quantity preset. It's invisible (because it's positive) & user cannot change it";else if(presetQuan==0)presetQuanExp="; Quantity blank, user must type it (typical)";else
presetQuanExp="; Quantity preset to "+Math.abs(presetQuan)+". User may change it becuase it is a negative number";var reviewDataGUI="<TABLE ALIGN='center' BORDER='0' CELLSPACING='0' CELLPADDING='0' class='fSize11 fColorGray204'><TR><TD COLSPAN=2><div class='fSize10' style='margin:0px 10px 6px 10px;'>NOTE: You are viewing data intended for Administrator Review. Left-click the \""+Link.innerHTML+"\" link to avoid seeing this info in the future.</div></TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right' nowrap>Lookup Key:&nbsp;&nbsp;</TD><TD>Item."+key+"</TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right' nowrap>Package Key:&nbsp;&nbsp;</TD><TD>"+pkg+"</TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right' nowrap>Price:&nbsp;&nbsp;</TD><TD>"+Item[key][0]+"</TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right' nowrap>Item:&nbsp;&nbsp;</TD><TD>"+Item[key][1]+"</TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right' nowrap>Cart Description:&nbsp;&nbsp;</TD><TD>"+Item[key][2]+"</TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right' nowrap>Min Quantity:&nbsp;&nbsp;</TD><TD>"+Item[key][3]+"</TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right' nowrap>Max Quantity:&nbsp;&nbsp;</TD><TD>"+Item[key][4]+"</TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right' nowrap>Max Group Quan:&nbsp;&nbsp;</TD><TD>"+Item[key][5]+"</TD></TR><TR><TD NOWRAP VALIGN=top ALIGN='right' nowrap>Preset Quan:&nbsp;&nbsp;</TD><TD>"+presetQuan+presetQuanExp+"</TD></TR></TABLE>";SC.ReviewData=["Administrator Review",reviewDataGUI];DW.createWindow(SC.ReviewData,[1,500,0],Link,evt,6);return false;}
function writeCheckoutMsg(){if(GetCookie("cartData")){var htm="<table align='center' border='0' cellspacing='0' cellpadding='0' width='600'><tr><td>You presently have items in your shopping cart. If you intend to submit your shopping cart to us, please use our <a href='maui-wedding-order.aspx' onClick='return setURL( this );' target='_top'>checkout form</a> in lieu of this Make-a-Payment form.</td></tr></table><br>";document.write(htm);}}
function deleteCart(){if(confirm("Click OK to remove ALL items from your shopping cart")){DeleteCookie("cartData","/",cookieDomain);document.getElementById("shopping_cart").innerHTML=this.getCart(true);}}}
SC=new ShoppingCart();