Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Comcast Cable Communications, LLC Proprietary. Copyright 2013.
- // Intended use is to display browser notifications for critical and time sensitive alerts.
- var _ComcastAlert = (function(){
- return {
- SYS_URL: '/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do'
- , dragObj: {zIndex: 9999}
- , browser: null
- , comcastCheck: 1
- , comcastTimer: null
- , xmlhttp: null
- , go: function(){
- if(self.location !== top.location) return;
- if(document.body){
- _ComcastAlert.MyDeviceOwnedAlert();
- _ComcastAlert.browser = _ComcastAlert.checkBrowser();
- _ComcastAlert.getXmlhttp();
- _ComcastAlert.checkBulletin();
- return _ComcastAlert;
- }else{
- setTimeout(_ComcastAlert.go, 200);
- }
- }
- , MyDeviceOwnedAlert: function(){
- var image_url = 'http://servicealerts.comcast.net:8080/images/mydevicealert/browser/';
- // var mydeviceDeviceAlertDate = 'Wednesday 30-OCT-2013';
- var mydeviceDeviceAlertDate = 'Tuesday 19-NOV-2013';
- // var mydeviceDeviceAlertDate = 'Tuesday 10-DEC-2013';
- // var myDeviceAlertAnalytics = 'mydevicealert_owned_cd.png?';
- var myDeviceAlertAnalytics = 'mydevicealert_owned_ned.png?';
- // var myDeviceAlertAnalytics = 'mydevicealert_owned_wd.png?';
- var winObj = {
- image_url: image_url
- , myDeviceAlertAnalytics: myDeviceAlertAnalytics
- , mydeviceDeviceAlertDate: mydeviceDeviceAlertDate
- , headertext1: '<strong>XFINITY Internet Service Reminder</strong>'
- , textline1: '<b>Hello, Comcast Customer!</b>'
- , textline2: 'As of <b>' + mydeviceDeviceAlertDate + '</b>, your cable modem will no longer be able to operate on Comcast's network.'
- , textline3: '<b>To avoid service interruption, please immediately make arrangements to replace your modem using one of the convenient modem replacement options available to you:</b>'
- , textline4: 'Visit a retailer to purchase a new cable modem. You may visit <a href=\"#\" onClick="document.location.href=\'' + this.SYS_URL + '?dispatch=ackBulletinRedirectSleep&redirectName=mydevicealert\'">http://mydeviceinfo.comcast.net</a> for a list of modems certified to work on our network'
- , textline5: 'Arrange to lease a cable modem by calling 1-800-XFINITY.'
- , textline6: 'Please properly recycle your older modem by following the instructions provided in the letter we mailed to you.'
- , textline7: 'If you have any questions, please chat with us online at <a href="https://www.comcastsupport.com/EOS-EOL" target="_new">https://www.comcastsupport.com/EOS-EOL</a>.'
- , privacystatement: '<a style="text-decoration: underline; "href="http://xfinity.comcast.net/privacy/2012-03/" target="_new">PRIVACY STATEMENT</a>'
- };
- this.createWindow(winObj);
- }
- , createWindow: function(winObj){
- var html = '<style type="text/css">';
- html += '#comcast_content {width: 650px; height:500px; box-shadow: 10px 10px 5px #888; background: #fff; border: 1px solid #454545; position:absolute; top:50px; left:100px; zoom:1; z-index: 9999999; opacity:0.99; filter:alpha(opacity=99);}';
- html += '#comcast_content .header {height: 30px; background-color:rgb(220,220,220); repeat-x;}';
- html += '#comcast_content .a {color: #00a3e0;}';
- html += '#comcast_content .logo {float:left;}';
- html += '#comcast_content .closebn {float:right; text-decoration: none; margin: 9px 10px 0 0; font: 15px/16px bold Arial, Helvetica, sans-serif; color: #2ca4e3;}';
- html += '#comcast_content .content-wrapper {padding-left: 18px; padding-right: 15px; padding-bottom: 12px;}';
- html += '#comcast_content .headerimage { margin-top: 15px;}';
- html += '#comcast_content .header1 {margin: 18px 0 0 0; color: #DD1524; padding: 0; font: 24px/26px bold Arial, Helvetica, sans-serif;}';
- html += '#comcast_content .textcontent {margin: 10px 10px 0 0; color: #303030; word-spacing: 1px; font: 15px/16px Arial, Helvetica, sans-serif; line-height: 1.50;}';
- html += '#comcast_content .acknowledge {padding-top:3px; text-align: center;}';
- html += '#comcast_content .bulletcontent li {list-style-type:disc; list-style-position:outside; color: #303030; padding-left: 0.1em; margin: 10px 10px 10px 10px; font: 14px/15px Arial, Helvetica, sans-serif; line-height:1.50;}';
- html += '#comcast_content .how-do-i {float:left; position:absolute; bottom:20px; left:18px; margin: 12px 0 0 0; font: 13px/14px bold Arial, Helvetica, sans-serif; text-align: bottom;}';
- html += '#comcast_content .comcast-logo {float:right; position:absolute; bottom:5px; right:5px; padding-top:10px; text-align: right;}';
- html += '#comcast_content .privacystatement {float:left; position:absolute; bottom:10px; left:20px; margin: 12px 0 0 0; font: 13px/14px sans-serif; text-align: bottom;}';
- html += '</style>';
- html += '<div class="main-wrapper" id="comcast_content">';
- html += '<div class="header" onmousedown="javascript:_ComcastAlert.dragStart(event,\'comcast_content\')">';
- html += '<img src="' + winObj.image_url + 'xfinity-logo.png" height="30" width="84" alt="Comcast" class="logo" />';
- html += '<a href=\"#\" onClick=\"javascript:_ComcastAlert.close_comcast_alert()\" class="closebn"><b>CLOSE X</b></a>';
- html += '</div>';
- html += '<div class="content-wrapper">';
- html += '<p class="header1">';
- html += winObj.headertext1;
- html += '</p>';
- html += '<p class="textcontent">';
- html += winObj.textline1;
- html += '</p>';
- html += '<p class="textcontent">';
- html += winObj.textline2;
- html += '</p>';
- html += '<p class="textcontent">';
- html += winObj.textline3;
- html += '</p>';
- html += '<ul class="bulletcontent">';
- html += '<li>';
- html += winObj.textline4;
- html += '</li>';
- html += '<li>';
- html += winObj.textline5;
- html += '</li>';
- html += '</ul>';
- html += '<p class="textcontent">';
- html += winObj.textline6;
- html += '</p>';
- html += '<p class="textcontent">';
- html += winObj.textline7;
- html += '</p>';
- html += '<div class="privacystatement">';
- html += winObj.privacystatement;
- html += '</div>';
- html += '<div class="comcast-logo">';
- html += '<img src="' + winObj.image_url + winObj.myDeviceAlertAnalytics + _ComcastAlert.comcastContentnoCache() + '" width="1" height="1">';
- html += '<img src="' + winObj.image_url + 'comcast-logo.png" height="50" width="115" alt="Message by Comcast"/>';
- html += '</div>';
- html += '</div>';
- html += '</div>';
- html += '</div>';
- document.body.innerHTML = document.body.innerHTML + html;
- }
- // Function to Determine browser and version. Copyright 2001 by Mike Hall.
- // See http://www.brainjar.com for terms of use.
- , checkBrowser: function() {
- var ua, s, i;
- var browser = {
- isIE: false
- , isNS: false
- , version: null
- };
- ua = navigator.userAgent;
- s = "MSIE";
- if ((i = ua.indexOf(s)) >= 1) {
- browser.isIE = true; browser.version = parseFloat(ua.substr(i + s.length));
- }
- s = "Netscape6/";
- if ((i = ua.indexOf(s)) >= 0) {
- browser.isNS = true; browser.version = parseFloat(ua.substr(i + s.length));
- }
- s = "Gecko";
- if ((i = ua.indexOf(s)) >= 0) {
- browser.isNS = true; browser.version = 6.1;
- }
- return browser;
- }
- , dragStart: function(event, id) {
- var browser1 = _ComcastAlert.browser;
- var dragObj = _ComcastAlert.dragObj;
- var el;
- var x, y;
- if (id) dragObj.elNode = document.getElementById(id);
- else {
- if (browser1.isIE) dragObj.elNode = window.event.srcElement;
- if (browser1.isNS) dragObj.elNode = event.target;
- if (dragObj.elNode.nodeType == 3) dragObj.elNode = dragObj.elNode.parentNode;
- }
- if (browser1.isIE) {
- x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
- y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
- }
- if (browser1.isNS) {
- x = event.clientX + window.scrollX;
- y = event.clientY + window.scrollY;
- }
- dragObj.cursorStartX = x;
- dragObj.cursorStartY = y;
- dragObj.elStartLeft = parseInt(dragObj.elNode.style.left, 10);
- dragObj.elStartTop = parseInt(dragObj.elNode.style.top, 10);
- if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 100;
- if (isNaN(dragObj.elStartTop)) dragObj.elStartTop = 50;
- if (browser1.isIE) {
- document.attachEvent("onmousemove", _ComcastAlert.dragGo);
- document.attachEvent("onmouseup", _ComcastAlert.dragStop);
- window.event.cancelBubble = true;
- window.event.returnValue = false; }
- if (browser1.isNS) {
- document.addEventListener("mousemove", _ComcastAlert.dragGo, true);
- document.addEventListener("mouseup", _ComcastAlert.dragStop, true);
- event.preventDefault();
- }
- }
- // End Function
- , comcastContentnoCache: function() {
- return Math.round(Math.random() * 103050709);
- }
- , dragGo: function(event) {
- var browser1 = _ComcastAlert.browser;
- var dragObj = _ComcastAlert.dragObj;
- var x, y;
- if (browser1.isIE) {
- x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
- y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
- }
- if (browser1.isNS) {
- x = event.clientX + window.scrollX; y = event.clientY + window.scrollY;
- }
- dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
- dragObj.elNode.style.top = (dragObj.elStartTop + y - dragObj.cursorStartY) + "px";
- if (browser1.isIE) { window.event.cancelBubble = true; window.event.returnValue = false; }
- if (browser1.isNS) event.preventDefault();
- }
- , dragStop: function(event) {
- var browser1 = _ComcastAlert.browser;
- if (browser1.isIE) {
- document.detachEvent("onmousemove", _ComcastAlert.dragGo);
- document.detachEvent("onmouseup", _ComcastAlert.dragStop);
- }
- if (browser1.isNS) {
- document.removeEventListener("mousemove", _ComcastAlert.dragGo, true);
- document.removeEventListener("mouseup", _ComcastAlert.dragStop, true);
- }
- }
- , getXmlhttp: function(){
- var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/
- if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
- try {
- xmlhttp = new XMLHttpRequest();
- } catch (e) {
- xmlhttp=false;
- }
- }
- if (!xmlhttp && window.createRequest) {
- try {
- xmlhttp = window.createRequest();
- } catch (e) {
- xmlhttp=false;
- }
- }
- this.xmlhttp = xmlhttp;
- }
- , checkBulletin: function(){
- if(_ComcastAlert.comcastCheck==0) { return; }
- var xmlhttp = _ComcastAlert.xmlhttp;
- xmlhttp.open("GET", _ComcastAlert.SYS_URL+'?dispatch=checkBulletin',true);
- xmlhttp.onreadystatechange = function() {
- if (xmlhttp.readyState == 4) {
- if(xmlhttp.responseText.indexOf('43a1028c-7d11-11de-b687-1f15c5ad6a13') == -1){
- document.getElementById('comcast_content').style.display="none";
- _ComcastAlert.comcastCheck = 0;
- }
- _ComcastAlert.comcastTimer = setTimeout("_ComcastAlert.checkBulletin()",5000);
- };
- };
- xmlhttp.send(null);
- }
- , sendAck: function(){
- var xmlhttp = _ComcastAlert.xmlhttp;
- xmlhttp.open("GET", _ComcastAlert.SYS_URL+'?dispatch=ackBulletin',true);
- xmlhttp.send(null)
- }
- , close_comcast_alert: function() {
- document.getElementById('comcast_content').style.display = "none";
- _ComcastAlert.sendAck();
- }
- }
- }());
- _ComcastAlert.go();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement