(function (document) {
var IsCms = true;
function RewriteSecure(url, domain) {
var reWrite = (!IsCms && window.location.protocol == 'http:' && (domain.indexOf('chambermaster.com') !== -1 || domain.indexOf('memberzone.com') !== -1 || domain.indexOf('growthzone.com') !== -1));
return reWrite ? url.replace('http://', 'http://') : url;
}
/** @const */
var WIDGET_CLASS_PREFIX = 'mn-widget-';
/** @const */
var ACTIVE_WIDGET_CLASS = WIDGET_CLASS_PREFIX + 'active';
/** @enum {number} */
var WidgetType = {
UNDEFINED: 0,
BUSINESS_NEW: 1,
BUSINESS_FEATURED: 2,
EVENTS_UPCOMING: 3,
EVENTS_FEATURED: 4,
NEWS_CURRENT: 5
};
function formatDate(date, format) {
/**
* @param {*} str
* @param {number=} len
*/
function pad(str, len) {
str = String(str);
for (len = len || 2; str.length < len;)
str = '0' + str;
return str;
};
function ordinal(day) {
return (1 == day || 21 == day || 31 == day) ? "st" :
(2 == day || 22 == day) ? "nd" :
(3 == day || 23 == day) ? "rd" :
"th";
};
var daysAbbr = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
daysFull = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
monthsAbbr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
monthsFull = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
designatorAbbr = ['A', 'P'],
designatorFull = ['AM', 'PM'],
tokens = /d{1,4}|M{1,4}|y{1,5}|o|"[^"]*"|'[^']*'|[hHmst]{1,2}/g,
day = date.getDate(),
weekDay = date.getDay(),
month = date.getMonth(),
year = date.getFullYear(),
hours = date.getHours(),
minutes = date.getMinutes(),
seconds = date.getSeconds(),
pattern = {
d: day,
dd: pad(day),
ddd: daysAbbr[weekDay],
dddd: daysFull[weekDay],
M: month + 1,
MM: pad(month + 1),
MMM: monthsAbbr[month],
MMMM: monthsFull[month],
y: year,
yy: pad(year % 100),
yyy: pad(year % 1E3, 3),
yyyy: pad(year % 1E4, 4),
yyyyy: pad(year % 1E5, 5),
o: ordinal(day),
h: ((hours + 12) % 12) || 12,
hh: pad(((hours + 12) % 12) || 12),
H: hours,
HH: pad(hours),
m: minutes,
mm: pad(minutes),
s: seconds,
ss: pad(seconds),
t: designatorAbbr[hours < 12 ? 0 : 1],
tt: designatorFull[hours < 12 ? 0 : 1]
};
return format.replace(tokens, function (segment) {
return segment in pattern ? pattern[segment] : segment.slice(1, segment.length - 1);
});
};
var NULL = null,
core_toString = {}.toString,
isArray = Array.isArray || function (obj) { return core_toString.call(obj) === '[object Array]'; },
timestamp = +new Date,
xhr = createXHR(),
supportsAjax = !!xhr && window.JSON,
supportsCrossDomain = false; // supportsAjax && 'withCredentials' in xhr;
xhr = undefined;
/** @constructor */
function WidgetManager() {
this._version = 3;
this._marquee = true;
this._popUp = true;
this._showEndDate = false;
this._showLinks = true;
this._showLocation = false;
this._dateFormat = 'MMM d';
this._dateTimeFormat = null;
this._onCreatingHandler = WidgetManager_Default_Creating;
this._onCreatedHandler = WidgetManager_Default_Created;
};
extend(WidgetManager.prototype, {
getData: WidgetManager_GetData,
getPath: WidgetManager_GetPath,
getDomain: WidgetManager_GetDomain,
setDomain: WidgetManager_SetDomain,
getAccount: WidgetManager_GetAccount,
setAccount: WidgetManager_SetAccount,
getType: WidgetManager_GetType,
setType: WidgetManager_SetType,
getCategory: WidgetManager_GetCategory,
setCategory: WidgetManager_SetCategory,
getLocation: WidgetManager_GetLocation,
setLocation: WidgetManager_SetLocation,
getLimit: WidgetManager_GetLimit,
setLimit: WidgetManager_SetLimit,
getDaysForward: WidgetManager_GetDaysForward,
setDaysForward: WidgetManager_SetDaysForward,
getDaysBack: WidgetManager_GetDaysBack,
setDaysBack: WidgetManager_SetDaysBack,
getTargetTemplate: WidgetManager_GetTargetTemplate,
setTargetTemplate: WidgetManager_SetTargetTemplate,
getVersion: WidgetManager_GetVersion,
setVersion: WidgetManager_SetVersion,
getMarquee: WidgetManager_GetMarquee,
setMarquee: WidgetManager_SetMarquee,
getScrollFreq: WidgetManager_GetScrollFreq,
setScrollFreq: WidgetManager_SetScrollFreq,
getPopUp: WidgetManager_GetPopUp,
setPopUp: WidgetManager_SetPopUp,
getShowEndDate: WidgetManager_GetShowEndDate,
setShowEndDate: WidgetManager_SetShowEndDate,
getShowLinks: WidgetManager_GetShowLinks,
setShowLinks: WidgetManager_SetShowLinks,
getShowLocation: WidgetManager_GetShowLocation,
setShowLocation: WidgetManager_SetShowLocation,
getTeaserLength: WidgetManager_GetTeaserLength,
setTeaserLength: WidgetManager_SetTeaserLength,
getDateFormat: WidgetManager_GetDateFormat,
setDateFormat: WidgetManager_SetDateFormat,
getDateTimeFormat: WidgetManager_GetDateTimeFormat,
setDateTimeFormat: WidgetManager_SetDateTimeFormat,
getSanitize: WidgetManager_GetSanitize,
setSanitize: WidgetManager_SetSanitize,
getStyleTemplate: WidgetManager_GetStyleTemplate,
setStyleTemplate: WidgetManager_SetStyleTemplate,
getEmptyMessage: WidgetManager_GetEmptyMessage,
setEmptyMessage: WidgetManager_SetEmptyMessage,
getOnLoading: WidgetManager_GetOnLoading,
setOnLoading: WidgetManager_SetOnLoading,
handleOnLoading: WidgetManager_HandleOnLoading,
'defaultCreating': WidgetManager_Default_Creating,
getOnCreating: WidgetManager_GetOnCreating,
setOnCreating: WidgetManager_SetOnCreating,
handleOnCreating: WidgetManager_HandleOnCreating,
'defaultCreated': WidgetManager_Default_Created,
getOnCreated: WidgetManager_GetOnCreated,
setOnCreated: WidgetManager_SetOnCreated,
handleOnCreated: WidgetManager_HandleOnCreated,
getURL: WidgetManager_GetURL,
getSecure: WidgetManager_GetSecure,
setSecure: WidgetManager_SetSecure,
_renderJsonDate: function (value, format) {
var match = value.match(/^(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)/),
date;
if (match) {
date = new Date(+match[1], match[2] - 1, +match[3], +match[4], +match[5], +match[6], 0);
} else {
// the date comes from the database with the offset based on UTC -06:00 (Central US/CA time) so we need to adjust it for local time
date = new Date(((new Date()).getTimezoneOffset() * 60000) + -21600000 + parseInt(value.slice(6, value.length - 2), 10));
}
return formatDate(date, format || this.getDateFormat());
},
create: WidgetManager_Create
});
/**
* @param {!Element} container
* @param {Array.>} data
*/
function WidgetManager_Default_Creating(container, data) {
var styleTemplate = this.getStyleTemplate();
if (styleTemplate) {
var containerId = container.getAttribute('id'),
headElement = document.getElementsByTagName('head')[0],
styleElement,
tokens = /@\w+/g,
patterns = {
id: containerId
},
css = styleTemplate.replace(tokens, function (segment) {
return patterns[segment.slice(1)] || segment;
});
if (document.createStyleSheet) {
styleElement = document.createStyleSheet();
styleElement.cssText = css;
} else {
styleElement = createElement('style', { id: containerId + '-style' }, NULL);
appendTextNode(styleElement, css);
if (headElement)
headElement.appendChild(styleElement);
}
}
if (data.length < 1) {
var emptyMessage = this.getEmptyMessage();
if (emptyMessage) {
var messageElement = createElement('div', NULL, 'mn-message-empty');
appendTextNode(messageElement, emptyMessage);
container.appendChild(messageElement);
}
addClass(container, 'mn-widget-empty');
} else {
var self = this,
sanitize = this.getSanitize(),
tmpElement;
tmpElement = createElement('div', { 'type': this._type }, 'mn-scroll-container');
container.appendChild(tmpElement);
container = tmpElement;
tmpElement = createElement('div', NULL, 'mn-scroll-slider');
container.appendChild(tmpElement);
container = tmpElement;
for (var i = 0; i < data.length; i++) {
var widget = data[i],
element = createElement('div', NULL, 'mn-scroll-item'),
text;
if (text = widget['StartDate'] || widget['Date']) {
var format = (!widget['AllDay'] && self.getDateTimeFormat()) || self.getDateFormat(),
startDate = self._renderJsonDate(text, format),
shownDate = startDate,
endDate;
if (format.indexOf('yyyy') != -1) addClass(element, 'mn-is-long-date');
if (self.getShowEndDate() && (text = widget['EndDate']) && startDate != (endDate = self._renderJsonDate(text, format))) {
shownDate += ' - ' + endDate;
addClass(element, 'mn-has-enddate');
}
if (sanitize['date']) {
tmpElement = createSpanElement(shownDate, 'mn-scroll-date');
} else {
tmpElement = createElement('span', NULL, 'mn-scroll-date');
tmpElement.innerHTML = shownDate;
}
element.appendChild(tmpElement);
}
tmpElement = self.getShowLinks() ?
createElement('a', { href: RewriteSecure(widget['URL'], self.getDomain().toLowerCase()), target: self.getPopUp() ? '_blank' : '_self' }, 'mn-scroll-name mn-scroll-link') :
createElement('span', NULL, 'mn-scroll-name');
appendTextNode(tmpElement, widget['Name'], sanitize['name'] ? 25 : null);
element.appendChild(tmpElement);
if (self.getShowLocation() && (text = widget['Location'])) {
tmpElement = createElement('div', NULL, 'mn-scroll-location');
if (sanitize['location']) {
appendTextNode(tmpElement, text, 75);
} else {
tmpElement.innerHTML = text;
}
element.appendChild(tmpElement);
}
if (text = widget['Teaser']) {
tmpElement = createElement('div', NULL, 'mn-scroll-teaser');
if (sanitize['teaser']) {
appendTextNode(tmpElement, text);
} else {
tmpElement.innerHTML = text;
}
element.appendChild(tmpElement);
}
container.appendChild(element);
}
}
};
/**
* @param {!Element} container
* @param {Object.} settings
*/
function WidgetManager_Default_Created(container, settings) {
var self = this,
marquee = self.getMarquee();
if (marquee && !hasClass(container, 'mn-widget-empty')) {
var timer,
sliderContainer = container.childNodes[0],
slider = sliderContainer.childNodes[0],
itemCount = slider.childNodes.length,
first = slider.childNodes[0],
firstCopy,
scrollFreq = self.getScrollFreq() || settings['DefaultScrollFreq'] || 35;
if (marquee == 'auto' && slider.clientHeight <= sliderContainer.clientHeight) {
addClass(container, 'mn-scroll-disabled');
} else {
for (var i = 0, tmpSlider; i < itemCount; i++) {
tmpSlider = slider.childNodes[i].cloneNode(true);
slider.appendChild(tmpSlider);
}
firstCopy = slider.childNodes[itemCount];
addEventListener(container, 'mouseenter', function () {
clearInterval(timer);
});
var start = function () {
timer = setInterval(function () {
var top = slider.offsetTop - 1,
diff = first.offsetTop - firstCopy.offsetTop;
if (top <= diff)
top -= diff;
slider.style.top = top + 'px';
}, scrollFreq);
};
addEventListener(container, 'mouseleave', start);
start();
}
}
};
function WidgetManager_GetData() {
switch (this._type) {
case WidgetType.BUSINESS_NEW:
case WidgetType.BUSINESS_FEATURED:
return { 'version': this._version, 'limit': this._limit, 'locationid': this._location, 'daysBack': this._daysBack };
case WidgetType.EVENTS_UPCOMING:
case WidgetType.EVENTS_FEATURED:
return { 'version': this._version, 'limit': this._limit, 'catgid': this._category, 'locationid': this._location, 'teaserLength': this._teaserLength, 'daysForward': this._daysForward, 'targetTemplate': this._targetTemplate };
case WidgetType.NEWS_CURRENT:
return { 'version': this._version, 'limit': this._limit, 'catgid': this._category, 'teaserLength': this._teaserLength };
}
};
function WidgetManager_GetPath() {
switch (this._type) {
case WidgetType.BUSINESS_NEW:
return '/business_new';
case WidgetType.BUSINESS_FEATURED:
return '/business_featured';
case WidgetType.EVENTS_UPCOMING:
return '/events_upcoming';
case WidgetType.EVENTS_FEATURED:
return '/events_featured';
case WidgetType.NEWS_CURRENT:
return '/news_current';
}
};
function WidgetManager_GetDomain() {
return this._domain || getScriptTagData().domain || window.location.host;
};
function WidgetManager_SetDomain(domain) {
this._domain = domain;
};
function WidgetManager_GetAccount() {
return this._account;
};
function WidgetManager_SetAccount(account) {
this._account = account;
};
function WidgetManager_GetType() {
return this._type;
};
function WidgetManager_SetType(type) {
var widgetType;
switch (type) {
case 'business_new':
widgetType = WidgetType.BUSINESS_NEW;
break;
case 'business_featured':
widgetType = WidgetType.BUSINESS_FEATURED;
break;
case 'events_upcoming':
widgetType = WidgetType.EVENTS_UPCOMING;
break;
case 'events_featured':
widgetType = WidgetType.EVENTS_FEATURED;
break;
case 'news_current':
widgetType = WidgetType.NEWS_CURRENT;
break;
default:
widgetType = WidgetType.UNDEFINED;
break;
}
this._type = widgetType;
};
function WidgetManager_GetCategory() {
return this._category;
};
function WidgetManager_SetCategory(category) {
this._category = category;
};
function WidgetManager_GetLocation() {
return this._location;
};
function WidgetManager_SetLocation(location) {
this._location = location;
};
function WidgetManager_GetLimit() {
return this._limit;
};
function WidgetManager_SetLimit(limit) {
this._limit = limit;
};
function WidgetManager_GetDaysForward() {
return this._daysForward;
};
function WidgetManager_SetDaysForward(daysForward) {
this._daysForward = daysForward;
};
function WidgetManager_GetDaysBack() {
return this._daysBack;
};
function WidgetManager_SetDaysBack(daysBack) {
this._daysBack = daysBack;
};
function WidgetManager_GetTargetTemplate() {
return this._targetTemplate;
};
function WidgetManager_SetTargetTemplate(targetTemplate) {
this._targetTemplate = targetTemplate;
};
function WidgetManager_GetVersion() {
return this._version;
};
function WidgetManager_SetVersion(version) {
this._version = version;
};
function WidgetManager_GetMarquee() {
return this._marquee;
};
function WidgetManager_SetMarquee(marquee) {
this._marquee = marquee;
};
function WidgetManager_GetScrollFreq() {
return this._scrollFreq;
};
function WidgetManager_SetScrollFreq(scrollFreq) {
this._scrollFreq = scrollFreq;
};
function WidgetManager_GetPopUp() {
return this._popUp;
};
function WidgetManager_SetPopUp(popUp) {
this._popUp = popUp;
};
function WidgetManager_GetShowEndDate() {
return this._showEndDate;
};
function WidgetManager_SetShowEndDate(showEndDate) {
this._showEndDate = showEndDate;
};
function WidgetManager_GetShowLinks() {
return this._showLinks;
};
function WidgetManager_SetShowLinks(showLinks) {
this._showLinks = showLinks;
};
function WidgetManager_GetShowLocation() {
return this._showLocation;
};
function WidgetManager_SetShowLocation(showLocation) {
this._showLocation = showLocation;
};
function WidgetManager_GetTeaserLength() {
return this._teaserLength;
};
function WidgetManager_SetTeaserLength(teaserLength) {
this._teaserLength = teaserLength;
};
function WidgetManager_GetDateFormat() {
return this._dateFormat;
};
function WidgetManager_SetDateFormat(dateFormat) {
this._dateFormat = dateFormat;
};
function WidgetManager_GetDateTimeFormat() {
return this._dateTimeFormat;
};
function WidgetManager_SetDateTimeFormat(dateFormat) {
this._dateTimeFormat = dateFormat;
};
function WidgetManager_GetSanitize() {
return extend({ 'date': true, 'teaser': false, 'location': false }, this._sanitize);
};
function WidgetManager_SetSanitize(sanitize) {
this._sanitize = sanitize;
};
function WidgetManager_GetStyleTemplate() {
return this._styleTemplate;
};
function WidgetManager_SetStyleTemplate(styleTemplate) {
this._styleTemplate = styleTemplate;
};
function WidgetManager_GetEmptyMessage() {
return this._emptyMessage;
};
function WidgetManager_SetEmptyMessage(emptyMessage) {
this._emptyMessage = emptyMessage;
};
function WidgetManager_GetOnLoading() {
return this._onLoadingHandler;
};
function WidgetManager_SetOnLoading(handler) {
this._onLoadingHandler = handler;
};
function WidgetManager_HandleOnLoading(element) {
if (this._onLoadingHandler)
this._onLoadingHandler(element);
};
function WidgetManager_GetOnCreating() {
return this._onCreatingHandler;
};
function WidgetManager_SetOnCreating(handler) {
this._onCreatingHandler = handler;
};
function WidgetManager_HandleOnCreating(element, data) {
if (this._onCreatingHandler)
this._onCreatingHandler(element, data);
};
function WidgetManager_GetOnCreated() {
return this._onCreatedHandler;
};
function WidgetManager_SetOnCreated(handler) {
this._onCreatedHandler = handler;
};
function WidgetManager_HandleOnCreated(element, settings) {
if (this._onCreatedHandler)
this._onCreatedHandler(element, settings);
};
function WidgetManager_GetURL() {
return this.getSecure() ?
'http://' + this.getDomain() + (!IsCms ? '/public' : '') + this.getPath() :
'http://' + this.getDomain() + this.getPath();
};
function WidgetManager_GetSecure() {
if (this._secure !== undefined)
return this._secure;
return (getScriptTagData().protocol || window.location.protocol) == 'http:' ?
true :
undefined;
};
function WidgetManager_SetSecure(secure) {
this._secure = secure;
};
function WidgetManager_Create(elementId) {
var container = document.getElementById(elementId),
_this = extend({}, this); // Make a copy
if (container) {
_this.handleOnLoading(container);
var url = _this.getURL(),
isJsonp = !supportsAjax || (getOrigin(url) != window.location.origin && !supportsCrossDomain),
data = extend({
't': timestamp++,
'rendermode': 'json'
}, _this.getData()),
vals = [];
addClass(container, 'mn-widget-loading');
if (isJsonp) {
data['jsonpcallback'] = 'MNI_Widgets_jpc' + data['t'];
delete data['t'];
window[data['jsonpcallback']] = function (json) {
handleJsonResponse.call(_this, container, json);
try {
delete window[data['jsonpcallback']];
} catch (e) {
window[data['jsonpcallback']] = undefined;
}
};
}
url = urlWithParams(url, data);
if (isJsonp) {
var firstScript = document.getElementsByTagName('script')[0],
script = createElement('script', NULL, NULL);
script.async = true;
script.onload = script.onreadystatechange = scriptOnLoad;
script.src = url;
firstScript.parentNode.insertBefore(script, firstScript);
}
else {
var xhr = createXHR();
xhr.open('GET', url, true);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('Accept', 'application/json, text/javascript, */*');
xhr.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200)
handleJsonResponse.call(_this, container, JSON.parse(this.responseText));
};
xhr.send();
}
}
};
function scriptOnLoad() {
if (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete') {
this.onload = this.onreadystatechange = NULL;
this.parentNode.removeChild(this);
}
};
function getOrigin(url) {
var match = url.match(/^http?:\/\/[^/]+/i);
return match && match[0];
};
function getScriptTagData() {
var scripts = document.getElementsByTagName('script');
for (var i = 0; i < scripts.length; i++) {
var script = scripts[i],
match = script.src.match(/^((http?:)?\/\/([^/]+))\/(public\/)?content\/script\/widgets\.(min\.)?js/i);
if (match) {
return {
protocol: match[2] || window.location.protocol,
origin: match[1] || window.location.origin,
domain: match[3]
};
}
}
return {};
};
function createXHR() {
if (window.XMLHttpRequest)
try { return new XMLHttpRequest(); } catch (e) { }
if (window.ActiveXObject) {
try { return new ActiveXObject("MSXML2.XMLHTTP"); } catch (e) { }
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { }
}
};
function handleJsonResponse(container, data) {
var self = this,
version = self.getVersion(),
settings;
if ('Data' in data) {
settings = data['Settings'];
data = data['Data'];
} else {
settings = {};
}
emptyElement(container);
self.handleOnCreating(container, data);
addClass(container, 'mn-widget-loaded');
removeClass(container, 'mn-widget-loading');
self.handleOnCreated(container, settings);
};
/**
* @param {string} url
* @param {Object} data
* @return {string}
*/
function urlWithParams(url, data) {
/**
* @param {Array.} array
* @param {string} name
* @param {Object} value
*/
function addEntry(array, name, value) {
array.push(window['encodeURIComponent'](name) + '=' + window['encodeURIComponent'](value));
};
var parts = [];
url = url || '';
for (name in data) {
if ((value = data[name]) != undefined) {
if (typeof value === 'object' && 'length' in value) {
for (var i = 0; i < value.length; i++)
addEntry(parts, name, value[i]);
}
else
addEntry(parts, name, value);
}
}
if (parts.length)
url += (url.indexOf('?') >= 0 ? '&' : '?') + parts.join('&');
return url;
};
function hasClass(element, className) {
return (' ' + element.className + ' ').replace(/\s+/g, ' ').indexOf(' ' + className + ' ') >= 0;
};
function addClass(element, className) {
if (!element.className)
element.className = className;
else if (!hasClass(element, className))
element.className += ' ' + className;
};
function removeClass(element, className) {
element.className = (' ' + element.className + ' ').replace(/\s+/g, ' ').replace(' ' + className + ' ', ' ').replace(/^\s+|\s+$/g, '');
};
function containsElement(a, b) {
while (b = b.parentNode) {
if (b === a)
return true;
}
return false;
};
function addEventListener(element, name, handler) {
function createBubbleFix(handler) {
return function (e) {
var target = this,
related = e.relatedTarget;
if (!related || (related !== target && !containsElement(target, related)))
handler();
};
};
if (name == 'mouseenter') {
handler = createBubbleFix(handler);
name = 'mouseover';
} else if (name == 'mouseleave') {
handler = createBubbleFix(handler);
name = 'mouseout';
}
if (element['addEventListener'])
element.addEventListener(name, handler);
else
element.attachEvent('on' + name, handler);
};
/**
* @param {string} type
* @param {Object=} attributes
* @param {string=} className
*/
function createElement(type, attributes, className) {
var element = document.createElement(type);
for (var name in attributes)
element.setAttribute(name, attributes[name]);
if (className)
addClass(element, className);
return element;
};
/**
* @param {string} text
* @param {string=} className
*/
function createSpanElement(text, className) {
var element = createElement('span', NULL, className);
appendTextNode(element, text);
return element;
};
/**
* @param {!Element} element
* @param {?Object} text
*/
function strip(html) {
var tmp = document.createElement("DIV");
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || "";
}
function appendTextNode(element, text, limit) {
if (text == null)
text = '';
if (limit != null) {
text = strip(text);
text = (text.length < limit) ? text : (text.substring(0, limit) + '...');
}
element.appendChild(document.createTextNode(String(text)));
};
/**
* @param {!Element} element
*/
function emptyElement(element) {
while (element.lastChild)
element.removeChild(element.lastChild);
};
/*
* Shallow copy
*/
function extend(target, object) {
var name,
value;
for (name in object) {
value = object[name];
if (value !== undefined)
target[name] = value;
}
return target;
};
var queueVarName = '_mniwq',
old = window[queueVarName],
instance = {
'push': push
},
mainManager = new WidgetManager(),
managers = {},
methods = {
'domain': WidgetManager_SetDomain,
'account': WidgetManager_SetAccount,
'type': WidgetManager_SetType,
'category': WidgetManager_SetCategory,
'location': WidgetManager_SetLocation,
'limit': WidgetManager_SetLimit,
'daysForward': WidgetManager_SetDaysForward,
'daysBack': WidgetManager_SetDaysBack,
'targetTemplate': WidgetManager_SetTargetTemplate,
'version': WidgetManager_SetVersion,
'marquee': WidgetManager_SetMarquee,
'scrollFreq': WidgetManager_SetScrollFreq,
'popUp': WidgetManager_SetPopUp,
'showEndDate': WidgetManager_SetShowEndDate,
'showLinks': WidgetManager_SetShowLinks,
'showLocation': WidgetManager_SetShowLocation,
'teaserLength': WidgetManager_SetTeaserLength,
'dateFormat': WidgetManager_SetDateFormat,
'dateTimeFormat': WidgetManager_SetDateTimeFormat,
'sanitize': WidgetManager_SetSanitize,
'styleTemplate': WidgetManager_SetStyleTemplate,
'emptyMessage': WidgetManager_SetEmptyMessage,
'onLoading': WidgetManager_SetOnLoading,
'onCreating': WidgetManager_SetOnCreating,
'onCreated': WidgetManager_SetOnCreated,
'secure': WidgetManager_SetSecure,
'create': WidgetManager_Create
};
function push() {
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i],
manager = mainManager,
func = arg[0], // First argument is function name
params = arg.slice(1), // Remaining is parameters
index = func.indexOf('.'),
namespace;
if (index >= 0) {
namespace = func.slice(0, index);
func = func.slice(index + 1);
manager = managers[namespace];
if (!manager)
managers[namespace] = manager = new WidgetManager();
}
func = methods[func];
if (func)
func.apply(manager, params);
}
};
if (old == null || isArray(old)) {
if (isArray(old))
push.apply(instance, old);
window[queueVarName] = instance;
}
})(document);
网上博彩平台
皇冠体育博彩
荆楚理工学院
单机游戏大全
Sports-betting-platform-customerservice@cesametal.net
沙巴体育博彩
极客海淘
bet365-Sports-contact@ferrosound.net
三峡新闻网新闻中心
Crown-betting-contact@seezl.com
bet365-Sports-service@media2v-api.net
起点操作系统门户
OFweek机器人网
网络赌博平台
澳门威尼斯
Venetian-platform-admin@car-rentalturkey.com
羽毛球比赛规则
3D之家论坛
Sport-Venetian-contactus@tassahil.net
赛客虚拟家庭
深圳奥数网
华夏游乐有限公司
君联资本
电动汽车时代网
17173QQ三国专区
重庆华美整形美容医院
郴州红盾网
玩家网PSP中国站
成都耳鼻喉医院
求魔官网
站点地图
掌商网
合团网
中央气象台台风网