function CollapsablePanel_Item(id, cellId, linkId, hiddenId, imageId, expandText, collapseText, allowSliding, slideSpeed, slideLines, styleCells, collapseStyle, expandStyle, collapseImage, expandImage, clientToggleMethod, groupName, loggedUserId) { var storage = typeof (LocalStorageWrp) == "function" ? new LocalStorageWrp("eWorldCollapsablePanel", loggedUserId.toString()) : null; this.Id = id; this.LinkId = linkId; this.HiddenId = hiddenId; this.ImageId = imageId; this.ExpandText = expandText; this.CollapseText = collapseText; this.StyleCells = styleCells; this.CollapseStyle = collapseStyle; this.ExpandStyle = expandStyle; this.CollapseImage = collapseImage; this.ExpandImage = expandImage; this.ClientToggleMethod = clientToggleMethod; this.GroupName = groupName; this.Collapsed = false; this.HiddenField = null; this.Link = null; this.Image = null; this.Div = null; // Setup this.HiddenField = document.getElementById(this.HiddenId); this.Link = document.getElementById(this.LinkId); this.Image = document.getElementById(this.ImageId); this.Div = document.getElementById(this.Id); this.Setup = function() { } this.Init = function () { this.Collapsed = eval(this.HiddenField.value); if (!this.Collapsed && storage != null && storage.get(id + "_Hide") == "1") this.CollapsePanel(true); if (this.Collapsed) this.Div.style.display = 'none'; this.SetState(this.Collapsed); this.SetStyle(); } this.CollapsePanel = function (force) { this.SetState(true); if (force) { $(this.Div).hide(); $(window).trigger("resize"); } else { $(this.Div).slideUp({ progress: function () { $(window).trigger("resize"); } }); if (storage != null) storage.set(id + "_Hide", "1"); } if (this.Link != null && this.Image != null) { this.Image.innerHTML = this.ExpandImage; this.Image.alt = this.ExpandText; } else if (this.Link != null) { this.Link.innerHTML = this.ExpandText; } } this.ExpandPanel = function () { this.SetState(false); $(this.Div).slideDown({ progress: function () { $(window).trigger("resize"); } }); if (storage != null) storage.set(id + "_Hide", "0"); if (this.Link != null && this.Image != null) { this.Image.innerHTML = this.CollapseImage; this.Image.alt = this.CollapseText; } else if (this.Link != null) { this.Link.innerHTML = this.CollapseText; } } this.Toggle = function (collapseGroup) { if (collapseGroup == null) collapseGroup = true; if (this.Collapsed) { if (collapseGroup && this.GroupName.length > 0) this.CloseGroup(); this.ExpandPanel(); } else this.CollapsePanel(); } this.SetStyle = function () { for (var i = 0; i < this.StyleCells.length; i++) { var cell = document.getElementById(this.StyleCells[i]); if (cell != null) { var style = this.Collapsed ? this.CollapseStyle : this.ExpandStyle; cell.className = style; } } } this.SetState = function(collapsed) { this.Collapsed = collapsed; this.HiddenField.value = collapsed; } this.CloseGroup = function() { var items = CollapsablePanel_GetItemsInGroup(this.GroupName); for (var i=0; i 0) { eval(eWorld_ReplaceFormat('{0}("{1}", {2})', new Array(this.ClientToggleMethod, this.Id, this.Collapsed))); } if (this.AutoPostBack) { __doPostBack(this.Id, ''); } } } function CollapsablePanel_Find(id) { return eWorld_FindItem(eWorld_CollapsablePanel_Items, id); } function CollapsablePanel_Initialize() { if (typeof eWorld_CollapsablePanel_Items != 'undefined') { for (var i=eWorld_CollapsablePanel_Items.length - 1; i>=0; i--) { eWorld_CollapsablePanel_Items[i].Setup(); } for (var i=0; i