if (typeof (wng_includesTracker) == 'undefined') { var wng_includesTracker = {}; } wng_includesTracker['/global/interface/container-e/core.js'] = 1; if (typeof (wng_pageInfo) == 'undefined') { var wng_pageInfo = {}; } if (!window.wng_backwardsCompatible) { var wng_AffiliateName = g_AffName = wng_pageInfo.affiliateName; var g_BaseURL = wng_pageInfo.baseUrl; var wng_page_containerId = g_ContID = wng_pageInfo.containerId; var wng_page_containerType = g_ContType = wng_pageInfo.containerType; var g_AdTag = targetadtag = wng_pageInfo.contentClassification; var wng_VideoHelpPage = wng_pageInfo.videoHelpPage; var wng_VideoMacHelpPage = wng_pageInfo.videoHelpPageMac; function OpenWin(props) { var url, name, properties = ''; props = props.split('|'); url = props[0]; var prefixTest = "(^http)|(^ftp)|(^/)"; if (!(url.match(prefixTest))) url = "http://" + url; if (props.length > 1) name = props[1]; if (props.length > 2) properties = props[2]; if (window.WNBrowser) { WNBrowser.openWindow(url, name, properties); } else { window.open(url, name, properties); } } function popProfile() { if (window.WNMemberCenterManager) { WNMemberCenterManager.populateBoxes(); return true; } return false; } var agt = '', ns6 = false, is_safari = false, is_ie = false; if (window.WNBrowser) { var agt = WNBrowser.userAgent; var ns6 = WNBrowser.browserName == 'Netscape' && WNBrowser.browserVersion >= 5; var is_safari = WNBrowser.checkUserAgent('safari'); var is_ie = agt.indexOf('msie') != -1 && agt.indexOf('opera') == -1; } var wng_backwardsCompatible = 1; function refreshAds() { WNAdManager.reloadAds(); } function checkad(adsize) { } } if (!wng_includesTracker['/global/interface/globals.js']) { var wng_includesDomain = wng_pageInfo.includesDomain || 'http://content.worldnow.com'; var wng_includesVersion = wng_pageInfo.includesVersion || '20070120'; document.writeln('<scr' + 'ipt type="text/javascript" src="' + wng_includesDomain + '/global/interface/globals.js?ver=' + wng_includesVersion + '"></scr' + 'ipt>'); } var WNG_OBJTYPE_TEXTCHANGER = 'WNTextChanger'; var WNG_OBJTYPE_COLUMN = 'WNColumn'; var WNG_OBJTYPE_ADSIZE = 'WNAdSize'; var WNG_OBJTYPE_EMBED = 'WNEmbed'; var WNG_WEATHER_CLASSNAME_TOGGLE = 'wnWxPrimary'; var WNG_WEATHER_CLASSNAME_FORECASTDAY = 'wnWxDay'; var WNG_WEATHERALERTS_CLASSNAME = 'wnWxAlert'; var WNG_WEATHERALERTS_CLASSNAME_ACTIVE = 'wnWxAlert-active'; var WNG_WEATHERALERTS_CLASSNAME_INACTIVE = 'wnWxAlert-inactive'; var PLATFORM = {}; function wnRenderDate(dateString, formatString, doFixTime, returnString) { formatString = formatString || '%MMM% %DD%, %YYYY% %h%:%mm% %AMPM% %tz%'; if (returnString == true) { return (new Date(dateString)).customFormat(formatString, doFixTime); } else { document.writeln((new Date(dateString)).customFormat(formatString, doFixTime)); } } function wnValidateSearchTerm(form, minChars) { var plural = ''; if (minChars > 1) { plural = 's'; } form.qu.value = form.qu.value.replace(/^\s+|\s+$/g, ''); if (form.qu.value.length < minChars) { alert('You must enter a search term with at least ' + minChars + ' character' + plural + '!'); return false; } return true; } if (typeof PLATFORM.EventMan == 'undefined') { PLATFORM['EventMan'] = { _event: function() { return { actions: [], addAction: function(_fn, order) { this.actions[this.actions.length] = _fn; }, triggerActions: function() { for (var i = 0; i < this.actions.length; i++) { try { this.actions[i](); } catch (e) { this.debug('PLATFORM.EventMan.triggerActions', e); } } }, debug: function(funcName, msg) { try { WNErrorHandle.addErrorMsg(e); WNErrorHandle.console(e); } catch (e) { } } }; }, events: {}, getEventName: function(eventName) { return new String(eventName).toLowerCase(); }, registerToEvent: function(_fn, eventName, order) { eventName = this.getEventName(eventName); if (typeof this.events[eventName] == 'undefined' || !this.events[eventName]) { this.events[eventName] = new this._event(); } this.events[eventName].addAction(_fn, order); }, triggerEvent: function(eventName) { eventName = this.getEventName(eventName); if (typeof this.events[eventName] == 'object') { this.events[eventName].triggerActions(); } }, debug: function(funcName, msg) { try { WNErrorHandle.addErrorMsg(e); WNErrorHandle.console(e); } catch (e) { } } }; try { PLATFORM.EventMan.registerToEvent(function() { var tickerDiv = document.getElementById('WNDS40'); if (typeof (tickerDiv) != 'undefined' && tickerDiv) { $wn("#WNDS40 ul.wnDSItemsList").liScroll({ travelocity: 0.04 }); tickerDiv.style.visibility = 'visible'; } if (typeof window.WNAdManager == 'object') { WNAdManager.loadEAPIAds(); } }, 'documentready'); $wn(document).ready(function() { PLATFORM.EventMan.triggerEvent('documentready'); }); } catch (e) { } } if (typeof (PLATFORM.ColumnMan) == 'undefined') { PLATFORM['ColumnMan'] = function() { var TIMER_INTERVAL = 5000; var AUTO_RESIZE_HEIGHT_CLASS = 'wnColsResetHeights'; var tallestHeight = 0; var timerHandle = null; var setTallestHeight = function(height) { tallestHeight = parseInt(height); }; var getTallestHeight = function() { return tallestHeight; }; var findTallest = function() { var windowHeight = stripPx($wn(window).height()); var headerHeight = stripPx($wn('#WNHeader').outerHeight()); var menuHeight = stripPx($wn('.wnColConfig #WNMenuCol1').outerHeight()); var vertDS = stripPx($wn('#WNDS35').outerHeight()); var footerHeight = stripPx($wn('#WNFooter').outerHeight()); var minConentHeight = windowHeight - headerHeight - menuHeight - vertDS - footerHeight; $wn('body').addClass(AUTO_RESIZE_HEIGHT_CLASS); var col1Height = stripPx($wn('.wnColConfig1 #WNMenuCol1').height()); var col23Height = stripPx($wn('#WNCol23').height()); var col4Height = stripPx($wn('#WNCol4').height()); var col5Height = stripPx($wn('#WNCol5').height()); $wn('body').removeClass(AUTO_RESIZE_HEIGHT_CLASS); var tallestHeight = minConentHeight; tallestHeight = (tallestHeight > col1Height) ? tallestHeight : col1Height; tallestHeight = (tallestHeight > col23Height) ? tallestHeight : col23Height; tallestHeight = (tallestHeight > col4Height) ? tallestHeight : col4Height; tallestHeight = (tallestHeight > col5Height) ? tallestHeight : col5Height; return tallestHeight; }; var stripPx = function(string) { var numString = parseInt(new String(string).replace('px', '')); return (!!numString) ? numString : 0; }; var debug = function(funcName, msg) { try { WNErrorHandle.addErrorMsg(e); WNErrorHandle.console(e); } catch (e) { } }; return { startTimer: function() { if (!timerHandle) { resizeColumns(); timerHandle = window.setInterval('PLATFORM.ColumnMan.resizeColumns()', 5000); } }, stopTimer: function() { try { window.clearInterval(timerHandle); } catch (e) { debug('PLATFORM.ColumnMan.stopTimer', e); } }, resizeColumns: function() { var currentTallest = getTallestHeight(); var maybeNewTallest = findTallest(); if (maybeNewTallest != currentTallest) { setTallestHeight(maybeNewTallest); var tallestHeight = getTallestHeight(); if ($.browser.msie && $.browser.version.substr(0, 1) < 7) { $wn('.wnColConfig1 #WNMenuCol1').css('height', tallestHeight); $wn('#WNCol23').css('height', tallestHeight); $wn('#WNCol4').css('height', tallestHeight); $wn('#WNCol5').css('height', tallestHeight); } else { $wn('.wnColConfig1 #WNMenuCol1').css('minHeight', tallestHeight); $wn('#WNCol23').css('minHeight', tallestHeight); $wn('#WNCol4').css('minHeight', tallestHeight); $wn('#WNCol5').css('minHeight', tallestHeight); } } } }; } (); try { PLATFORM.EventMan.registerToEvent(PLATFORM.ColumnMan.resizeColumns, 'documentready'); PLATFORM.EventMan.registerToEvent(PLATFORM.ColumnMan.resizeColumns, 'cb-newcontent'); PLATFORM.EventMan.registerToEvent(PLATFORM.ColumnMan.startTimer, 'inv-newcontent'); } catch (e) { } } if (typeof (WNLinksPlus) == 'undefined') { var WNLinksPlus = WNClass.createSingleton(function() { var _BRANDING_FEATURE_HEIGHT = 70; var classConstructor = function() { }; classConstructor.prototype = { writeIframe: function(iframe, url, id) { if (url) { var params = WNBrowser.getQueryParametersString(WNBrowser.queryParametersWorldNow, true); if (params) { url += (url.indexOf('?') == -1) ? '?' : '&'; url += params; } } document.writeln(iframe); if (url) { WNElement.reload(id, { url: url }); } } }; return classConstructor; }); } if (typeof (WNPoll) == 'undefined') { var WNPoll = WNClass.createSingleton(function() { var _COOKIE_PREFIX = 'Poll'; var _ID_PREFIX = 'WNPoll'; var _NAME_PREFIX = 'WNPoll'; var _CLASSNAME_VOTED = 'wnPollVoted'; var _ATTR_NAME_ACTION_UPDATED = 'actionUpdated'; function _getForm(name) { var forms = $wn("form[name=" + _NAME_PREFIX + name + "]"); if ($wn(forms).length == 1) { return $wn(forms)[0]; } return null; } var classConstructor = function() { }; classConstructor.prototype = { setState: function(id) { if (WNCookie.get(_COOKIE_PREFIX + id)) { var form = _getForm(id); if (form) { $wn(form).parent().addClass(_CLASSNAME_VOTED); } } }, submit: function(id) { this.updateFormAction(id); return this.validate(id); }, validate: function(id) { var form = _getForm(id); if (form) { var options = form.getElementsByTagName('INPUT'); for (var i = 0, l = options.length, option; i < l; i++) { option = options[i]; if (option.checked && option.getAttribute('type') == 'radio') { return true; } } } alert('Please select a poll option.'); form.focus(); return false; }, updateFormAction: function(id) { var form = _getForm(id); if (form && !form.getAttribute(_ATTR_NAME_ACTION_UPDATED)) { var actionList = form.action.split('#'); var action = actionList[0]; var sep = (action.indexOf('?') == -1) ? '?' : '&'; var params = WNBrowser.getQueryParametersString(WNBrowser.queryParametersWorldNow); if (params) { action += sep + params; } if (actionList.length > 1) { action += '#' + actionList[1]; } form.action = action; form.setAttribute(_ATTR_NAME_ACTION_UPDATED, 1); } } }; return classConstructor; }); } if (typeof (WNFormValidation) == 'undefined') { var WNFormValidation = WNClass.createSingleton(function() { var _VALIDATION_ATT_NAME = 'validation'; var _VALIDATION_TYPE_REQUIRED = 'wnRequired'; var _MSG_REQUIRED_FIELD = 'Field is required.'; var _VALIDATION_TYPE_EMAIL = 'wnEmail'; var _MSG_INVALID_EMAIL = 'Email Address is invalid'; var _VALIDATION_TYPE_ZIPCODE = 'wnZipCode'; var _MSG_INVALID_ZIPCODE = 'Zip Code is invalid'; var _VALIDATION_TYPE_DOB = 'wnDateOfBirth'; var _MSG_INVALID_DOB = 'Date of birth is invalid'; var _VALIDATION_TYPE_REQAGE = 'wnRequiredAge'; var _MSG_INVALID_REQAGE = 'Must be at least 13 to submit this form'; var _REQ_AGE = 13; var _CLASS_NAME_ERROR = 'wnFormError'; var _CLASS_NAME_ERROR_MSG = 'wnErrorMsg'; var _DATE_YEAR_MILLI = 31536000000; function _runValidation(type, element) { var errorMsg = ''; var value = wnTrim(element.value); switch (type) { case _VALIDATION_TYPE_REQUIRED: if (value == '') { errorMsg = _MSG_REQUIRED_FIELD; } break; case _VALIDATION_TYPE_EMAIL: var emailPattern = new RegExp('^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$'); if (value.match(emailPattern) == null) { errorMsg = _MSG_INVALID_EMAIL; } break; case _VALIDATION_TYPE_ZIPCODE: var zipCodePattern = new RegExp('^\d{5}(-?\d{4})?$'); if (value.match(zipCodePattern) == null) { errorMsg = _MSG_INVALID_ZIPCODE; } break; case _VALIDATION_TYPE_DOB: if (value != '') { var splitDate = value.split('/'); if (splitDate.length == 3) { var dateTest = new Date(); dateTest.setFullYear(1901, 0, 31); var month = splitDate[0]; var day = splitDate[1]; var year = splitDate[2]; dateTest.setFullYear(year); dateTest.setDate(day); dateTest.setMonth(month - 1); if (dateTest.getFullYear() == year && year != 0 && dateTest.getMonth() == (month - 1) && dateTest.getDate() == day) { break; } } errorMsg = _MSG_INVALID_DOB; } break; case _VALIDATION_TYPE_REQAGE: if (value != '') { var splitDate = value.split('/'); if (splitDate.length == 3) { var month = splitDate[0] - 1; var day = splitDate[1]; var year = splitDate[2]; var today = new Date(); var birthDate = new Date(year, month, day); var dateDiff = today - birthDate; var age = dateDiff / _DATE_YEAR_MILLI; if (age < _REQ_AGE) { errorMsg = _MSG_INVALID_REQAGE; } } } break; default: break; } return errorMsg; } function _highlightError(label, errorBox, errorMsg) { if (label && label != 'undefined') { $wn(label).addClass(_CLASS_NAME_ERROR); } if (errorBox && errorBox != 'undefined') { $wn(errorBox).html(errorMsg); } } function _resetHighlightedErrors(form) { $wn(form).find("[className=" + _CLASS_NAME_ERROR + "]").removeClass(_CLASS_NAME_ERROR); $wn(form).find("span[className=" + _CLASS_NAME_ERROR_MSG + "]").html(''); } var classConstructor = function() { }; classConstructor.prototype = { validateForm: function(form) { _resetHighlightedErrors(form); var errorCount = 0; $wn(form).find("[validation]").each(function() { var validationString = $wn(this).attr(_VALIDATION_ATT_NAME); var validationTypes = validationString.split(' '); var errorMsg = ''; var tempErrorMsg = ''; var label = null; var errorBox = null; for (j = 0; j < validationTypes.length; j++) { tempErrorMsg = _runValidation(validationTypes[j], this); errorMsg += (tempErrorMsg != '') ? ' ' + tempErrorMsg : ''; } if (errorMsg != '') { errorCount++; label = $wn(this).parent().find("label")[0]; errorBox = $wn(this).parent().find("span[className=" + _CLASS_NAME_ERROR_MSG + "]")[0]; _highlightError(label, errorBox, errorMsg); } }); return (errorCount > 0) ? false : true; } }; return classConstructor; }); } if (typeof (WNQuickForms) == 'undefined') { var WNQuickForms = WNClass.createSingleton(function() { var _ID_PREFIX = 'WNQuickForm'; var _USER_LOGGED_IN = 'wnDVQuickForm-loggedIn'; var _USER_LOGGED_OUT = 'wnDVQuickForm-loggedOut'; var _CLASS_ANONYMOUS_SUBMIT = 'wnDVQuickForm-anonymous'; var _USER_LOGGED_OUT = 'wnDVQuickForm-loggedOut'; var _CONFIRMATION_CLASS = 'wnQuickFormsConfirmation'; var _MULTIPLE_ENTRIES_CLASS = 'wnQuickFormsMultipleEntriesMet'; var _QUERYNAME_FORM_COMPLETED = 'formcompleted'; var _ELEMENT_TYPE_SUBMIT = 'submit'; var _FIELD_REGISTRATION_REQUIRED = 'requireregistration'; function _getFormParent(id) { var element = document.getElementById(id); return element; } function _getForm(parentId) { var element = _getFormParent(parentId); if (element) { form = element.getElementsByTagName('FORM'); if (form.length) { return form[0]; } } return null; } function _getFormNo(form) { var formNo = $wn(form).find('[name = "formno"]').attr('value'); if (formNo == 'undefined' || !formNo) { formNo = $wn(form).find('[name = "quicksignupno"]').attr('value'); } return formNo; } function _removeFormField(field) { $wn(field).parent().remove(); } function _disableForm(form) { $wn(form).find("input[type='submit']").disabled = true; $wn("body").css('cursor', 'wait'); } function _enableForm(form) { $wn(form).find("input[type='submit']").disabled = false; $wn("body").css('cursor', 'auto'); } function _checkMultipleEntries(formno, userEmailAddress) { var string = WNCookie.get('multipleentries'); if (string) { var regExpCheck = new RegExp('[^0-9]' + formno + '=' + userEmailAddress, 'ig'); if (regExpCheck.test(string)) { return true; } } return false; } function _checkFormCompleted(formno, userEmailAddress) { var string = WNCookie.get('completeditems'); userEmailAddress = (!userEmailAddress || userEmailAddress == 'undefined' || userEmailAddress == null) ? '' : userEmailAddress; if (string) { var regExpCheck = new RegExp('[^0-9]' + formno + '=' + userEmailAddress, 'ig'); if (regExpCheck.test(string)) { if (location.search.indexOf(_QUERYNAME_FORM_COMPLETED + '=' + formno) > 0) { return true; } } } return false; } function _dateOfBirthOnChange(parentId) { var parent = (typeof (parentId) != 'string') ? $wn(this).parent() : $wn("#" + parentId); var month = $wn(parent).find("select.wnQuickForms-birthmonth:first").attr("value"); var day = $wn(parent).find("select.wnQuickForms-birthday:first").attr("value"); var year = $wn(parent).find("select.wnQuickForms-birthyear:first").attr("value"); if (month == '' && day == '' && year == '') { $wn(parent).find("input.wnQuickForms-dateofbirth").attr("value", ""); } else { $wn(parent).find("input.wnQuickForms-dateofbirth").attr("value", month + '/' + day + '/' + year); } } function _dateOfBirthControls(formParentId) { var wnDate = new Date(); var endYear = wnDate.getFullYear(); var startYear = 1901; var defaultYear = wnDate.getFullYear() - 13; $wn("#" + formParentId + " select.wnQuickForms-birthmonth").html(_generateOptions(1, 12, 'MM')).bind("change", _dateOfBirthOnChange); $wn("#" + formParentId + " select.wnQuickForms-birthday").html(_generateOptions(1, 31, 'DD')).bind("change", _dateOfBirthOnChange); $wn("#" + formParentId + " select.wnQuickForms-birthyear").html(_generateOptions(startYear, endYear, 'YYYY')).bind("change", _dateOfBirthOnChange); } function _generateOptions(start, end, label, increment) { increment = (parseInt(increment) > 0) ? increment : 1; var returnOptions = document.createElement('DIV'); var optionBox = null; optionBox = document.createElement('OPTION'); optionBox.setAttribute('value', ''); optionBox.innerHTML = label; $wn(returnOptions).append(optionBox); var failSafeMaxCount = 99999; var failSafeCount = 0; for (i = start; i <= end; i = i + increment) { if (failSafeCount > failSafeMaxCount) { var errorMsg = 'Bad parameters in _generateOptions method.  start: ' + start + ' end: ' + end + ' _default: ' + _default + ' increment: ' + increment; console.log(errorMsg); return; } optionBox = document.createElement('OPTION'); optionBox.setAttribute('value', i); optionBox.innerHTML = (i < 10) ? '0' + i : i; $wn(returnOptions).append(optionBox); failSafeCount++; } return $wn(returnOptions).html(); } var classConstructor = function() { }; classConstructor.prototype = { initForm: function(formParentId) { var form = $wn("#" + formParentId + " form")[0]; var formNo = _getFormNo(form); $wn("#" + formParentId + " .wnEscaped").each(function() { $wn(this).html(unescape($wn(this).html())); $wn(this).removeClass('wnEscaped'); }); if ($wn("#" + formParentId + " input[name='DateOfBirth']").length > 0) { _dateOfBirthControls(formParentId); } var regRequired = $wn("#" + formParentId + " input[name=" + _FIELD_REGISTRATION_REQUIRED + "]").val(); try { regRequired = (regRequired.toLowerCase() == 'false') ? false : true; } catch (e) { regRequired = true; } if (!regRequired) { $wn("#" + formParentId).addClass(_CLASS_ANONYMOUS_SUBMIT); } if (_checkFormCompleted(formNo)) { $wn("#" + formParentId).addClass(_CONFIRMATION_CLASS); } if (WNMemberCenterManager.isRegistered && regRequired) { if (_checkMultipleEntries(formNo, WNMemberCenterManager.userEmailAddress)) { $wn("#" + formParentId).addClass(_MULTIPLE_ENTRIES_CLASS); } $wn("#" + formParentId).removeClass(_USER_LOGGED_OUT).addClass(_USER_LOGGED_IN); if (WNMemberCenterManager.userEmailAddress) { var loginEmailAddress = $wn("input#" + formParentId + "-LoginEmailAddress"); $wn(document.createElement('input')).attr({ type: "hidden", id: formParentId + "-LoginEmailAddressClone", name: $wn(loginEmailAddress).attr("name"), value: WNMemberCenterManager.userEmailAddress }).insertAfter($wn(loginEmailAddress)); $wn(loginEmailAddress).val(WNMemberCenterManager.userEmailAddress).attr("disabled", "disabled"); } if (WNMemberCenterManager.suppliedProfileElements.length > 0) { var suppliedProfileElements = WNMemberCenterManager.suppliedProfileElements; var stripFieldName = new RegExp(_ID_PREFIX + '[0-9]+Field\-', 'i'); var strippedFieldElement = ''; var stripCookieName = new RegExp('User\_', 'i'); var strippedProfileElement = ''; for (var i in suppliedProfileElements) { switch (suppliedProfileElements[i]) { case 'EmailAddress': case '': continue; break; default: break; } strippedProfileElement = suppliedProfileElements[i].replace(stripCookieName, ''); for (j = 0; j < form.elements.length; j++) { try { strippedFieldElement = form.elements[j].name.replace(stripFieldName, ''); if (strippedProfileElement == strippedFieldElement) { _removeFormField(form.elements[j]); } } catch (e) { } } } } } }, submit: function(form) { _disableForm(form); var isValid = WNFormValidation.validateForm(form); if (isValid) { var submittedFields = $wn(form).find("[name='submittedfields']"); var referrer = location.href; var sep = (referrer.indexOf('?') > 0) ? '&' : '?'; var formNo = _getFormNo(form); var formFunction = "form"; if ($wn(form).find("input[name='quicksignupname']").length > 0) { formFunction = "quicksignup"; } referrer += sep + 'formcompleted=' + formNo; $wn(form).find("input[name='referrer']").val(escape(referrer)); $wn(form).find("[submitfield='true']").each(function() { if ($wn(this).attr("value") != '') { switch ($wn(this).attr("name")) { case 'referrer': case 'formno': case 'landingpagetype': case 'isformcomplete': break; case 'LoginEmailAddress': $wn(submittedFields).val($wn(submittedFields).attr("value") + $wn(this).attr("name") + "|"); break; default: $wn(submittedFields).val($wn(submittedFields).attr("value") + '_' + $wn(this).attr("name") + "|"); break; } } }); form.method = 'POST'; form.action = '/global/link.asp?L=' + wng_pageInfo.registrationId + '&function=' + formFunction; _enableForm(form); return true; } _enableForm(form); return false; } }; return classConstructor; }); } if (typeof (WNMemberCenterManager) == 'undefined') { var WNMemberCenterManager = { MEMBER_CENTER_WRAPPER_ELEMENT: 'DIV', MEMBER_CENTER_WRAPPER_CLASSNAME: 'wnMemberCenter', MEMBER_CENTER_LOGGEDIN_CLASSNAME: 'wnMemberCenter-loggedIn', MEMBER_CENTER_LOGGEDOUT_CLASSNAME: 'wnMemberCenter-loggedOut', MEMBER_CENTER_WRAPPER_REFRESH_ON: '1', MEMBER_CENTER_WRAPPER_REFRESH_OFF: '0', MEMBER_CENTER_COOKIE_SEP: '|', initialized: false, regId: 104054, referrerURL: '', finalArray: [], isRegistered: false, userFirstName: '', userEmailAddress: '', suppliedProfileElements: [], initialized: false, init: function() { var functionName = 'init'; this.setRegLinkNo(); this.setReferrerURL(); this.checkIfRegistered(); this.initialized = true; }, setRegLinkNo: function() { var functionName = 'setRegLinkNo'; try { this.regId = wng_pageInfo.registrationId; } catch (e) { return false; } }, checkIfRegistered: function() { var functionName = 'checkIfRegistered'; var authCookie = WNCookie.get("REGISTRATION"); if (authCookie != null) { this.isRegistered = true; var firstName = WNCookie.get("FirstName"); var email = WNCookie.get("EmailAddress"); var profileElements = WNCookie.get("SuppliedProfileFields"); this.userFirstName = (firstName || (firstName != '' && firstName != null)) ? firstName : email.substring(0, email.indexOf('@')); this.userEmailAddress = email; if (profileElements && profileElements.indexOf(this.MEMBER_CENTER_COOKIE_SEP) > 1) { this.suppliedProfileElements = profileElements.split(this.MEMBER_CENTER_COOKIE_SEP); } } }, collectMemberBoxes: function() { var functionName = 'collectMemberBoxes'; var finalArray = []; $wn(this.MEMBER_CENTER_WRAPPER_ELEMENT + " ." + this.MEMBER_CENTER_WRAPPER_CLASSNAME).each(function() { if ($wn(this).attr('refresh') == 1) { if (finalArray.length == 0) { finalArray[0] = $wn(this); } else { finalArray[finalArray.length + 1] = $wn(this); } } }); this.finalArray = finalArray; if (this.finalArray.length > 0) this.initialized = true; }, populateBoxes: function() { var functionName = 'populateBoxes'; if (!this.initialized) this.init(); if (this.isRegistered) { this.collectMemberBoxes(); for (var i in this.finalArray) { $wn(this.finalArray[i]).removeClass(this.MEMBER_CENTER_LOGGEDOUT_CLASSNAME); $wn(this.finalArray[i]).addClass(this.MEMBER_CENTER_LOGGEDIN_CLASSNAME); if (this.userFirstName && this.userFirstName != '') { $wn(this.finalArray[i]).find("strong:first").html("Welcome, " + this.userFirstName + "! "); } } } }, setReferrerURL: function() { var functionName = 'setReferrerURL'; try { this.referrerURL = location.href; } catch (e) { this.debug('Could not set referrerURL', e, functionName); } }, getRegistrationLink: function(mode) { var functionName = 'setRegistrationLink'; var registrationLink = ''; try { } catch (e) { this.debug('Not able to find base URL', e, functionName); } try { registrationLink += '/global/link.asp?L=' + this.regId; } catch (e) { this.debug('Not able to find registration ID', e, functionName); return false; } registrationLink += '&function=manageprofile'; switch (mode) { case 'create': registrationLink += '&mode=create'; break; case 'login': registrationLink += '&mode=login'; break; case 'logout': registrationLink = '/Global/PM/Registration.asp?function=logout'; break; default: break; } registrationLink += '&referrer=' + escape(this.referrerURL); return registrationLink; }, gotoLoginLink: function(mode) { var functionName = 'gotoLoginLink'; window.location = this.getRegistrationLink(mode); return false; }, debug: function(msg, funcName, error) { try { if (!funcName) { funcName = 'NA'; } console.log('Method: ' + funcName + '. Message: ' + msg + '. Error: ' + error); } catch (e) { } } }; } function createSeperator(str) { var span = document.createElement('SPAN'); span.ClassName = "wnSeparator"; span.innerText = str; span.textContent = str; return span; } function createLink(url, text) { var alink = document.createElement('A'); alink.href = url; alink.innerText = text; alink.textContent = text; return alink; } var WNTextChanger = WNClass.create(function() { var _STATE_OFF = WNG_STATE_OFF; var _STATE_ON = WNG_STATE_ON; var _PREFIX_OPTION = 'Option'; var _CLASSNAME = 'wnTextChanger'; var _PREFIX_TARGET = 'Size'; var _SIZES = ['Normal', 'Medium', 'Large']; var _SIZES_PATHS = { Normal: ['/images/static/container-e/story_textsize1.gif', '/images/static/container-e/story_textsize1_on.gif'], Medium: ['/images/static/container-e/story_textsize2.gif', '/images/static/container-e/story_textsize2_on.gif'], Large: ['/images/static/container-e/story_textsize3.gif', '/images/static/container-e/story_textsize3_on.gif'] }; var _LABEL_TEXT = 'Text Size'; var _IMAGE_DOMAIN = ''; function _createOptionImage(size, changer) { var img = null; try { if (size && changer.objectType == WNG_OBJTYPE_TEXTCHANGER) { var imagePath = changer.sizesPaths[size][0]; if (imagePath) { img = wng_doc.createElement('IMG'); img.id = changer.id + _PREFIX_OPTION + size; img.className = changer.className + _PREFIX_OPTION; img.src = changer.imagePrefix + imagePath; img.setAttribute('border', '0'); img.setAttribute('alt', ''); } } } catch (e) { img = null; } return img; } function _createOptionText(size, changer) { var option = null; if (size && changer.objectType == WNG_OBJTYPE_TEXTCHANGER) { option = wng_doc.createElement('SPAN'); option.id = changer.id + _PREFIX_OPTION + size; option.className = changer.className + _PREFIX_OPTION; option.appendChild(wng_doc.createTextNode(size)); } return option; } var classConstructor = function(id, parentId, targetId, options) { this.id = id; this.parentId = parentId; this.targetId = targetId; if (typeof (options) != 'object' || options instanceof Array) { options = {}; } this.className = options.className || _CLASSNAME; this.sizes = (options.sizes instanceof Array) ? options.sizes : _SIZES; this.useImage = (typeof (options.useImage) == 'boolean') ? options.useImage : true; this.sizesPaths = (typeof (options.sizesPaths) == 'object' && !(options.sizesPaths instanceof Array)) ? options.sizesPaths : _SIZES_PATHS; this.imagePrefix = options.imagePrefix || ''; this._createOption = (this.useImage) ? _createOptionImage : _createOptionText; this.labelText = options.labelText || _LABEL_TEXT; this.sizeDefault = WNCookie.get(this.id) || this.sizes[0]; this.sizeCurrent = null; var targetLoading = (typeof (options.targetLoading) == 'boolean') ? options.targetLoading : true; this._setup(targetLoading); }; classConstructor.create = function(id, parentId, targetId, options) { if (id) { return new WNTextChanger(id, parentId, targetId, options); } return null; }; classConstructor.prototype = { objectType: WNG_OBJTYPE_TEXTCHANGER, _setup: function(targetLoading) { var parent = WNElement.getElement(this.parentId); if (parent) { var changer = wng_doc.createElement('SPAN'); changer.className = this.className; changer.id = this.id; var sizes = this.sizes; for (var i = 0, l = sizes.length, option; i < l; i++) { option = this._createOption(sizes[i], this); changer.appendChild(option); WNEvent.addListener(option, 'click', this.changeSize, this); } var label = wng_doc.createElement('SPAN'); label.appendChild(wng_doc.createTextNode(this.labelText)); changer.appendChild(label); parent.appendChild(changer); if (!targetLoading) { this.changeSize(this.sizeDefault); } else { WNEvent.addListener(window, 'load', this.changeSize, this, this.sizeDefault); } } }, changeSize: function(evt, element, size) { if (!size) { var prefixLen = this.id.length + _PREFIX_OPTION.length; size = element.id.substr(prefixLen); } var id = this.id; var changer = WNElement.getElement(id); var target = WNElement.getElement(this.targetId); if (target) { var optionClass = this.className + _PREFIX_OPTION + '-' + _STATE_ON; var useImage = this.useImage; var oldSize = this.sizeCurrent; if (oldSize) { WNElement.removeClassName(target, this.className + _PREFIX_TARGET + oldSize); WNElement.removeClassName(WNElement.getElement(id + _PREFIX_OPTION + oldSize), optionClass); if (useImage) { WNElement.imageSwap(id + _PREFIX_OPTION + oldSize, _STATE_OFF); } } WNElement.addClassName(target, this.className + _PREFIX_TARGET + size); WNElement.addClassName(WNElement.getElement(id + _PREFIX_OPTION + size), optionClass); if (useImage) { WNElement.imageSwap(id + _PREFIX_OPTION + size, _STATE_ON, this.imagePrefix + this.sizesPaths[size][1]); } this.sizeCurrent = size; if (oldSize) { WNCookie.set(id, size, { path: '/' }); } } } }; return classConstructor; }); var WNEmbedHandler = { embed: function(props) { var embedObj = new WNEmbedObject(props); embedObj.write(); } }; function WNEmbedObject(props) { this.objParams = new Object(); this.objAttrs = new Object(); this.embedAttrs = new Object(); if (props) { props = this.setAutoProperties(props); this.distributeProperties(props); } } WNEmbedObject.prototype = { objectType: WNG_OBJTYPE_EMBED, distributeProperties: function(props) { if (typeof props == "object") { var propValue; for (var propName in props) { propValue = props[propName]; switch (propName) { case 'file': this.objAttrs.data = propValue; this.embedAttrs.src = propValue; break; case 'type': case 'width': case 'height': this.objAttrs[propName] = propValue; this.embedAttrs[propName] = propValue; break; case 'codebase': case 'classid': case 'id': case 'class': case 'style': this.objAttrs[propName] = propValue; break; case 'name': case 'pluginspage': this.embedAttrs[propName] = propValue; break; case 'fileParamName': this.objParams[propValue] = props.file; break; default: this.objParams[propName] = propValue; this.embedAttrs[propName] = propValue; } } } }, setAutoProperties: function(props) { if (props && props.file) { var autoProps = new Object(); var fileName = props.file.toLowerCase(); var extensionStart = fileName.lastIndexOf('.'); var extension; if (extensionStart != -1) { extension = fileName.substr(extensionStart + 1, fileName.length); if (extension.match('swf')) { autoProps.type = 'application/x-shockwave-flash'; autoProps.allowscriptaccess = 'samedomain'; autoProps.wmode = 'transparent'; autoProps.classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; autoProps.codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab'; autoProps.fileParamName = 'movie'; autoProps.pluginspage = 'http://www.adobe.com/go/getflashplayer'; } else if (extension.match('wm')) { autoProps.type = 'video/x-ms-wm'; autoProps.windowlessvideo = 'true'; autoProps.classid = 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'; autoProps.fileParamName = 'url'; autoProps.pluginspage = 'http://www.microsoft.com/windows/windowsmedia/player/download/'; } else if (extension.match('asx') || extension.match('asf')) { autoProps.type = 'video/x-ms-asf'; autoProps.windowlessvideo = 'true'; autoProps.classid = 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'; autoProps.fileParamName = 'url'; autoProps.pluginspage = 'http://www.microsoft.com/windows/windowsmedia/player/download/'; } else if (extension.match('qtif')) { autoProps.type = 'image/x-quicktime'; autoProps.classid = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; autoProps.codebase = 'http://www.apple.com/qtactivex/qtplugin.cab'; autoProps.fileParamName = 'src'; autoProps.pluginspage = 'http://www.apple.com/quicktime/download/'; } else if (extension.match('avi') || extension.match('mov') || extension.match('qt')) { autoProps.type = 'video/quicktime'; autoProps.classid = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; autoProps.codebase = 'http://www.apple.com/qtactivex/qtplugin.cab'; autoProps.fileParamName = 'src'; autoProps.pluginspage = 'http://www.apple.com/quicktime/download/'; } else if (extension.match('mp3')) { autoProps.type = 'audio/mpeg'; autoProps.classid = 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'; autoProps.fileParamName = 'url'; autoProps.pluginspage = 'http://www.apple.com/quicktime/download/'; } else if (extension.match('mp')) { autoProps.type = 'video/mpeg'; autoProps.classid = 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'; autoProps.fileParamName = 'url'; autoProps.pluginspage = 'http://www.apple.com/quicktime/download/'; } else if (extension.match('ra') || extension.match('rm') || extension.match('rpm')) { autoProps.type = 'audio/x-pn-realaudio'; autoProps.classid = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; autoProps.fileParamName = 'src'; autoProps.pluginspage = 'http://www.real.com/player/'; } else if (extension.match('dcr') || extension.match('dir') || extension.match('dxr')) { autoProps.type = 'application/x-director'; autoProps.classid = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; autoProps.codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab'; autoProps.fileParamName = 'src'; autoProps.pluginspage = 'http://www.adobe.com/shockwave/download/'; } else if (extension.match('wav')) { autoProps.type = 'audio/wav'; autoProps.classid = 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'; autoProps.fileParamName = 'url'; autoProps.pluginspage = 'http://www.apple.com/quicktime/download/'; } } for (var autoPropName in autoProps) { if (!props[autoPropName]) { props[autoPropName] = autoProps[autoPropName]; } } } return props; }, write: function() { var objectAttributes = this.objAttrs; var objectParameters = this.objParams; var embedAttributes = this.embedAttrs; var htmlString = '<object'; for (var i in objectAttributes) { htmlString += " " + i + '="' + objectAttributes[i] + '"'; } htmlString += '>'; for (var i in objectParameters) { htmlString += '<param name="' + i + '" value="' + objectParameters[i] + '">'; } htmlString += '<embed'; for (var i in embedAttributes) { htmlString += " " + i + '="' + embedAttributes[i] + '"'; } htmlString += '></embed></object>'; document.write(htmlString); } }; function wnWxRegionToggle(currentRegion) { var regions = getElementsByClass(WNG_WEATHER_CLASSNAME_TOGGLE, document.getElementById('WNCol23'), '*'); for (var i = 0; i < regions.length; i++) { var region = regions[i]; region.className = region.className.replace(WNG_WEATHER_CLASSNAME_TOGGLE, ''); } var regionID = currentRegion.name; document.getElementById(regionID).className += (' ' + WNG_WEATHER_CLASSNAME_TOGGLE); currentRegion.className += (' ' + WNG_WEATHER_CLASSNAME_TOGGLE); wnWxExtendedForecastEqualHeight(); } function wnWxExtendedForecastEqualHeight() { var primaryRegions = getElementsByClass(WNG_WEATHER_CLASSNAME_TOGGLE, document.getElementById('WNCol23'), 'div'); var largeHeight = 0; for (var i = 0; i < primaryRegions.length; i++) { var region = primaryRegions[i]; var orientation = region.parentNode.parentNode.className; if (orientation.match('Horizontal')) { var forecastDays = getElementsByClass(WNG_WEATHER_CLASSNAME_FORECASTDAY, region, 'div'); for (var j = 0; j < forecastDays.length; j++) { var fDay = forecastDays[j]; if (fDay.clientHeight > largeHeight) { largeHeight = fDay.clientHeight; j = -1; } else { fDay.style.height = largeHeight + 'px'; } } } } } function wnWxAlertInit() { var wxAlerts = getElementsByClass(WNG_WEATHERALERTS_CLASSNAME, document.getElementById('WNCol23'), 'div'); for (var i = 0; i < wxAlerts.length; i++) { var wxAlert = wxAlerts[i]; wxAlert.className += (' ' + WNG_WEATHERALERTS_CLASSNAME_INACTIVE); } if (location.hash) { wnWxAlertToggle(location.hash); } } function wnWxAlertToggle(wxAlert) { if (wxAlert.href) { var wxAlertID = wxAlert.href.split('#').pop(); } else { var wxAlertID = wxAlert.split('#').pop(); } var wxAlertDiv = document.getElementById(wxAlertID); if (wxAlertDiv.className.match(WNG_WEATHERALERTS_CLASSNAME_INACTIVE)) { wxAlertDiv.className = wxAlertDiv.className.replace(WNG_WEATHERALERTS_CLASSNAME_INACTIVE, WNG_WEATHERALERTS_CLASSNAME_ACTIVE); } else if (wxAlertDiv.className.match(WNG_WEATHERALERTS_CLASSNAME_ACTIVE)) { wxAlertDiv.className = wxAlertDiv.className.replace(WNG_WEATHERALERTS_CLASSNAME_ACTIVE, WNG_WEATHERALERTS_CLASSNAME_INACTIVE); } } function tickerinit(itemsClass) { WNErrorHandle.console('Warning. This WorldNow method is being phased out.  Please update code to use alternative methods.', 'tickerinit'); return null; var tickerDiv = document.getElementById('WNDS40'); var items = getElementsByClass(itemsClass, tickerDiv, 'div')[0]; ticker = new scrollerObj(items, 'ticker', 2, 45); ticker.update(); ticker.goLeft(); tickerDiv.style.visibility = 'visible'; } function getPosY(element) { var ePosY = element.offsetTop; WNErrorHandle.console('Warning. This method is being phased out.  Please update code to use alternative methods.', 'getPosY'); return parseInt(ePosY); } function getPosX(element) { var ePosX = element.offsetLeft; WNErrorHandle.console('Warning. This method is being phased out.  Please update code to use alternative methods.', 'getPosX'); return parseInt(ePosX + 3); } function scrollerObj(items, objName, moveBy, duration) { WNErrorHandle.console('Warning. This WorldNow method is being phased out.  Please update code to use alternative methods.', 'scrollerObj'); return null; this.objName = objName; this.moveBy = moveBy ? moveBy : 1; this.duration = duration ? duration : 40; this.div = items; this.runId = null; this.divHeight = this.div.offsetHeight; this.posX = parseInt(this.div.offsetTop); this.maxHeight = parseInt(this.div.parentNode.offsetHeight); this.divWidth = parseInt(this.div.scrollWidth); this.tickerWidth = this.div.parentNode.offsetWidth; this.posY = this.tickerWidth; } function updateDiv() { WNErrorHandle.console('Warning. This WorldNow method is being phased out.  Please update code to use alternative methods.', 'updateDiv'); return null; this.divHeight = parseInt(this.div.scrollHeight); this.divWidth = parseInt(this.div.scrollWidth); this.tickerWidth = this.div.parentNode.offsetWidth; } function scrollUp() { WNErrorHandle.console('Warning. This WorldNow method is being phased out.  Please update code to use alternative methods.', 'scrollUp'); return null; this.stop(); if (this.posX != 0 && this.divHeight > this.maxHeight) { this.posX += this.moveBy; this.div.style.top = this.posX + 'px'; this.runId = setTimeout(this.objName + ".goUp();", this.duration); } } function scrollDown() { WNErrorHandle.console('Warning. This WorldNow method is being phased out.  Please update code to use alternative methods.', 'scrollDown'); return null; this.stop(); if (this.divHeight > this.maxHeight) { if (this.posX > (this.maxHeight - this.divHeight)) { this.posX -= this.moveBy; this.div.style.top = this.posX + 'px'; this.runId = setTimeout(this.objName + ".goDown();", this.duration); } } } function scrollLeft() { WNErrorHandle.console('Warning. This WorldNow method is being phased out.  Please update code to use alternative methods.', 'scrollLeft'); return null; this.stop(); this.posY -= this.moveBy; this.div.style.left = this.posY + 'px'; this.runId = setTimeout(this.objName + ".goLeft();", this.duration); if ((this.posY + this.divWidth) <= 0) { this.posY = this.tickerWidth; } } function stopScroll() { WNErrorHandle.console('Warning. This WorldNow method is being phased out.  Please update code to use alternative methods.', 'stopScroll'); return null; if (this.runId) { clearTimeout(this.runId); } this.runId = null; } scrollerObj.prototype.stop = stopScroll; scrollerObj.prototype.goUp = scrollUp; scrollerObj.prototype.goDown = scrollDown; scrollerObj.prototype.goLeft = scrollLeft; scrollerObj.prototype.update = updateDiv; function playVideoClip() { displayVideoHelp(); } function playVideoClips() { displayVideoHelp(); } function checkAllBoxes(strState, formID) { var objForm = eval('document.' + formID); if (strState == 'false') { objForm.reset(); } else { for (i = 0; i < objForm.length; i++) { if (objForm.elements[i].type == "checkbox") { objForm.elements[i].checked = true; } } } } function displayVideoHelp(p_os) { self.name = wng_AffiliateName + "CONTENT"; if (p_os == 'mac-noPlugin') { var videoHelp = window.open(wng_VideoMacHelpPage, 'CONTENT'); } else { var videoHelp = window.open(wng_VideoHelpPage + '&displayHelp=true', 'CONTENT'); } videoHelp.focus(); window.name = "CONTENT"; } function getElementsByClass(searchClass, node, tag) { var classElements = new Array(); if (node == null) { node = document; } if (tag == null) { tag = '*'; } var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp('(?:^|\\s+)' + searchClass + '(?:\\s+|$)'); for (i = 0, j = 0; i < elsLen; i++) { if (pattern.test(els[i].className)) { classElements[j] = els[i]; j++; } } return classElements; } function wnTrim(str) { return str.replace(/^\s*/, "").replace(/\s*$/, ""); } function wnXMLString(xmlString) { try { xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); xmlDoc.async = 'false'; xmlDoc.loadXML(xmlString); } catch (e) { try { parser = new DOMParser(); xmlDoc = parser.parseFromString(xmlString, 'text/xml'); } catch (e) { } } return xmlDoc; } function wnAppendCommentsAd() { iframeInfo = WN_DFPAdCalls.iframeAd('1', '468', '60', 'nat', wng_pageInfo.affiliateName, wng_pageInfo.contentClassification, WNAdManager.getKeywordString('=', ';')); wnCommentsAdFrame = iframeInfo['element']; $wn('#wnCommentsAd').empty().append(wnCommentsAdFrame); $wn(wnCommentsAdFrame).attr({ src: iframeInfo['src'], frameBorder: '0', border: '0', marginWidth: '0', marginHeight: '0', scrolling: 'no' }).css({ width: '468px', height: '60px', border: '1px solid #c5c5c5' }); } function showCommentPopup(show) { var commentPopup = $wn('#wnJsKitCommentingAll'); if (show) { var x = 50, y = 50; x += document.body.scrollLeft; y += document.body.scrollTop; commentPopup.show(); commentPopup.css({ 'left': x + 'px', 'top': y + 'px' }); wnAppendCommentsAd(); try { DCS.dcsuri = "/global/story.wid"; WT.cg_n = "SocialComments"; WT.ti = "SocialComments"; DCSext.pageclass = "SocialComments"; DCSext.nclicks = gIndex; dcsTag(); } catch (err) { } } else { commentPopup.hide(); } } function wnShowHideJsKit(attemptNum) { var maxAttempts = 4; if (!attemptNum) attemptNum = 0; attemptNum++; if (!WNMemberCenterManager.initialized) WNMemberCenterManager.init(); if (wnShowHideJsKit.initalized) return; try { if (WNMemberCenterManager.isRegistered) { if (WNMemberCenterManager.userFirstName && WNMemberCenterManager.userFirstName != '') { $wn(":text[name='js-CmtName']").val(WNMemberCenterManager.userFirstName).attr("disabled", "disabled"); } if (WNMemberCenterManager.userEmailAddress && WNMemberCenterManager.userEmailAddress != '') { $wn(":text[name='js-CmtEmail']").val(WNMemberCenterManager.userEmailAddress).attr("disabled", "disabled"); } } if (WNG_JSKIT_RATINGS_REGISTRATION_REQUIRED == 'True' || WNG_JSKIT_RATINGS_REGISTRATION_REQUIRED == 'true') { if (WNMemberCenterManager.isRegistered) { $wn("#wnJsKitRatings").removeClass("read-mode"); $wn("#wnJsKitRatings").addClass("write-mode"); } else { $wn("#wnJsKitRatings").removeClass("write-mode"); $wn("#wnJsKitRatings").addClass("read-mode"); } } else { $wn("#wnJsKitRatings").removeClass("read-mode"); $wn("#wnJsKitRatings").addClass("write-mode"); } if (WNG_JSKIT_COMMENTS_REGISTRATION_REQUIRED == 'True' || WNG_JSKIT_COMMENTS_REGISTRATION_REQUIRED == 'true') { if (WNMemberCenterManager.isRegistered) { $wn("#wnJsKitCommentingLimited").removeClass("read-mode"); $wn("#wnJsKitCommentingAll").removeClass("read-mode"); $wn("#wnJsKitCommentingLimited").addClass("write-mode"); $wn("#wnJsKitCommentingAll").addClass("write-mode"); } else { $wn("#wnJsKitCommentingLimited").removeClass("write-mode"); $wn("#wnJsKitCommentingAll").removeClass("write-mode"); $wn("#wnJsKitCommentingLimited").addClass("read-mode"); $wn("#wnJsKitCommentingAll").addClass("read-mode"); } } else { $wn("#wnJsKitCommentingLimited").removeClass("read-mode"); $wn("#wnJsKitCommentingAll").removeClass("read-mode"); $wn("#wnJsKitCommentingLimited").addClass("write-mode"); $wn("#wnJsKitCommentingAll").addClass("write-mode"); } dragDrop.initElement("#wnJsKitCommentingAll", "#wnJsKitCommentingAllHeader"); if ($JCA[0].serverOptions.pages.tc > 0) { $wn("#wnJsKitShowAllLink").show(); } } catch (e) { if (attemptNum <= maxAttempts) window.setTimeout(500, 'wnShowHideJsKit(' + attemptNum + ')'); return; } wnShowHideJsKit.initalized = true; } var WNAddThisBookmark = { SHOW_ON_CONTAINER: 'S', PREPEND_ELEMENT_ID: 'wnSocialToolsSection', ADD_THIS_PUB_ID: 'N1PSZUHXZFWVNLB7', ADD_THIS_TEXT_ALIGN: 'right', setShowOnContainer: function(containerId) { this.SHOW_ON_CONTAINER = containerId; }, getShowOnContainer: function() { return this.SHOW_ON_CONTAINER; }, setPrependElementId: function(elementId) { this.PREPEND_ELEMENT_ID = elementId; }, getPrependElementId: function() { return this.PREPEND_ELEMENT_ID; }, setAddThisPubId: function(addThisPubId) { this.ADD_THIS_PUB_ID = addThisPubId; }, getAddThisPubId: function() { return this.ADD_THIS_PUB_ID; }, setAddThisAlignment: function(alignment) { this.ADD_THIS_TEXT_ALIGN = alignment; }, getAddThisAlignment: function() { return this.ADD_THIS_TEXT_ALIGN; }, show: function() { try { addthis_pub = this.getAddThisPubId(); var wnAnchorElement = $wn("#" + this.getPrependElementId()); var pageContainerID = wng_pageInfo.containerType.toLowerCase(); var showOnContainer = this.getShowOnContainer(); showOnContainer = showOnContainer.toLowerCase(); if (wnAnchorElement && wnAnchorElement != 'undefined' && pageContainerID == showOnContainer) { var wrapperElement = document.createElement('DIV'); wrapperElement.className = 'wnAddThisBookmark'; wrapperElement.style.textAlign = this.getAddThisAlignment(); var wnsiString = '<a href="http://www.addthis.com/bookmark.php" onclick="addthis_url=location.href;addthis_title=document.title;return addthis_click(this);" target="_blank"><img src="http://s9.addthis.com/button1-bm.gif" width="125" height="16" border="0" alt="AddThis Social Bookmark Button" /></a>'; wrapperElement.innerHTML = wnsiString; $wn(wnAnchorElement).prepend(wrapperElement); } } catch (e) { } } }; var WNVideoWidgetGallery = { ID_PREFIX: "wnVideoGalleryPage", CLASS_NAME_SHOW: "show", current: 1, total: 0, showBind: function(page) { return function(evt) { return WNVideoWidgetGallery.show(page); }; }, show: function(page) { page = parseInt(page); if (page) { if (this.current) { this.hide(this.current); } this.current = page; document.getElementById(this.ID_PREFIX + page).className += " " + this.CLASS_NAME_SHOW; document.getElementById("wnVideoGalleryNav" + page).className = "active"; var prev = document.getElementById("WNVideoGalleryPrev"); if (page > 1) { prev.onclick = this.showBind(page - 1); prev.className = ""; } else { prev.className = "inactive"; } var next = document.getElementById("WNVideoGalleryNext"); if (page < this.total) { next.onclick = this.showBind(page + 1); next.className = ""; } else { next.className = "inactive"; } } return false; }, hide: function(page) { page = parseInt(page); if (page) { var item = document.getElementById(this.ID_PREFIX + page), className = " " + item.className, start = className.indexOf(this.CLASS_NAME_SHOW); if (start > -1) { className = className.substr(0, start) + className.substr(className.indexOf(" ", start) + 1, className.length - 1); item.className = (className.indexOf(" ") == 0) ? className.substr(1) : className; } document.getElementById("wnVideoGalleryNav" + page).className = ""; } }, initialize: function() { var navigation = document.getElementById("WNVideoGalleryNavigation").getElementsByTagName("font")[0], gallery = document.getElementById("WNVideoGalleryPages"), items = (gallery) ? gallery.childNodes : [], idPrefix = this.ID_PREFIX, links = "", page = 0, item, className; for (var i = 0, l = items.length; i < l; i++) { item = items[i]; className = item.className; if (className && className.indexOf(idPrefix) != -1) { page++; if (page > 1) { links += "<span class=\"separator\">|</span>"; } className = (page == 1) ? " class=\"active\"" : ""; links += "<span id=\"wnVideoGalleryNav" + page + "\"" + className + " onclick=\"return WNVideoWidgetGallery.show(" + page + ")\">" + page + "</span>"; } } if (navigation && page > 0) { navigation.innerHTML = ("<span id=\"WNVideoGalleryPrev\" class=\"inactive\">&lt;</span>" + links + "<span id=\"WNVideoGalleryNext\" onclick=\"return WNVideoWidgetGallery.show(" + page + ")\">&gt;</span>"); } this.total = page; } };