(function (a) {
a.easing.easeOutQuint = function (f, g, e, j, h) {
return j * ((g = g / h - 1) * g * g * g * g + 1) + e
};
a.widget("ui.hmkSlider", {
options: {
loadDataLeft: true,
selectedItemWidth: 390,
selectedItemHeight: 185,
selectedItemTop: 10,
unselectedItemWidth: 50,
unselectedItemHeight: 60,
unselectedItemTop: 115,
current: 0,
displayCount: 9,
ajaxUrl: "getAtAGlanceData2.php",
initDataFunc: function () { },
filterBy: "",
filterValue: "",
noDataMsg: '
We can help you plan an event. Add guests with ease, and we\'ll send them an email invitation.
'
},
_create: function () {
var d = this,
g = d.options,
e = d.element;
var f = a('');
f.appendTo(this.element);
this.slider = this.element.find("#hmkslider");
this.sliderItems = this.slider.children();
var j = d.slider.parent();
this.ajaxUrl = g.ajaxUrl;
this.initDataFunc = g.initDataFunc;
this.filterBy = g.filterBy;
this.filterValue = g.filterValue;
this.selectedItemHeight = g.selectedItemHeight;
this.unselectedItemHeight = g.unselectedItemHeight;
this.unselectedItemTop = g.unselectedItemTop;
this.noDataMsg = g.noDataMsg;
this.loadDataLeft = g.loadDataLeft;
this.unselectedItemWidth = g.unselectedItemWidth;
this.selectedItemWidth = g.selectedItemWidth;
this.selectedItemTop = g.selectedItemTop;
this.unselectedItemWidth = g.unselectedItemWidth;
this.displayCount = g.displayCount;
this.current = g.current;
this.prev = this.current;
this.nextItemToDisplay = this.current;
this.highPage = 1;
this.lowPage = 0;
this.leftDataTriggerIndex = Math.floor(d.displayCount * 0.5);
this.rightDataTriggerIndex = d.displayCount - this.leftDataTriggerIndex;
this.moreDataLeft = true;
this.moreDataRight = true;
this.btnLeft = a('');
this.btnLeft.insertAfter(j);
this.btnRight = a('');
this.btnRight.insertAfter(this.btnLeft);
this.loading = a('');
this.loading.insertAfter(this.btnLeft);
this.firstTry = true;
this.pastDataOnly = false;
var h = parseInt(d.displayCount - 1);
var c = d.displayCount;
var b = parseInt(d.element.find(".wrapper").css("width"));
this.itemInterval = Math.round((b - ((h * d.unselectedItemWidth) + d.selectedItemWidth)) / c);
this.unselectedItemWidthPlusSpacing = this.unselectedItemWidth + this.itemInterval;
d.loading.css("display", "block");
d.disableNavButtons();
d.tryFutureInit()
},
destroy: function () {
a.Widget.prototype.destroy.apply(this, arguments);
this.element.children().remove()
},
_setOption: function (c, d) {
a.Widget.prototype._setOption.apply(this, arguments);
var b = this.element
},
tryFutureInit: function () {
var b = this;
a.ajax({
url: b.ajaxUrl,
context: b,
success: b.handleFutureInit,
error: b.handleAjaxErrorFuture,
data: "page=1&direction=F&filterBy=" + this.filterBy + "&filterValue=" + this.filterValue,
dataType: "html"
})
},
handleFutureInit: function (e, f, d) {
var c = this;
if (e.length > 0) {
var b = a("");
b.append(e);
if (b.find(".error").size() > 0) {
c.displayError()
} else {
c.loadInitialData(e, f, d);
if (c.loadDataLeft == true) {
c.getMoreData("left")
} else {
c.moreDataLeft = false;
c.btnLeft.unbind("click").bind("click", function () {
c.nextItemToDisplay = c.current - 1;
c.select(c.nextItemToDisplay)
})
}
}
} else {
c.btnRight.unbind("click").bind("click", function () {
c.nextItemToDisplay = c.current + 1;
c.select(c.nextItemToDisplay)
});
if (c.loadDataLeft == true) {
c.tryPastInit()
} else {
c.loadInitialData(e, f, d)
}
}
},
tryPastInit: function () {
var b = this;
a.ajax({
url: b.ajaxUrl,
context: this,
success: b.handlePastInit,
error: b.handleAjaxErrorPast,
data: "page=1&direction=P&filterBy=" + this.filterBy + "&filterValue=" + this.filterValue,
dataType: "html"
})
},
handlePastInit: function (e, f, d) {
var c = this;
c.moreDataRight = false;
if (e.length > 0) {
var b = a("");
b.append(e);
if (b.find(".error").size() > 0) {
c.displayError();
c.btnPrev.css("display", "none")
} else {
c.pastDataOnly = true;
c.loadInitialData(e, f, d)
}
} else {
c.btnLeft.unbind("click").bind("click", function () {
c.nextItemToDisplay = c.current - 1;
c.select(c.nextItemToDisplay)
});
c.loadInitialData(e, f, d)
}
},
getMoreData: function (c) {
var b = this;
var d;
var f;
var e;
if (c == "right") {
d = ++this.highPage;
f = this.appendData;
e = "F"
} else {
if (c == "left") {
d = ++this.lowPage;
f = this.prependData;
e = "P"
}
}
b.loading.css("display", "block");
b.disableNavButtons();
a.ajax({
url: b.ajaxUrl,
context: this,
success: f,
data: "page=" + d + "&direction=" + e + "&filterBy=" + this.filterBy + "&filterValue=" + this.filterValue,
datatype: "html"
})
},
loadInitialData: function (d, e, c) {
var b = this;
b.loading.css("display", "none");
b.enableNavButtons();
if (d != null && d.length > 0) {
b.sliderItems.unbind("click");
b.slider.append(d);
b.sliderItems = b.slider.children();
if (b.pastDataOnly == true) {
b.current = b.sliderItems.size() - 1;
b.pastDataOnly = false;
b.firstTry = false;
b.updateNavButtons()
}
b.initItems();
if (a(".lastPastEvent").size() > 0) {
b.moreDataLeft = false;
b.btnLeft.unbind("click").bind("click", function () {
b.nextItemToDisplay = b.current - 1;
b.select(b.nextItemToDisplay)
})
}
if (a(".lastFutureEvent").size() > 0) {
b.moreDataRight = false;
b.btnRight.unbind("click").bind("click", function () {
b.nextItemToDisplay = b.current + 1;
b.select(b.nextItemToDisplay)
})
}
} else {
b.element.append(b.noDataMsg);
b.btnLeft.css("display", "none");
b.btnRight.css("display", "none");
b.element.append('NO DATA
')
}
},
prependData: function (e, f, d) {
var b = this;
var c;
b.loading.css("display", "none");
b.enableNavButtons();
if (e != null && e.length > 0) {
b.sliderItems.unbind("click");
b.slider.prepend(e);
b.sliderItems = b.slider.children();
c = a(e).find(".ataglanceItem").size();
b.current += c;
b.prev += c;
b.nextItemToDisplay += c;
b.initItems();
if (b.firstTry) {
b.setInitialSelection(b.nextItemToDisplay);
b.firstTry = false
} else {
b.select(b.nextItemToDisplay)
}
if (a(".lastPastEvent").size() > 0) {
b.moreDataLeft = false;
b.btnLeft.unbind("click").bind("click", function () {
b.nextItemToDisplay = b.current - 1;
b.select(b.nextItemToDisplay)
})
}
} else {
b.moreDataLeft = false;
b.btnLeft.unbind("click").bind("click", function () {
b.nextItemToDisplay = b.current - 1;
b.select(b.nextItemToDisplay)
})
}
},
appendData: function (d, e, c) {
var b = this;
b.loading.css("display", "none");
b.enableNavButtons();
if (d != null && d.length > 0) {
b.sliderItems.unbind("click");
b.slider.append(d);
b.sliderItems = b.slider.children();
b.initItems();
b.select(b.nextItemToDisplay);
if (a(".lastFutureEvent").size() > 0) {
b.moreDataRight = false;
b.btnRight.unbind("click").bind("click", function () {
b.nextItemToDisplay = b.current + 1;
b.select(b.nextItemToDisplay)
})
}
} else {
b.moreDataRight = false;
b.btnRight.unbind("click").bind("click", function () {
b.nextItemToDisplay = b.current + 1;
b.select(b.nextItemToDisplay)
})
}
},
select: function (d) {
var c = this;
c.prev = c.current;
c.current = d;
c.sliderItems.css("zIndex", 0);
var g = c.sliderItems.eq(d);
g.css("zIndex", 20);
var f = {};
f.left = (c.slider.parent()[0]["offsetWidth"] / 2 - c.selectedItemWidth / 2 - (c.current * c.unselectedItemWidthPlusSpacing));
c.slider.stop().animate(f, {
duration: 1000,
easing: "easeOutQuint"
});
var e = {
width: c.selectedItemWidth,
height: c.selectedItemHeight,
top: 7
};
g.stop().animate(e, {
duration: 1000,
easing: "easeOutQuint"
});
g.addClass("itemSelected");
g.find(".thumb").css("display", "none");
g.find(".content").css("display", "block");
var b = {
width: c.unselectedItemWidth,
height: c.unselectedItemHeight,
top: c.unselectedItemTop
};
c.sliderItems.eq(c.prev).stop().animate(b, {
duration: 1000,
easing: "easeOutQuint"
});
c.sliderItems.eq(c.prev).removeClass("itemSelected");
c.sliderItems.eq(c.prev).find(".thumb").css("display", "block");
c.sliderItems.eq(c.prev).find(".content").css("display", "none");
c.updateNavButtons()
},
setInitialSelection: function (c) {
var b = this;
b.prev = b.current;
b.current = c;
b.sliderItems.css("zIndex", 0);
var f = b.sliderItems.eq(c);
f.css("zIndex", 20);
var e = {};
e.left = (b.slider.parent()[0]["offsetWidth"] / 2 - b.selectedItemWidth / 2 - (b.current * b.unselectedItemWidthPlusSpacing));
b.slider.stop().animate(e, {
duration: 1000,
easing: "easeOutQuint"
});
var d = {
width: b.selectedItemWidth,
height: b.selectedItemHeight,
top: 7
};
f.stop().animate(d, {
duration: 1000,
easing: "easeOutQuint"
});
f.addClass("itemSelected");
f.find(".thumb").css("display", "none");
f.find(".content").css("display", "block");
b.updateNavButtons()
},
initItems: function () {
var b = this;
var d = Math.floor(b.displayCount * 0.5);
var c = b.displayCount - d;
b.sliderItems.each(function (e) {
a(this).css({
width: b.unselectedItemWidth,
height: b.unselectedItemHeight,
left: e * b.itemInterval,
top: b.unselectedItemTop
});
a(this).click(function () {
if (e != b.current) {
b.nextItemToDisplay = e;
if (e < d && b.moreDataLeft && e < b.current) {
b.getMoreData("left")
} else {
if (e > b.sliderItems.size() - c && b.moreDataRight && e > b.current) {
b.getMoreData("right")
} else {
b.select(e)
}
}
}
});
a(this).find(".content").css("display", "none");
a(this).find(".thumb").css("display", "block")
});
b.slider.css("left", b.slider.parent()[0]["offsetWidth"] / 2 - b.selectedItemWidth / 2 - (b.current * b.unselectedItemWidthPlusSpacing));
b.sliderItems.eq(b.current).addClass("itemSelected");
b.sliderItems.eq(b.current).css({
width: b.selectedItemWidth,
height: b.selectedItemHeight,
top: 7
});
b.sliderItems.eq(b.current).find(".content").css("display", "block");
b.sliderItems.eq(b.current).find(".thumb").css("display", "none");
b.initDataFunc(b.slider);
b.updateNavButtons()
},
updateNavButtons: function () {
var b = this;
if (b.current > 0) {
b.btnLeft.css({
display: "block"
})
} else {
b.btnLeft.css({
display: "none"
})
}
if (b.current < b.sliderItems.size() - 1) {
b.btnRight.css({
display: "block"
})
} else {
b.btnRight.css({
display: "none"
})
}
},
enableNavButtons: function () {
var b = this;
b.btnLeft.bind("click", function () {
if (b.current == b.leftDataTriggerIndex && b.moreDataLeft == true) {
b.nextItemToDisplay = b.current - 1;
b.getMoreData("left")
} else {
b.nextItemToDisplay = b.current - 1;
b.select(b.nextItemToDisplay)
}
});
b.btnRight.bind("click", function () {
if (b.current == b.sliderItems.size() - b.rightDataTriggerIndex && b.moreDataRight == true) {
b.nextItemToDisplay = b.current + 1;
b.getMoreData("right")
} else {
b.nextItemToDisplay = b.current + 1;
b.select(b.nextItemToDisplay)
}
})
},
disableNavButtons: function () {
this.btnLeft.unbind("click");
this.btnRight.unbind("click")
},
handleAjaxErrorFuture: function () {
var b = this;
b.displayError()
},
handleAjaxErrorPast: function () {
var b = this;
b.displayError()
},
displayError: function () {
var b = this;
a("#errorDiv").css("display", "block")
},
hideError: function () {
var b = this;
a("#errorDiv").css("display", "none")
}
})
})(jQuery);
(function (a) {
a.easing.easeOutQuint = function (f, g, e, j, h) {
return j * ((g = g / h - 1) * g * g * g * g + 1) + e
};
a.widget("ui.hmkListView", {
options: {
current: 0,
ajaxUrl: "getEventListData.php",
filterBy: "",
filterValue: "",
onComplete: function () { }
},
_create: function () {
var b = this,
e = b.options,
c = b.element;
this.current = e.current;
this.ajaxUrl = e.ajaxUrl;
this.filterBy = e.filterBy;
this.filterValue = e.filterValue;
this.onComplete = e.onComplete;
this.prev = this.current;
this.highPage = 1;
this.lowPage = 0;
var d = a('');
d.appendTo(this.element);
this.slider = this.element.find("#hmkEventList");
this.sliderItems = this.slider.children();
var f = b.slider.parent();
this.btnPrev = a(".listViewPrev");
this.btnNext = a(".listViewNext");
this.btnSeeAll = a(".eventListSeeAll");
this.enableNavButtons();
this.loading = a('');
this.loading.insertAfter(this.btnPrev);
this.loading.css({
left: f.position().left + f.width() * 0.5 - this.loading.width() * 0.5,
top: f.position().top + f.height() * 0.5 - this.loading.height() * 0.5
});
this.currentOpenElement;
b.eventList = {};
b.eventListKeys = [];
this.slider.find(".eventListGroupRoot").each(function () {
var g = a(this).metadata().date;
b.eventList[g] = a(this)
});
b.tryFutureInit()
},
destroy: function () {
a.Widget.prototype.destroy.apply(this, arguments);
this.element.children().remove()
},
_setOption: function (c, d) {
a.Widget.prototype._setOption.apply(this, arguments);
var b = this.element
},
tryFutureInit: function () {
var b = this;
a.ajax({
url: b.ajaxUrl,
context: b,
success: b.handleFutureInit,
error: b.handleAjaxErrorFuture,
data: "page=1&direction=F&filterBy=" + this.filterBy + "&filterValue=" + this.filterValue,
dataType: "html"
})
},
handleFutureInit: function (e, f, d) {
var c = this;
if (e.length > 0) {
var b = a("");
b.append(e);
if (b.find(".error").size() > 0) {
c.displayError();
c.btnNext.css("display", "none")
} else {
c.initData(e, f, d)
}
} else {
c.btnNext.css("display", "none");
c.tryPastInit()
}
},
tryPastInit: function () {
var b = this;
a.ajax({
url: b.ajaxUrl,
context: this,
success: b.handlePastInit,
error: b.handleAjaxErrorPast,
data: "page=1&direction=P&filterBy=" + this.filterBy + "&filterValue=" + this.filterValue,
dataType: "html"
})
},
handlePastInit: function (e, f, d) {
var c = this;
if (e.length > 0) {
var b = a("");
b.append(e);
if (b.find(".error").size() > 0) {
c.displayError();
c.btnPrev.css("display", "none")
} else {
c.initData(e, f, d)
}
} else {
c.btnPrev.css("display", "none");
c.initData(e, f, d)
}
},
getMoreData: function (c) {
var b = this;
var d;
var f;
var g;
var e;
if (c == "right") {
d = ++this.highPage;
g = this.appendData;
f = "F";
e = b.handleAjaxErrorFuture
} else {
if (c == "left") {
d = ++this.lowPage;
g = this.prependData;
f = "P";
e = b.handleAjaxErrorPast
} else {
if (c == "") {
d = "";
g = this.showAllData
}
}
}
b.loading.css("display", "block");
b.disableNavButtons();
a.ajax({
url: b.ajaxUrl,
context: this,
success: g,
error: e,
data: "page=" + d + "&direction=" + f + "&filterBy=" + b.filterBy + "&filterValue=" + b.filterValue,
dataType: "html"
})
},
prependData: function (e, g, d) {
var c = this;
c.loading.css("display", "none");
c.enableNavButtons();
if (e.length > 0) {
var b = a("");
b.append(e);
if (b.find(".error").size() > 0) {
c.displayError();
c.btnPrev.css("display", "none");
return
}
var f = a(e);
f.each(function (m) {
if (a(this).hasClass("eventListGroupRoot")) {
var k = a(this).metadata().date;
var n = a(this);
if (c.eventList[k] != undefined) {
var p = a(c.eventList[k]).children(".eventListGroup");
var o = a(n).find(".eventListItem");
var l = o.size();
if (l > 0) {
for (var h = l - 1; h >= 0; h--) {
p.prepend(o.eq(h).get())
}
}
} else {
c.eventList[k] = a(n)
}
}
});
c.formatEventList();
c.initAccordion();
if (a(".lastPastEvent").size() > 0) {
c.btnPrev.css("display", "none")
}
} else {
c.btnPrev.css("display", "none")
}
},
appendData: function (e, g, d) {
var c = this;
c.loading.css("display", "none");
c.enableNavButtons();
if (e.length > 0) {
var b = a("");
b.append(e);
if (b.find(".error").size() > 0) {
c.displayError();
c.btnNext.css("display", "none");
return
}
var f = a(e);
f.each(function (m) {
if (a(this).hasClass("eventListGroupRoot")) {
var k = a(this).metadata().date;
var n = a(this);
if (c.eventList[k] != undefined) {
var p = a(c.eventList[k]).children(".eventListGroup");
var o = a(n).find(".eventListItem");
var l = o.size();
if (l > 0) {
for (var h = 0; h < l; h++) {
p.append(o.eq(h).get())
}
}
} else {
c.eventList[k] = a(n)
}
}
});
c.formatEventList();
c.initAccordion();
if (a(".lastFutureEvent").size() > 0) {
c.btnNext.css("display", "none")
}
} else {
c.btnNext.css("display", "none")
}
},
initData: function (f, h, e) {
var c = this;
c.loading.css("display", "none");
if (f.length > 0) {
var g = a(f);
g.each(function (k) {
if (a(this).hasClass("eventListGroupRoot")) {
var j = a(this).metadata().date;
var l = a(this);
c.eventList[j] = a(l)
}
});
c.formatEventList();
c.initAccordion();
c.currentOpenElement = a(".eventListItem").eq(0).children().eq(0);
if (a(".lastPastEvent").size() > 0) {
c.btnPrev.css("display", "none")
}
if (a(".lastFutureEvent").size() > 0) {
c.btnNext.css("display", "none")
}
c.onComplete()
} else {
var d = a('Add an occasion or holiday, and we can remind you when it\'s coming up.
');
var b = a("#hmkEventList > ul");
b.append(d);
c.btnPrev.css("display", "none");
c.btnNext.css("display", "none");
c.element.append('NO DATA
')
}
},
showAllData: function (g, j, f) {
var b = this;
b.loading.css("display", "none");
b.enableNavButtons();
b.eventList = {};
b.eventListKeys = [];
if (g != null) {
for (var d = 0; d < g.length; d++) {
var c = g[d].date;
var e = g[d].content;
if (b.eventList[c] != undefined) {
var h = a(b.eventList[c]).children(".eventListGroup");
a(e).appendTo(h)
} else {
b.eventList[c] = e
}
}
b.formatEventList();
b.initAccordion();
b.moreDataRight = false;
b.btnSeeAll.unbind("click")
}
},
select: function (c) {
var b = this;
b.prev = b.current;
b.current = c;
b.sliderItems.css("zIndex", 0);
var d = b.sliderItems.eq(c);
b.updateNavButtons()
},
updateNavButtons: function () {
var b = this;
if (b.current > 0) {
b.btnPrev.css({
display: "block"
})
} else {
b.btnPrev.css({
display: "none"
})
}
if (b.current < b.sliderItems.size() - 1) {
b.btnNext.css({
display: "block"
})
} else {
b.btnNext.css({
display: "none"
})
}
},
enableNavButtons: function () {
var b = this;
b.btnPrev.bind("click", function (c) {
b.hideError();
b.getMoreData("left");
c.preventDefault()
});
b.btnNext.bind("click", function (c) {
b.hideError();
b.getMoreData("right");
c.preventDefault()
});
b.btnSeeAll.bind("click", function (c) {
b.getMoreData("");
c.preventDefault()
})
},
disableNavButtons: function () {
this.btnPrev.unbind("click");
this.btnNext.unbind("click");
this.btnSeeAll.unbind("click")
},
initAccordion: function () {
var b = this;
a(".accordionHead").each(function () {
a(this).unbind("click").bind("click", function (c) {
if ((a(this).hasClass("accSlideDownLeft") && b.currentOpenElement.hasClass("accSlideDownLeft")) || (a(this).hasClass("accSlideUpLeft") && b.currentOpenElement.hasClass("accSlideUpLeft"))) { } else {
if (b.currentOpenElement.hasClass("accSlideUpLeft")) {
b.currentOpenElement.next(".accordionBod").slideToggle(300);
b.currentOpenElement.removeClass("accSlideUpLeft").addClass("accSlideDownLeft")
}
}
a(this).next(".accordionBod").slideToggle(300);
if (a(this).hasClass("accSlideDownLeft")) {
a(this).removeClass("accSlideDownLeft").addClass("accSlideUpLeft")
} else {
if (a(this).hasClass("accSlideUpLeft")) {
a(this).removeClass("accSlideUpLeft").addClass("accSlideDownLeft")
}
}
b.currentOpenElement = a(this)
})
});
a(".scrollable").scrollable({
size: 1,
prevPage: ".leftScroll",
nextPage: ".rightScroll"
}).circular()
},
formatEventList: function () {
var c = this;
c.eventListKeys = c.getKeys(c.eventList).sort();
a("#hmkEventList").children("ul").remove();
a("#hmkEventList").append(a(''));
var b = a("#hmkEventList > ul");
for (var e = 0; e < c.eventListKeys.length; e++) {
var d = c.eventListKeys[e];
b.append(c.eventList[d])
}
a(".eventListGroupRoot").each(function () {
var f = a(this).find(".eventListItem");
f.addClass("eventListItemBorder");
f.eq(f.size() - 1).removeClass("eventListItemBorder")
})
},
getKeys: function (d) {
var c = [];
for (var b in d) {
c.push(b)
}
return c
},
handleAjaxErrorFuture: function () {
var b = this;
b.btnNext.css("display", "none");
b.displayError()
},
handleAjaxErrorPast: function () {
var b = this;
b.btnPrev.css("display", "none");
b.displayError()
},
displayError: function () {
var b = this;
a("#errorDiv").css("display", "block")
},
hideError: function () {
var b = this;
a("#errorDiv").css("display", "none")
}
})
})(jQuery);
(function (a) {
a.widget("ui.hmkTypeAheadish", {
options: {
ajaxUrl: "typeAhead.php",
specialDisplayField: "IsSpecial",
specialDisplayItemClass: "special",
displayField: "name",
dataListClass: "names",
dataItemClass: "nameItem",
dataItemSelectedClass: "",
callback: function () { },
parser: function () { },
mode: "single",
params: ""
},
_create: function () {
var b = this;
var e = b.options;
var c = b.element;
this.ajaxUrl = e.ajaxUrl;
this.displayField = e.displayField;
this.dataListClass = e.dataListClass;
this.dataItemClass = e.dataItemClass;
this.dataItemSelectedClass = e.dataItemSelectedClass;
this.specialDisplayField = e.specialDisplayField;
this.specialDisplayItemClass = e.specialDisplayItemClass;
this.callback = e.callback;
this.parser = e.parser;
this.mode = e.mode;
this.params = e.params;
this.searchStr = "";
this.prevSearchStr = "undefined";
this.arrDataObjects;
this.selectedItem = -1;
this.ajaxData;
this.caretPos = 0;
this.tokens = new Array();
this.savedObjects = {};
this.commas = new Array();
this.currentWord;
this.dataItemHeight = parseInt(a('').css("height"));
b.searchStr = jQuery.trim(b.element.val());
b.element.bind("keyup", function (f) {
b.prevSearchStr = b.searchStr;
b.caretPos = b.getCaretPosition(b.element.get(0));
b.setSearchString();
if (b.searchStr.length == 3) {
b.doAjaxCall()
} else {
if (b.searchStr != b.prevSearchStr) {
b.execCallback()
}
}
f.preventDefault()
});
var d = function () {
if (c.val().length >= 3) {
b.doAjaxCall()
}
a(this).unbind("focus", d)
};
c.focus(d);
this.dataList = a('');
this.dataList.css("width", c.outerWidth());
this.dataList.insertAfter(c);
this.element.blur(function () {
b.dataList.css("display", "none")
});
this.element.mouseup(function () {
b.caretPos = b.getCaretPosition(b.element.get(0));
b.prevSearchStr = b.searchStr;
b.setSearchString()
})
},
destroy: function () {
a.Widget.prototype.destroy.apply(this, arguments)
},
_setOption: function (c, d) {
a.Widget.prototype._setOption.apply(this, arguments);
var b = this.element
},
doAjaxCall: function () {
var b = this;
if (b.searchStr != b.prevSearchStr) {
var c = "searchStr=" + b.searchStr;
if (b.params != "") {
c += "&" + b.params
}
a.ajax({
url: b.ajaxUrl,
type: "POST",
context: this,
success: b.showData,
data: c,
dataType: "json"
})
}
},
showData: function (d) {
var c = this;
c.prevSearchStr = c.searchStr;
c.dataList.css("width", c.element.outerWidth());
c.dataList.css("display", "block");
c.arrDataObjects = c.parser(d);
if (c.arrDataObjects.length > 0) {
c.dataList.html("");
for (i = 0; i < c.arrDataObjects.length; i++) {
var e = c.arrDataObjects[i];
var b;
if (e[c.specialDisplayField] && (e[c.specialDisplayField] == "true" || e[c.specialDisplayField] == true)) {
if (e.Key != undefined) {
b = a('' + e[c.displayField] + "
")
} else {
if (e.PersonID != undefined) {
b = a('' + e[c.displayField] + "
")
} else {
b = a('' + e[c.displayField] + "
")
}
}
} else {
if (e.Key != undefined) {
b = a('' + e[c.displayField] + "
")
} else {
if (e.PersonID != undefined) {
b = a('' + e[c.displayField] + "
")
} else {
b = a('' + e[c.displayField] + "
")
}
}
}
c.dataList.append(b)
}
c.initDataItemBehavior();
c.initFilter();
c.selectedItem = -1;
c.selectNextItem()
} else {
c.dataList.css("display", "none")
}
},
initFilter: function () {
var b = this;
b.element.unbind("keyup").bind("keyup", function (g) {
var f = (g.keyCode ? g.keyCode : g.which);
switch (f) {
case 37:
b.caretPos = b.getCaretPosition(b.element.get(0));
b.prevSearchStr = b.searchStr;
b.setSearchString();
break;
case 39:
b.caretPos = b.getCaretPosition(b.element.get(0));
b.prevSearchStr = b.searchStr;
b.setSearchString();
break;
case 40:
b.selectNextItem();
break;
case 38:
b.selectPreviousItem();
break;
case 13:
b.prevSearchStr = b.searchStr;
b.setSearchString();
if (b.selectedItem > -1) {
b.writeCurrentItem(b.dataList.children().eq(b.selectedItem).text())
} else {
var d = b.searchStr.length >= 3 ? b.searchStr.substring(0, 3) : b.searchStr;
var c = b.prevSearchStr.length >= 3 ? b.prevSearchStr.substring(0, 3) : b.prevSearchStr;
if (b.searchStr.length >= 3 && d.toUpperCase() != c.toUpperCase()) {
b.doAjaxCall()
}
}
return false;
break;
default:
b.caretPos = b.getCaretPosition(b.element.get(0));
b.prevSearchStr = b.searchStr;
b.setSearchString();
var d = b.searchStr.length >= 3 ? b.searchStr.substring(0, 3) : b.searchStr;
var c = b.prevSearchStr.length >= 3 ? b.prevSearchStr.substring(0, 3) : b.prevSearchStr;
if (b.searchStr.length == 3) {
b.doAjaxCall()
}
if (b.searchStr.length > 3 && d.toUpperCase() != c.toUpperCase()) {
b.doAjaxCall()
} else {
b.filterDataItems()
}
break
}
g.preventDefault()
});
b.element.closest("form").bind("keypress", function (c) {
if (c.keyCode == 13) {
return false
}
})
},
filterDataItems: function () {
var c = this;
var e = false;
c.dataList.html("");
c.selectedItem = -1;
if (c.searchStr.length >= 3) {
for (var d = 0; d < c.arrDataObjects.length; d++) {
var f = c.arrDataObjects[d];
if (f[c.displayField].toUpperCase().indexOf(c.searchStr.toUpperCase()) == 0) {
var b;
if (f[c.specialDisplayField] && (f[c.specialDisplayField] == "true" || f[c.specialDisplayField] == true)) {
if (f.Key != undefined) {
b = a('' + f[c.displayField] + "
")
} else {
if (f.PersonID != undefined) {
b = a('' + f[c.displayField] + "
")
} else {
b = a('' + f[c.displayField] + "
")
}
}
} else {
if (f.Key != undefined) {
b = a('' + f[c.displayField] + "
")
} else {
if (f.PersonID != undefined) {
b = a('' + f[c.displayField] + "
")
} else {
b = a('' + f[c.displayField] + "
")
}
}
}
c.dataList.append(b);
e = true;
c.execCallback()
}
}
if (e) {
c.selectNextItem();
c.initDataItemBehavior()
} else {
c.execCallback()
}
} else {
c.dataList.css("display", "none");
c.execCallback()
}
},
selectNextItem: function () {
var c = this;
c.dataList.css("display", "block");
var b = c.dataList.children();
b.each(function () {
a(this).removeClass(c.dataItemSelectedClass)
});
if (c.selectedItem == -1) {
b.eq(0).addClass(c.dataItemSelectedClass);
c.selectedItem = 0
} else {
if (c.selectedItem == b.size() - 1) {
c.selectedItem = -1
} else {
c.selectedItem += 1;
b.eq(c.selectedItem).addClass(c.dataItemSelectedClass)
}
}
if (c.selectedItem > -1) {
c.dataList.scrollTop(c.selectedItem * c.dataItemHeight)
} else {
c.dataList.scrollTop(0)
}
},
selectPreviousItem: function () {
var c = this;
c.dataList.css("display", "block");
var b = c.dataList.children();
b.each(function () {
a(this).removeClass(c.dataItemSelectedClass)
});
if (c.selectedItem == -1) {
b.eq(b.size() - 1).addClass(c.dataItemSelectedClass);
c.selectedItem = b.size() - 1
} else {
if (c.selectedItem == 0) {
c.selectedItem = -1
} else {
c.selectedItem -= 1;
b.eq(c.selectedItem).addClass(c.dataItemSelectedClass)
}
}
if (c.selectedItem > -1) {
c.dataList.scrollTop(c.selectedItem * c.dataItemHeight)
} else {
c.dataList.scrollTop(0)
}
},
writeCurrentItem: function (f, g) {
var b = this;
b.dataList.css("display", "none");
var d = b.element.val();
var c = jQuery.trim(f);
b.tokens[b.currentWord] = c;
b.savedObjects[c] = b.getObjectFromKeyValue(c, g);
b.element.val(b.tokens.join(", "));
b.getCaretPosition(b.element.get(0));
var e = b.getObjectFromKeyValue(b.element.val(), g);
b.execCallback()
},
initDataItemBehavior: function () {
var b = this;
var c = b.dataList.children("." + b.dataItemClass);
c.mousedown(function () {
b.writeCurrentItem(a(this).text(), a(this).find("span").attr("id"))
});
c.mouseover(function (d) {
b.dataList.children("div").removeClass(b.dataItemSelectedClass);
a(this).addClass(b.dataItemSelectedClass);
d.stopPropagation()
});
c.mouseout(function (d) {
a(this).removeClass(b.dataItemSelectedClass);
d.stopPropagation()
})
},
setSearchString: function () {
var b = this;
var d = b.element.val();
if (b.mode == "multiple") {
b.findCommas();
b.tokens = d.split(",")
} else {
b.tokens = new Array(d)
}
for (var c = 0; c < b.tokens.length; c++) {
b.tokens[c] = jQuery.trim(b.tokens[c])
}
b.currentWord = b.whatWord();
b.searchStr = b.currentWord > -1 ? b.tokens[b.currentWord] : ""
},
getObjectFromKeyValue: function (e, g) {
var b = this;
if (b.arrDataObjects != null) {
for (var c = 0; c < b.arrDataObjects.length; c++) {
var f = b.arrDataObjects[c];
if (g != undefined && g != "") {
var d;
if (f.Key != undefined) {
d = f.Key
} else {
if (f.PersonID != undefined) {
d = f.PersonID
}
}
if (f[b.displayField] == e && d == g) {
return f
}
} else {
if (f[b.displayField] == e) {
return f
}
}
}
}
return null
},
getCaretPosition: function (e) {
if (window.getSelection) {
return e.selectionStart
} else {
if (e.tagName.toLowerCase() == "textarea") {
var b = document.selection.createRange();
var c = b.duplicate();
c.moveToElementText(e);
c.setEndPoint("EndToEnd", b);
e.selectionStart = c.text.length - b.text.length;
e.selectionEnd = e.selectionStart + b.text.length;
return e.selectionStart
} else {
var d = document.selection.createRange().duplicate();
d.moveEnd("character", e.value.length);
if (d.text == "") {
return e.value.length
}
return e.value.lastIndexOf(d.text)
}
}
},
findCommas: function () {
var c = this;
var d = /,/gi;
var b;
var f = [];
c.commas = new Array();
var e = c.element.val();
while ((b = d.exec(e))) {
c.commas.push(b.index)
}
},
whatWord: function () {
var c = this;
var b = -1;
var e = false;
if (c.commas.length > 0) {
for (var d = 0; d < c.commas.length; d++) {
if (c.caretPos <= c.commas[d]) {
b = d;
break
}
}
if (b == -1) {
b = c.commas.length
}
} else {
if (c.tokens.length > 0) {
b = 0
}
}
return b
},
execCallback: function () {
var b = this;
if (b.mode == "multiple") {
var f = new Array();
for (var e = 0; e < b.tokens.length; e++) {
var d = b.tokens[e];
if (d != null && d != "") {
var g = b.savedObjects[d];
if (g != null) {
f.push(g)
} else {
var c = {};
c[b.displayField] = d;
f.push(c)
}
}
}
b.callback(f)
} else {
var g = b.savedObjects[b.tokens[0]];
if (g != null) {
b.callback(g)
} else {
b.callback({})
}
}
}
})
})(jQuery);
(function (a) {
a.easing.easeOutQuint = function (f, g, e, j, h) {
return j * ((g = g / h - 1) * g * g * g * g + 1) + e
};
a.widget("ui.hmkSlider2", {
options: {
itemSpacing: 10,
itemWidth: 78,
displayCount: 10,
ajaxUrl: "getContactData_TEST0117.php",
initDataFunc: function () { },
itemCountField: "",
successCallBackMethod: function () { }
},
_create: function () {
var b = this,
e = b.options,
c = b.element;
this.successCallBack = e.successCallBackMethod;
this.itemSpacing = e.itemSpacing;
this.itemWidth = e.itemWidth;
this.itemWidthPlusSpacing = this.itemWidth + this.itemSpacing;
this.itemInterval = e.itemSpacing;
this.ajaxUrl = e.ajaxUrl;
this.initDataFunc = e.initDataFunc;
this.itemCountField = e.itemCountField;
this.totalItemCount;
this.current = 0;
this.prev = 0;
this.nextItemToDisplay = this.current;
this.numItems;
var d = a('');
d.appendTo(this.element);
this.slider = this.element.find(".items");
this.sliderItems = this.slider.children();
this.displayCount = e.displayCount;
this.moreData = true;
this.highPage = 0;
this.numPages;
var f = b.element.find(".contactWidgetWrapper");
this.btnLeft = a('');
this.btnLeft.insertAfter(f);
this.btnRight = a('');
this.btnRight.insertAfter(this.btnLeft);
this.loading = a('');
this.loading.insertAfter(this.btnLeft);
b.getMoreData()
},
destroy: function () {
a.Widget.prototype.destroy.apply(this, arguments);
this.slider.attr("style", "")
},
_setOption: function (c, d) {
a.Widget.prototype._setOption.apply(this, arguments);
var b = this.element
},
getMoreData: function () {
var b = this;
var c = ++(b.highPage);
b.loading.css("display", "block");
b.disableNavButtons();
a.ajax({
url: b.ajaxUrl,
context: this,
type: "POST",
success: b.appendData,
data: "page=" + c,
dataType: "html"
})
},
appendData: function (e, f, d) {
var c = this;
c.loading.css("display", "none");
if (e.length > 0) {
var b = jQuery.parseJSON(e);
if (b[c.itemCountField] != null) {
c.totalItemCount = b[c.itemCountField]
} else {
alert("ERROR : No item count field!")
}
c.successCallBack(c.slider, b);
c.sliderItems = c.slider.children();
c.initItems();
c.select(c.current)
} else {
c.btnRight.unbind("click").bind("click", function () {
c.nextItemToDisplay = c.current + 1;
c.select(c.nextItemToDisplay)
})
}
},
select: function (c) {
var b = this;
b.prev = b.current;
b.current = c;
b.sliderItems.css("zIndex", 0);
var e = b.sliderItems.eq(c);
e.css("zIndex", 20);
var d = {};
d.left = (0 - ((b.current) * b.itemWidthPlusSpacing * b.displayCount));
b.slider.stop().animate(d, {
duration: 1000,
easing: "easeOutQuint"
});
b.updateNavButtons()
},
initItems: function () {
var b = this;
b.sliderItems.each(function (c) {
a(this).css({
width: b.itemWidth,
left: c * b.itemInterval
})
});
b.slider.css("left", 0 - (b.current * b.itemWidthPlusSpacing));
if (b.sliderItems.size() >= b.totalItemCount) {
b.moreData = false
}
b.numPages = Math.ceil(b.sliderItems.size() / b.displayCount);
b.enableNavButtons()
},
updateNavButtons: function () {
var b = this;
if (b.current > 0) {
b.btnLeft.css({
display: "block"
})
} else {
b.btnLeft.css({
display: "none"
})
}
if ((b.current < b.numPages - 1) || (b.current == b.numPages - 1 && b.moreData)) {
b.btnRight.css({
display: "block"
})
} else {
b.btnRight.css({
display: "none"
})
}
},
enableNavButtons: function () {
var b = this;
b.btnLeft.bind("click", function () {
b.current -= 1;
b.select(b.current)
});
b.btnRight.bind("click", function () {
b.current += 1;
if (b.sliderItems.size() < b.displayCount * (b.current + 1) && b.moreData) {
b.getMoreData("right")
} else {
b.select(b.current)
}
})
},
disableNavButtons: function () {
this.btnLeft.unbind("click");
this.btnRight.unbind("click")
}
})
})(jQuery);
(function (a) {
a.widget("ui.hmkRecommendations", {
options: {
ajaxUrl: "getEventListData.php",
ajaxDataType: "jsonp",
params: "",
alignment: "H",
isCarousel: "N",
numCarouselDisplayItems: "1",
productSortOrder: "PODCARD:2,ECARD:2,FINISHEDGOODS:1",
headerText: "Recommendations...",
headerLink: "http://www.hallmark.com",
headerLinkText: "See More Occasions",
successCallback: function () { }
},
_create: function () {
var b = this,
d = b.options,
c = b.element;
this.ajaxUrl = d.ajaxUrl;
this.ajaxDataType = d.ajaxDataType;
this.params = d.params;
this.alignment = d.alignment;
this.isCarousel = d.isCarousel;
this.numCarouselDisplayItems = d.numCarouselDisplayItems;
this.productSortOrder = d.productSortOrder;
this.headerText = d.headerText;
this.headerLink = d.headerLink;
this.headerLinkText = d.headerLinkText;
this.displayCount = 0;
this.successCallback = d.successCallback;
this.arrProductTypes = {};
a.ajax({
type: "POST",
url: b.ajaxUrl,
context: this,
success: b.initData,
error: b.handleAjaxError,
data: this.params,
dataType: b.ajaxDataType
})
},
destroy: function () {
a.Widget.prototype.destroy.apply(this, arguments)
},
_setOption: function (c, d) {
a.Widget.prototype._setOption.apply(this, arguments);
var b = this.element
},
initData: function (c, b, k) {
var l = this;
var g = false;
if (c != null) {
var j = c.products;
var e = "";
if (j.length == 1 && l.isCarousel == "Y") {
l.isCarousel = "N"
}
for (var d = 0; d < j.length; d++) {
var f = j[d].ProductLine;
if (f != e) {
l.arrProductTypes[f] = new Array();
e = f
}
l.arrProductTypes[f].push(j[d])
}
l.processProductOrder();
var h;
if (l.alignment == "H") {
if (l.isCarousel == "Y") {
h = l.element.find(".items");
if (h.children().size() == 0) {
l.element.children().remove()
}
} else {
h = l.element.children(":first");
if (h.children().size() == 1) {
contentSpot.AppendAdHTML(h, "ProductRecommendations", "PRODUCTRECOMMENDATIONS", "staticOtherRecommendations", l.successCallback);
g = true
}
}
}
} else {
l.processProductOrder();
var h;
h = l.element.children(":first");
contentSpot.AppendAdHTML(h, "ProductRecommendations", "PRODUCTRECOMMENDATIONS", "staticOtherRecommendations", l.successCallback);
g = true
}
if (!g) {
l.successCallback()
}
},
processProductOrder: function () {
var d = this;
var c = d.productSortOrder.split(",");
for (var f = 0; f < c.length; f++) {
var b = c[f].split(":");
d.displayCount += parseInt(b[1], 10)
}
d.insertHeader();
for (var f = 0; f < c.length; f++) {
var b = c[f].split(":");
var g = b[0];
var e = b[1];
d.prepareDetailOutput(g, e)
}
if (d.alignment == "H" && d.isCarousel == "N") {
d.element.find(".dropShadowBox:last").addClass("lastCol")
}
if (d.isCarousel == "Y") { }
d.element.find(".scrollable").scrollable({
size: parseInt(d.numCarouselDisplayItems, 10),
prevPage: ".leftScroll",
nextPage: ".rightScroll",
clickable: false
}).circular()
},
prepareDetailOutput: function (f, d) {
var c = this;
var b;
b = c.arrProductTypes[f];
if (b) {
if (d > b.length) {
d = b.length
}
for (var e = 0; e < d; e++) {
var j = {};
j.productName = b[e].Name;
j.productType = b[e].ProductType;
j.productCategory = f;
j.price = b[e].SalePrice;
if (b[e].isPurchased != null && b[e].isPurchased == "Y") {
j.price = "Purchased"
}
j.href = b[e].PDPUrl;
j.img = b[e].ImagePath;
j.sku = b[e].ProductID;
j.eventType = b[e].EventType;
j.productLine = b[e].ProductLine;
j.isInStores = b[e].IsInStores;
if (b[e].AvailabilityStatement == null) {
j.availabilityStatement = ""
} else {
j.availabilityStatement = b[e].AvailabilityStatement
}
var h = c.formatOutput(j);
if (c.isCarousel == "N") {
if (c.alignment == "H") {
a(h).appendTo(c.element.children(":first"))
} else {
var g = c.element.children(":first").children(":last");
a(h).insertBefore(g)
}
} else {
a(h).appendTo(c.element.children(":first").find(".items:first"))
}
}
}
},
insertHeader: function () {
var c = this;
var e = "width-" + (c.displayCount * 3) + "col";
var b = a('");
var f = a('");
var g = a('');
var d = a('");
if (c.isCarousel == "N") {
if (c.alignment == "H") {
c.element.append(b)
} else {
c.element.append(f)
}
} else {
if (c.alignment == "H") {
c.element.append(g)
} else {
c.element.append(d)
}
}
},
formatOutput: function (h) {
var c = this;
var f = h.price;
if (true == h.isInStores) {
var e = ' In Stores Only ';
f = f + e
}
var j = "'" + h.sku + "','" + h.productLine + "','" + h.href + "','" + h.eventType.replace("'", "\\'") + "'";
var g = '";
var d = '";
var b = '";
if (c.isCarousel == "N") {
return g
} else {
if (c.alignment == "H") {
return d
} else {
return b
}
}
}
})
})(jQuery);
function PostOmnitureForRecommendations(d, c, a, b) {
} (function (c) {
var b = {
init: function (e) {
var d = this;
d.data("start", {});
d.data("changedElements", new Array());
c(this).find(":input").each(function () {
d.data("start")[c(this).attr("id")] = (c(this).attr("type") == "checkbox" || c(this).attr("type") == "radio") ? (c(this).prop("checked") ? "checked" : "") : c(this).val()
})
},
didFormChange: function () {
return a(this)
},
resetForm: function () {
var d = this;
if (!d.data("end")) {
a(d)
}
c(this).find(":input").each(function () {
if (c(this).attr("type") == "checkbox" || c(this).attr("type") == "radio") {
if (d.data("start")[c(this).attr("id")] == true) {
c(this).prop("checked", true);
} else {
c(this).prop("checked",false);
}
} else {
c(this).val(d.data("start")[c(this).attr("id")])
}
});
if (d.data("changedElements") && d.data("changedElements").length > 0) {
for (var f = 0; f < d.data("changedElements").length; f++) {
var e = "#" + d.data("changedElements")[f];
var g = c(e);
if (g.attr("type") != "radio") {
g.trigger("change");
} else {
if (g.prop("checked")) {
g.trigger("change");
}
}
}
}
d.data("changedElements", new Array());
d.data("end", null)
}
};
function a(e) {
var d = false;
e.data("end", {});
c(e).find(":input").each(function () {
e.data("end")[c(this).attr("id")] = (c(this).attr("type") == "checkbox" || c(this).attr("type") == "radio") ? (c(this).prop("checked") ? "checked" : "") : c(this).val()
});
for (var f in e.data("start")) {
if (e.data("start")[f] != e.data("end")[f]) {
d = true;
e.data("changedElements").push(f)
}
}
return d
}
c.fn.hmkFormChecker = function (d) {
var e;
if (b[d]) {
return b[d].apply(this, Array.prototype.slice.call(arguments, 1))
} else {
if (!d || typeof d === "object") {
e = c.extend({}, c.fn.hmkFormChecker.defaults, d);
return b.init.apply(this, arguments)
} else {
c.error("Method " + d + " does not exist on jQuery.hmkFormChecker")
}
}
};
c.fn.hmkFormChecker.defaults = {}
})(jQuery);
(function (a) {
a.easing.easeOutQuint = function (f, g, e, j, h) {
return j * ((g = g / h - 1) * g * g * g * g + 1) + e
};
a.widget("ui.bucketomatic", {
options: {
current: 0,
ajaxUrl: "getEventListData.php",
baseStructure: "",
filterBy: "",
filterValue: "",
onComplete: function () { },
btnNextSelector: "",
listGroupClass: "",
itemClass: "",
itemActionFunc: function () { },
noDataFunc: function () { },
pageVar: "page"
},
_create: function () {
var b = this,
d = b.options,
c = b.element;
this.current = d.current;
this.ajaxUrl = d.ajaxUrl;
this.filterBy = d.filterBy;
this.filterValue = d.filterValue;
this.onComplete = d.onComplete;
this.baseStructure = d.baseStructure;
this.btnNextSelector = d.btnNextSelector;
this.listGroupClass = d.listGroupClass;
this.itemActionFunc = d.itemActionFunc;
this.itemClass = d.itemClass;
this.noDataFunc = d.noDataFunc;
this.pageVar = d.pageVar;
this.prev = this.current;
this.highPage = 1;
this.lowPage = 0;
this.btnNext = a(this.btnNextSelector);
this.enableNavButtons();
this.loading = a('');
this.loading.insertAfter(this.btnNext);
b.eventList = {};
b.eventListKeys = [];
b.tryFutureInit()
},
destroy: function () {
a.Widget.prototype.destroy.apply(this, arguments);
this.element.children().remove()
},
_setOption: function (c, d) {
a.Widget.prototype._setOption.apply(this, arguments);
var b = this.element
},
tryFutureInit: function () {
var b = this;
a.ajax({
url: b.ajaxUrl,
context: b,
success: b.handleFutureInit,
error: b.handleAjaxErrorFuture,
data: b.pageVar + "=1",
dataType: "html"
})
},
handleFutureInit: function (e, f, d) {
var c = this;
if (e.length > 0) {
var b = a("");
b.append(e);
if (b.find(".error").size() > 0) {
c.displayError();
c.btnNext.css("display", "none")
} else {
c.initData(e, f, d)
}
} else {
c.btnNext.css("display", "none");
c.initData(e, f, d)
}
},
getMoreData: function (c) {
var b = this;
var d;
var f;
var g;
var e;
d = ++this.highPage;
g = this.appendData;
f = "F";
e = b.handleAjaxErrorFuture;
b.loading.css("display", "block");
b.disableNavButtons();
a.ajax({
url: b.ajaxUrl,
context: this,
success: g,
error: e,
data: b.pageVar + "=" + d,
dataType: "html"
})
},
appendData: function (e, g, d) {
var c = this;
c.loading.css("display", "none");
c.enableNavButtons();
if (e.length > 0) {
var b = a("");
b.append(e);
if (b.find(".error").size() > 0) {
c.displayError();
c.btnNext.css("display", "none");
return
}
var f = a(e);
f.each(function (m) {
if (a(this).hasClass(c.listGroupClass)) {
var k = a(this).children(":first").html();
var n = a(this);
if (c.eventList[k] != undefined) {
var p = a(c.eventList[k]);
var o = a(n).children(c.itemClass);
var l = o.size();
if (l > 0) {
for (var h = 0; h < l; h++) {
p.append(o.eq(h).get())
}
}
} else {
c.eventList[k] = a(n)
}
}
});
c.formatEventList();
c.itemActionFunc();
if (a(".lastBucket").size() > 0) {
c.btnNext.css("display", "none")
}
} else {
c.btnNext.css("display", "none")
}
},
initData: function (d, f, c) {
var b = this;
b.loading.css("display", "none");
if (d.length > 0) {
var e = a(d);
e.each(function (h) {
if (a(this).hasClass(b.listGroupClass)) {
var g = a(this).children(":first").html();
var j = a(this);
b.eventList[g] = a(j)
}
});
b.formatEventList();
b.itemActionFunc();
if (a(".lastBucket").size() > 0) {
b.btnNext.css("display", "none")
}
b.onComplete()
} else {
b.noDataFunc();
b.btnNext.css("display", "none")
}
},
enableNavButtons: function () {
var b = this;
b.btnNext.bind("click", function (c) {
b.hideError();
b.getMoreData("right");
c.preventDefault()
})
},
disableNavButtons: function () {
this.btnNext.unbind("click")
},
formatEventList: function () {
var c = this;
c.eventListKeys = c.getKeys(c.eventList);
var b = c.element;
b.children().remove();
for (var e = 0; e < c.eventListKeys.length; e++) {
var d = c.eventListKeys[e];
b.append(c.eventList[d])
}
},
getKeys: function (d) {
var c = [];
for (var b in d) {
c.push(b)
}
return c
},
handleAjaxErrorFuture: function () {
var b = this;
b.btnNext.css("display", "none");
b.displayError()
},
displayError: function () {
var b = this;
a("#errorDiv").css("display", "block")
},
hideError: function () {
var b = this;
a("#errorDiv").css("display", "none")
}
})
})(jQuery);
(function (a) {
a.fn.slidifier = function (b) {
a.fn.slidifier.defaults = {
duration: 1000,
startState: "closed",
triggerClosed: "",
triggerOpen: "",
onOpen: function () { },
onClose: function () { }
};
var c = a.extend({}, a.fn.slidifier.defaults, b);
return this.each(function () {
var e = a(this).next();
var f = parseInt(e.css("bottom"));
if (c.startState == "open") {
a(this).css("bottom", e.height() + f);
e.css("display", "block")
} else {
a(this).css("bottom", f);
e.css("display", "none")
}
a(this).click(function (m) {
var l = parseFloat(a(this).css("bottom"));
var j = a(this);
var k = c.duration;
if (e.is(":visible")) {
var n = e.height();
var h = parseFloat(l) - parseFloat(n);
a(this).stop().animate({
bottom: h
}, {
duration: k,
complete: function () {
j.removeClass(c.triggerOpen).addClass(c.triggerClosed)
}
});
e.stop().animate({
height: 0
}, {
duration: k,
complete: function () {
e.css("display", "none");
e.css("height", n);
c.onClose()
}
})
} else {
e.css("display", "block");
var n = e.height();
var h = parseFloat(l) + parseFloat(n);
var g = {};
g.bottom = h;
a(this).stop().animate(g, {
duration: k,
complete: function () {
j.removeClass(c.triggerClosed).addClass(c.triggerOpen)
}
});
e.css("height", "0");
e.stop().animate({
height: n
}, {
duration: k,
complete: function () {
c.onOpen()
}
})
}
m.preventDefault()
})
});
var d;
if (!option || typeof option === "object") {
d = a.extend({}, a.fn.slidifier.defaults, option);
return methods.init.apply(this, arguments)
}
}
})(jQuery);
(function (a) {
a.widget("ui.listifier", {
options: {
json: "",
inputFormatter: function () { },
outputFormatter: function () { },
actionMsg: "",
target: "",
form: "",
formSubmitBtn: "",
selectAll: "",
selectNone: ""
},
_create: function () {
var b = this,
d = b.options,
c = b.element;
this.parser = d.parser;
this.inputFormatter = d.inputFormatter;
this.outputFormatter = d.outputFormatter;
this.actionMsg = d.actionMsg;
this.target = d.target;
this.form = d.form;
this.formSubmitBtn = d.formSubmitBtn;
this.selectAll = d.selectAll;
this.selectNone = d.selectNone;
this.myDictionary = {};
this.keyInfo = {};
if (d.json != "") {
b._addToDictionary(d.json)
}
a(this.selectAll).unbind("click").bind("click", function () {
b.element.find(".hdr").addClass("hdrSelected");
b.element.find(".item").addClass("itemSelected")
});
a(this.selectNone).unbind("click").bind("click", function () {
b.element.find(".hdr").removeClass("hdrSelected");
b.element.find(".item").removeClass("itemSelected")
})
},
_addToDictionary: function (e) {
var f = jQuery.parseJSON(e);
var b = this;
for (var d = 0; d < f.length; d++) {
var g = f[d];
var c = g.groupid;
if (!b.myDictionary[c]) {
b.myDictionary[c] = new Array();
b.keyInfo[c] = g.groupname
}
b.myDictionary[c].push(g)
}
},
_initGroupSelection: function () {
var b = a(this.element);
b.find(".groupOfItems .hdr").unbind("click").click(function () {
var c = a(this).closest(".groupOfItems").find(".item");
if (!a(this).hasClass("hdrSelected")) {
a(this).addClass("hdrSelected");
c.each(function () {
if (!a(this).hasClass("itemSelected")) {
a(this).addClass("itemSelected")
}
})
} else {
a(this).removeClass("hdrSelected");
c.each(function () {
if (a(this).hasClass("itemSelected")) {
a(this).removeClass("itemSelected")
}
})
}
});
b.find(".groupOfItems .item").unbind("click").click(function () {
var d = a(this).closest(".groupOfItems");
var e = d.find(".hdr");
var c = d.find(".item");
a(this).toggleClass("itemSelected");
if (d.find(".itemSelected").size() == c.size()) {
if (!e.hasClass("hdrSelected")) {
e.addClass("hdrSelected")
}
} else {
if (e.hasClass("hdrSelected")) {
e.removeClass("hdrSelected")
}
}
})
},
_sortGroupName: function (d, c) {
var f = a(d).find(".firstName").text().toUpperCase() + " " + a(d).find(".lastName").text().toUpperCase();
var e = a(c).find(".firstName").text().toUpperCase() + " " + a(c).find(".lastName").text().toUpperCase();
return (f < e) ? -1 : (f > e) ? 1 : 0
},
_initDeleteAction: function (c, e, d) {
var b = this;
c.find("a").unbind("click").click(function (l) {
var k = a(this).parent();
k.remove();
k.removeClass("remainder");
k.children("ul").removeClass("fltLeft");
var g = k.children("a");
g.remove();
var h = k.attr("title");
k.attr("title", "");
var j = e.find("div[id=" + h + "]").next();
j.append(k);
var f = j.children().get();
f.sort(b._sortGroupName);
j.children().remove();
for (i = 0; i < f.length; i++) {
j.append(f[i])
}
b._initGroupSelection(e);
l.stopPropagation();
l.preventDefault();
b._setActionMsg(d)
})
},
_setActionMsg: function (c) {
var b = this;
if (a(c).children(":not(.actionMsg)").size() == 0) {
a(c).append(b.actionMsg)
} else {
if (a(c + " .actionMsg").size() > 0) {
a(c + " .actionMsg").remove()
}
}
},
_makeItAllWork: function () {
var b = this;
var d = a(this.element);
var c = b.target;
b._initGroupSelection();
b._setActionMsg(c);
a(".addBtn").unbind("click").click(function (g) {
d.find(".itemSelected").each(function () {
var k = a(this);
var h = ' Delete';
var e = a(this).closest(".groupOfItems").find(".hdr");
var j = e.attr("id");
a(this).remove();
k.removeClass("itemSelected");
k.addClass("remainder");
k.attr("title", j);
k.children("ul").addClass("fltLeft");
k.append(h);
a(c).append(k);
if (e.hasClass("hdrSelected")) {
e.removeClass("hdrSelected")
}
b._setActionMsg(c)
});
var f = a(c).children().get();
f.sort(b._sortGroupName);
a(c).children().remove();
for (i = 0; i < f.length; i++) {
a(c).append(f[i]);
b._initDeleteAction(a(f[i]), d, c)
}
g.preventDefault()
});
a(b.formSubmitBtn).unbind("click").click(function () {
var e = new Array();
a(b.target).children().each(function () {
var g = a(this).find(".personID").text();
e.push(g)
});
var f = b._getOutputData(e);
b.outputFormatter(f);
a(b.form).submit()
})
},
_getOutputData: function (e) {
var f = new Array();
for (key in this.myDictionary) {
var d = this.myDictionary[key];
for (var c = 0; c < d.length; c++) {
var g = d[c];
for (var b = e.length - 1; b >= 0; b--) {
if (e[b] == g.id) {
f.push(g);
e.splice(b, 1)
}
}
if (e.length == 0) {
break
}
}
}
return f
},
append: function (b) {
this._addToDictionary(b)
},
process: function () {
this.inputFormatter(this.myDictionary, this.keyInfo);
this._makeItAllWork()
},
destroy: function () {
a.Widget.prototype.destroy.apply(this, arguments)
},
_setOption: function (c, d) {
a.Widget.prototype._setOption.apply(this, arguments);
var b = this.element
}
})
})(jQuery); (function (a) { a.easing.easeOutQuint = function (f, g, e, j, h) { return j * ((g = g / h - 1) * g * g * g * g + 1) + e }; a.widget("ui.hmkSlider", { options: { loadDataLeft: true, selectedItemWidth: 390, selectedItemHeight: 185, selectedItemTop: 10, unselectedItemWidth: 50, unselectedItemHeight: 60, unselectedItemTop: 115, current: 0, displayCount: 9, ajaxUrl: "getAtAGlanceData2.php", initDataFunc: function () { }, filterBy: "", filterValue: "", noDataMsg: 'We can help you plan an event. Add guests with ease, and we\'ll send them an email invitation.
' }, _create: function () { var d = this, g = d.options, e = d.element; var f = a(''); f.appendTo(this.element); this.slider = this.element.find("#hmkslider"); this.sliderItems = this.slider.children(); var j = d.slider.parent(); this.ajaxUrl = g.ajaxUrl; this.initDataFunc = g.initDataFunc; this.filterBy = g.filterBy; this.filterValue = g.filterValue; this.selectedItemHeight = g.selectedItemHeight; this.unselectedItemHeight = g.unselectedItemHeight; this.unselectedItemTop = g.unselectedItemTop; this.noDataMsg = g.noDataMsg; this.loadDataLeft = g.loadDataLeft; this.unselectedItemWidth = g.unselectedItemWidth; this.selectedItemWidth = g.selectedItemWidth; this.selectedItemTop = g.selectedItemTop; this.unselectedItemWidth = g.unselectedItemWidth; this.displayCount = g.displayCount; this.current = g.current; this.prev = this.current; this.nextItemToDisplay = this.current; this.highPage = 1; this.lowPage = 0; this.leftDataTriggerIndex = Math.floor(d.displayCount * 0.5); this.rightDataTriggerIndex = d.displayCount - this.leftDataTriggerIndex; this.moreDataLeft = true; this.moreDataRight = true; this.btnLeft = a(''); this.btnLeft.insertAfter(j); this.btnRight = a(''); this.btnRight.insertAfter(this.btnLeft); this.loading = a(''); this.loading.insertAfter(this.btnLeft); this.firstTry = true; this.pastDataOnly = false; var h = parseInt(d.displayCount - 1); var c = d.displayCount; var b = parseInt(d.element.find(".wrapper").css("width")); this.itemInterval = Math.round((b - ((h * d.unselectedItemWidth) + d.selectedItemWidth)) / c); this.unselectedItemWidthPlusSpacing = this.unselectedItemWidth + this.itemInterval; d.loading.css("display", "block"); d.disableNavButtons(); d.tryFutureInit() }, destroy: function () { a.Widget.prototype.destroy.apply(this, arguments); this.element.children().remove() }, _setOption: function (c, d) { a.Widget.prototype._setOption.apply(this, arguments); var b = this.element }, tryFutureInit: function () { var b = this; a.ajax({ url: b.ajaxUrl, context: b, success: b.handleFutureInit, error: b.handleAjaxErrorFuture, data: "page=1&direction=F&filterBy=" + this.filterBy + "&filterValue=" + this.filterValue, dataType: "html" }) }, handleFutureInit: function (e, f, d) { var c = this; if (e.length > 0) { var b = a(""); b.append(e); if (b.find(".error").size() > 0) { c.displayError() } else { c.loadInitialData(e, f, d); if (c.loadDataLeft == true) { c.getMoreData("left") } else { c.moreDataLeft = false; c.btnLeft.unbind("click").bind("click", function () { c.nextItemToDisplay = c.current - 1; c.select(c.nextItemToDisplay) }) } } } else { c.btnRight.unbind("click").bind("click", function () { c.nextItemToDisplay = c.current + 1; c.select(c.nextItemToDisplay) }); if (c.loadDataLeft == true) { c.tryPastInit() } else { c.loadInitialData(e, f, d) } } }, tryPastInit: function () { var b = this; a.ajax({ url: b.ajaxUrl, context: this, success: b.handlePastInit, error: b.handleAjaxErrorPast, data: "page=1&direction=P&filterBy=" + this.filterBy + "&filterValue=" + this.filterValue, dataType: "html" }) }, handlePastInit: function (e, f, d) { var c = this; c.moreDataRight = false; if (e.length > 0) { var b = a(""); b.append(e); if (b.find(".error").size() > 0) { c.displayError(); c.btnPrev.css("display", "none") } else { c.pastDataOnly = true; c.loadInitialData(e, f, d) } } else { c.btnLeft.unbind("click").bind("click", function () { c.nextItemToDisplay = c.current - 1; c.select(c.nextItemToDisplay) }); c.loadInitialData(e, f, d) } }, getMoreData: function (c) { var b = this; var d; var f; var e; if (c == "right") { d = ++this.highPage; f = this.appendData; e = "F" } else { if (c == "left") { d = ++this.lowPage; f = this.prependData; e = "P" } } b.loading.css("display", "block"); b.disableNavButtons(); a.ajax({ url: b.ajaxUrl, context: this, success: f, data: "page=" + d + "&direction=" + e + "&filterBy=" + this.filterBy + "&filterValue=" + this.filterValue, datatype: "html" }) }, loadInitialData: function (d, e, c) { var b = this; b.loading.css("display", "none"); b.enableNavButtons(); if (d != null && d.length > 0) { b.sliderItems.unbind("click"); b.slider.append(d); b.sliderItems = b.slider.children(); if (b.pastDataOnly == true) { b.current = b.sliderItems.size() - 1; b.pastDataOnly = false; b.firstTry = false; b.updateNavButtons() } b.initItems(); if (a(".lastPastEvent").size() > 0) { b.moreDataLeft = false; b.btnLeft.unbind("click").bind("click", function () { b.nextItemToDisplay = b.current - 1; b.select(b.nextItemToDisplay) }) } if (a(".lastFutureEvent").size() > 0) { b.moreDataRight = false; b.btnRight.unbind("click").bind("click", function () { b.nextItemToDisplay = b.current + 1; b.select(b.nextItemToDisplay) }) } } else { b.element.append(b.noDataMsg); b.btnLeft.css("display", "none"); b.btnRight.css("display", "none"); b.element.append('NO DATA
') } }, prependData: function (e, f, d) { var b = this; var c; b.loading.css("display", "none"); b.enableNavButtons(); if (e != null && e.length > 0) { b.sliderItems.unbind("click"); b.slider.prepend(e); b.sliderItems = b.slider.children(); c = a(e).find(".ataglanceItem").size(); b.current += c; b.prev += c; b.nextItemToDisplay += c; b.initItems(); if (b.firstTry) { b.setInitialSelection(b.nextItemToDisplay); b.firstTry = false } else { b.select(b.nextItemToDisplay) } if (a(".lastPastEvent").size() > 0) { b.moreDataLeft = false; b.btnLeft.unbind("click").bind("click", function () { b.nextItemToDisplay = b.current - 1; b.select(b.nextItemToDisplay) }) } } else { b.moreDataLeft = false; b.btnLeft.unbind("click").bind("click", function () { b.nextItemToDisplay = b.current - 1; b.select(b.nextItemToDisplay) }) } }, appendData: function (d, e, c) { var b = this; b.loading.css("display", "none"); b.enableNavButtons(); if (d != null && d.length > 0) { b.sliderItems.unbind("click"); b.slider.append(d); b.sliderItems = b.slider.children(); b.initItems(); b.select(b.nextItemToDisplay); if (a(".lastFutureEvent").size() > 0) { b.moreDataRight = false; b.btnRight.unbind("click").bind("click", function () { b.nextItemToDisplay = b.current + 1; b.select(b.nextItemToDisplay) }) } } else { b.moreDataRight = false; b.btnRight.unbind("click").bind("click", function () { b.nextItemToDisplay = b.current + 1; b.select(b.nextItemToDisplay) }) } }, select: function (d) { var c = this; c.prev = c.current; c.current = d; c.sliderItems.css("zIndex", 0); var g = c.sliderItems.eq(d); g.css("zIndex", 20); var f = {}; f.left = (c.slider.parent()[0]["offsetWidth"] / 2 - c.selectedItemWidth / 2 - (c.current * c.unselectedItemWidthPlusSpacing)); c.slider.stop().animate(f, { duration: 1000, easing: "easeOutQuint" }); var e = { width: c.selectedItemWidth, height: c.selectedItemHeight, top: 7 }; g.stop().animate(e, { duration: 1000, easing: "easeOutQuint" }); g.addClass("itemSelected"); g.find(".thumb").css("display", "none"); g.find(".content").css("display", "block"); var b = { width: c.unselectedItemWidth, height: c.unselectedItemHeight, top: c.unselectedItemTop }; c.sliderItems.eq(c.prev).stop().animate(b, { duration: 1000, easing: "easeOutQuint" }); c.sliderItems.eq(c.prev).removeClass("itemSelected"); c.sliderItems.eq(c.prev).find(".thumb").css("display", "block"); c.sliderItems.eq(c.prev).find(".content").css("display", "none"); c.updateNavButtons() }, setInitialSelection: function (c) { var b = this; b.prev = b.current; b.current = c; b.sliderItems.css("zIndex", 0); var f = b.sliderItems.eq(c); f.css("zIndex", 20); var e = {}; e.left = (b.slider.parent()[0]["offsetWidth"] / 2 - b.selectedItemWidth / 2 - (b.current * b.unselectedItemWidthPlusSpacing)); b.slider.stop().animate(e, { duration: 1000, easing: "easeOutQuint" }); var d = { width: b.selectedItemWidth, height: b.selectedItemHeight, top: 7 }; f.stop().animate(d, { duration: 1000, easing: "easeOutQuint" }); f.addClass("itemSelected"); f.find(".thumb").css("display", "none"); f.find(".content").css("display", "block"); b.updateNavButtons() }, initItems: function () { var b = this; var d = Math.floor(b.displayCount * 0.5); var c = b.displayCount - d; b.sliderItems.each(function (e) { a(this).css({ width: b.unselectedItemWidth, height: b.unselectedItemHeight, left: e * b.itemInterval, top: b.unselectedItemTop }); a(this).click(function () { if (e != b.current) { b.nextItemToDisplay = e; if (e < d && b.moreDataLeft && e < b.current) { b.getMoreData("left") } else { if (e > b.sliderItems.size() - c && b.moreDataRight && e > b.current) { b.getMoreData("right") } else { b.select(e) } } } }); a(this).find(".content").css("display", "none"); a(this).find(".thumb").css("display", "block") }); b.slider.css("left", b.slider.parent()[0]["offsetWidth"] / 2 - b.selectedItemWidth / 2 - (b.current * b.unselectedItemWidthPlusSpacing)); b.sliderItems.eq(b.current).addClass("itemSelected"); b.sliderItems.eq(b.current).css({ width: b.selectedItemWidth, height: b.selectedItemHeight, top: 7 }); b.sliderItems.eq(b.current).find(".content").css("display", "block"); b.sliderItems.eq(b.current).find(".thumb").css("display", "none"); b.initDataFunc(b.slider); b.updateNavButtons() }, updateNavButtons: function () { var b = this; if (b.current > 0) { b.btnLeft.css({ display: "block" }) } else { b.btnLeft.css({ display: "none" }) } if (b.current < b.sliderItems.size() - 1) { b.btnRight.css({ display: "block" }) } else { b.btnRight.css({ display: "none" }) } }, enableNavButtons: function () { var b = this; b.btnLeft.bind("click", function () { if (b.current == b.leftDataTriggerIndex && b.moreDataLeft == true) { b.nextItemToDisplay = b.current - 1; b.getMoreData("left") } else { b.nextItemToDisplay = b.current - 1; b.select(b.nextItemToDisplay) } }); b.btnRight.bind("click", function () { if (b.current == b.sliderItems.size() - b.rightDataTriggerIndex && b.moreDataRight == true) { b.nextItemToDisplay = b.current + 1; b.getMoreData("right") } else { b.nextItemToDisplay = b.current + 1; b.select(b.nextItemToDisplay) } }) }, disableNavButtons: function () { this.btnLeft.unbind("click"); this.btnRight.unbind("click") }, handleAjaxErrorFuture: function () { var b = this; b.displayError() }, handleAjaxErrorPast: function () { var b = this; b.displayError() }, displayError: function () { var b = this; a("#errorDiv").css("display", "block") }, hideError: function () { var b = this; a("#errorDiv").css("display", "none") } }) })(jQuery); (function (a) { a.easing.easeOutQuint = function (f, g, e, j, h) { return j * ((g = g / h - 1) * g * g * g * g + 1) + e }; a.widget("ui.hmkListView", { options: { current: 0, ajaxUrl: "getEventListData.php", filterBy: "", filterValue: "", onComplete: function () { } }, _create: function () { var b = this, e = b.options, c = b.element; this.current = e.current; this.ajaxUrl = e.ajaxUrl; this.filterBy = e.filterBy; this.filterValue = e.filterValue; this.onComplete = e.onComplete; this.prev = this.current; this.highPage = 1; this.lowPage = 0; var d = a(''); d.appendTo(this.element); this.slider = this.element.find("#hmkEventList"); this.sliderItems = this.slider.children(); var f = b.slider.parent(); this.btnPrev = a(".listViewPrev"); this.btnNext = a(".listViewNext"); this.btnSeeAll = a(".eventListSeeAll"); this.enableNavButtons(); this.loading = a(''); this.loading.insertAfter(this.btnPrev); this.loading.css({ left: f.position().left + f.width() * 0.5 - this.loading.width() * 0.5, top: f.position().top + f.height() * 0.5 - this.loading.height() * 0.5 }); this.currentOpenElement; b.eventList = {}; b.eventListKeys = []; this.slider.find(".eventListGroupRoot").each(function () { var g = a(this).metadata().date; b.eventList[g] = a(this) }); b.tryFutureInit() }, destroy: function () { a.Widget.prototype.destroy.apply(this, arguments); this.element.children().remove() }, _setOption: function (c, d) { a.Widget.prototype._setOption.apply(this, arguments); var b = this.element }, tryFutureInit: function () { var b = this; a.ajax({ url: b.ajaxUrl, context: b, success: b.handleFutureInit, error: b.handleAjaxErrorFuture, data: "page=1&direction=F&filterBy=" + this.filterBy + "&filterValue=" + this.filterValue, dataType: "html" }) }, handleFutureInit: function (e, f, d) { var c = this; if (e.length > 0) { var b = a(""); b.append(e); if (b.find(".error").size() > 0) { c.displayError(); c.btnNext.css("display", "none") } else { c.initData(e, f, d) } } else { c.btnNext.css("display", "none"); c.tryPastInit() } }, tryPastInit: function () { var b = this; a.ajax({ url: b.ajaxUrl, context: this, success: b.handlePastInit, error: b.handleAjaxErrorPast, data: "page=1&direction=P&filterBy=" + this.filterBy + "&filterValue=" + this.filterValue, dataType: "html" }) }, handlePastInit: function (e, f, d) { var c = this; if (e.length > 0) { var b = a(""); b.append(e); if (b.find(".error").size() > 0) { c.displayError(); c.btnPrev.css("display", "none") } else { c.initData(e, f, d) } } else { c.btnPrev.css("display", "none"); c.initData(e, f, d) } }, getMoreData: function (c) { var b = this; var d; var f; var g; var e; if (c == "right") { d = ++this.highPage; g = this.appendData; f = "F"; e = b.handleAjaxErrorFuture } else { if (c == "left") { d = ++this.lowPage; g = this.prependData; f = "P"; e = b.handleAjaxErrorPast } else { if (c == "") { d = ""; g = this.showAllData } } } b.loading.css("display", "block"); b.disableNavButtons(); a.ajax({ url: b.ajaxUrl, context: this, success: g, error: e, data: "page=" + d + "&direction=" + f + "&filterBy=" + b.filterBy + "&filterValue=" + b.filterValue, dataType: "html" }) }, prependData: function (e, g, d) { var c = this; c.loading.css("display", "none"); c.enableNavButtons(); if (e.length > 0) { var b = a(""); b.append(e); if (b.find(".error").size() > 0) { c.displayError(); c.btnPrev.css("display", "none"); return } var f = a(e); f.each(function (m) { if (a(this).hasClass("eventListGroupRoot")) { var k = a(this).metadata().date; var n = a(this); if (c.eventList[k] != undefined) { var p = a(c.eventList[k]).children(".eventListGroup"); var o = a(n).find(".eventListItem"); var l = o.size(); if (l > 0) { for (var h = l - 1; h >= 0; h--) { p.prepend(o.eq(h).get()) } } } else { c.eventList[k] = a(n) } } }); c.formatEventList(); c.initAccordion(); if (a(".lastPastEvent").size() > 0) { c.btnPrev.css("display", "none") } } else { c.btnPrev.css("display", "none") } }, appendData: function (e, g, d) { var c = this; c.loading.css("display", "none"); c.enableNavButtons(); if (e.length > 0) { var b = a(""); b.append(e); if (b.find(".error").size() > 0) { c.displayError(); c.btnNext.css("display", "none"); return } var f = a(e); f.each(function (m) { if (a(this).hasClass("eventListGroupRoot")) { var k = a(this).metadata().date; var n = a(this); if (c.eventList[k] != undefined) { var p = a(c.eventList[k]).children(".eventListGroup"); var o = a(n).find(".eventListItem"); var l = o.size(); if (l > 0) { for (var h = 0; h < l; h++) { p.append(o.eq(h).get()) } } } else { c.eventList[k] = a(n) } } }); c.formatEventList(); c.initAccordion(); if (a(".lastFutureEvent").size() > 0) { c.btnNext.css("display", "none") } } else { c.btnNext.css("display", "none") } }, initData: function (f, h, e) { var c = this; c.loading.css("display", "none"); if (f.length > 0) { var g = a(f); g.each(function (k) { if (a(this).hasClass("eventListGroupRoot")) { var j = a(this).metadata().date; var l = a(this); c.eventList[j] = a(l) } }); c.formatEventList(); c.initAccordion(); c.currentOpenElement = a(".eventListItem").eq(0).children().eq(0); if (a(".lastPastEvent").size() > 0) { c.btnPrev.css("display", "none") } if (a(".lastFutureEvent").size() > 0) { c.btnNext.css("display", "none") } c.onComplete() } else { var d = a('Add an occasion or holiday, and we can remind you when it\'s coming up.
'); var b = a("#hmkEventList > ul"); b.append(d); c.btnPrev.css("display", "none"); c.btnNext.css("display", "none"); c.element.append('NO DATA
') } }, showAllData: function (g, j, f) { var b = this; b.loading.css("display", "none"); b.enableNavButtons(); b.eventList = {}; b.eventListKeys = []; if (g != null) { for (var d = 0; d < g.length; d++) { var c = g[d].date; var e = g[d].content; if (b.eventList[c] != undefined) { var h = a(b.eventList[c]).children(".eventListGroup"); a(e).appendTo(h) } else { b.eventList[c] = e } } b.formatEventList(); b.initAccordion(); b.moreDataRight = false; b.btnSeeAll.unbind("click") } }, select: function (c) { var b = this; b.prev = b.current; b.current = c; b.sliderItems.css("zIndex", 0); var d = b.sliderItems.eq(c); b.updateNavButtons() }, updateNavButtons: function () { var b = this; if (b.current > 0) { b.btnPrev.css({ display: "block" }) } else { b.btnPrev.css({ display: "none" }) } if (b.current < b.sliderItems.size() - 1) { b.btnNext.css({ display: "block" }) } else { b.btnNext.css({ display: "none" }) } }, enableNavButtons: function () { var b = this; b.btnPrev.bind("click", function (c) { b.hideError(); b.getMoreData("left"); c.preventDefault() }); b.btnNext.bind("click", function (c) { b.hideError(); b.getMoreData("right"); c.preventDefault() }); b.btnSeeAll.bind("click", function (c) { b.getMoreData(""); c.preventDefault() }) }, disableNavButtons: function () { this.btnPrev.unbind("click"); this.btnNext.unbind("click"); this.btnSeeAll.unbind("click") }, initAccordion: function () { var b = this; a(".accordionHead").each(function () { a(this).unbind("click").bind("click", function (c) { if ((a(this).hasClass("accSlideDownLeft") && b.currentOpenElement.hasClass("accSlideDownLeft")) || (a(this).hasClass("accSlideUpLeft") && b.currentOpenElement.hasClass("accSlideUpLeft"))) { } else { if (b.currentOpenElement.hasClass("accSlideUpLeft")) { b.currentOpenElement.next(".accordionBod").slideToggle(300); b.currentOpenElement.removeClass("accSlideUpLeft").addClass("accSlideDownLeft") } } a(this).next(".accordionBod").slideToggle(300); if (a(this).hasClass("accSlideDownLeft")) { a(this).removeClass("accSlideDownLeft").addClass("accSlideUpLeft") } else { if (a(this).hasClass("accSlideUpLeft")) { a(this).removeClass("accSlideUpLeft").addClass("accSlideDownLeft") } } b.currentOpenElement = a(this) }) }); a(".scrollable").scrollable({ size: 1, prevPage: ".leftScroll", nextPage: ".rightScroll" }).circular() }, formatEventList: function () { var c = this; c.eventListKeys = c.getKeys(c.eventList).sort(); a("#hmkEventList").children("ul").remove(); a("#hmkEventList").append(a('')); var b = a("#hmkEventList > ul"); for (var e = 0; e < c.eventListKeys.length; e++) { var d = c.eventListKeys[e]; b.append(c.eventList[d]) } a(".eventListGroupRoot").each(function () { var f = a(this).find(".eventListItem"); f.addClass("eventListItemBorder"); f.eq(f.size() - 1).removeClass("eventListItemBorder") }) }, getKeys: function (d) { var c = []; for (var b in d) { c.push(b) } return c }, handleAjaxErrorFuture: function () { var b = this; b.btnNext.css("display", "none"); b.displayError() }, handleAjaxErrorPast: function () { var b = this; b.btnPrev.css("display", "none"); b.displayError() }, displayError: function () { var b = this; a("#errorDiv").css("display", "block") }, hideError: function () { var b = this; a("#errorDiv").css("display", "none") } }) })(jQuery); (function (a) { a.widget("ui.hmkTypeAheadish", { options: { ajaxUrl: "typeAhead.php", specialDisplayField: "IsSpecial", specialDisplayItemClass: "special", displayField: "name", dataListClass: "names", dataItemClass: "nameItem", dataItemSelectedClass: "", callback: function () { }, parser: function () { }, mode: "single", params: "" }, _create: function () { var b = this; var e = b.options; var c = b.element; this.ajaxUrl = e.ajaxUrl; this.displayField = e.displayField; this.dataListClass = e.dataListClass; this.dataItemClass = e.dataItemClass; this.dataItemSelectedClass = e.dataItemSelectedClass; this.specialDisplayField = e.specialDisplayField; this.specialDisplayItemClass = e.specialDisplayItemClass; this.callback = e.callback; this.parser = e.parser; this.mode = e.mode; this.params = e.params; this.searchStr = ""; this.prevSearchStr = "undefined"; this.arrDataObjects; this.selectedItem = -1; this.ajaxData; this.caretPos = 0; this.tokens = new Array(); this.savedObjects = {}; this.commas = new Array(); this.currentWord; this.dataItemHeight = parseInt(a('').css("height")); b.searchStr = jQuery.trim(b.element.val()); b.element.bind("keyup", function (f) { b.prevSearchStr = b.searchStr; b.caretPos = b.getCaretPosition(b.element.get(0)); b.setSearchString(); if (b.searchStr.length == 3) { b.doAjaxCall() } else { if (b.searchStr != b.prevSearchStr) { b.execCallback() } } f.preventDefault() }); var d = function () { if (c.val().length >= 3) { b.doAjaxCall() } a(this).unbind("focus", d) }; c.focus(d); this.dataList = a(''); this.dataList.css("width", c.outerWidth()); this.dataList.insertAfter(c); this.element.blur(function () { b.dataList.css("display", "none") }); this.element.mouseup(function () { b.caretPos = b.getCaretPosition(b.element.get(0)); b.prevSearchStr = b.searchStr; b.setSearchString() }) }, destroy: function () { a.Widget.prototype.destroy.apply(this, arguments) }, _setOption: function (c, d) { a.Widget.prototype._setOption.apply(this, arguments); var b = this.element }, doAjaxCall: function () { var b = this; if (b.searchStr != b.prevSearchStr) { var c = "searchStr=" + b.searchStr; if (b.params != "") { c += "&" + b.params } a.ajax({ url: b.ajaxUrl, type: "POST", context: this, success: b.showData, data: c, dataType: "json" }) } }, showData: function (d) { var c = this; c.prevSearchStr = c.searchStr; c.dataList.css("width", c.element.outerWidth()); c.dataList.css("display", "block"); c.arrDataObjects = c.parser(d); if (c.arrDataObjects.length > 0) { c.dataList.html(""); for (i = 0; i < c.arrDataObjects.length; i++) { var e = c.arrDataObjects[i]; var b; if (e[c.specialDisplayField] && (e[c.specialDisplayField] == "true" || e[c.specialDisplayField] == true)) { if (e.Key != undefined) { b = a('' + e[c.displayField] + "
") } else { if (e.PersonID != undefined) { b = a('' + e[c.displayField] + "
") } else { b = a('' + e[c.displayField] + "
") } } } else { if (e.Key != undefined) { b = a('' + e[c.displayField] + "
") } else { if (e.PersonID != undefined) { b = a('' + e[c.displayField] + "
") } else { b = a('' + e[c.displayField] + "
") } } } c.dataList.append(b) } c.initDataItemBehavior(); c.initFilter(); c.selectedItem = -1; c.selectNextItem() } else { c.dataList.css("display", "none") } }, initFilter: function () { var b = this; b.element.unbind("keyup").bind("keyup", function (g) { var f = (g.keyCode ? g.keyCode : g.which); switch (f) { case 37: b.caretPos = b.getCaretPosition(b.element.get(0)); b.prevSearchStr = b.searchStr; b.setSearchString(); break; case 39: b.caretPos = b.getCaretPosition(b.element.get(0)); b.prevSearchStr = b.searchStr; b.setSearchString(); break; case 40: b.selectNextItem(); break; case 38: b.selectPreviousItem(); break; case 13: b.prevSearchStr = b.searchStr; b.setSearchString(); if (b.selectedItem > -1) { b.writeCurrentItem(b.dataList.children().eq(b.selectedItem).text()) } else { var d = b.searchStr.length >= 3 ? b.searchStr.substring(0, 3) : b.searchStr; var c = b.prevSearchStr.length >= 3 ? b.prevSearchStr.substring(0, 3) : b.prevSearchStr; if (b.searchStr.length >= 3 && d.toUpperCase() != c.toUpperCase()) { b.doAjaxCall() } } return false; break; default: b.caretPos = b.getCaretPosition(b.element.get(0)); b.prevSearchStr = b.searchStr; b.setSearchString(); var d = b.searchStr.length >= 3 ? b.searchStr.substring(0, 3) : b.searchStr; var c = b.prevSearchStr.length >= 3 ? b.prevSearchStr.substring(0, 3) : b.prevSearchStr; if (b.searchStr.length == 3) { b.doAjaxCall() } if (b.searchStr.length > 3 && d.toUpperCase() != c.toUpperCase()) { b.doAjaxCall() } else { b.filterDataItems() } break } g.preventDefault() }); b.element.closest("form").bind("keypress", function (c) { if (c.keyCode == 13) { return false } }) }, filterDataItems: function () { var c = this; var e = false; c.dataList.html(""); c.selectedItem = -1; if (c.searchStr.length >= 3) { for (var d = 0; d < c.arrDataObjects.length; d++) { var f = c.arrDataObjects[d]; if (f[c.displayField].toUpperCase().indexOf(c.searchStr.toUpperCase()) == 0) { var b; if (f[c.specialDisplayField] && (f[c.specialDisplayField] == "true" || f[c.specialDisplayField] == true)) { if (f.Key != undefined) { b = a('' + f[c.displayField] + "
") } else { if (f.PersonID != undefined) { b = a('' + f[c.displayField] + "
") } else { b = a('' + f[c.displayField] + "
") } } } else { if (f.Key != undefined) { b = a('' + f[c.displayField] + "
") } else { if (f.PersonID != undefined) { b = a('' + f[c.displayField] + "
") } else { b = a('' + f[c.displayField] + "
") } } } c.dataList.append(b); e = true; c.execCallback() } } if (e) { c.selectNextItem(); c.initDataItemBehavior() } else { c.execCallback() } } else { c.dataList.css("display", "none"); c.execCallback() } }, selectNextItem: function () { var c = this; c.dataList.css("display", "block"); var b = c.dataList.children(); b.each(function () { a(this).removeClass(c.dataItemSelectedClass) }); if (c.selectedItem == -1) { b.eq(0).addClass(c.dataItemSelectedClass); c.selectedItem = 0 } else { if (c.selectedItem == b.size() - 1) { c.selectedItem = -1 } else { c.selectedItem += 1; b.eq(c.selectedItem).addClass(c.dataItemSelectedClass) } } if (c.selectedItem > -1) { c.dataList.scrollTop(c.selectedItem * c.dataItemHeight) } else { c.dataList.scrollTop(0) } }, selectPreviousItem: function () { var c = this; c.dataList.css("display", "block"); var b = c.dataList.children(); b.each(function () { a(this).removeClass(c.dataItemSelectedClass) }); if (c.selectedItem == -1) { b.eq(b.size() - 1).addClass(c.dataItemSelectedClass); c.selectedItem = b.size() - 1 } else { if (c.selectedItem == 0) { c.selectedItem = -1 } else { c.selectedItem -= 1; b.eq(c.selectedItem).addClass(c.dataItemSelectedClass) } } if (c.selectedItem > -1) { c.dataList.scrollTop(c.selectedItem * c.dataItemHeight) } else { c.dataList.scrollTop(0) } }, writeCurrentItem: function (f, g) { var b = this; b.dataList.css("display", "none"); var d = b.element.val(); var c = jQuery.trim(f); b.tokens[b.currentWord] = c; b.savedObjects[c] = b.getObjectFromKeyValue(c, g); b.element.val(b.tokens.join(", ")); b.getCaretPosition(b.element.get(0)); var e = b.getObjectFromKeyValue(b.element.val(), g); b.execCallback() }, initDataItemBehavior: function () { var b = this; var c = b.dataList.children("." + b.dataItemClass); c.mousedown(function () { b.writeCurrentItem(a(this).text(), a(this).find("span").attr("id")) }); c.mouseover(function (d) { b.dataList.children("div").removeClass(b.dataItemSelectedClass); a(this).addClass(b.dataItemSelectedClass); d.stopPropagation() }); c.mouseout(function (d) { a(this).removeClass(b.dataItemSelectedClass); d.stopPropagation() }) }, setSearchString: function () { var b = this; var d = b.element.val(); if (b.mode == "multiple") { b.findCommas(); b.tokens = d.split(",") } else { b.tokens = new Array(d) } for (var c = 0; c < b.tokens.length; c++) { b.tokens[c] = jQuery.trim(b.tokens[c]) } b.currentWord = b.whatWord(); b.searchStr = b.currentWord > -1 ? b.tokens[b.currentWord] : "" }, getObjectFromKeyValue: function (e, g) { var b = this; if (b.arrDataObjects != null) { for (var c = 0; c < b.arrDataObjects.length; c++) { var f = b.arrDataObjects[c]; if (g != undefined && g != "") { var d; if (f.Key != undefined) { d = f.Key } else { if (f.PersonID != undefined) { d = f.PersonID } } if (f[b.displayField] == e && d == g) { return f } } else { if (f[b.displayField] == e) { return f } } } } return null }, getCaretPosition: function (e) { if (window.getSelection) { return e.selectionStart } else { if (e.tagName.toLowerCase() == "textarea") { var b = document.selection.createRange(); var c = b.duplicate(); c.moveToElementText(e); c.setEndPoint("EndToEnd", b); e.selectionStart = c.text.length - b.text.length; e.selectionEnd = e.selectionStart + b.text.length; return e.selectionStart } else { var d = document.selection.createRange().duplicate(); d.moveEnd("character", e.value.length); if (d.text == "") { return e.value.length } return e.value.lastIndexOf(d.text) } } }, findCommas: function () { var c = this; var d = /,/gi; var b; var f = []; c.commas = new Array(); var e = c.element.val(); while ((b = d.exec(e))) { c.commas.push(b.index) } }, whatWord: function () { var c = this; var b = -1; var e = false; if (c.commas.length > 0) { for (var d = 0; d < c.commas.length; d++) { if (c.caretPos <= c.commas[d]) { b = d; break } } if (b == -1) { b = c.commas.length } } else { if (c.tokens.length > 0) { b = 0 } } return b }, execCallback: function () { var b = this; if (b.mode == "multiple") { var f = new Array(); for (var e = 0; e < b.tokens.length; e++) { var d = b.tokens[e]; if (d != null && d != "") { var g = b.savedObjects[d]; if (g != null) { f.push(g) } else { var c = {}; c[b.displayField] = d; f.push(c) } } } b.callback(f) } else { var g = b.savedObjects[b.tokens[0]]; if (g != null) { b.callback(g) } else { b.callback({}) } } } }) })(jQuery); (function (a) { a.easing.easeOutQuint = function (f, g, e, j, h) { return j * ((g = g / h - 1) * g * g * g * g + 1) + e }; a.widget("ui.hmkSlider2", { options: { itemSpacing: 10, itemWidth: 78, displayCount: 10, ajaxUrl: "getContactData_TEST0117.php", initDataFunc: function () { }, itemCountField: "", successCallBackMethod: function () { } }, _create: function () { var b = this, e = b.options, c = b.element; this.successCallBack = e.successCallBackMethod; this.itemSpacing = e.itemSpacing; this.itemWidth = e.itemWidth; this.itemWidthPlusSpacing = this.itemWidth + this.itemSpacing; this.itemInterval = e.itemSpacing; this.ajaxUrl = e.ajaxUrl; this.initDataFunc = e.initDataFunc; this.itemCountField = e.itemCountField; this.totalItemCount; this.current = 0; this.prev = 0; this.nextItemToDisplay = this.current; this.numItems; var d = a(''); d.appendTo(this.element); this.slider = this.element.find(".items"); this.sliderItems = this.slider.children(); this.displayCount = e.displayCount; this.moreData = true; this.highPage = 0; this.numPages; var f = b.element.find(".contactWidgetWrapper"); this.btnLeft = a(''); this.btnLeft.insertAfter(f); this.btnRight = a(''); this.btnRight.insertAfter(this.btnLeft); this.loading = a(''); this.loading.insertAfter(this.btnLeft); b.getMoreData() }, destroy: function () { a.Widget.prototype.destroy.apply(this, arguments); this.slider.attr("style", "") }, _setOption: function (c, d) { a.Widget.prototype._setOption.apply(this, arguments); var b = this.element }, getMoreData: function () { var b = this; var c = ++(b.highPage); b.loading.css("display", "block"); b.disableNavButtons(); a.ajax({ url: b.ajaxUrl, context: this, type: "POST", success: b.appendData, data: "page=" + c, dataType: "html" }) }, appendData: function (e, f, d) { var c = this; c.loading.css("display", "none"); if (e.length > 0) { var b = jQuery.parseJSON(e); if (b[c.itemCountField] != null) { c.totalItemCount = b[c.itemCountField] } else { alert("ERROR : No item count field!") } c.successCallBack(c.slider, b); c.sliderItems = c.slider.children(); c.initItems(); c.select(c.current) } else { c.btnRight.unbind("click").bind("click", function () { c.nextItemToDisplay = c.current + 1; c.select(c.nextItemToDisplay) }) } }, select: function (c) { var b = this; b.prev = b.current; b.current = c; b.sliderItems.css("zIndex", 0); var e = b.sliderItems.eq(c); e.css("zIndex", 20); var d = {}; d.left = (0 - ((b.current) * b.itemWidthPlusSpacing * b.displayCount)); b.slider.stop().animate(d, { duration: 1000, easing: "easeOutQuint" }); b.updateNavButtons() }, initItems: function () { var b = this; b.sliderItems.each(function (c) { a(this).css({ width: b.itemWidth, left: c * b.itemInterval }) }); b.slider.css("left", 0 - (b.current * b.itemWidthPlusSpacing)); if (b.sliderItems.size() >= b.totalItemCount) { b.moreData = false } b.numPages = Math.ceil(b.sliderItems.size() / b.displayCount); b.enableNavButtons() }, updateNavButtons: function () { var b = this; if (b.current > 0) { b.btnLeft.css({ display: "block" }) } else { b.btnLeft.css({ display: "none" }) } if ((b.current < b.numPages - 1) || (b.current == b.numPages - 1 && b.moreData)) { b.btnRight.css({ display: "block" }) } else { b.btnRight.css({ display: "none" }) } }, enableNavButtons: function () { var b = this; b.btnLeft.bind("click", function () { b.current -= 1; b.select(b.current) }); b.btnRight.bind("click", function () { b.current += 1; if (b.sliderItems.size() < b.displayCount * (b.current + 1) && b.moreData) { b.getMoreData("right") } else { b.select(b.current) } }) }, disableNavButtons: function () { this.btnLeft.unbind("click"); this.btnRight.unbind("click") } }) })(jQuery); (function (a) { a.widget("ui.hmkRecommendations", { options: { ajaxUrl: "getEventListData.php", ajaxDataType: "jsonp", params: "", alignment: "H", isCarousel: "N", numCarouselDisplayItems: "1", productSortOrder: "PODCARD:2,ECARD:2,FINISHEDGOODS:1", headerText: "Recommendations...", headerLink: "http://www.hallmark.com", headerLinkText: "See More Occasions", successCallback: function () { } }, _create: function () { var b = this, d = b.options, c = b.element; this.ajaxUrl = d.ajaxUrl; this.ajaxDataType = d.ajaxDataType; this.params = d.params; this.alignment = d.alignment; this.isCarousel = d.isCarousel; this.numCarouselDisplayItems = d.numCarouselDisplayItems; this.productSortOrder = d.productSortOrder; this.headerText = d.headerText; this.headerLink = d.headerLink; this.headerLinkText = d.headerLinkText; this.displayCount = 0; this.successCallback = d.successCallback; this.arrProductTypes = {}; a.ajax({ type: "POST", url: b.ajaxUrl, context: this, success: b.initData, error: b.handleAjaxError, data: this.params, dataType: b.ajaxDataType }) }, destroy: function () { a.Widget.prototype.destroy.apply(this, arguments) }, _setOption: function (c, d) { a.Widget.prototype._setOption.apply(this, arguments); var b = this.element }, initData: function (c, b, k) { var l = this; var g = false; if (c != null) { var j = c.products; var e = ""; if (j.length == 1 && l.isCarousel == "Y") { l.isCarousel = "N" } for (var d = 0; d < j.length; d++) { var f = j[d].ProductLine; if (f != e) { l.arrProductTypes[f] = new Array(); e = f } l.arrProductTypes[f].push(j[d]) } l.processProductOrder(); var h; if (l.alignment == "H") { if (l.isCarousel == "Y") { h = l.element.find(".items"); if (h.children().size() == 0) { l.element.children().remove() } } else { h = l.element.children(":first"); if (h.children().size() == 1) { contentSpot.AppendAdHTML(h, "ProductRecommendations", "PRODUCTRECOMMENDATIONS", "staticOtherRecommendations", l.successCallback); g = true } } } } else { l.processProductOrder(); var h; h = l.element.children(":first"); contentSpot.AppendAdHTML(h, "ProductRecommendations", "PRODUCTRECOMMENDATIONS", "staticOtherRecommendations", l.successCallback); g = true } if (!g) { l.successCallback() } }, processProductOrder: function () { var d = this; var c = d.productSortOrder.split(","); for (var f = 0; f < c.length; f++) { var b = c[f].split(":"); d.displayCount += parseInt(b[1], 10) } d.insertHeader(); for (var f = 0; f < c.length; f++) { var b = c[f].split(":"); var g = b[0]; var e = b[1]; d.prepareDetailOutput(g, e) } if (d.alignment == "H" && d.isCarousel == "N") { d.element.find(".dropShadowBox:last").addClass("lastCol") } if (d.isCarousel == "Y") { } d.element.find(".scrollable").scrollable({ size: parseInt(d.numCarouselDisplayItems, 10), prevPage: ".leftScroll", nextPage: ".rightScroll", clickable: false }).circular() }, prepareDetailOutput: function (f, d) { var c = this; var b; b = c.arrProductTypes[f]; if (b) { if (d > b.length) { d = b.length } for (var e = 0; e < d; e++) { var j = {}; j.productName = b[e].Name; j.productType = b[e].ProductType; j.productCategory = f; j.price = b[e].SalePrice; if (b[e].isPurchased != null && b[e].isPurchased == "Y") { j.price = "Purchased" } j.href = b[e].PDPUrl; j.img = b[e].ImagePath; j.sku = b[e].ProductID; j.eventType = b[e].EventType; j.productLine = b[e].ProductLine; j.isInStores = b[e].IsInStores; if (b[e].AvailabilityStatement == null) { j.availabilityStatement = "" } else { j.availabilityStatement = b[e].AvailabilityStatement } var h = c.formatOutput(j); if (c.isCarousel == "N") { if (c.alignment == "H") { a(h).appendTo(c.element.children(":first")) } else { var g = c.element.children(":first").children(":last"); a(h).insertBefore(g) } } else { a(h).appendTo(c.element.children(":first").find(".items:first")) } } } }, insertHeader: function () { var c = this; var e = "width-" + (c.displayCount * 3) + "col"; var b = a('"); var f = a('"); var g = a(''); var d = a('"); if (c.isCarousel == "N") { if (c.alignment == "H") { c.element.append(b) } else { c.element.append(f) } } else { if (c.alignment == "H") { c.element.append(g) } else { c.element.append(d) } } }, formatOutput: function (h) { var c = this; var f = h.price; if (true == h.isInStores) { var e = ' In Stores Only '; f = f + e } var j = "'" + h.sku + "','" + h.productLine + "','" + h.href + "','" + h.eventType.replace("'", "\\'") + "'"; var g = '"; var d = '"; var b = '"; if (c.isCarousel == "N") { return g } else { if (c.alignment == "H") { return d } else { return b } } } }) })(jQuery); function PostOmnitureForRecommendations(d, c, a, b) { s.products = ";" + d; s.events = "prodView"; s.eVar4 = "reco > " + c + " > " + b + " > " + s.pageName; window.location.href = a; evalOmniture() } (function (c) { var b = { init: function (e) { var d = this; d.data("start", {}); d.data("changedElements", new Array()); c(this).find(":input").each(function () { d.data("start")[c(this).attr("id")] = (c(this).attr("type") == "checkbox" || c(this).attr("type") == "radio") ? (c(this).prop("checked") ? "checked" : "") : c(this).val() }) }, didFormChange: function () { return a(this) }, resetForm: function () { var d = this; if (!d.data("end")) { a(d) } c(this).find(":input").each(function () { if (c(this).attr("type") == "checkbox" || c(this).attr("type") == "radio") { if (d.data("start")[c(this).attr("id")] == true) { c(this).prop("checked", true) } else { c(this).prop("checked",false) } } else { c(this).val(d.data("start")[c(this).attr("id")]) } }); if (d.data("changedElements") && d.data("changedElements").length > 0) { for (var f = 0; f < d.data("changedElements").length; f++) { var e = "#" + d.data("changedElements")[f]; var g = c(e); if (g.attr("type") != "radio") { g.trigger("change") } else { if (g.prop("checked")) { g.trigger("change") } } } } d.data("changedElements", new Array()); d.data("end", null) } }; function a(e) { var d = false; e.data("end", {}); c(e).find(":input").each(function () { e.data("end")[c(this).attr("id")] = (c(this).attr("type") == "checkbox" || c(this).attr("type") == "radio") ? (c(this).prop("checked") ? "checked" : "") : c(this).val() }); for (var f in e.data("start")) { if (e.data("start")[f] != e.data("end")[f]) { d = true; e.data("changedElements").push(f) } } return d } c.fn.hmkFormChecker = function (d) { var e; if (b[d]) { return b[d].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (!d || typeof d === "object") { e = c.extend({}, c.fn.hmkFormChecker.defaults, d); return b.init.apply(this, arguments) } else { c.error("Method " + d + " does not exist on jQuery.hmkFormChecker") } } }; c.fn.hmkFormChecker.defaults = {} })(jQuery); (function (a) { a.easing.easeOutQuint = function (f, g, e, j, h) { return j * ((g = g / h - 1) * g * g * g * g + 1) + e }; a.widget("ui.bucketomatic", { options: { current: 0, ajaxUrl: "getEventListData.php", baseStructure: "", filterBy: "", filterValue: "", onComplete: function () { }, btnNextSelector: "", listGroupClass: "", itemClass: "", itemActionFunc: function () { }, noDataFunc: function () { }, pageVar: "page" }, _create: function () { var b = this, d = b.options, c = b.element; this.current = d.current; this.ajaxUrl = d.ajaxUrl; this.filterBy = d.filterBy; this.filterValue = d.filterValue; this.onComplete = d.onComplete; this.baseStructure = d.baseStructure; this.btnNextSelector = d.btnNextSelector; this.listGroupClass = d.listGroupClass; this.itemActionFunc = d.itemActionFunc; this.itemClass = d.itemClass; this.noDataFunc = d.noDataFunc; this.pageVar = d.pageVar; this.prev = this.current; this.highPage = 1; this.lowPage = 0; this.btnNext = a(this.btnNextSelector); this.enableNavButtons(); this.loading = a(''); this.loading.insertAfter(this.btnNext); b.eventList = {}; b.eventListKeys = []; b.tryFutureInit() }, destroy: function () { a.Widget.prototype.destroy.apply(this, arguments); this.element.children().remove() }, _setOption: function (c, d) { a.Widget.prototype._setOption.apply(this, arguments); var b = this.element }, tryFutureInit: function () { var b = this; a.ajax({ url: b.ajaxUrl, context: b, success: b.handleFutureInit, error: b.handleAjaxErrorFuture, data: b.pageVar + "=1", dataType: "html" }) }, handleFutureInit: function (e, f, d) { var c = this; if (e.length > 0) { var b = a(""); b.append(e); if (b.find(".error").size() > 0) { c.displayError(); c.btnNext.css("display", "none") } else { c.initData(e, f, d) } } else { c.btnNext.css("display", "none"); c.initData(e, f, d) } }, getMoreData: function (c) { var b = this; var d; var f; var g; var e; d = ++this.highPage; g = this.appendData; f = "F"; e = b.handleAjaxErrorFuture; b.loading.css("display", "block"); b.disableNavButtons(); a.ajax({ url: b.ajaxUrl, context: this, success: g, error: e, data: b.pageVar + "=" + d, dataType: "html" }) }, appendData: function (e, g, d) { var c = this; c.loading.css("display", "none"); c.enableNavButtons(); if (e.length > 0) { var b = a(""); b.append(e); if (b.find(".error").size() > 0) { c.displayError(); c.btnNext.css("display", "none"); return } var f = a(e); f.each(function (m) { if (a(this).hasClass(c.listGroupClass)) { var k = a(this).children(":first").html(); var n = a(this); if (c.eventList[k] != undefined) { var p = a(c.eventList[k]); var o = a(n).children(c.itemClass); var l = o.size(); if (l > 0) { for (var h = 0; h < l; h++) { p.append(o.eq(h).get()) } } } else { c.eventList[k] = a(n) } } }); c.formatEventList(); c.itemActionFunc(); if (a(".lastBucket").size() > 0) { c.btnNext.css("display", "none") } } else { c.btnNext.css("display", "none") } }, initData: function (d, f, c) { var b = this; b.loading.css("display", "none"); if (d.length > 0) { var e = a(d); e.each(function (h) { if (a(this).hasClass(b.listGroupClass)) { var g = a(this).children(":first").html(); var j = a(this); b.eventList[g] = a(j) } }); b.formatEventList(); b.itemActionFunc(); if (a(".lastBucket").size() > 0) { b.btnNext.css("display", "none") } b.onComplete() } else { b.noDataFunc(); b.btnNext.css("display", "none") } }, enableNavButtons: function () { var b = this; b.btnNext.bind("click", function (c) { b.hideError(); b.getMoreData("right"); c.preventDefault() }) }, disableNavButtons: function () { this.btnNext.unbind("click") }, formatEventList: function () { var c = this; c.eventListKeys = c.getKeys(c.eventList); var b = c.element; b.children().remove(); for (var e = 0; e < c.eventListKeys.length; e++) { var d = c.eventListKeys[e]; b.append(c.eventList[d]) } }, getKeys: function (d) { var c = []; for (var b in d) { c.push(b) } return c }, handleAjaxErrorFuture: function () { var b = this; b.btnNext.css("display", "none"); b.displayError() }, displayError: function () { var b = this; a("#errorDiv").css("display", "block") }, hideError: function () { var b = this; a("#errorDiv").css("display", "none") } }) })(jQuery); (function (a) { a.fn.slidifier = function (b) { a.fn.slidifier.defaults = { duration: 1000, startState: "closed", triggerClosed: "", triggerOpen: "", onOpen: function () { }, onClose: function () { } }; var c = a.extend({}, a.fn.slidifier.defaults, b); return this.each(function () { var e = a(this).next(); var f = parseInt(e.css("bottom")); if (c.startState == "open") { a(this).css("bottom", e.height() + f); e.css("display", "block") } else { a(this).css("bottom", f); e.css("display", "none") } a(this).click(function (m) { var l = parseFloat(a(this).css("bottom")); var j = a(this); var k = c.duration; if (e.is(":visible")) { var n = e.height(); var h = parseFloat(l) - parseFloat(n); a(this).stop().animate({ bottom: h }, { duration: k, complete: function () { j.removeClass(c.triggerOpen).addClass(c.triggerClosed) } }); e.stop().animate({ height: 0 }, { duration: k, complete: function () { e.css("display", "none"); e.css("height", n); c.onClose() } }) } else { e.css("display", "block"); var n = e.height(); var h = parseFloat(l) + parseFloat(n); var g = {}; g.bottom = h; a(this).stop().animate(g, { duration: k, complete: function () { j.removeClass(c.triggerClosed).addClass(c.triggerOpen) } }); e.css("height", "0"); e.stop().animate({ height: n }, { duration: k, complete: function () { c.onOpen() } }) } m.preventDefault() }) }); var d; if (!option || typeof option === "object") { d = a.extend({}, a.fn.slidifier.defaults, option); return methods.init.apply(this, arguments) } } })(jQuery); (function (a) { a.widget("ui.listifier", { options: { json: "", inputFormatter: function () { }, outputFormatter: function () { }, actionMsg: "", target: "", form: "", formSubmitBtn: "", selectAll: "", selectNone: "" }, _create: function () { var b = this, d = b.options, c = b.element; this.parser = d.parser; this.inputFormatter = d.inputFormatter; this.outputFormatter = d.outputFormatter; this.actionMsg = d.actionMsg; this.target = d.target; this.form = d.form; this.formSubmitBtn = d.formSubmitBtn; this.selectAll = d.selectAll; this.selectNone = d.selectNone; this.myDictionary = {}; this.keyInfo = {}; if (d.json != "") { b._addToDictionary(d.json) } a(this.selectAll).unbind("click").bind("click", function () { b.element.find(".hdr").addClass("hdrSelected"); b.element.find(".item").addClass("itemSelected") }); a(this.selectNone).unbind("click").bind("click", function () { b.element.find(".hdr").removeClass("hdrSelected"); b.element.find(".item").removeClass("itemSelected") }) }, _addToDictionary: function (e) { var f = jQuery.parseJSON(e); var b = this; for (var d = 0; d < f.length; d++) { var g = f[d]; var c = g.groupid; if (!b.myDictionary[c]) { b.myDictionary[c] = new Array(); b.keyInfo[c] = g.groupname } b.myDictionary[c].push(g) } }, _initGroupSelection: function () { var b = a(this.element); b.find(".groupOfItems .hdr").unbind("click").click(function () { var c = a(this).closest(".groupOfItems").find(".item"); if (!a(this).hasClass("hdrSelected")) { a(this).addClass("hdrSelected"); c.each(function () { if (!a(this).hasClass("itemSelected")) { a(this).addClass("itemSelected") } }) } else { a(this).removeClass("hdrSelected"); c.each(function () { if (a(this).hasClass("itemSelected")) { a(this).removeClass("itemSelected") } }) } }); b.find(".groupOfItems .item").unbind("click").click(function () { var d = a(this).closest(".groupOfItems"); var e = d.find(".hdr"); var c = d.find(".item"); a(this).toggleClass("itemSelected"); if (d.find(".itemSelected").size() == c.size()) { if (!e.hasClass("hdrSelected")) { e.addClass("hdrSelected") } } else { if (e.hasClass("hdrSelected")) { e.removeClass("hdrSelected") } } }) }, _sortGroupName: function (d, c) { var f = a(d).find(".firstName").text().toUpperCase() + " " + a(d).find(".lastName").text().toUpperCase(); var e = a(c).find(".firstName").text().toUpperCase() + " " + a(c).find(".lastName").text().toUpperCase(); return (f < e) ? -1 : (f > e) ? 1 : 0 }, _initDeleteAction: function (c, e, d) { var b = this; c.find("a").unbind("click").click(function (l) { var k = a(this).parent(); k.remove(); k.removeClass("remainder"); k.children("ul").removeClass("fltLeft"); var g = k.children("a"); g.remove(); var h = k.attr("title"); k.attr("title", ""); var j = e.find("div[id=" + h + "]").next(); j.append(k); var f = j.children().get(); f.sort(b._sortGroupName); j.children().remove(); for (i = 0; i < f.length; i++) { j.append(f[i]) } b._initGroupSelection(e); l.stopPropagation(); l.preventDefault(); b._setActionMsg(d) }) }, _setActionMsg: function (c) { var b = this; if (a(c).children(":not(.actionMsg)").size() == 0) { a(c).append(b.actionMsg) } else { if (a(c + " .actionMsg").size() > 0) { a(c + " .actionMsg").remove() } } }, _makeItAllWork: function () { var b = this; var d = a(this.element); var c = b.target; b._initGroupSelection(); b._setActionMsg(c); a(".addBtn").unbind("click").click(function (g) { d.find(".itemSelected").each(function () { var k = a(this); var h = ' Delete'; var e = a(this).closest(".groupOfItems").find(".hdr"); var j = e.attr("id"); a(this).remove(); k.removeClass("itemSelected"); k.addClass("remainder"); k.attr("title", j); k.children("ul").addClass("fltLeft"); k.append(h); a(c).append(k); if (e.hasClass("hdrSelected")) { e.removeClass("hdrSelected") } b._setActionMsg(c) }); var f = a(c).children().get(); f.sort(b._sortGroupName); a(c).children().remove(); for (i = 0; i < f.length; i++) { a(c).append(f[i]); b._initDeleteAction(a(f[i]), d, c) } g.preventDefault() }); a(b.formSubmitBtn).unbind("click").click(function () { var e = new Array(); a(b.target).children().each(function () { var g = a(this).find(".personID").text(); e.push(g) }); var f = b._getOutputData(e); b.outputFormatter(f); a(b.form).submit() }) }, _getOutputData: function (e) { var f = new Array(); for (key in this.myDictionary) { var d = this.myDictionary[key]; for (var c = 0; c < d.length; c++) { var g = d[c]; for (var b = e.length - 1; b >= 0; b--) { if (e[b] == g.id) { f.push(g); e.splice(b, 1) } } if (e.length == 0) { break } } } return f }, append: function (b) { this._addToDictionary(b) }, process: function () { this.inputFormatter(this.myDictionary, this.keyInfo); this._makeItAllWork() }, destroy: function () { a.Widget.prototype.destroy.apply(this, arguments) }, _setOption: function (c, d) { a.Widget.prototype._setOption.apply(this, arguments); var b = this.element } }) })(jQuery);