Core.StockNotification_Class=function(){this.StockNotificationID="StockNotification_MainContainerID";this.Html_Email_CtrlID="StockNotification_Email";this.PreviousPopUpControlID=null;this.Code="";this.AddStockNotification=function(){var b="";var a=$get(this.Html_Email_CtrlID);if(a!=null){if(a.value!=""){b=a.value;if(checkemail(b)){_CoreModalPopUp.Hide();_WebServiceAPI.ProductStockNotificationSave(b,this.Code,this.AddStockNotificationOnComplete)}else{alert("The email address supplied is invalid.")}}}};this.AddStockNotificationOnComplete=function(a){DoDefault();_StockNotification.DoComplete(a)};this.DoComplete=function(a){_CoreModalPopUp.Hide();if(this.PreviousPopUpControlID!=null){_CoreModalPopUp._PopupControlID=this.PreviousPopUpControlID;_CoreModalPopUp.ShowModal()}if(a.ActivityStatus==true){alert("Your email has been stored in our database.")}else{alert(a.ErrorString)}};this.ShowBubble=function(a,b){this.Code=a;if(b){_CoreModalPopUp.Hide();this.PreviousPopUpControlID=_CoreModalPopUp._PopupControlID}else{this.PreviousPopUpControlID=null;_CoreModalPopUp.Hide()}_CoreModalPopUp._PopupControlID=this.StockNotificationID;_CoreModalPopUp.ShowModal()};this.Close=function(){_CoreModalPopUp.Hide();if(this.PreviousPopUpControlID!=null){_CoreModalPopUp._PopupControlID=this.PreviousPopUpControlID;_CoreModalPopUp.ShowModal()}}};if(IsTypeDefined){Core.StockNotification_Class.registerClass("Core.StockNotification_Class")}var _StockNotification=new Core.StockNotification_Class();