// <SCRIPT language="JavaScript">

// onerror = handleErrors
   var msg = null
   function handleErrors(errorMessage, url, line)
   {
   msg = "There was an error on this page.\n\n";
   msg += "An internal programming error may keep\n";
   msg += "this page from displaying properly.\n";
   msg += "Click OK to continue.\n\n";
   msg += "Error message: " + errorMessage + "\n";
   msg += "URL: " + url + "\n";
   msg += "Line #: " + line;
   alert(msg);
   return true
   }

 function CheckDate(){
   var agt=navigator.userAgent.toLowerCase();
   var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
               && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1));
   var is_navonly  = (is_nav && ((agt.indexOf(";nav") != -1) ||
   (agt.indexOf("; nav") != -1) || (agt.indexOf("; u") != -1) ));
   var is_ie   = (agt.indexOf("msie") != -1);

  if (((new Date()).getYear() >= 2000) && (is_nav) && (!is_ie) && (parseFloat(navigator.appVersion) < 4.06))
  {
  alert("Notice: You appear to have Netscape version 4.05 or earlier which " +
  "erroneously reports some secure certificates as expired. " +
  "We recommend you ignore the incorrect expiration message and " +
  "continue with your order. Your transaction will still be FULLY secure. " +
  "Upgrade to the latest version of your browser to avoid this message in the future.")
  }
  return true; //Always
 }
 function Certify(URL) {
   popupWin = window.open(URL, 'Participant', 'location,scrollbars,width=450,height=300')
   window.top.name = 'opener';
 }
 function WriteCookie () {
   CookieName = 'FF2.Prefs';
   var expire = new Date ();
   numDays       = 365;  //Days 'till Cookie expires
   expire.setTime (expire.getTime() + (numDays * 24 * 3600000)); //6 months from now!
   var SV = expire ;
   SV = SV + '`' + document.Order.A05_name.value;
   SV = SV + '`' + document.Order.A06_address1.value;
   SV = SV + '`' + document.Order.A07_address2.value;
   SV = SV + '`' + document.Order.A08_city.value;
   SV = SV + '`' + document.Order.A09_state.value;
   SV = SV + '`' + document.Order.A10_zip.value;
   SV = SV + '`' + document.Order.A11_country.value;
   SV = SV + '`' + document.Order.A12_phone.value;
   SV = SV + '`' + document.Order.cust_email.value;
   SV = SV + '`' + document.Order.A15_Ship_Name.value;
   SV = SV + '`' + document.Order.A16_Ship_Address1.value;
   SV = SV + '`' + document.Order.A17_Ship_Address2.value;
   SV = SV + '`' + document.Order.A18_Ship_City.value;
   SV = SV + '`' + document.Order.A19_Ship_State.value;
   SV = SV + '`' + document.Order.A20_Ship_Zip.value;
   SV = SV + '`' + document.Order.A21_Ship_Country.value;
   SV = SV + '`' + document.Order.A22_Ship_Phone.value;
   SV = SV + '`' + document.Order.A13_phone.value;
   document.cookie = CookieName +"=" + escape (SV) + "; expires=" + expire.toGMTString() ;
 }
 function ReadCookie() {
   var i = 0,indx = 0, ilen =0; RV ="";
   CookieName = 'FF2.Prefs';
   RV = GetCookie(CookieName);
   if ((RV != null) && (RV != "*")) {  //Data has expired or never entered.
    while (ilen < RV.length) {
     ilen=(RV.indexOf("`", indx)>0) ?RV.indexOf("`", indx):RV.length;
//   if (i==0)  lastvisit.value           = RV.substring(indx, ilen);
     if (i==1)  document.Order.A05_name.value = RV.substring(indx, ilen);
     if (i==2)  document.Order.A06_address1.value = RV.substring(indx, ilen);
     if (i==3)  document.Order.A07_address2.value = RV.substring(indx, ilen);
     if (i==4)  document.Order.A08_city.value = RV.substring(indx, ilen);
     if (i==5)  document.Order.A09_state.value = RV.substring(indx, ilen);
     if (i==6)  document.Order.A10_zip.value = RV.substring(indx, ilen);
//   if (i==7)  document.Order.A11_country.value = RV.substring(indx, ilen);
     if (i==8)  document.Order.A12_phone.value = RV.substring(indx, ilen);
     if (i==9)  document.Order.cust_email.value = RV.substring(indx, ilen);
     if (i==10) document.Order.A15_Ship_Name.value = RV.substring(indx, ilen);
     if (i==11) document.Order.A16_Ship_Address1.value = RV.substring(indx, ilen);
     if (i==12) document.Order.A17_Ship_Address2.value = RV.substring(indx, ilen);
     if (i==13) document.Order.A18_Ship_City.value = RV.substring(indx, ilen);
     if (i==14) document.Order.A19_Ship_State.value = RV.substring(indx, ilen);
     if (i==15) document.Order.A20_Ship_Zip.value = RV.substring(indx, ilen);
//   if (i==16) document.Order.A21_Ship_Country.value = RV.substring(indx, ilen);
     if (i==17) document.Order.A22_Ship_Phone.value = RV.substring(indx, ilen);
     if (i==18) document.Order.A13_phone.value = RV.substring(indx, ilen);
     i++; indx = ilen + 1;
    }
   }

   indx = 0;
   CookieName = 'FF.Refer';
   RV = GetCookie(CookieName);
   if ((RV != null) && (RV != "*")) {  //Data has expired or never entered.
     idx1=RV.indexOf("`")+1;
     idx2=RV.indexOf("`",idx1)+1;
     document.Order.doc_url.value = unescape(RV.substring(idx1, idx2-1));
     document.Order.ref_url.value = unescape(RV.substring(idx2, RV.length));
     ref=RV.toUpperCase();
     if      (ref.indexOf("GOOGLE.")         >1 ) { document.Order.A36_Referrer.selectedIndex=2; }
     else if (ref.indexOf("YAHOO.COM")       >1 ) { document.Order.A36_Referrer.selectedIndex=3; }
     else if (ref.indexOf("BING.COM")        >1 ) { document.Order.A36_Referrer.selectedIndex=4; }
     else if (ref.indexOf("AOL.COM")         >1 ) { document.Order.A36_Referrer.selectedIndex=5; }
     else if (ref.indexOf("ALLTHEWEB.COM")   >1 ) { document.Order.A36_Referrer.selectedIndex=6; }
     else if (ref.indexOf("ALTAVISTA.COM")   >1 ) { document.Order.A36_Referrer.selectedIndex=7; }
     else if (ref.indexOf("OVERTURE.COM")    >1 ) { document.Order.A36_Referrer.selectedIndex=8; }
     else if (ref.indexOf("HOTBOT.")         >1 ) { document.Order.A36_Referrer.selectedIndex=9; }
     else if (ref.indexOf("LOOKSMART.COM")   >1 ) { document.Order.A36_Referrer.selectedIndex=10; }
     else if (ref.indexOf("DOGPILE.COM")     >1 ) { document.Order.A36_Referrer.selectedIndex=11; }
     else if (ref.indexOf("BIZRATE.COM")     >1 ) { document.Order.A36_Referrer.selectedIndex=12; }
     else if (ref.indexOf("TOURBUS.COM")     >1 ) { document.Order.A36_Referrer.selectedIndex=13; }
     else if (ref.indexOf("WEBSBESTNETWORK") >1 ) { document.Order.A36_Referrer.selectedIndex=14; }
     else if (ref.indexOf("123-FLOWERS")     >1 ) { document.Order.A36_Referrer.selectedIndex=14; }
     else if (ref.indexOf("FLOWERSFAST.COM/SAVE")     >1 ) { document.Order.A36_Referrer.selectedIndex=1; }
     else if (ref.indexOf("FLOWERSFAST.COM/SPECIALS") >1 ) { document.Order.A36_Referrer.selectedIndex=13; }

   }
 }
 function GetCookie (CookieName) {
   var cname = CookieName + "=";
   var i = 0;
   while (i < document.cookie.length) {
     var j = i + cname.length;
     if (document.cookie.substring(i, j) == cname){
       var leng = document.cookie.indexOf (";", j);
       if (leng == -1) leng = document.cookie.length;
       return unescape(document.cookie.substring(j, leng));
     }
     i = document.cookie.indexOf(" ", i) + 1;
     if (i == 0) break;
   }
   return "*";
 }
 function Setvals()
 {
   var newtot = 0.00;
   document.Order.price.value = parseInt((parseFloat(document.Order.A03_subtot.value) + parseFloat(document.Order.A04_shipping.value))*100)/100;

   if (document.Order.Add_Balloon.checked) {
      document.Order.Add_Balloon.value="**** ADD A FOIL BALLOON ****";
      newtot = parseFloat(document.Order.price.value) + 4.95;
      document.Order.price.value = round2(newtot) }
   if (document.Order.Add_Bear.checked) {
      document.Order.Add_Bear.value="**** ADD A PLUSH BEAR ****";
      newtot = parseFloat(document.Order.price.value) + 9.95;
      document.Order.price.value = round2(newtot) }
   if (document.Order.Add_Chocolate.checked) {
      document.Order.Add_Chocolate.value="**** ADD CHOCOLATES ****";
      newtot = parseFloat(document.Order.price.value) + 14.95;
      document.Order.price.value = round2(newtot) }
   if (document.Order.Upgrade_Deluxe.checked) {
      document.Order.Upgrade_Deluxe.value="**** DELUXE UPGRADE $" + parseFloat(document.Order.deluxe.value) + " ****";
      newtot = parseFloat(document.Order.price.value) + parseFloat(document.Order.deluxe.value);
      document.Order.price.value = round2(newtot) }
   if (document.Order.Upgrade_Premium.checked) {
      document.Order.Upgrade_Premium.value="**** PREMIUM UPGRADE $" + parseFloat(document.Order.premium.value) + " ****";
      newtot = parseFloat(document.Order.price.value) + parseFloat(document.Order.premium.value);
      document.Order.price.value = round2(newtot) }

   if (document.Order.wgship.value != "NA") {
     if (document.Order.wgship[1].checked) {
         newtot = parseFloat(document.Order.price.value) + 10;
         document.Order.price.value = round2(newtot) }
     if (document.Order.wgship[2].checked) {
         newtot = parseFloat(document.Order.price.value) + 20;
         document.Order.price.value = round2(newtot) }
   }

   newtot = parseFloat(document.Order.price.value);
   document.Order.price.value = round2(newtot);
   document.Order.submit.value = " Pay by Credit Card - Total: $" + document.Order.price.value + " ";

   if (document.Order.A05_name.value != "") { return; }

   today = new Date;				// Get Local date info
   dow   = today.getDay();
   day   = today.getDate();
   hour  = today.getHours();
   month = today.getMonth() + 1;

   myDate = new Date();				// Get GMT date info
   GMTdate = myDate.toGMTString();
   splitvals = GMTdate.split(' ');
   GMTdow  = splitvals[0].substring(0,3);
   GMTday  = splitvals[1];
   GMTmonth= splitvals[2];
   GMThour = splitvals[4].split(':')[0];

   ESTdow = GMTdow;				// Calculate EST date & time
   ESThour = GMThour - 5; if (ESThour<0) {ESThour = ESThour + 24}
   daynames = "SatSunMonTueWedThuFriSat";
   j = daynames.lastIndexOf(GMTdow)-3;
   if (GMThour<4) {ESTdow = daynames.substr(j,3)}

   FEDEX = 0; UPS = 0;
   if (document.Order.A01_title.value.indexOf("FedEx")   >1) { FEDEX   = 1; }
   if (document.Order.A01_title.value.indexOf("- UPS")   >1) { UPS     = 1; }

   if (FEDEX==1) {	// For FEDEX orders
     if  (ESTdow=="Sun")                   {day=day+2}
     if ((ESTdow=="Mon") && (ESThour<12))  {day=day+1}
     if ((ESTdow=="Mon") && (ESThour>=12)) {day=day+2}
     if ((ESTdow=="Tue") && (ESThour<12))  {day=day+1}
     if ((ESTdow=="Tue") && (ESThour>=12)) {day=day+2}
     if ((ESTdow=="Wed") && (ESThour<12))  {day=day+1}
     if ((ESTdow=="Wed") && (ESThour>=12)) {day=day+2}
     if ((ESTdow=="Thu") && (ESThour<12))  {day=day+1}
     if ((ESTdow=="Thu") && (ESThour>=12)) {day=day+2}
     if  (ESTdow=="Fri")                   {day=day+4}
     if  (ESTdow=="Sat")                   {day=day+3}
   }
   else if (UPS==1) {	// For UPS orders
     if  (ESTdow=="Sun")                   {day=day+2}
     if ((ESTdow=="Mon") && (ESThour<12))  {day=day+2}
     if ((ESTdow=="Mon") && (ESThour>=12)) {day=day+3}
     if ((ESTdow=="Tue") && (ESThour<12))  {day=day+2}
     if ((ESTdow=="Tue") && (ESThour>=12)) {day=day+3}
     if ((ESTdow=="Wed") && (ESThour<12))  {day=day+2}
     if ((ESTdow=="Wed") && (ESThour>=12)) {day=day+5}
     if ((ESTdow=="Thu") && (ESThour<12))  {day=day+4}
     if ((ESTdow=="Thu") && (ESThour>=12)) {day=day+5}
     if ((ESTdow=="Fri") && (ESThour<12))  {day=day+4}
     if ((ESTdow=="Fri") && (ESThour>=12)) {day=day+4}
     if  (ESTdow=="Sat")                   {day=day+3}
   }
   else {							// Not FEDEX or UPS
     if (hour>11) { day=day+1 }
     if (document.Order.A00_sku.value.substring(0,1) == "i") { day=day+2; if (dow > 2) {day=day+2;} }
   }

   if ((day>28) && (month==2))  {day=day-28; month=month+1}
   if ((day>30) && (month==4))  {day=day-30; month=month+1}
   if ((day>30) && (month==6))  {day=day-30; month=month+1}
   if ((day>30) && (month==9))  {day=day-30; month=month+1}
   if ((day>30) && (month==11)) {day=day-30; month=month+1}
   if (day==32) {day=1; month=month+1}
   if (day==33) {day=2; month=month+1}
   if (day==34) {day=3; month=month+1}
   if (day==35) {day=4; month=month+1}
   if (day==36) {day=5; month=month+1}
   if (month==13) { month=1 }

   document.Order.A33_Deliver_Month.options[month].selected=true;
   document.Order.A34_Deliver_Day.options[day].selected=true;
   document.Order.EPD.value = document.Order.A33_Deliver_Month.value + " " + document.Order.A34_Deliver_Day.value;

   if (document.Order.A01_title.value.indexOf("Rose") >1) { document.Order.A29_comment1.value = "Rose color second choice: "; }
   if (document.Order.A01_title.value.indexOf("Heart Shaped") >=0) { document.Order.A29_comment1.value = "CAKE MESSAGE \(20 characters max\): "; }

   ReadCookie();
   xrecip = GetCookie("FF.SendTo");
   if ((xrecip != null) && (xrecip != "*")) {
     document.Order.A15_Ship_Name.value = xrecip;
     document.Order.A16_Ship_Address1.value = "Address on File";
     document.Order.A17_Ship_Address2.value = "N/A";
     document.Order.A18_Ship_City.value = "N/A";
     document.Order.A19_Ship_State.value = "N/A";
     document.Order.A20_Ship_Zip.value = "N/A";
     document.Order.A21_Ship_Country.selectedIndex = "0";
     document.Order.A22_Ship_Phone.value = "N/A";
   }

 }
 function Lookup()
 {
  names=document.Order.A15_Ship_Name.value.split(" ")
  city=escape(document.Order.A18_Ship_City.value)
  state=document.Order.A19_Ship_State.value
  name1=names[0]; name2=names[1]; name3=names[2];
  first = name1; last = name2;
  if ((name1=="Mr.") || (name1=="Mrs.")) { first=name2; last=name3}
  URL="http://people.yahoo.com/py/psPhoneSearch.py?Pyt=Tps&FirstName="+first+"&LastName="+last+"&City="+city+"&State="+state
  if (navigator.appVersion.substring(0,1)<4) { W=500; H=400 }
  else { W=screen.width*.75; H=screen.height*.75; }
  window.alert("Using  NAME, CITY and STATE for directory lookup.\n\nPress OK, then close results window when done viewing.")
  window.open(URL,"FFLookup","toolbar=0,location=0,directories=0,menubar=0,resizable=1,scrollbars=1,width="+W+",height="+H);
 }
 function ShowPop(url)
 {
  window.open(url,"NewWin","toolbar=0,location=0,directories=0,menubar=0,resizable=1,scrollbars=1,width=200,height=500");
 }
 function automsg()
 {
  occmsg = new Array(13);
  occmsg[0]=" ";
  occmsg[1]="Our thoughts & prayers are with you."
  occmsg[2]="Hope you're feeling better soon.  We're thinking of you!"
  occmsg[3]="Happy Birthday!  Hope this brightens your day!"
  occmsg[5]="Happy Anniversary!  Here's to another great year together!"
  occmsg[6]="Congratulations!"
  occmsg[7]="Thanks for being a good friend to me."
  occmsg[8]="I love you with all my heart and soul."
  occmsg[9]="Thanks for your kindness to me."
  occmsg[10]="Congratulations on your wedding!"
  occmsg[11]="We appreciate your business."
  occmsg[12]="Hope these flowers brighten your day!"

  var d = new Date();
  mm = d.getMonth() + 1;
  dd = d.getDate();
  occmsg[4]= " ";
  if (mm == 1) { occmsg[4]="Happy New Year!" };
  if (mm == 2) { occmsg[4]="Happy Valentine's Day!" };
  if (mm == 3) { occmsg[4]="Happy Easter!" };
  if (mm == 4) { occmsg[4]="Happy Easter!" };
  if (mm == 5) { occmsg[4]="Happy Mother's Day!" };
  if (mm == 6) { occmsg[4]="Happy Father's Day!" };
  if (mm == 11) { occmsg[4]="Happy Thanksgiving!" };
  if (mm == 12) { occmsg[4]="Merry Christmas!" };
  if ((mm == 12) && (dd >26) ) { occmsg[4]="Happy New Year!" };

  idx=document.Order.A23_occasion.selectedIndex
  names=document.Order.A15_Ship_Name.value.split(" ")
  name1=names[0]; name2=names[1]; name3=names[2]; cardname = name1
  if ((name1=="Mr.") || (name1=="Mrs.")) { cardname=name2; }
  if ((name2=="and") || (name2=="&")) { cardname=name1+" & "+name3; }
  if (document.Order.A25_cardmsg1.value != "") { window.alert("Your card message has been updated.") }
  document.Order.A25_cardmsg1.value="Dear "+cardname+","
  document.Order.A26_cardmsg2.value=occmsg[idx]
  document.Order.A27_cardmsg3.value="-- "+document.Order.A05_name.value
  if (navigator.appVersion.substring(0,1)<4)
    { document.Order.A27_cardmsg3.value="-- (your name)" ; }
 }
 function unquot(instr) {
  var newstr="";
  arrayOfStrings = instr.split('"')
  for (var i=0; i < arrayOfStrings.length; i++) {
     newstr += (arrayOfStrings[i] + "''")
  }
  return newstr.substring(0,newstr.length-2);
 }
 function Checkit()
 {
   var ok=1;
   var m1=" ";
   CheckDate();
   // document.Order.cust_name.value  = document.Order.A05_name.value;
   pf1=document.Order.A00_sku.value.substring(0,1);
   bctry=document.Order.A11_country.value.substring(0,2);

   x = document.Order.A09_state.value;
   while (x.substring(0,1) == ' ') x = x.substring(1);
   while (x.substring(x.length-1,x.length) == ' ') x = x.substring(0,x.length-1);
   document.Order.A09_state.value = x;
   bstat = document.Order.A09_state.value;
   bstat = bstat.replace(/\./g,"");
   document.Order.A09_state.value = bstat;

   ship_ground  = 0; ship_2day = 0; ship_nextday = 0;
   WEBGIFT = 0; FEDEX = 0; UPS = 0;

   if (document.Order.A01_title.value.indexOf("WebGift") >1) { WEBGIFT = 1; }
   if (document.Order.A01_title.value.indexOf("FedEx")   >1) { FEDEX   = 1; }
   if (document.Order.A01_title.value.indexOf("- UPS")   >1) { UPS     = 1; }

   if (WEBGIFT==1) {
     if (document.Order.wgship[0].checked) { ship_ground  = 1; }
     if (document.Order.wgship[1].checked) { ship_2day    = 1; }
     if (document.Order.wgship[2].checked) { ship_nextday = 1; }
   }
   mv = "Missing value: ";

   xstat=document.Order.A19_Ship_State.value.toUpperCase();
   xctry=document.Order.A21_Ship_Country.value.substring(0,2);

   if ( ((xctry!="US" && xctry!="CA")) && (pf1!="i")) { window.alert ("Cannot send this item outside USA/Canada. Please select a product from the INTERNATIONAL page."); ok=0; }
   if ( ((xstat=="PUERTO RICO" || xstat=="PR")) && (pf1!="i")) { window.alert ("Cannot send this item to PUERTO RICO.  Please select a product from the INTERNATIONAL page."); ok=0; }

   if ( (WEBGIFT==1) && (xctry!="US") ) { window.alert ("Cannot send WebGift items outside USA."); ok=0; }
   if ( (FEDEX==1)   && (xctry!="US") ) { window.alert ("Cannot send FedEx items outside USA."); ok=0; }
   if ( (UPS==1)     && (xctry!="US") ) { window.alert ("Cannot send UPS items outside USA."); ok=0; }
   if ( ((WEBGIFT==1) || (FEDEX==1) || (UPS==1)) && ((xstat=="AK") || (xstat=="HI") || (xstat=="ALASKA") || (xstat=="HAWAII")) ) { window.alert ("Cannot send this item to Alaska or Hawaii."); ok=0; }

   if (document.Order.A05_name.value=="") { window.alert (mv + "Billing Name"); ok=0; }
// if (document.Order.orderid.value=="") { window.alert (mv + "Order ID"); ok=0; }
   if (document.Order.A06_address1.value=="") { window.alert (mv + "Billing Address"); ok=0; }
   if (document.Order.A08_city.value=="") { window.alert (mv + "Billing City"); ok=0; }
   if ((bctry=="US") && (bstat.length!=2)) { window.alert ("Please enter 2-letter abbreviation for Billing State/Province"); ok=0; }
   if ((document.Order.A11_country.value=="US") && (document.Order.A10_zip.value=="")) { window.alert (mv + "Billing Zip"); ok=0; }
   if (document.Order.A11_country.value=="") { window.alert (mv + "Billing Country"); ok=0; }
   if (document.Order.A12_phone.value=="") { window.alert (mv + "Home Phone Number "); ok=0; }
   if (document.Order.A13_phone.value=="") { window.alert (mv + "Work Phone Number "); ok=0; }
   if (document.Order.cust_email.value.indexOf("@")<0) { window.alert ("Invalid Billing E-mail"); ok=0; }
   if (document.Order.A15_Ship_Name.value=="") { window.alert (mv + "Recipient Name"); ok=0; }
   if (document.Order.A16_Ship_Address1.value=="") { window.alert (mv + "Recipient Address"); ok=0; }
   if (document.Order.A18_Ship_City.value=="") { window.alert (mv + "Recipient City"); ok=0; }
   if (document.Order.A20_Ship_Zip.value=="") { window.alert (mv + "Recipient Zip/Postal Code\nIf unknown, enter 00000"); ok=0; }
   szip  = document.Order.A20_Ship_Zip.value; szip5 = szip.substring(0,5);
   if ( (szip5 != "") && (xctry=="US") && (isNaN(parseFloat(szip5))) ) { window.alert ("Invalid Recipient Zip Code - Enter 00000 if unknown"); ok=0; }
   if (document.Order.A21_Ship_Country.value=="") { window.alert (mv + "Recipient Country"); ok=0; }
   if (document.Order.A22_Ship_Phone.value=="") { window.alert (mv + "Recipient Phone Number\nIf unknown, enter '???'"); ok=0; }
   if (document.Order.A23_occasion.selectedIndex==0) { window.alert (mv + "Occasion"); ok=0; }
   if (document.Order.A25_cardmsg1.value=="") { window.alert (mv + "Card Message"); ok=0; }
   if (document.Order.A33_Deliver_Month.selectedIndex==0) { window.alert (mv + "Delivery Month"); ok=0; }
   if (document.Order.A34_Deliver_Day.selectedIndex==0) { window.alert (mv + "Delivery Date"); ok=0; }
   if (document.Order.A36_Referrer.selectedIndex==0) { window.alert ("Please tell us how you heard about our store.\nThis information helps us keep our prices low!"); ok=0; }

   testname = document.Order.A15_Ship_Name.value;
   for (var i=0; i<testname.length; i++) {if (testname.lastIndexOf(" ") == testname.length - 1) testname = testname.substr(0,testname.length - 1);}
   test=testname.split(" ");
   if (test.length<2) { window.alert (mv + "Recipient's first & last name required"); ok=0; }

   testname = document.Order.A15_Ship_Name.value;
   for (var i=0; i<testname.length; i++) {if (testname.lastIndexOf(" ") == testname.length - 1) testname = testname.substr(0,testname.length - 1);}
   test=testname.split(" ");
   if (test.length<2) { window.alert (mv + "Recipient's first & last name required"); ok=0; }


   if ( (xctry=="US") && ((xstat == "AB") || (xstat == "ALBERTA")) ) { window.alert ("Invalid U.S. State"); ok=0; }
   if ( (xctry=="US") && ((xstat == "BC") || (xstat == "BRITISH COLUMBIA")) ) { window.alert ("Invalid U.S. State"); ok=0; }
   if ( (xctry=="US") && ((xstat == "MB") || (xstat == "MANITOBA")) ) { window.alert ("Invalid U.S. State"); ok=0; }
   if ( (xctry=="US") && ((xstat == "NL") || (xstat == "NEWFOUNDLAND")) ) { window.alert ("Invalid U.S. State"); ok=0; }
   if ( (xctry=="US") && ((xstat == "NT") || (xstat == "NORTHWEST TERRITORIES")) ) { window.alert ("Invalid U.S. State"); ok=0; }
   if ( (xctry=="US") && ((xstat == "NS") || (xstat == "NOVA SCOTIA")) ) { window.alert ("Invalid U.S. State"); ok=0; }
   if ( (xctry=="US") && ((xstat == "ON") || (xstat == "ONTARIO")) ) { window.alert ("Invalid U.S. State"); ok=0; }
   if ( (xctry=="US") && ((xstat == "PE") || (xstat == "PRINCE EDWARD ISLAND")) ) { window.alert ("Invalid U.S. State"); ok=0; }
   if ( (xctry=="US") && ((xstat == "QC") || (xstat == "PQ") || (xstat == "QUEBEC")) ) { window.alert ("Invalid U.S. State"); ok=0; }
   if ( (xctry=="US") && ((xstat == "SK") || (xstat == "SASKATCHEWAN")) ) { window.alert ("Invalid U.S. State"); ok=0; }
   if ( (xctry=="US") && ((xstat == "YT") || (xstat == "YUKON")) ) { window.alert ("Invalid U.S. State"); ok=0; }

   if (ok==0) return false;

   m1 = unquot(document.Order.A25_cardmsg1.value); document.Order.A25_cardmsg1.value = m1;
   m1 = unquot(document.Order.A26_cardmsg2.value); document.Order.A26_cardmsg2.value = m1;
   m1 = unquot(document.Order.A27_cardmsg3.value); document.Order.A27_cardmsg3.value = m1;

   m1 = unquot(document.Order.A29_comment1.value); document.Order.A29_comment1.value = m1;
   m1 = unquot(document.Order.A30_comment2.value); document.Order.A30_comment2.value = m1;
   m1 = unquot(document.Order.A31_comment3.value); document.Order.A31_comment3.value = m1;

   m1 = unquot(document.Order.A15_Ship_Name.value); document.Order.A15_Ship_Name.value = m1;
   m1 = unquot(document.Order.A16_Ship_Address1.value); document.Order.A16_Ship_Address1.value = m1;
   m1 = unquot(document.Order.A17_Ship_Address2.value); document.Order.A17_Ship_Address2.value = m1;

   mm=document.Order.A33_Deliver_Month.selectedIndex;    // Warn about Sunday
   dd=document.Order.A34_Deliver_Day.selectedIndex;

   today = new Date;				// Get Local date info
   yy=today.getYear(); if (yy<1000) {yy=yy+1900;}
   mdy = new Date(mm+"/"+dd+"/"+yy);

   shipzip = document.Order.A20_Ship_Zip.value;
   // katrina_msg = "Due to the effects of hurricane Katrina, there will be difficulty \n making deliveries in and around the New Orleans area, and other \n affected areas at this time.  Please be aware that significant \n delays may occur in the zipcode you have specified. \n\n";
   // if ( ((shipzip >= 35450) && (shipzip <= 39722)) || ((shipzip >= 70000) && (shipzip <= 70499)) )
   // {
   //   if (!confirm (katrina_msg + "Press OK to continue, or Cancel to modify your order.")) ok=0;
   // }

   if (ok==0) return false;

   if (document.Order.A34_Deliver_Day.options[ document.Order.A34_Deliver_Day.selectedIndex ].value.substring(0,1)=="X") {
     if (!confirm ("PLEASE NOTE: You selected a BLOCKED delivery date.  Your order \n" +
     "will be delivered on the next available business day.  During holiday timeframes \n" +
     "this will probably be the first business day AFTER the holiday. \n\n" +
     "Press OK to continue, or Cancel to modify your order.")) ok=0;
   }
   else if (WEBGIFT==1)  {
     if ( ship_2day && ((mdy.getDay()<3) || (mdy.getDay()==6)) ) {
       if (!confirm ("PLEASE NOTE: 2nd-Day Air delivery is not available Saturday thru Tuesday\n\n" +
       "Press OK to continue, or Cancel to modify your order.")) ok=0;
     }
     if ( ship_nextday && ((mdy.getDay()<2) || (mdy.getDay()==6)) ) {
       if (!confirm ("PLEASE NOTE: Next-Day Air delivery is not available Saturday thru Monday\n\n" +
       "Press OK to continue, or Cancel to modify your order.")) ok=0;
     }
   }
   else if (FEDEX==1) {
     if (mdy.getDay()<2) {
// VDAY   if (document.Order.A34_Deliver_Day.value != 14) {
       if (!confirm ("PLEASE NOTE: FedEx delivery is not available on Sunday or Monday.\n\n" +
       "Press OK to continue, or Cancel to modify your order.")) ok=0;
// VDAY  }
     }
     if (mdy.getDay()==6) {
       if (!confirm ("PLEASE NOTE: FedEx delivery is not available on Saturday. \n\n" +
       "Press OK to continue, or Cancel to modify your order.")) ok=0;
     }
   }
   else if (UPS==1) {
     if ( (mdy.getDay()==0) || (mdy.getDay()==6) ) {
       if (!confirm ("PLEASE NOTE: UPS delivery is not available on Saturday or Sunday .\n\n" +
       "Press OK to continue, or Cancel to modify your order.")) ok=0;
     }
   }
// VDAY else if ( (mdy.getDay()==0) && (dd != 13) ) {
   else if (mdy.getDay()==0) {
     if (!confirm ("PLEASE NOTE: Sunday delivery can not be guaranteed.\n\n" +
     "Your order may be delivered on Monday.\n" +
     "Press OK to continue, or Cancel to modify your order.")) ok=0;
   }

   if ( (FEDEX==1) || (UPS==1) ) {
     if (!confirm ("Earliest possible delivery date:" + document.Order.EPD.value + "\n" +
                   "Your selected delivery date:" + document.Order.A33_Deliver_Month.value + " " + document.Order.A34_Deliver_Day.value + "\n\n" +
     "Press OK to continue, or Cancel to modify your order.")) ok=0;
   }

   if (WEBGIFT==1) {
     if (ship_ground==1)  { ship_msg = "GROUND shipping takes 3-7 business days, and we cannot guarantee a specific delivery date.\n\n Please consider 2nd-Day or Next-Day delivery if a specific delivery date is required." };
     if (ship_2day==1)    { ship_msg = "Orders received by 1pm EST Monday-Wednesday will go out that day." };
     if (ship_nextday==1) { ship_msg = "Orders received by 1pm EST Monday-Thursday will go out that day." };
     if (!confirm ("*** WARNING: YOUR GIFT MAY NOT ARRIVE ON TIME! ***\n\n" + ship_msg + "\n\n" +
                   "Did you read the WebGift Delivery Policy? \n\n" +
     "OK: Continue to Checkout\nCANCEL: Return to order form.")) ok=0;
   }

   if (ok==1) WriteCookie();
   if (ok==0) return false;
 }

function round2(num)
{
  var newval = "0000";
  num = parseFloat(num) + 0.001;
  num = parseFloat(num) * 100;
  num = String(num);
  dot = num.indexOf(".");
  newval = num.substring(0,dot);
  dollars = newval.substr(0,dot-2);
  cents   = newval.substr(dot-2,2);
  if (cents==84) { cents = 85; }
  newval = dollars + "." + cents;
  return newval
}

 function do_balloon()
 {
  var ok=1;
  var newtot = 0.00;
  if (document.Order.Add_Balloon.checked) {
    if ((document.Order.A00_sku.value.substring(0,1)=="i") &&
        (!confirm ("PLEASE NOTE: For international orders, we cannot guarantee availability of add-on items.  If the item is not available, we will compensate by adding extra flowers to the order.\n\n" +
         "Press OK if you agree, or Cancel to remove the add-on item."))) ok=0;

    if (ok==1) {
      document.Order.Add_Balloon.value="**** ADD A FOIL BALLOON ****";
      newtot = parseFloat(document.Order.price.value) + 4.95;
      document.Order.price.value = round2(newtot);
    }
    else {
      document.Order.Add_Balloon.checked = false;
      document.Order.Add_Balloon.value="no";
    }
  }
  else {
      document.Order.Add_Balloon.value="no";
      newtot = parseFloat(document.Order.price.value) - 4.95;
      document.Order.price.value = round2(newtot);
  }

  document.Order.submit.value = " Pay by Credit Card - Total: $" + document.Order.price.value + " ";
 }

 function do_deluxe()
 {
  var newtot = 0.00;
  if (document.Order.Upgrade_Deluxe.checked) {
      document.Order.Upgrade_Deluxe.value="**** DELUXE UPGRADE $" + parseFloat(document.Order.deluxe.value) + " ****";
      newtot = parseFloat(document.Order.price.value) + parseFloat(document.Order.deluxe.value);
      document.Order.price.value = round2(newtot);

      if (document.Order.Upgrade_Premium.checked) {
        document.Order.Upgrade_Premium.value="no";
        document.Order.Upgrade_Premium.checked=false;
        newtot = parseFloat(document.Order.price.value) - parseFloat(document.Order.premium.value);
        document.Order.price.value = round2(newtot);
      }
  }
  else {
      document.Order.Upgrade_Deluxe.value="no";
      newtot = parseFloat(document.Order.price.value) - parseFloat(document.Order.deluxe.value);
      document.Order.price.value = round2(newtot);
  }
  document.Order.submit.value = " Pay by Credit Card - Total: $" + document.Order.price.value + " ";
 }

 function do_premium()
 {
  var newtot = 0.00;
  if (document.Order.Upgrade_Premium.checked) {
      document.Order.Upgrade_Premium.value="**** PREMIUM UPGRADE $" + parseFloat(document.Order.premium.value) + " ****";
      newtot = parseFloat(document.Order.price.value) + parseFloat(document.Order.premium.value);
      document.Order.price.value = round2(newtot);

     if (document.Order.Upgrade_Deluxe.checked) {
      document.Order.Upgrade_Deluxe.value="no";
      document.Order.Upgrade_Deluxe.checked=false;
      newtot = parseFloat(document.Order.price.value) - parseFloat(document.Order.deluxe.value);
      document.Order.price.value = round2(newtot);
     }
  }
  else {
      document.Order.Upgrade_Premium.value="no";
      newtot = parseFloat(document.Order.price.value) - parseFloat(document.Order.premium.value);
      document.Order.price.value = round2(newtot);
  }
  document.Order.submit.value = " Pay by Credit Card - Total: $" + document.Order.price.value + " ";
 }

 function do_bear()
 {
  var ok=1;
  var newtot = 0.00;
  if (document.Order.Add_Bear.checked) {
    if ((document.Order.A00_sku.value.substring(0,1)=="i") &&
        (!confirm ("PLEASE NOTE: For international orders, we cannot guarantee availability of add-on items.  If the item is not available, we will compensate by adding extra flowers to the order.\n\n" +
         "Press OK if you agree, or Cancel to remove the add-on item."))) ok=0;

    if (ok==1) {
      document.Order.Add_Bear.value="**** ADD A PLUSH BEAR ****";
      newtot = parseFloat(document.Order.price.value) + 9.95;
      document.Order.price.value = round2(newtot);
    }
    else {
      document.Order.Add_Bear.checked = false;
      document.Order.Add_Bear.value="no";
    }
  }
  else {
      document.Order.Add_Bear.value="no";
      newtot = parseFloat(document.Order.price.value) - 9.95;
      document.Order.price.value = round2(newtot);
  }
  document.Order.submit.value = " Pay by Credit Card - Total: $" + document.Order.price.value + " ";
 }

 function do_chocolate()
 {
  var ok=1;
  var newtot = 0.00;
  if (document.Order.Add_Chocolate.checked) {
    if ((document.Order.A00_sku.value.substring(0,1)=="i") &&
        (!confirm ("PLEASE NOTE: For international orders, we cannot guarantee availability of add-on items.  If the item is not available, we will compensate by adding extra flowers to the order.\n\n" +
         "Press OK if you agree, or Cancel to remove the add-on item."))) ok=0;

    if (ok==1) {
      document.Order.Add_Chocolate.value="**** ADD CHOCOLATES ****";
      newtot = parseFloat(document.Order.price.value) + 14.95;
      document.Order.price.value = round2(newtot);
    }
    else {
      document.Order.Add_Chocolate.checked = false;
      document.Order.Add_Chocolate.value="no";
    }
  }
  else {
      document.Order.Add_Chocolate.value="no";
      newtot = parseFloat(document.Order.price.value) - 14.95;
      document.Order.price.value = round2(newtot);
  }
  document.Order.submit.value = " Pay by Credit Card - Total: $" + document.Order.price.value + " ";
 }

 function do_wgship()
 {
  var newtot = 0.00;
  document.Order.price.value = parseInt((parseFloat(document.Order.A03_subtot.value) + parseFloat(document.Order.A04_shipping.value))*100)/100;
  if (document.Order.wgship[0].checked) {
    newtot = parseFloat(document.Order.price.value) + 0;
    document.Order.price.value = round2(newtot);
  }
  if (document.Order.wgship[1].checked) {
    newtot = parseFloat(document.Order.price.value) + 10;
    document.Order.price.value = round2(newtot);
  }
  if (document.Order.wgship[2].checked) {
    newtot = parseFloat(document.Order.price.value) + 20;
    document.Order.price.value = round2(newtot);
  }
  document.Order.submit.value = " Pay by Credit Card - Total: $" + document.Order.price.value + " ";
 }

// </SCRIPT>

