var projX = {}; projX.repeat = false; projX.test = false; projX.displayEventPre = function(){ return true;}; projX.displayEventPost = function(){}; projX.closeEvent = function(){}; projX.layerindex = 9999999; projX.init = function(){ // testurl for test param try{ var fullUrl = document.location.toString(); var strQ = fullUrl.split('?')[1]; var nameValues = strQ.split("&"); for(n=0; n < nameValues.length; n++ ){ var name = nameValues[n].split('=')[0]; var value = nameValues[n].split('=')[1]; if(name=='_localAdvisoryTest' && value == 'true'){ projX.test = true; projX.repeat = true; } } }catch(e){} try{ var hz = projX.util.getNextHighestZindex(); if(hz > projX.layerindex) projX.layerindex = hz } catch(e){} var projXcookie = projX.cookie.get('projxcookie'); if(projXcookie == undefined || projX.test){ var expir = projX.cookie.getExpDate(0,0,1); if(projX.cookie.set('projxcookie','yes',false,'/')){ if(projX.test){ projX.displayOverlay(false, 'placeholder', 'placeholder', 'placeholder', 'placeholder.com', 'placeholder.com'); }else{ } } } }; projX.close = function(){ document.getElementById('projxalert').style.display = 'none'; projX.closeEvent(); }; projX.displayOverlay = function(phase2, operatorName, phoneMessage, affectedChannels, websiteUrl, websiteMessage){ var eventcall = projX.displayEventPre(); if(!eventcall) return; // create a modal pane in front of the entire window var alertwidth = 500; var pageSize = projX.util.getPageSize(); var winSize = projX.util.getWindowSize(); var scrDiv = document.createElement('div'); scrDiv.setAttribute("id", "projxalert"); scrDiv.setAttribute("class", "projxalert"); scrDiv.setAttribute("style","position:absolute;top:0px; left:0px; text-align: center; z-index:"+projX.layerindex+"; width:"+pageSize[0]+"px; height:"+pageSize[1]+"px;"); var alertleft = (pageSize[0]/2)-(alertwidth/2); var winH = projX.util.getWindowSize(); var alerttop = (winSize[1]/2)-150; if(alerttop < 0) alerttop = 0; var htmlout = ''; htmlout += '
 
'; htmlout += '
'; if (phase2) htmlout += projX.message_phase2(operatorName, phoneMessage, affectedChannels, websiteUrl, websiteMessage); else htmlout += projX.message_phase1(operatorName, phoneMessage, affectedChannels, websiteUrl, websiteMessage); htmlout += '
'; htmlout += 'CLOSE'; htmlout += '
' scrDiv.innerHTML = htmlout; var alert_div = document.getElementsByTagName('body')[0].appendChild(scrDiv); projX.displayEventPost(); }; projX.displayPhase2Inline = function(operatorName, phoneMessage, affectedChannels, websiteUrl, websiteMessage){ var htmlout = ''; htmlout += '
'; htmlout += projX.message_phase2(operatorName, phoneMessage, affectedChannels, websiteUrl, websiteMessage); htmlout += '
'; document.write(htmlout); }; projX.message_phase1 = function(operatorName, phoneMessage, affectedChannels, websiteUrl, websiteMessage){ var html = ''; html += 'ATTENTION '; html += operatorName; html += ' CUSTOMERS:

'; html += ''; html += 'YOU COULD LOSE YOUR FAVORITE TV AND ONLINE PROGRAMMING.

TONIGHT, '; html += operatorName; html += ' COULD DROP '; html += affectedChannels; html += '.

'; html += phoneMessage; html += ' AND ASK THEM TO KEEP THESE CHANNELS ON THE AIR. YOU MUST BE AT LEAST 18 YEARS OLD TO CALL.

'; html += ''; html += websiteMessage; html += ''; html += '
'; return html; }; projX.message_phase2 = function(operatorName, phoneMessage, affectedChannels, websiteUrl, websiteMessage){ var html = ''; html += 'ATTENTION '; html += operatorName; html += ' CUSTOMERS!

'; html += ''; html += operatorName; html += ' HAS TAKEN AWAY YOUR FAVORITE SHOWS ON TV AND ONLINE. THEY NO LONGER CARRY '; html += affectedChannels; html += '.

YOU CAN CHANGE THIS! '; html += phoneMessage; html += ' NOW AND DEMAND THAT '; html += operatorName; html += ' RETURN YOUR FAVORITE CHANNELS AND SHOWS! You must be at least 18 years old to call.

'; html += ''; html += websiteMessage; html += ''; html += '
'; return html; }; projX.util = { trimString : function(str){ if(typeof str != 'string') return str; var retString = str; // check begining of string for white spaces var character = retString.substring(0,1); while(character.charCodeAt(0) == 9 || character.charCodeAt(0) == 32 || character.charCodeAt(0) == 10){ retString = retString.substring(1,retString.length); character = retString.substring(0,1); } // check end of string for white spaces character = retString.substring(retString.length-1,retString.length); while(character.charCodeAt(0) == 9 || character.charCodeAt(0) == 32 || character.charCodeAt(0) == 10){ retString = retString.substring(0,retString.length-1); character = retString.substring(retString.length-1,retString.length); } return retString; }, getPageSize : function(){ if (window.innerHeight && window.scrollMaxY) {// Firefox yWithScroll = window.innerHeight + window.scrollMaxY; xWithScroll = window.innerWidth + window.scrollMaxX; yWithoutScroll = window.innerHeight; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac yWithScroll = document.body.scrollHeight; xWithScroll = document.body.scrollWidth; yWithoutScroll = document.body.clientHeight; } else if(window.innerHeight){ // ff3 yWithScroll = document.body.offsetHeight; if(window.innerHeight > document.body.offsetHeight); yWithScroll = window.innerHeight xWithScroll = document.body.offsetWidth; yWithoutScroll = document.body.clientHeight; } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari yWithScroll = document.body.offsetHeight; xWithScroll = document.body.offsetWidth; yWithoutScroll = document.body.clientHeight; } var tempArray = new Array(xWithScroll,yWithScroll,yWithoutScroll); return tempArray; }, getWindowSize : function() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } var tempArray = new Array(myWidth,myHeight); return tempArray; }, getNextHighestZindex : function(){ var els = document.getElementsByTagName('DIV'); var elslen = els.length; var highestZ = 0; for(var i = 0; i < elslen; i++){ try{ var level = parseFloat(els[i].currentStyle['zIndex']); if(level){ if(level > highestZ) highestZ = level; } }catch(e){}; } return (highestZ+1); } }; projX.cookie = { cookieArray : [], set : function(name,value,expires,path,domain) { document.cookie = name + "=" + value +((path) ? ";path=" + path : "") +((domain) ? ";domain=" + domain : "") + ((expires) ? ";expires="+ expires : ""); var cookietest = projX.cookie.get(name); if(cookietest == value){ return true; } else{ return false; } }, get : function(name) { this.parsecookies(); return this.cookieArray[name]; }, del : function(name, path, domain) { if (this.cookieArray[name]) { document.cookie = name + "=" +((path) ? ";path=" + path : "") +((domain) ? ";domain=" + domain : "") +";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } }, parsecookies : function() { this.cookieArray.length = 0; var cookies = document.cookie; var namevalues = cookies.split(';'); for(i=0; i < namevalues.length; i++){ // the cookieParams will have multiple = signs if(namevalues[i].indexOf('cookieParams')>-1){ var splitAt = namevalues[i].indexOf('='); var pairs = new Array(); pairs[0] = namevalues[i].substring(0,splitAt); pairs[1] = namevalues[i].substring(splitAt+1); } else{ var pairs = namevalues[i].split('='); } this.cookieArray[projX.util.trimString(pairs[0])] = pairs[1]; } }, getExpDate : function(days, hours, minutes) { // expires format "Thu, 01-Jan-1970 00:00:01 GMT" var expDate = new Date(); if (typeof days == "number" && typeof hours == "number" && typeof hours == "number") { expDate.setDate(expDate.getDate() + parseInt(days)); expDate.setHours(expDate.getHours() + parseInt(hours)); expDate.setMinutes(expDate.getMinutes() + parseInt(minutes)); return expDate.toGMTString(); } } }; if(window.attachEvent){ window.attachEvent('onload',projX.init); } else if(document.addEventListener){ // safari if (/WebKit/i.test(navigator.userAgent)) { var projx_safari_timer = setInterval(function() { if (/loaded|complete/.test(document.readyState)) { clearInterval(projx_safari_timer); projX.init(); } }, 10); } else // not safari document.addEventListener('DOMContentLoaded',projX.init,null); } function ThemeScheduler() { this.scheduledTheme = null; this.makeSchedule = function() { var themesJSON={"themes": [ {"start":"08/12/2010 23:55","end":"09/29/2010 23:59","pageurl":"/music/unplugged/main.jhtml","url":"/sitewide/css/themes/starbust/theme.css","oparamName":"starburst"}, {"start":"09/06/2010 00:00","end":"09/06/2010 23:59","pageurl":"/shows/ochocinco_the_ultimate_catch/series.jhtml","url":"/sitewide/css/themes/ocho_showpage/theme.css","oparamName":"ocho"}, {"start":"09/06/2010 00:00","end":"09/06/2010 23:59","pageurl":"/shows/ochocinco_the_ultimate_catch/video.jhtml","url":"/sitewide/css/themes/ocho_showpage/theme.css","oparamName":"ocho"}, {"start":"09/06/2010 00:00","end":"09/06/2010 23:59","pageurl":"/shows/ochocinco_the_ultimate_catch/cast.jhtml","url":"/sitewide/css/themes/ocho_showpage/theme.css","oparamName":"ocho"}, {"start":"09/06/2010 00:00","end":"09/06/2010 23:59","pageurl":"/shows/ochocinco_the_ultimate_catch/episodes.jhtml","url":"/sitewide/css/themes/ocho_showpage/theme.css","oparamName":"ocho"}, {"start":"09/06/2010 00:00","end":"09/06/2010 23:59","pageurl":"/shows/ochocinco_the_ultimate_catch/photos.jhtml","url":"/sitewide/css/themes/ocho_showpage/theme.css","oparamName":"ocho"}, {"start":"09/06/2010 00:00","end":"09/06/2010 23:59","pageurl":"/shows/ochocinco_the_ultimate_catch/cast_member.jhtml","url":"/sitewide/css/themes/ocho_showpage/theme.css","oparamName":"ocho"}, {"start":"10/22/2010 00:00","end":"10/22/2011 23:59","pageurl":"/video/misc/589000/speak-now-taylor-swift-live-from-new-york-city.jhtml","url":"/sitewide/css/themes/taylorswift/theme.css","oparamName":"ocho"}, {"start":"10/22/2010 00:00","end":"10/22/2011 23:59","pageurl":"/video/shows/full-episodes/taylor-swift-full-show-on-demand/1650636/playlist.jhtml","url":"/sitewide/css/themes/taylorswift/theme.css","oparamName":"ocho"}, {"start":"10/22/2010 00:00","end":"10/22/2011 23:59","pageurl":"/video/misc/588319/kanye-west-premiere-runaway.jhtml","url":"/content/video/config/skins/kanyewest/theme.css","oparamName":"ocho"}, {"start":"11/17/2010 00:00","end":"11/22/2011 23:59","pageurl":"/video/keri-hilson/596802/pretty-girl-rock.jhtml","url":"/sitewide/css/charlie/themes/franchises/posted/theme.css","oparamName":"keri"}, {"start":"11/22/2010 00:00","end":"11/23/2011 23:59","pageurl":"/video/misc/598640/live-in-la-my-chemical-romance.jhtml","url":"/content/video/config/skins/my_chemical_romance/theme.css","oparamName":"chemical"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602750/hero-package-1.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602755/hero-package-2.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602761/hero-package-3.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602771/hero-package-4.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602772/hero-package-5.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602739/boogie-woogie-bugle-boy-open.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602749/katy-perry-performs-california-gurls.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602746/paramore-perform-the-only-exception.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602760/grace-potter-and-the-nocturnals-perform-paris-ooh-la-la.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/603090/grace-potter-and-the-nocturnals-and-ann-and-wancy-wilson-of-heart-perform-crazy-on-you.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602770/katy-perry-and-nicki-minaj-perform-girls-just-wanna-have-fun.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602786/paramore-perform-my-hero.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, {"start":"11/22/2010 00:00","end":"12/05/2010 23:00","pageurl":"/video/misc/602801/katy-perry-performs-firework.jhtml","url":"/content/video/config/skins/divas_2010_vh1head/theme.css","oparamName":"divas"}, ] }; var sn = new Object(); window.location.search.replace( new RegExp( "([^?=&]+)(=([^&]*))?", "g" ), function( $0, $1, $2, $3 ){ sn[ $1 ] = $3; } ); var n; var now = "201103221011"; if(now.indexOf("esi") > -1) { n = new Date(); }else{ now = (now.indexOf('-')> -1) ? now.replace(/-/g,'/') : now.substring(0,4)+'/'+now.substring(4,6)+'/'+now.substring(6,8)+' '+now.substring(8,10)+':'+now.substring(10,12); n = new Date(now); } this.scheduledTheme = makeScheduleExt(themesJSON, n); } }