// CN: there are new separate js files for photo gallery, faq and sport pages; code that was here have been moved to the appropriate file // CONSTANTS var COOKIE_NAMES = { COUNTRY: 'country', LANGUAGE: 'language', USE_VANCOUVER_TIME: 'useVancouverTime', SEARCH_QUERY: 'searchQuery', PHOTO_TERMS_ACCEPTED: 'acceptedTermsForPhotoDownload' }; var DICTIONARY = { EN: { months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], localTime: 'Local Time', vancouverTime: 'Vancouver Time', pacificTime: 'Pacific Time', switchTo: 'Switch to' }, FR: { months: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], days: ['Sunday', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'], localTime: 'Heure locale', vancouverTime: 'Heure du Vancouver', pacificTime: 'Heure du Pacifique', switchTo: 'Passage à' } }; var CURRENT_LANG; var flashElements = []; // NEW JQUERY FUNCTIONS jQuery.fn.delay = function(time,func){ this.each(function(){ setTimeout(func,time); }); return this; }; jQuery.fn.alternateRowColors = function(){ $('tbody tr.sortMe:odd', this).removeClass('even').addClass('odd'); $('tbody tr.sortMe:even', this).removeClass('odd').addClass('even'); return this; }; jQuery.fn.log = function(msg){ console.log("%s: %o", msg, this); return this; }; jQuery.cookie = function(name, value, options) { if (typeof value != 'undefined') { // name and value given, set cookie options = options || {}; if (value === null) { value = ''; options.expires = -1; } var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE } // CAUTION: Needed to parenthesize options.path and options.domain // in the following expressions, otherwise they evaluate to undefined // in the packed version for some reason... var path = options.path ? '; path=' + (options.path) : ''; var domain = options.domain ? '; domain=' + (options.domain) : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); } else { // only name given, get cookie var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } }; // OTHER METHOD EXTENSIONS Date.prototype.getFormattedTime = function() { var hours = this.getHours(); //return ((hours == 0) ? '12' : (hours <= 12) ? hours : hours - 12) + ':' + ((this.getMinutes() < 10) ? '0' : '') + this.getMinutes() + ' ' + ((hours < 12) ? 'am' : 'pm'); return hours + ((cmArr['lang'] == 'FR') ? ' h ' : ':') + ((this.getMinutes() < 10) ? '0' : '') + this.getMinutes(); }; Date.prototype.getFormattedDate = function(isShortMonth, addComma) { var month = CURRENT_LANG['months'][this.getMonth()]; var mon = (month.substring(0, 3).indexOf('&') > -1) ? month.substring(0, 8) : month.substring(0, 3); if (cmArr['lang'] == 'FR') { return 'le ' + this.getDate() + ' ' + (isShortMonth ? mon : month); } else { return (isShortMonth ? mon : month) + ' ' + this.getDate() + (addComma ? ',' : ''); } } // ON LOAD FUNCTIONS $(function(){ CURRENT_LANG = DICTIONARY[cmArr['lang']]; // load flash elements for (var flashIndex = flashElements.length - 1; flashIndex >= 0; flashIndex--) { var flashObj = flashElements[flashIndex]; var flashDiv = $('.' + flashObj.divId); if (flashDiv) { eval('var flashTags = AC_FL_RunContent_GenerateOnly("' + flashObj.arguments.join('","') + '")'); flashDiv.append(flashTags); } } // create extra markup to display rounded corner boxes $('.boxItUp').wrapInner('
').append('
'); // default actions if JS is enabled $('body').removeClass('noJs'); $('.metaContent').remove(); $('.accessBar ul').before('

This site is using enhanced visual functionalities that might affect your experience. Restore default browser behaviors accross the website.

'); /* =====>>> remettre apres le d?but de la torche var homeclass = Math.floor(Math.random()*16); var homeparaclass = Math.floor(Math.random()*5+19); if ($('#home .footerExtra2')) {$('#home .footerExtra2').addClass('footerExtraspe'+homeclass);} if ($('#home_para .footerExtra2')) {$('#home_para .footerExtra2').addClass('footerExtraspe'+homeparaclass);} =====> remove? var homeheaderclass = Math.floor(Math.random()*22); var homeheaderparaclass = Math.floor(Math.random()*6+30); if ($('#home .bodyExtra')) {$('#home .bodyExtra').addClass('bodyExtraSpe'+homeheaderclass);} if ($('#home_para .bodyExtra')) {$('#home_para .bodyExtra').addClass('bodyExtraSpe'+homeheaderparaclass);} */ // transform all when the user clicks on an element with the class 'defaultBox' $('.defaultBox').click(function(){ $('.drpSelect').each(function(){ var whichAction = $(this).attr('rel'); var whichDrop = $(this).attr('class'); whichDrop = whichDrop.substring(14,whichDrop.length); $(this).parent('div.drpElement').before(''); $(this).find('li a').each(function(){ var whichURL = $(this).attr('href'); var whichId = $(this).attr('id'); whichId = whichId.substring(whichId.length-3,whichId.length); var whichValue = whichId+'_'+whichURL; if($(this).attr('class') == 'activeIndex'){ $('select#drp_'+whichDrop).append(''); }else{ $('select#drp_'+whichDrop).append(''); } }); $(this).parent('div.drpElement').remove(); }); }); // restore all custom dropdowns into their original