//
// @(#)$Header:   //VM/ecom/archives/agstore/htdocs/store/includes/shoppingBagMessages.js-arc   1.5   Jan 09 2009 10:51:54   guntakas  $
//

function cartHeader() 
{
 return "<td height=\"0\">"+ 
        "<span class=\"hdrLargeBold\"><nobr>Shopping Bag</nobr></span>"+ 
        "</td>";
}

function keyCodeLabel() 
{
 return "<span class=\"txtInfo\">Enter key code or promotional code (optional):</span>";
}

function Write_add_to_bag() {
  var sOutput = "";
  sOutput = sOutput + 'Add to Bag. ';
  sOutput = sOutput + '<a class="actionOn" href="javascript:document.cartform.submit();"><img src="/checkout/images/bag/addtobag.gif" border="0" alt="Add to Bag"></a>';
  document.write(sOutput);
}

function Write_Cart_Instructions() {
  var sOutput = "";
  sOutput = '<b>If you make any changes to your shopping bag, be sure to press the "Update Items" button.</b>';
  document.write(sOutput);
}

function Write_Save_Cart_Instructions() {
  var sOutput = "";
  sOutput = sOutput + '<b>To save your shopping bag contents for 30 days, ';
  sOutput = sOutput + '<a href="shopping_cart_interface.save_cart?p_sc_type=S" target="_main">click here</a>.</b>';
  document.write(sOutput);
}

function Write_Cart_Saved() {
  var sOutput = "";
  sOutput = sOutput + '<b class=hl1b>The contents of your shopping bag will be stored for 30 days. ';
  sOutput = sOutput + 'Please log in when you return to americangirl.com to access your order. ';
  sOutput = sOutput + 'Note that saving the contents does not guarantee item availability.</b>';
  document.write(sOutput);
}

function Write_Sold_Out_Message() {
  var sOutput = "";
  sOutput = 'We are sorry, the following item(s) you selected are Sold Out and cannot be purchased at this time: ';
  document.write(sOutput);
}

function Write_Invalid_Key_Code() {
  var sOutput = "";
  sOutput = sOutput + 'is an invalid Key Code. Please check the back of your catalogue and re-enter the code. ';
  sOutput = sOutput + 'If you continue to get this error, leave the Key Code blank and proceed to Step 2.';
  document.write(sOutput);
}

function Write_Invalid_Key_Code_Msg() {
  var sOutput = "";
  sOutput = sOutput + 'is an invalid Key Code. Please check the back of your catalogue and re-enter the code. ';
  sOutput = sOutput + 'If you continue to get this error, leave the Key Code blank and proceed with shopping.';
  document.write(sOutput);
}

// #930180 start

function Write_InvalidExpired_Key_Code_Msg() {
  var sOutput = ""; 
  sOutput = sOutput +' Please check the back of your catalogue and re-enter the code. ';
  sOutput = sOutput + 'If you continue to get this error, leave the Key Code blank and proceed with shopping.';  
  document.write(sOutput);
}
// #930180 end

function Write_Invalid_Item(prodcode) {
  var sOutput = "";
  sOutput = "! We're sorry. " + prodcode + " is an invalid Product Code.";
  document.write(sOutput);
}

function Write_Unavailable_Item(prodcode) {
  var sOutput = "";
  sOutput = "! We're sorry. " + prodcode + " is currently sold out.";
  document.write(sOutput);
}

function Write_Note_Item(pagelink) {
  var sOutput = "";
  sOutput = sOutput + "! We're sorry. Gift Certificates cannot be ordered using Catalogue Quick Order.  ";
  sOutput = sOutput + 'Please go to <a href="' + pagelink + '">Gift Ideas</a>';
  document.write(sOutput);
}

function Write_Club_Item(pagelink) {
  var sOutput = "";
  sOutput = "We're sorry. " + pagelink + " is a club item and must be entered from its product page.";
  document.write(sOutput);
}

function Write_QCart_Step1() {
  var sOutput = "";
  sOutput = sOutput + 'Please enter the key code that appears on the back cover of your catalogue in the ';
  sOutput = sOutput + 'yellow box above your mailing address. If your key code is from a special promotion, ';
  sOutput = sOutput + 'please enter that key code instead to take advantage of your special offer. If you ';
  sOutput = sOutput + 'don\'t have a key code, leave this field blank.';
  document.write(sOutput);
}

function Write_QCart_Step2(p_gift_registry_number) {
  var sOutput = "";
  if (p_gift_registry_number == ""){
    sOutput = sOutput + 'Enter Product Codes for items you would like to order (e.g., A7-MDH). When finished, ';
    sOutput = sOutput + 'or if you need to enter additional items, click "Add to Shopping Bag." If prompted, ';
    sOutput = sOutput + 'please make color or size selections for marked items and re-click "Add to Shopping Bag."';
  } else {
    sOutput = sOutput + 'In order to update a Gift Registry through Catalogue Quick Entry, simply enter the ';
    sOutput = sOutput + 'desired product codes in the spaces provided.';
  }

  document.write(sOutput);
}

function Write_QCart_Step3() {
  var sOutput = "";
  sOutput = 'To view or remove items added to your Shopping Bag using Catalogue Quick Order, click "Confirm."';
  document.write(sOutput);
}

function Write_Max_Club_Qty_Message() {
  var sOutput = "";
  sOutput = "This item has been removed from your shopping bag.";
  document.write(sOutput);
}

function Write_Max_Order_Qty_Message() {
  var sOutput = "";
  sOutput = 'The following product(s) have purchase quantity limits. Your item quantity has been set to the maximum quantity.: ';
  document.write(sOutput);
}

function Write_Note_Item_Qty_Message() {
  var sOutput = "";
  sOutput = 'Additional quantities for the following product(s) can be entered through their product page(s): ';
  document.write(sOutput);
}

function Write_QCart_Added_Message() {
  var sOutput = "";
  sOutput = '<span class="txtError">The following items have been added to your Shopping Bag using Catalogue Quick Order.</span>';
  document.write(sOutput);
}

function Write_Cart_Footer() {
  var sOutput = "";
  sOutput = sOutput + '<hr><span class="txtError">If you are experiencing difficulties with the americangirl.com ';
  sOutput = sOutput + 'Web site and/or wish to order by phone, please call us toll-free at <nobr>1-800-845-0005,</nobr>';
  sOutput = sOutput + ' seven days a week, 6 a.m. to midnight, Central Time.</span>';
  document.write(sOutput);
}

function Write_Expired_Item() {
  var sOutput = "";
  sOutput = 'The following item(s) you had saved in your shopping bag are no longer available, and have been removed from your bag:';
  document.write(sOutput);
}

function Write_Cart_Specials_Link() {
  var sOutput = "";
  sOutput = '<a href="/pls/ag/AG_pagemthspc?catid=369413" target="_top">';
  document.write(sOutput);
}

function Write_Empty_Form() {
  var sOutput = "";
  sOutput = 'Please enter a valid Product Code from your catalogue.';
  document.write(sOutput);
}

function Write_Need_Selection() {
  var sOutput = "";
  sOutput = '* Please make a selection for the item(s) marked below.';
  document.write(sOutput);
}

function Write_Ship_Tier_Max() {
  var sOutput = "";
  sOutput = 'Your shipping rate will not increase if you add any additional products to your order.';
  document.write(sOutput);
}

function Write_Ship_Tier(tierRemaining) {
  var sOutput = "";
  sOutput = '<font color="990033">You may purchase an additional ' + tierRemaining + ' of products without increasing your shipping costs.</font>';
  document.write(sOutput);
}

function backToCatalog() {

  return '';

}

function backToShopLink() {
  var cookieString = document.cookie;

  var cookies = document.cookie.split(";");
  var referCookie = "";
  var linkStr = "/";

  for (i=0; i<cookies.length; i++) {

    referCookie = cookies[i].split("=");

    if (referCookie[0].replace(/^\s*|\s*$/,"") == "REFERURL") {

      if ((referCookie[1].indexOf('americangirl.com') > -1) &&
          (referCookie[1].indexOf('wishlist') == -1)) {

        linkStr = cookies[i].substr(cookies[i].indexOf('=')+1);

      }

    }

  }//end for

  return "<a href=\"javaScript:backToShopping('" + 
         linkStr + 
         "');\"><img src=\"/checkout/images/bag/btn_backtoshop.gif\" border=0 alt=\"Back to Shopping\"></a>";
}
