$(document).ready(function()
{
   try
   {
      // Variables
$UseTransparentMissingImage = true;

// Article missing image goes transparent
if ($UseTransparentMissingImage) {
  $(".cssArtGalleryImgInner img, .cssArtListImg img").hide().each(function(i){
    if ($(this).attr("src").indexOf("-IngenBildVald") != -1)
      $(this).attr("src", $(this).attr("src").replace(".jpg", ".png"));
  });
  $(".cssArtGalleryImgInner img, .cssArtListImg img").show();
}

// Move buttons to right column in artview
if ($("body").attr("id") == "bodyArtItem") {
   $(".cssArtItemDataBtnRowList").clone().appendTo(".cssArtItemDataInner");
   $(".cssArtItemDataRow_1 .cssArtItemDataBtnRowList").remove();
   $(".cssArtItemDataBtnRowList").css("margin-top", "10px");
   $(".cssArtItemDataBtnRowList div").css("clear", "both").css("margin-left", "0");
}

// Hide buy button on Ring för pris/offert
var aLangStockStatusItem = {
LangSwe : "Ring för pris/offert",
LangEng : "Call us for price!"
}

$("input#oArtStockStatus:[value='"+ aLangStockStatusItem["LangSwe"] +"']").each(function(){$(".cssArtItemCostExclVatNr").css("display", "none");
$("#cssBtnBuy").css("display", "none");
$(".cssFrmFldArtQtyNr").css("display", "none");
$(".cssBtnBuy").css("display", "none");
});


// Put product in cart and redirect customer to checkout after
// clicking buy button (in product view)
$('#cssBtnBuy > input').removeAttr('onclick');
$('#cssBtnBuy > input').click(function(oE) {
   oE.preventDefault();
   $.get(GetUrlBtnBuyArtItem(), function() {
     window.location.href = sBaseUrl+'/kassan-bestall';
   });
});

// Put the "aqua super" product in cart and redirect customer to checkout after 
// clicking buy button (first product offer on start page)
$('.cssBtnBuy_55000 > input').removeAttr('onclick');
$('.cssBtnBuy_55000 > input').click(function(oE) {
   oE.preventDefault();
   $.get(GetUrlBtnBuyArtList(4, 'aqua-super'), function() {
     window.location.href = sBaseUrl+'/kassan-bestall';
   });
});
   }
   catch(err)
   {
      if (window.console && window.console.error)
      { console.error(arguments); }
      
      
      alert(err.toString());
   }
});

