function LandingAddToBag(sku){var qty=$("#"+sku).val(),bagItems=[],bagItem={Quantity:parseInt(qty),Sku:sku,OrderType:"LP"};bagItems.push(bagItem);Bag_AddToBagServiceCall(bagItems)}function ShowLandingModal(imgSrc,title){var popupBackground=$("#popupBackground");if(popupBackground.length===0){$("body").append('<div id="popupBackground"></div>');popupBackground=$("#popupBackground")}popupBackground.css("filter","alpha(opacity=70)").fadeIn(500);$("#ModalLandingPopupText").text(title);$(function(){var img=new Image;$(img).load(function(){$("#LandingImageHolder").append(this);GetImageSizeAndShowModal(this,title.length)}).error(function(){hideModal("ModalLandingPopupImageDiv")}).attr("src",imgSrc)});$("#LandingImageHolder").fadeIn(500)}function GetImageSizeAndShowModal(image,textLength){if(image.height===0||image.width===0){HideLandingModalImagePopup();return}var modalHeight=image.height+28;if(textLength>45)modalHeight+=20;var modalWidth=image.width,widthString=modalWidth.toString()+"px",marginLeftString="-"+(modalWidth/2).toString()+"px",heightString=modalHeight.toString()+"px",scollpos=document.documentElement.scrollTop,popup=$("#ModalLandingPopupImageDiv");popup.css("display","inline");popup.css("width",widthString);popup.css("margin-left",marginLeftString);popup.css("height",heightString);popup.css("top",scollpos)}function HideLandingModalImagePopup(){$("#LandingImageHolder").html("");hideModal("ModalLandingPopupImageDiv")}
