// IMPORTANT - Before launching do a find and replace of img src="' + protocolString + '//www.bellsouth.com/images/
// to img src="' + protocolString + '//www.bellsouth.com/images/

//////////////////////////////////////////////////////////////////////////////////////////////////////
// The header_footer.js script is leveraged by most of the BellSouth.com sites. Because updates are // 
// distributed to a number of third parties outside of the BellSouth network certain parts of this  //
// should be removed before distributing to avoid javascript errors for these groups.               //
// All code snippets that should be removed are notated as 'BellSouth.com exclusive content'        //
//                                                                                                  //
// IMPORTANT: the writeFooter() function contains calls to these BellSouth exclusive functions.     //
// These function calls also need to be removed before distribution.                                //
//////////////////////////////////////////////////////////////////////////////////////////////////////

// creates a variable from the current URL that is leveraged in a number of the functions below.
var currURL = unescape(window.location.href) ;
var currREF = unescape(document.referrer); //Added 12-15-05 

function getProtocol()
{	
	// function for building location dependent URLs 
	var defaultName = "http://";
	
	if(location.protocol)
	{
		return location.protocol;
	}
	else
	{
		return defaultName;
	}
}

var protocolString = getProtocol();


////////////////////////////////////////////////////////////////////////////////////////////////////
// Begin BellSouth.com exclusive content                                                          //
// The following functions create a cookie that is used for tracking reports and to determine     //
// customer type. This code should be removed before distribution to third party vendors outside  //
// of the BellSouth.com network.                                                                  //
////////////////////////////////////////////////////////////////////////////////////////////////////

// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments\cf1

function setCookie(name, value, expires, path, domain, secure)
{
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

 // name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist\cf1
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));
}

//returns a random value from 1 to 10 million
function getRand()
{
var n =10000000; //uper perameter from 0 to 10 mill
var val = Math.round(Math.random() * n);
return val.toString(); 
}

//writes a cookie 
function writeCookie()
{
var delimeter='&'; var yearLen=3;
var cookieName="bs_metriccookie"; var val = "metricValue="+getRand()+delimeter;

var domainValue=document.domain;

if((domainValue=="")||(domainValue==" "))domainValue="bellsouth.com";

var today = new Date(); var expDate = new Date (today.getFullYear()+yearLen,today.getMonth(),today.getDay());
 //expDate is set for 3 years  from whatever date

val+=" expDate="+expDate+delimeter;
if(!getCookie(cookieName))  setCookie(cookieName,val,expDate,"/",domainValue);
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds\cf1
function deleteCookie(name, path, domain)
{
  if (getCookie(name))
  {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

//cookie stuff
var expires = "";
var path ="/";
var domain = "bellsouth.com";
var secure = "";

cookiestuff = ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
	  
var branch_string = "";
function branch_place(branch, url)
{
branch_string = branch_string + "xxx" + branch;
document.cookie = "branch=" + escape(branch_string) + cookiestuff;
window.location = url;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
// End BellSouth.com exclusive content for writing cookies                                          //
//////////////////////////////////////////////////////////////////////////////////////////////////////



//////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////// Begin Global Headers and Footer functions ////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////

// Logic to determine customer type - leveraged in writeGlobalNav()
var custumerTypeID = "null";
var urlMatch= -1;

// These arrays contain the URLs that determine which tab navigation image to display. 
// There is not an array for residential as it is the default in the event that the current URL does not match
// any of the strings in these arrays.
var custID_smlBiz = new Array ('smallbusiness.bellsouth.com','contact.bellsouth.com/smallbusiness','/bapco/','/apps/adsl/','/dsl/BusinessCPE')
var custID_lrgBiz = new Array ('largebusiness.bellsouth.com','bellsouthlargebusiness.com','contact.bellsouth.com/business','interconnection.bellsouth.com/notifications/network/','/apps/bsldto/','/bsldto/')
var custID_aboutUs = new Array ('/employment/','bellsouthcorp.com','/investor/','/community/','corporate_governance','/suppliers/','ethics.bellsouth.com','/federal/','contact.bellsouth.com/sponsor/','contact.bellsouth.com/bipman/','aboutus/index.html')
var custID_none = new Array ('/mastercard','/myAcct')

//initial custerTypeID search - checks for match in URL string for small Business
var arrayLen = custID_smlBiz.length;
for(var i=0; i < arrayLen; i++){
  urlMatch = currURL.indexOf (custID_smlBiz[i]);
  if(urlMatch != -1){
    custumerTypeID = "smallBiz"; 
    break;   
  }  
}
//if a match was not found above check for match in URL string for large business
if(custumerTypeID == "null"){
  //search for match in custID_smlBiz
  var arrayLen = custID_lrgBiz.length;
  for(var i=0; i < arrayLen; i++){
    urlMatch = currURL.indexOf (custID_lrgBiz[i]);
      if(urlMatch != -1){
        custumerTypeID = "lrgBiz"; 
		break;   
      }  
  }
}
//if a match was not found above check for match in URL string for About Us
if(custumerTypeID == "null"){
  //search for match in custID_smlBiz
  var arrayLen = custID_aboutUs.length;
  for(var i=0; i < arrayLen; i++){
    urlMatch = currURL.indexOf (custID_aboutUs[i]);
      if(urlMatch != -1){
        custumerTypeID = "aboutUs"; 
		break;   
      }  
  }
}
if(custumerTypeID == "null"){
  //search for match in custID_none
  var arrayLen = custID_none.length;
  for(var i=0; i < arrayLen; i++){
    urlMatch = currURL.indexOf (custID_none[i]);
      if(urlMatch != -1){
        custumerTypeID = "none"; 
		break;   
      }  
  }
}
// if a match is not found above the script assumes the user is a residential customer

// use this on every page for the nav back
function writeNavBack()
{
	var tStr='<div id="globalNavBack">';
	tStr+='<table cellpadding="0" cellspacing="0" border="0" background=" ' + protocolString + '//www.bellsouth.com/images/navback.jpg">\n';
	tStr+='<tr>\n';
	tStr+='<td><img src="' + protocolString + '//www.bellsouth.com/images/spacer.gif" width="780" height="79" border="0"></td>\n';
	tStr+='</tr>\n';
	tStr+='</table>\n';
	tStr+='</div>';
	document.writeln(tStr);
}

// use this on every page to write the BellSouth Logo 
function writeLogo()
{
	var tStr='<div id="globalLogo">';	
	tStr+='<table cellpadding="0" cellspacing="0" border="0">\n';
	tStr+='<tr>\n';
	tStr+='<td width="35"><img src="/images/spacer.gif" width="35" height="35"></td>\n';
	tStr+='<td width="90"><img src="' + protocolString + '//www.bellsouth.com/global/promos/images/logoday1a.gif" alt="AT&T" border="0" width="90" height="35"></td>\n';
	tStr+='<td width="202"><img src="/images/spacer.gif" width="202" height="35"></td>\n';
	tStr+='</tr>\n';
	tStr+='</table>\n';
	tStr+='</div>';
	document.writeln(tStr);
}

function writeServiceLinks()
{
 var tStr='<div id="globalServiceLinks">';
 tStr+='<table border="0" cellspacing="0" cellpadding="0" align="right">\n';
 tStr+='<tr>\n';
 tStr+='<td nowrap class="whtlink"><a href="http://www.yellowpages.com/" class="whtlink">YELLOWPAGES.COM&trade;</a> | <a href="http://www.bellsouth.com/specialneeds/index.html" class="whtlink">Special Needs</a> | <a href="http://www.bellsouth.com/spanish/index.html" class="whtlink">En Espanol</a> | <a href="http://interconnection.bellsouth.com/" class="whtlink">Wholesale</a> | <a href="http://www.bellsouth.com/employment/car_hom.htm" class="whtlink">Careers</a> | <a href="http://www.bellsouth.com/contactus/index.html" class="whtlink">Contact Us</a></td>\n';
 tStr+='</tr>\n';
 tStr+='</table>\n';
 tStr+='</div>';
 document.writeln(tStr);
}

// use this on pages that need the quick links
function writeGlobalSearch()
{
    var tStr='<div id="globalSearch">';
	tStr+='<table width="261" border="0" cellpadding="0" cellspacing="0">\n';
	tStr+='<form onsubmit="return submitQuestion();" method="POST" action="https://www.bellsouth.com/apps/nlss/index.jsp" name="question_form">\n';
	tStr+='<input type="hidden" name="ui_mode" value="question"><input type="hidden" name="charset" value="UTF-8"><input type="hidden" name="language" value="en-US"><input type="hidden" name="Ask" value="Ask"><input name="qsource" value="gn" type="hidden"><input name="context" value="new" type="hidden">\n';
	tStr+='<tr>\n';
	tStr+='<td align="right"><span class="smallFont"><input name="question_box" type="text" value="enter search criteria here" size="26" maxlength="150" onFocus="clearSearchBox()" class="smallFont"></span></td>\n';
	tStr+='<td width="10">&nbsp;</td>\n';	
	tStr+='<td width="61"><input type="image" title="Click here to search BellSouth" value="ASK" name="ACTION" src="' + protocolString + '//www.bellsouth.com/images/buttons/gh_search.gif" width="61" height="22" alt="search" border="0"></td>\n';
    tStr+='</tr>\n';
	tStr+='</form>\n';
	tStr+='</table>\n';
	tStr+='</div>';
	document.writeln(tStr);
}

function writeGlobalNav()
{	
	if(custumerTypeID == "smallBiz"){
      var tStr='<div id="globalTabSmallBusiness">';
      tStr+='<img src="' + protocolString + '//www.bellsouth.com/images/buttons/gh_nav_small_business.gif" width="505" height="24" border="0" usemap="#cust_smallbiz">\n';
      tStr+='<map name="cust_smallbiz">';
	  tStr+='<area shape="poly" coords="5,20,16,8,86,9,96,16,87,20" href="javascript: branch_place(&#39;residential&#39;, &#39;http://www.bellsouth.com/index.html&#39;)" alt="Residential">';
	  tStr+='<area shape="poly" coords="92,21,108,2,294,2,312,21" href="javascript: branch_place(&#39;smallbiz&#39;, &#39;http://smallbusiness.bellsouth.com/&#39;)" alt="Small Business">';
	  tStr+='<area shape="poly" coords="424,21,410,7,316,8,309,16,316,21" href="javascript: branch_place(&#39;largebiz&#39;, &#39;http://www.att.com/gen/landing-pages?pid=9214&#39;)" alt="Enterprise">';
	  tStr+='<area shape="poly" coords="428,21,418,16,426,9,487,8,500,22" href="javascript: branch_place(&#39;aboutus&#39;, &#39;http://www.bellsouth.com/aboutus/index.html&#39;)" alt="About Us">';
	  tStr+='</map>';
	  tStr+='</div>';
	  document.writeln(tStr);
    }
	else if(custumerTypeID == "lrgBiz"){
      var tStr='<div id="globalTabLargeBusiness">';
      tStr+='<img src="' + protocolString + '//www.bellsouth.com/images/buttons/gh_nav_lrg_business.gif" width="506" height="24" border="0" usemap="#cust_lrgbiz">\n';
      tStr+='<map name="cust_lrgbiz">';
	  tStr+='<area shape="poly" coords="99,22,2,21,17,8,87,8" href="javascript: branch_place(&#39;residential&#39;, &#39;http://www.bellsouth.com/index.html&#39;)" alt="Residential">';
	  tStr+='<area shape="poly" coords="101,22,94,15,102,9,198,8,211,17,202,22" href="javascript: branch_place(&#39;smallbiz&#39;, &#39;http://smallbusiness.bellsouth.com/&#39;)" alt="Small Business">';
	  tStr+='<area shape="poly" coords="423,23,404,2,222,3,203,22" href="javascript: branch_place(&#39;largebiz&#39;, &#39;http://www.att.com/gen/landing-pages?pid=9214&#39;)" alt="Enterprise">';
	  tStr+='<area shape="poly" coords="426,23,419,17,429,8,491,9,502,22" href="javascript: branch_place(&#39;aboutus&#39;, &#39;http://www.bellsouth.com/aboutus/index.html&#39;)" alt="About Us">';
	  tStr+='</map>';
	  tStr+='</div>';
	  document.writeln(tStr);
	}
	else if(custumerTypeID == "aboutUs"){
      var tStr='<div id="globalTabAboutUs">';
      tStr+='<img src="' + protocolString + '//www.bellsouth.com/images/buttons/gh_nav_about_us.gif" width="478" height="24" border="0" usemap="#cust_aboutus">\n';
      tStr+='<map name="cust_aboutus">';
	  tStr+='<area shape="poly" coords="101,22,88,9,17,8,2,21" href="javascript: branch_place(&#39;residential&#39;, &#39;http://www.bellsouth.com/index.html&#39;)" alt="Residential">';
	  tStr+='<area shape="poly" coords="214,26,200,8,102,9,95,16,106,24" href="javascript: branch_place(&#39;smallbiz&#39;, &#39;http://smallbusiness.bellsouth.com/&#39;)" alt="Small Business">';
	  tStr+='<area shape="poly" coords="311,22,318,15,310,8,212,9,208,16,212,22" href="javascript: branch_place(&#39;largebiz&#39;, &#39;http://www.att.com/gen/landing-pages?pid=9214&#39;)" alt="Enterprise">';
	  tStr+='<area shape="poly" coords="314,21,335,-1,454,1,476,22" href="javascript: branch_place(&#39;aboutus&#39;, &#39;http://www.bellsouth.com/aboutus/index.html&#39;)" alt="About Us">';
	  tStr+='</map>';
	  tStr+='</div>';
	  document.writeln(tStr);
	}
	else if(custumerTypeID == "none"){
      var tStr='<div id="globalTabAboutUs">';
      tStr+='<img src="' + protocolString + '//www.bellsouth.com/images/buttons/gh_nav_null.gif" width="478" height="24" border="0" usemap="#cust_none">\n';
      tStr+='<map name="cust_none">';
	  tStr+='<area shape="poly" coords="5,20,16,8,86,9,96,16,87,20" href="javascript: branch_place(&#39;residential&#39;, &#39;http://www.bellsouth.com/index.html&#39;)" alt="Residential">';
	  tStr+='<area shape="poly" coords="101,22,94,15,102,9,198,8,211,17,202,22" href="javascript: branch_place(&#39;smallbiz&#39;, &#39;http://smallbusiness.bellsouth.com/&#39;)" alt="Small Business">';
	  tStr+='<area shape="poly" coords="311,22,318,15,310,8,212,9,208,16,212,22" href="javascript: branch_place(&#39;largebiz&#39;, &#39;http://www.att.com/gen/landing-pages?pid=9214&#39;)" alt="Enterprise">';
	  tStr+='<area shape="poly" coords="314,24,320,15,327,8,389,8,402,24" href="javascript: branch_place(&#39;aboutus&#39;, &#39;http://www.bellsouth.com/aboutus/index.html&#39;)" alt="About Us">';
	  tStr+='</map>';
	  tStr+='</div>';
	  document.writeln(tStr);
	}
	else{ //if residential or no customerTypeID is defined
      var tStr='<div id="globalTabResidential">';
      tStr+='<img src="' + protocolString + '//www.bellsouth.com/images/buttons/gh_nav_residential.gif" width="488" height="24" border="0" usemap="#cust_res">\n';
      tStr+='<map name="cust_res" id="cust_res">';
	  tStr+='<area shape="poly" coords="186,24,3,23,23,2,164,2" href="javascript: branch_place(&#39;residential&#39;, &#39;http://www.bellsouth.com/index.html&#39;)" alt="Residential">';
	  tStr+='<area shape="poly" coords="296,22,187,23,181,15,189,8,282,9" href="javascript: branch_place(&#39;smallbiz&#39;, &#39;http://smallbusiness.bellsouth.com/&#39;)" alt="Small Business">';
	  tStr+='<area shape="poly" coords="408,23,294,22,292,15,303,8,393,8" href="javascript: branch_place(&#39;largebiz&#39;, &#39;http://www.att.com/gen/landing-pages?pid=9214&#39;)" alt="Enterprise">';
	  tStr+='<area shape="poly" coords="407,21,402,15,409,9,471,8,484,22" href="javascript: branch_place(&#39;aboutus&#39;, &#39;http://www.bellsouth.com/aboutus/index.html&#39;)" alt="About Us">';
	  tStr+='</map>';
	  tStr+='</div>';
	  document.writeln(tStr);
	}
}

// Global variables for global header variations
var adShowTabsShowSearch = 0;
var adHideTabsHideSearch = 1;
var adShowTabsHideSearch = 2;
var adHideTabsShowSearch = 3;


//main function to write bellsouth.com header
function writeCompleteHeader(globalNav,languageFlag) {

    var languageVar = languageFlag;
	
	if(globalNav == adHideTabsHideSearch || globalNav == adHideTabsShowSearch){
	   var hasNav = "false";	   
	}else{
	   var hasNav = "true";
	}
	
	if(globalNav == adHideTabsHideSearch || globalNav == adShowTabsHideSearch){
	   var hasSearch = "false";	   
	}else{
	   var hasSearch = "true";
	}
	
	// don't show the search on the following directories because of javascript conflicts
	if(currURL.indexOf("/apps/ebppwe/paymentflows/PaymentArrangements/") != -1 || currURL.indexOf("/apps/nlss") != -1)
	{ 
	   var hasSearch = "false";
	}
	
	//currently written in all cases regardless of passed arguments - writes background and logo
	writeNavBack();
	writeLogo();
		
		
	//currently the default header for spanish is: no tabs, no service links and no search
	if(languageVar == "spanish"){ 
	   if(hasNav == "true"){ //placeholder for future dev
	   
	   }else{

	   }
	}else{
	   if(hasNav == "true"){ //if hasNav is true write tabs and servicelinks
	      writeServiceLinks();
	      writeGlobalNav(languageVar);
		  if(hasSearch == "true"){ //if hasSearch is true write search
		    writeGlobalSearch();
		  }	      	   
	   }else{ //if not DHTML write only back to bellsouth portion
		  if(hasSearch == "true"){
		    writeGlobalSearch();
		  }	   
	   }	
	}	
}

//Begin functions for Global Navigation Search
function submitQuestion(){
  var searchVal = document.question_form.question_box.value;
  if(isEmpty(searchVal) || searchVal == "enter search criteria here"){
	document.question_form.question_box.value = "Search Tips";
	document.question_form.submit();
	return false;
  }else{
	document.question_form.submit();
	return false;				
  }			
}
		
function isEmpty(str){
  if (str == null){
	return false;
  }
  for (var intLoop = 0; intLoop < str.length; intLoop++){
	if (" " != str.charAt(intLoop)){
	  return false;		    
	}
  }
  return true;
}

// Clears initial value from search box onFocus
function clearSearchBox(){
  var searchVal = document.question_form.question_box.value;
  if(searchVal == "enter search criteria here"){
	document.question_form.question_box.value = "";
  }
}
//End functions for Global Navigation Search

// This function writes the legal footer, logic determines the content layer
function writeFooter(languageVar)
{
    var language = languageVar;
	var tStr="";
	var catchLayer;
	var ie_ver = 0;
	
	////////////////////////////////////////////////////////////////////////////////////////
    // begin BellSouth.com exclusive content                                              //
    // This portion of code should be removed before distribution to third party vendors  //

////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// begin BellSouth.com exclusive content//////////////////////////
///This portion of code should be removed before distribution to third party vendors///
    
//Added 02-07-06 by Ernest Fretwell
//Updated 04-04-06 with HBX calls
//Call Tracking codes
function TrackingCall()
{

////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////// Begin Websidestory tracking code ///////////////////////////////////////
///////////////////////////Added 04-04-06 by Ernest Fretwell////////////////////////////////////////

//REQUIRED SECTION. 



////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////// End Websidestory tracking code /////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
}
//End Tracking Code

	//Added TrackingCall() on 02-07-06 by Ernest Fretwell
	TrackingCall(); //Calls the tracking codes scripts
	writeCookie(); //writes a persistent cookie for tracking reports and customer type
	custSat(); //fires additional customer satisfaction survey popups
	
	// end BellSouth.com exclusive content                                                //
	////////////////////////////////////////////////////////////////////////////////////////
	
	//checking ie for [real] browser version
	if (is_ie ) {
		var split_agt = agt.split('msie');
		ie_ver = parseInt(split_agt[1]);
	}

	//if (!(is_nav && (is_minor >= 4.7) || (is_ie && (ie_ver >= 5.0)))) {
	if (!(is_nav && (is_major >= 5) || (is_ie && (ie_ver >= 5.0)))) {
		tStr += '<p align="center" class="grey">This site is optimized for '
		tStr += '<a href="http://www.microsoft.com/windows/ie/default.asp" class="bread" target="_blank">Microsoft<sup class="bread">&reg;</sup> Internet Explorer</a>'
		tStr += ' versions 5.5 or higher ';
		tStr += 'and <a href="http://www.netscape.com" class="bread" target="_blank">Netscape Communicator</a> versions 6.2 or higher.'
	}

	if(language == "spanish"){ //spanish language variable
	  tStr+='<p align="center" class="grey">Derechos de autor 1995 - 2009 BellSouth Corp.  Derechos reservados<br>\n';
	  tStr+=' <a href="http://www.bellsouth.com/spanish/legal.html" class="bread">Notificaciones legales</a> y <a href="http://www.bellsouth.com/spanish/privacydoc.html" class="bread">Normas de privacidad</a>\n';	
	}else{
	  tStr+='<p align="center" class="grey">&copy;2009 AT&T Intellectual Property.<br />All rights reserved. AT&T, AT&T logo and all other marks contained herein<br />are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies.<br />\n';
	  tStr+=' <a href="http://www.bellsouth.com/legal.html?ft=legal" class="bread" target="_blank">Legal Notices</a> | <a href="http://www.att.com/gen/privacy-policy?pid=2587" class="bread" target="_blank">Privacy Policy</a> | <a href="http://www.att.jobs" class="bread" name="&lid=Careers+Link&lpos=Homepage+Footer+Links">Careers</a>';
	}
	tStr+='</p>\n';
	tStr+='<br>\n';

	if (is_nav4)  //
	{
		for (eachLayer in document.layers) {
		  if ((eachLayer.indexOf('content') != -1) || (eachLayer.indexOf('legal') != -1)) catchLayer = eachLayer;
		}
		eval('document.' + catchLayer + '.document.writeln(tStr);');
	}
	else // ie or ns6
	{
		document.writeln(tStr);
	}
}

// This function writes the header for BellSouth popup windows
function writePopupHeader()
{
	var tStr='<div id="popupHeader">';
	tStr+='<table cellpadding="0" cellspacing="0" border="0" width="205" height="50">\n';
	tStr+='<tr>\n';
	tStr+='<td width="5">&nbsp;</td>\n';
	tStr+='<td><img src="' + protocolString + '//www.bellsouth.com/images/bellsouth_logo.gif" height="23" width="184" alt="BellSouth"></td>\n';
	tStr+='</tr>\n';
	tStr+='</table>\n';
	tStr+='</div>';
	document.writeln(tStr);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////// End Global Headers and Footer functions ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
// Begin BellSouth.com exclusive content                                                          //
// This portion of code should be removed before distribution to third party vendors              //
////////////////////////////////////////////////////////////////////////////////////////////////////

function custSat(){
//custSat fire a popup survey hosted by customersat.com. Most high traffic surveys are designed to pop every 100 visits
//Testing is virtually impossible in these cases and custunersat must be relied on to confirm functionality by received surveys   
	//eRepair survey
	if(currURL.indexOf("/emrs/jsp/RepairContactUsForm") == -1 && currURL.indexOf("/emrs/jsp/RepairContactUs") != -1){
	LaunchErepairCustSat();  }
	
	//payment confirmation survey
	if(currURL.indexOf('/PaymentArrangements/ScheduleController.jpf') != -1){
	LaunchPaymentConfCustSat();  }     
	
	if(currURL.indexOf('/PaymentArrangements/authAction.do') != -1){
	LaunchPaymentArrCustSat();  }  
	
	//order abort - rip and read orders
	if(currURL.indexOf('rr=cancel') != -1){
	LaunchRNRAbortCustSat();
	  }
	  
	// order complete - rip and read orders (C/N order)
	if(currURL.indexOf('rr=complete') != -1){
	LaunchRNRCompleteCustSat();
	  }
	
	//order abort - flow through orders (C/N order)
	//these surveys are based off the referrer
	if (currREF.length > 0)
	{
		// was client in ordering?
		if (currREF.indexOf('/apps/cnorder/') != -1 || currREF.indexOf('www.bellsouth.com/apps/corder') != -1)
		//is client now out of ordering?
		if (currURL.indexOf('/apps/cnorder/') == -1 && currURL.indexOf('/apps/corder') == -1 && currURL.indexOf('/apps/rnr/ordering/') == -1)
		//did customer not complete ordering?
		if ( currREF.indexOf('/COrderReqDispatcher/submitOrderEvent') == -1 || currREF.indexOf('/NOrderReqDispatcher/OrderSubmitEvent') == -1)
		LaunchFlowAbortCustSat();
	}
	
	//order complete - flow through orders (C/N order)
	if(currURL.indexOf('/COrderReqDispatcher/submitOrderEvent') != -1 && pageID == "corderConfirmation"){
	LaunchFlowCompleteCustSat();
	}
	
	// Spanish Repair wr6252 bh 6/19/06
	if(currURL.indexOf('/spanishrepair/thankyou.asp') != -1){
		LaunchSpanishRepairCustSat();
	}
	//end wr6252
	
	
}
//end custSat

//**Functions for Above Survey Fires**//

// Spanish Repair wr6252 bh 6/19/06
function LaunchSpanishRepairCustSat(){
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="' + protocolString + '//www.customersat3.com');
	document.write('/csc/si_bs.asp?si=36w430qvdQo%3D"></SCR' + 'IPT>');
}
//end wr6252



//order abort - rip and read orders
function LaunchRNRAbortCustSat(){
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="' + protocolString + '//www.customersat3.com');
	document.write('/csc/si_bs.asp?si=R79IBmBVYzE%3D"></SCR' + 'IPT>');
}
//order complete - rip and read orders
function LaunchRNRCompleteCustSat(){
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="' + protocolString + '//www.customersat3.com');
	document.write('/csc/si_bs.asp?si=bzCmSusN6pg%3D"></SCR' + 'IPT>');
}
//order abort - flow through orders
function LaunchFlowAbortCustSat(){
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="' + protocolString + '//www.customersat3.com');
	document.write('/csc/si_bs.asp?si=pp1x0uOOCro%3D"></SCR' + 'IPT>');
}
//order complete - flow through orders
function LaunchFlowCompleteCustSat(){
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="' + protocolString + '//www.customersat3.com');
	document.write('/csc/si_bs.asp?si=TBO%2FX5bx1gk%3D"></SCR' + 'IPT>');
}

function LaunchErepairCustSat(){
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="' + protocolString + '//www.customersat3.com');
	document.write('/si.asp?si=Sxv8tIfti%2BE%3D"></SCR' + 'IPT>');
}

function LaunchPaymentHistCustSat(){
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="' + protocolString + '//www.customersat3.com');
	document.write('/s/JEsEJqiP.asp?IID=JeOVretOPeOVEqiP&si=JEsEJqiP"></SCR' + 'IPT>');
}

//AH. this should not be the same URL as launch payment arrangement, correct?
function LaunchPaymentConfCustSat(){
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="https://www.customersat3.com');
	document.write('/csc/si_mod.asp?si=nsyDvuCRWnw%3D&sid=8"></SCR' + 'IPT>');
}

function LaunchPaymentArrCustSat(){
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="https://www.customersat3.com');
	document.write('/csc/si_mod.asp?si=nsyDvuCRWnw%3D&sid=8"></SCR' + 'IPT>');
}
//**END Functions for Above Survey Fires**//

// params: l = document.location.href, r = document.referrer
//writeCustSat_call fire a popup survey hosted by customersat.com. Most high traffic surveys are designed to pop every 100 visits
//Testing is virtually impossible in these cases and custunersat must be relied on to confirm functionality by received surveys 
function writeCustSat_call(l,r)
{
var cust_sat_survey_id = 0;  // the survey ID that will be passed to CustomerSat
var cust_sat_count = 7;	// the number of available surveys
  
	if (l.indexOf('/cpr') == -1 && l.indexOf('/ipc') == -1) { // do not pop any survey if hitting cpr or ipc. These are intermediary pages

		//ebpp surveys
		// one-time echeck complete
		if (l.indexOf('/resonetimeecheckterms?cmt_bank_tran_time') != -1) cust_sat_survey_id=2;
		// one-time echeck abort
		if (l.indexOf('/resonetimeecheckdecline?busUnit=CSR') != -1) cust_sat_survey_id=3
		// one-time cc complete
		if (l.indexOf('/resonetimeccsubmitpayment?busUnit=CSR') != -1) cust_sat_survey_id=4;
		// de-enroll in echeck
		if (l.indexOf('/recurringecheckdeenrollsubmit') != -1) cust_sat_survey_id=5;
		
		//ebill enroll
		if (l.indexOf('/executebillsuppression?busUnit=CSR&executeAction=A') != -1) cust_sat_survey_id=6;
		//ebill de-enroll
		if (l.indexOf('/executebillsuppression?busUnit=CSR&executeAction=D') != -1) cust_sat_survey_id=7;
		
		//completed cOrder
		// 12-15-05 if (l.indexOf('/COrderReqDispatcher/submitOrderEvent') != -1 && pageID == "corderConfirmation") cust_sat_survey_id=102;

		//completed nOrder
		// 12-15-05 if (l.indexOf('/NOrderReqDispatcher/OrderSubmitEvent') != -1) cust_sat_survey_id=102;

		//order abort - rip and read orders
		// 12-15-05 if (l.indexOf('rr=cancel') != -1) cust_sat_survey_id = 106;
		
		// order complete - rip and read orders
		// 12-15-05 if (l.indexOf('rr=complete') != -1) cust_sat_survey_id = 105;
		
		// these surveys are based off the referrer
		if (r.length > 0) {
			// view bill
			if (r.indexOf('ebppwe/billingflows/presentation/DisplayBillSummary.do') != -1) cust_sat_survey_id = 1;

			// one-time echeck abort
			if (r.indexOf('resonetimeechecksubmitpayment') != -1 && l.indexOf('/apps/ebpp/') == -1) cust_sat_survey_id=3;

			//product instructions		
			//if (r.indexOf('userEvent=displayUsageInstructionEvent') != -1 && l.indexOf('userEvent=displayUsageInstructionEvent') == -1) cust_sat_survey_id=101;

			//order abort - c/n order
			// 12-15-05 if (r.indexOf('/apps/cnorder/') != -1 || r.indexOf('www.bellsouth.com/apps/corder') != -1) // was client in ordering?
				// 12-15-05 if (l.indexOf('/apps/cnorder/') == -1 && l.indexOf('/apps/corder') == -1 && l.indexOf('/apps/rnr/ordering/') == -1)  //is client now out of ordering?
					// 12-15-05 if ( r.indexOf('/COrderReqDispatcher/submitOrderEvent') == -1 || r.indexOf('/NOrderReqDispatcher/OrderSubmitEvent') == -1) 	// did customer not complete ordering?
						// 12-15-05 cust_sat_survey_id=103;
		} 

	}
//Test code with this
//customer_sat_survey_id=101

	// pop surveys for ordering surveys (less traffic)
	if (cust_sat_survey_id>100 && cust_sat_survey_id<=100+cust_sat_count) {
		document.write ('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="https://www.customersat3.com/csc');
		document.write ('/si_mod.asp?si=BtClyyjFi7Q%3D&sid=' + (cust_sat_survey_id - 100) + '"></SCR' + 'IPT>');
	}
 
	//pop surveys for non-ordering surveys (high traffic)
	else if (cust_sat_survey_id>0 && cust_sat_survey_id<=cust_sat_count) {
  	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="https://www.customersat3.com/csc');
	document.write('/si_mod.asp?si=nsyDvuCRWnw%3D&sid=' + cust_sat_survey_id + '"></SCR' + 'IPT>');
  }
  
 return true;
}

writeCustSat_call(document.location.href, document.referrer);

////////////////////////////////////////////////////////////////////////////////////////////////////
// End BellSouth.com exclusive content                                                            //
////////////////////////////////////////////////////////////////////////////////////////////////////