var userLocationCompany; function parseCookie(cookieToParse) { var myCookie = getCookie(cookieToParse); if( myCookie != null) { var contentArray = myCookie.split("|"); var numNodes = contentArray.length; if(numNodes == 6) { document.getElementById('userLocationState').innerHTML = contentArray[3].substring(6); document.getElementById('welcomeBlock').innerHTML = 'Welcome back!'; document.getElementById('locChange').innerHTML = 'Change'; userLocationCompany = contentArray[2].substring(8); } } } function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) { return null; } } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } function runXHR(idToReplace) { var req = null; if (window.XMLHttpRequest) //if client is a gecko or webkit variant { req = new XMLHttpRequest(); if (req.overrideMimeType) { //default mime is text/xml we just want html source req.overrideMimeType('text/html'); } } else if (window.ActiveXObject) // if it's ie figure out if 6 or 7 { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } } } req.onreadystatechange = function() { if(req.readyState == 4) { if(req.status == 200) // only change the default tile if we get the legacy T, S, or B tile back in the repsonse, otherwise leave the default { document.getElementById(idToReplace).innerHTML = req.responseText; } } }; // this code will change to check the value of attPersistantLocalization.company, it will request the correct TS tile based on the cookie contents or leave the default if there is no value if(userLocationCompany == 'att') { req.open("GET", "/accounts/callouts/en_US/fakeSlots/fake2/legacy-att.html", true); req.send(null); } else if(userLocationCompany == 'bellsouth') { req.open("GET", "/accounts/callouts/en_US/fakeSlots/fake2/legacy-bellsouth.html", true); req.send(null); } else if(userLocationCompany == 'sbc') { req.open("GET", "/accounts/callouts/en_US/fakeSlots/fake2/legacy-sbc.html", true); req.send(null); } }