//
// @(#)$Header:   //VM/ecom/archives/fpstore/htdocs/store/includes/cartMessages.js-arc   1.5   22 Aug 2008 07:17:16   rajasuma  $
//

function cartHeader() 
{
 //return "<td valign=\"top\">" +
        //"&nbsp;&nbsp;<img src=\"/images/sc_header2.gif\" border=\"0\" ALT=\"Shopping Cart\">" +
        //"</td>";
 //return "<td valign=\"middle\" height=\"0\">" +
        //"&nbsp;&nbsp;<img src=\"/images/sc_header.gif\" border=\"0\" ALT=\"Shopping Cart\">" +
        //"</td>";
 return "<td height=\"0\">"+
        "<span class=\"hdrLargeBold\">Shopping Cart</span>"+
        "</td>";
}

function keyCodeLabel()
{
 return "Enter key code or promotional code (optional):";
}

function Write_add_to_bag(p_gift_registry_number) {
  var sOutput = "";
  if (p_gift_registry_number == ''){
    sOutput = sOutput + '&nbsp;Add to Cart. </td>';
    sOutput = sOutput + '<td valign="center" align="left">';
    sOutput = sOutput + '<a class="actionOn" href="javascript:document.cartform.submit();"><img src="/checkout/images/bag/addtobag.gif" alt="Add to Cart" border="0"></a>';
  } else {
    sOutput = sOutput + '</td>';
    sOutput = sOutput + '<td valign="center" align="right">';
    sOutput = sOutput + '<a class="actionOn" href="javascript:document.cartform.submit();"><img src="/gift_registry/images/btn_addtoregistry.gif" alt="Add to Registry" border="0"></a>';
  }

  document.write(sOutput);
}

function Write_Cart_Instructions() {
  var sOutput = "";
  sOutput = '<b>If you make any changes to your shopping cart, 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 cart 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 cart will be stored for 30 days. ';
  sOutput = sOutput + 'Please log in when you return to shop.fisher-price.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 catalog 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 catalog 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);
}

function Write_Invalid_Item(prodcode) {
  var sOutput = "";
 // below line commented by sumathi #927554
//  sOutput = "! We're sorry. " + prodcode + " is an invalid Product Code.";
    sOutput = " We're sorry. " + prodcode + " is an invalid Product Code.";
  document.write(sOutput);
}

function Write_Unavailable_Item(prodcode) {
  var sOutput = "";
 // below line commented by sumathi #927554
//  sOutput = "! We're sorry. " + prodcode + " currently sold out.";
    sOutput = " We're sorry. " + prodcode + " currently sold out.";
  document.write(sOutput);
}

function Write_Noqf_Item(prodcode,pagelink,prodmessage) {
  var sOutput = "";
  if (prodmessage != '') {
    sOutput = sOutput + prodmessage;
  } else {
    sOutput = sOutput + "We're sorry.  " + prodcode + " cannot be ordered using Catalogue Quick Order.  ";
    sOutput = sOutput + 'Please go to the <a href="' + pagelink + '">product page</a>.';
  }
  document.write(sOutput);
}

function Write_QCart_Step1() {
  var sOutput = "";
  sOutput = sOutput + '<SPAN class="text">';

  sOutput = sOutput + 'If this box is empty, simply enter the Key Code highlighted in yellow on the back of your Fisher-Price catalog ';
  sOutput = sOutput + '(for example, A12345).  When a number automatically appears here, do <b>not</b> change it to your catalog Key Code. ';
  sOutput = sOutput + '</SPAN>';
  sOutput = sOutput + ' <a class="popUpLnk" href="javascript:win_popup(\'/html/shared/KeyCode.html\',\'450\',\'425\');" border="0">Where is this?</a>';
  document.write(sOutput);
}

function Write_QCart_Step2(p_gift_registry_number) {
  var sOutput = "";
  sOutput = sOutput + '<SPAN class="text">';
  if (p_gift_registry_number == ""){
    sOutput = sOutput + 'Enter Product Codes for items you would like to order.';
    sOutput = sOutput + ' The code appears near the end of each item description (for example, F3-P73510).';
    sOutput = sOutput + ' <a class="popUpLnk" href="javascript:win_popup(\'/html/shared/ProductCode.html\',\'450\',\'400\');" border="0">Where is this?</a>';
  } else {
    sOutput = sOutput + 'In order to update a Gift Registry through Catalog Quick Entry, simply enter the ';
    sOutput = sOutput + 'desired product codes in the spaces provided.';
  }
  sOutput = sOutput + '</SPAN>';

  document.write(sOutput);
}

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

function Write_Max_Club_Qty_Message() {
  var sOutput = "";
  sOutput = 'The following product(s) have club purchase quantity limits. Your item quantity has been set to the maximum quantity.: ';
  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 Cart using Catalog Quick Order.</span>';
  document.write(sOutput);
}

function Write_Cart_Footer() {
  var sOutput = "";
  //replaced by shared navigation
  document.write(sOutput);
}

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

function Write_Cart_Specials_Link() {
  var sOutput = "";
  sOutput = '<a href="" target="_top">';
  document.write(sOutput);
}

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

function Write_Need_Selection() {
  var sOutput = "";
  sOutput = '* Listed below are one or more items that still need your attention.  Once you have made your selection(s), please choose "Add to Bag" to start the checkout process.';
  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="000000">You may purchase an additional ' + tierRemaining + ' of products without increasing your shipping costs.</font>';
  document.write(sOutput);
}

function Write_Bts_Link() {
  var cookieString = document.cookie;
  var refererUrl = "REFERURL";
  var refererUrlExists = cookieString.indexOf(refererUrl);
  var sOutput = "";
  var linkStr = "";

  if(refererUrlExists != -1){

    var start = cookieString.indexOf(refererUrl) + refererUrl.length + 1;
    var end = cookieString.indexOf(";",start);

    if (end == -1){
      end = cookieString.length;
    }

    linkStr = cookieString.substring(start,end);
  
    if ((linkStr.indexOf('shop.fisher-price.com') == -1) ||
        (linkStr.indexOf('topnav') != -1) ||
        (linkStr.indexOf('wishlist') != -1)) {
      linkStr = "/";
    }

  } else {

    linkStr = "/";
  }

  sOutput = '<a href="' + linkStr + '" target="_top"><img src="/images/sc_back_to_shop.gif" alt="Back to Shopping" border="0"></a>';

  document.write(sOutput);
}

