// Change URLs to point to Maintenance Window if within defined Maintenace windows isMaintMode == false; var maintStart = new Array(); var maintEnd = new Array(); var today = new Date(2010,7,1,3,2) // user server time var isMaintMode; maintStart[0] = new Date(2010, 3, 26,11,00); maintEnd[0] = new Date(2010, 3, 26,14,00); // need to add one for the 30th maintenance period // maintStart[1] = new Date(2010, 0, 24,08,00); // maintEnd[1] = new Date(2010, 0, 24,16,00); //year, month, day, hours, minutes, seconds, milliseconds var maintCount; maintCount = 0; isMaintMode = false; var activePeriod; activePeriod = 0; jQuery.each(maintStart, function() { if (today > this && today < maintEnd[maintCount]) { isMaintMode = true; activePeriod = maintCount+1; } maintCount++; // increment maintenance counter return (this); }); jQuery(document).ready(function() { // put all your jQuery goodness in here. if (isMaintMode == true) { maintMode(activePeriod); } }); function maintMode(activePeriod){ redirectURL = 'http://www.hydroottawa.com/mhl_maint.cfm?id='+activePeriod; // Change MyHydroLink Links jQuery("a[href='https://secure.hydroottawa.com/usage/Login.aspx']").attr('href', redirectURL); jQuery("a[href='https://secure.hydroottawa.com/usage/']").attr('href', redirectURL ); jQuery("a[href='https://secure.hydroottawa.com/moving/moving.aspx']").attr('href', redirectURL ); jQuery("a[href='https://secure.hydroottawa.com/usage/secure/WelcomeLogin.aspx?lang=en']").attr('href', redirectURL ); jQuery("a[href='https://secure.hydroottawa.com/usage/secure/WelcomeLogin.aspx?lang=fr']").attr('href', redirectURL ); jQuery('a', '#whatsNewCarousel').filter(function() { return (jQuery(this).attr('href') == "javascript:noticeWindow();window.location='https://secure.hydroottawa.com/usage/Login.aspx?lang=en';"); }).attr('href',redirectURL); // Change Move-In/Move-Out Links jQuery("a[href='javascript:void(0);']").attr('onclick', 'return false;'); jQuery("a[href='javascript:void(0);']").attr('href', 'http://www.hydroottawa.com/mhl_maint.cfm?id='+activePeriod ); }