///--------------------------
///----------Search----------
///--------------------------
function ExecuteSearch()
{
	var sGlobalSearch = document.getElementById('GlobalSearch').value;
	
	if((sGlobalSearch != sDefaultSearchText)&&(sGlobalSearch != '')){	
	  var f = document.forms[0];
	  f.action='http://' + document.location.host + '/search/text?searchtext=' + escape(document.getElementById('GlobalSearch').value);
	  f.submit();
	} else {
	  alert('Please provide search criteria.');
	}
}

function SearchFieldMouseDown(){
  var sGlobalSearch = document.getElementById('GlobalSearch').value;
  if(sGlobalSearch == sDefaultSearchText){
    document.getElementById('GlobalSearch').value = '';
  }
}

function SearchFieldBlur(){
  var sGlobalSearch = document.getElementById('GlobalSearch').value;
  if(sGlobalSearch == ''){
    document.getElementById('GlobalSearch').value = sDefaultSearchText;
  } 
}


///---------------------------
///----------Utility----------
///---------------------------

/// <summary>
/// Request Object for accessing Querystring and Cookie values
/// </summary>
/// <example>Request.QueryString["mykey"], Request.Cookies["mykey"]</example>
/// <author>Jason Throm</author>
var Request = {
    Querystring: new function(){
        var Q=window.location.search.replace('?','');
        var KVP=[];
        var QSA=[];
        if(Q){
            for(i=0;i<Q.split("&").length;i++)
                KVP[i]=Q.split("&")[i];
            for(i=0;i<KVP.length;i++)     
                QSA[KVP[i].split("=")[0]]=KVP[i].split("=")[1];
        }
        return QSA;
    },
    Cookies: new function(){
        var RQ = document.cookie.split('; ');
        var CA=[];
        if(RQ){
            for(i=0;i<RQ.length;i++)     
                CA[RQ[i].split("=")[0]]=RQ[i].split("=")[1];
        }
        return CA;
    }
};

/// <summary>
/// Key Character groups
/// </summary>
var keyCodes = {
	numeric: [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105],
	controls: [8, 9, 13, 16, 17, 18, 20, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 91, 92, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 144, 145],
	chars: [59, 61, 106, 107, 109, 110, 111, 186, 187, 188, 189, 190, 191, 192, 219, 220, 221, 222 ],
	alpha: [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90]
};

///--------------------------------
///----------Localization----------
///--------------------------------

var LocalizeObj = Class.create();
LocalizeObj.prototype = {
	initialize: function(obj){
		//inptEls, btnEl, imgObj, referrer, url
		this.obj = obj;
		this.inptEls = obj.inptEls;
		this.btnEl = obj.btnEl;
		this.imgObj = obj.imgObj;
		this.referrer = (obj.referrer!="") ? obj.referrer : location.href;
		this.url = obj.url;
		this.inputs = new Array();
		this.buttons = new Array();
		this.applyBehaviors();
	},
	
	applyBehaviors: function(){
		
		this.inptEls.each(function(el){
			this.inputs.push(new Input(el, this));
		}.bind(this));
	
		this.buttons.push(new Button(this.btnEl, this));

	}	
};

var Input = Class.create();
Input.prototype = {
	initialize: function(e, core){
		this.e = e;
		this.core = core;
		this.defaultValue = e.value;
		this.isValid = this.validateInput();
		this.attachBehaviors();
	},
	
	attachBehaviors: function(){
		Event.observe(this.e, 'focus', this.focus.bindAsEventListener(this));
		Event.observe(this.e, 'blur', this.blur.bindAsEventListener(this));
		Event.observe(this.e, 'keydown', this.keyDown.bindAsEventListener(this));
		Event.observe(this.e, 'keyup', this.keyUp.bindAsEventListener(this));
	},
	
	focus: function(){
		this.isValid = this.validateInput();
		this.e.value = (!this.validateInput()) ? "" : this.e.value;
	},
	
	blur: function(){
		this.isValid = this.validateInput();
		this.e.value = (!this.validateInput()) ? this.defaultValue : this.e.value;
	},

	keyDown: function(event){
		var charCode = (event.which) ? event.which : event.keyCode;
		if (keyCodes.chars.indexOf(charCode)!=-1 || keyCodes.alpha.indexOf(charCode)!=-1){
			Event.stop(event);
		}
	},
	
	keyUp: function(event){
		var charCode = (event.which) ? event.which : event.keyCode;
		this.isValid = this.validateInput();
		
		if(this.core.buttons[0].validateInputs() && charCode==13)
			this.core.buttons[0].submit();
		
		if(keyCodes.numeric.indexOf(charCode)!=-1 && this.e.value.length==this.e.getAttribute('maxlength') )
			this.moveToNextField();
		
	},	

	moveToNextField: function(){
		if(this.core.inputs[this.core.inputs.length-1].e.id != this.e.id)
			this.e.next('input').focus();
	},
	
	validateInput: function(){
		return (this.e.value.length==this.e.getAttribute("maxlength") && this.isNumeric(this.e.value)) ? true : false;
	},
	
	isNumeric: function(val) {
		var pattern = new RegExp(/\d+/);
		return pattern.test(val);
	}
};


var Button = Class.create();
Button.prototype = {
	initialize: function(e, core){
		this.e = e;
		this.core = core;
		this.events = {
			click: this.submit.bindAsEventListener(this),
			keydown: this.submit.bindAsEventListener(this)
		}
		this.isEnabled = this.validateInputs();
	},
	
	validateInputs: function(){
		var bool=true;
		this.core.inputs.each(function(input){
			bool = (!input.isValid || !bool) ? false : true;
		});
		
		this.enable(bool);			
		return bool;
	},
	
	enable: function(bool){
		if(bool){
			this.e.src = this.core.imgObj.enabled.src;
			this.e.alt = this.core.imgObj.enabled.alt;
			this.e.style.cursor = 'pointer';
			this.addObservers();
		}else{
			this.e.src = this.core.imgObj.disabled.src;
			this.e.alt = this.core.imgObj.disabled.alt;
			this.e.style.cursor = '';
			this.removeObservers();
			
		}
	},
	
	addObservers: function() {
		Event.observe(this.e, 'click', this.events.click);
		Event.observe(this.e, 'keydown', this.events.keydown);
	},

	removeObservers: function() {
		Event.stopObserving(this.e, 'click', this.events.click);
		Event.stopObserving(this.e, 'keydown', this.events.keydown);
	},
	
	submit: function(){
		var value='';
		this.core.inputs.each(function(input){
			value+=input.e.value;
		}.bind(this));
		
		this.url = this.core.url.evaluate({
			referrer: this.core.referrer, 
			value: value 
		});
		window.location = this.url;
	}

};

//////////////////////////////////////////////////////////
//      Format and Launch Article Links                 //
//////////////////////////////////////////////////////////
function launchArticle(id)
{
	//alert(id);
	window.location = 'http://' + document.location.host + '/article?id=' + id;
}
	
function FormatInContentLinks(containinerName,functionName)
{
    var cells = containinerName.getElementsByTagName("a"); 
	var PageBase = window.location.href.slice(0,window.location.href.lastIndexOf("/")) + "/";
	//var DomainBase = window.location.protocol + "//" + window.location.host + "/";
	var DomainBase = "http://" + window.location.host + "/";
	
	//document.writeln("PageBase: " + PageBase + "<br>");
	//document.writeln("DomainBase: " + DomainBase + "<br>");
	
	var replacement = "javascript:" + functionName + "('";
	
    for (var i = 0; i < cells.length; i++) 
    { 
        var linkTo = cells[i].getAttribute("href"); 
		
		//alert(linkTo);
		
		if(linkTo != null)
		{		
			//document.write("<strong>Orig:</strong> " + linkTo + "<br>");
	
	        // Stub out the jsfunction call 
	        
	        // Replace "./"
	        linkTo = linkTo.replace(DomainBase + "./", replacement);
	        linkTo = linkTo.replace(PageBase + "./", replacement);
			linkTo = linkTo.replace("./", replacement);
			
			// Replace "../"
	        linkTo = linkTo.replace(DomainBase + "../", replacement);
	        linkTo = linkTo.replace(PageBase + "../", replacement);
			linkTo = linkTo.replace("../", replacement);
	        
	        // Replace "/SBR_template.cfm?DocNumber= ("/SBR_template.cfm?DocNumber=PL12_0100.htm")
	        linkTo = linkTo.replace(DomainBase + "/SBR_template.cfm?DocNumber=", replacement);
	        linkTo = linkTo.replace(PageBase + "SBR_template.cfm?DocNumber=", replacement);
			linkTo = linkTo.replace("/SBR_template.cfm?DocNumber=", replacement);
			linkTo = linkTo.replace("SBR_template.cfm?DocNumber=", replacement);
			
			// Replace "/SBR_template.cfm?docNumber= ("/SBR_template.cfm?docNumber=PL01_0300.htm")
	        linkTo = linkTo.replace(DomainBase + "/SBR_template.cfm?docNumber=", replacement);
	        linkTo = linkTo.replace(PageBase + "SBR_template.cfm?docNumber=", replacement);
			linkTo = linkTo.replace("/SBR_template.cfm?docNumber=", replacement);
			linkTo = linkTo.replace("SBR_template.cfm?docNumber=", replacement);
			
			// Replace "/SBR_template.cfm?docNumber= ("/sbr_template.cfm?docnumber=pl12_1500.htm")
	        linkTo = linkTo.replace(DomainBase + "/sbr_template.cfm?docnumber=", replacement);
	        linkTo = linkTo.replace(PageBase + "sbr_template.cfm?docnumber=", replacement);
			linkTo = linkTo.replace("/sbr_template.cfm?docnumber=", replacement);
			linkTo = linkTo.replace("sbr_template.cfm?docnumber=", replacement);
	
	        // Replace "/SBR_template.cfm?Document=tools.cfm&tools=/ ("SBR_template.cfm?Document=tools.cfm&amp;tools=/fambud_m.htm")
	        linkTo = linkTo.replace(DomainBase + "/SBR_template.cfm?Document=tools.cfm&tools=/", replacement);
	        linkTo = linkTo.replace(PageBase + "SBR_template.cfm?Document=tools.cfm&tools=/", replacement);
			linkTo = linkTo.replace("SBR_template.cfm?Document=tools.cfm&tools=/", replacement);
	
	        // Replace "/SBR_template.cfm?Document=tools.cfm&tools=
	        linkTo = linkTo.replace(DomainBase + "/SBR_template.cfm?Document=tools.cfm&tools=", replacement);
	        linkTo = linkTo.replace(PageBase + "SBR_template.cfm?Document=tools.cfm&tools=", replacement);
			linkTo = linkTo.replace("SBR_template.cfm?Document=tools.cfm&tools=", replacement);
				
	        // Replace "/SBR_template.cfm?Document=tools.cfm&tool=
	        linkTo = linkTo.replace(DomainBase + "/SBR_template.cfm?Document=tools.cfm&tool=", replacement);
	        linkTo = linkTo.replace(PageBase + "SBR_template.cfm?Document=tools.cfm&tool=", replacement);
			linkTo = linkTo.replace("SBR_template.cfm?Document=tools.cfm&tool=", replacement);
	
	        // Replace "/SBR_template.cfm?Document=pops.cfm&pops=/
	        linkTo = linkTo.replace(DomainBase + "/SBR_template.cfm?Document=pops.cfm&pops=/", replacement);
	        linkTo = linkTo.replace(PageBase + "SBR_template.cfm?Document=pops.cfm&pops=/", replacement);
			linkTo = linkTo.replace("SBR_template.cfm?Document=pops.cfm&pops=/", replacement);
	
	        // Replace "/SBR_template.cfm?Document=pops.cfm&pops=  ("SBR_template.cfm?Document=pops.cfm&amp;pops=P98_02_5531_01.htm")
	        linkTo = linkTo.replace(DomainBase + "/SBR_template.cfm?Document=pops.cfm&pops=", replacement);
	        linkTo = linkTo.replace(PageBase + "SBR_template.cfm?Document=pops.cfm&pops=", replacement);
			linkTo = linkTo.replace("SBR_template.cfm?Document=pops.cfm&pops=", replacement);
			
			// Replace "/popup.cfm with http://www.bizeyeview.att.com/popup.cfm
	        linkTo = linkTo.replace(DomainBase + "/popup.cfm", "http://www.bizeyeview.att.com/popup.cfm");
	        linkTo = linkTo.replace(PageBase + "popup.cfm", "http://www.bizeyeview.att.com/popup.cfm");
			linkTo = linkTo.replace("popup.cfm", "http://www.bizeyeview.att.com/popup.cfm");
			
			/*********************************************************
			    TODO - Make these work
                "SBR_template.cfm?Document=industrycustomerservice.cfm"
                "SBR_template.cfm?document=sherman.cfm&amp;amp;article=sherman_2006_Aug2.htm"
                "SBR_template.cfm?document=steve.cfm&amp;article=2007Jan08"
                "Links.cfm?linkid=10048"

			*********************************************************/
			
			//alert(linkTo);
			//document.write("<strong>New:</strong> " + linkTo + "<br>");
	
			// Finish function call
			if(linkTo.indexOf(replacement) >= 0)
			{
				linkTo = linkTo.replace(".htm", "") + "');";
	        }
	        
	        // Set to new value;
		    cells[i].setAttribute("href", linkTo ); 
		}  
	}
}

function UpdateAuthor(c)
{
    if($(c))
    {
        var tmpTxt = $(c).innerHTML;
        if(tmpTxt.toLowerCase().indexOf("by ") == 0)
            tmpTxt = tmpTxt.substr(3);
        if(tmpTxt.toLowerCase().indexOf("by: ") == 0)
            tmpTxt = tmpTxt.substr(4);
        
        if(tmpTxt != "")
        {
            $(c).innerHTML = "By: " + tmpTxt;
            $(c).show();
        }
        else
            $(c).hide();
    }
}

// End - Format and Launch Article Links


//////////////////////////////////////////////////////////
//      Text Resize Functions                            //
//////////////////////////////////////////////////////////

var currentTextSize = null;
var currentLineHeight = null;
var fontSizeCookieName = "attfontsize";

// check for cookie
if (get_text_cookie(fontSizeCookieName)) {
    currentTextSize = parseInt(get_text_cookie(fontSizeCookieName));
} else {
    currentTextSize = 13;
    createCookie(fontSizeCookieName,currentTextSize,1000);
}
currentLineHeight = currentTextSize + 5;

// creates a cookie with the given parameters
function createCookie(name,value,days){
        if (days){
                var date = new Date();
                date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
                var expires = "; expires=" + date.toGMTString();
        } else {
                var expires = "";
        }
        document.cookie = name + "=" + value + expires + "; path=/";
}

function textSize(dir) {
    if (dir == 'up') {
        if (currentTextSize <= 17) {
            currentTextSize += 2;
        }
    } else if (dir == 'down') {
        if (currentTextSize >= 11) {
            currentTextSize -= 2;
        }
    }
    currentLineHeight = currentTextSize + 5;
    document.getElementById('bodyText').style.fontSize = currentTextSize + 'px';
    document.getElementById('bodyText').style.lineHeight = currentLineHeight + 'px';
    // write/rewrite cookie
    createCookie(fontSizeCookieName,currentTextSize,1000);
}

function get_text_cookie ( cookie_name )
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

  if ( results ) {
    return ( unescape ( results[1] ) );
  }
  else { return null; }
}

// End - Text Resize Functions

///--------------------------
///---------Validation-------
///--------------------------

/**************************************************************
 IsAlpha: Returns a Boolean value indicating whether an 
                 expression is all alpha

 Parameters:
      Expression = Variant containing a numeric expression or 
                   string expression.

 Returns: Boolean
***************************************************************/
function IsAlpha(Expression)
{
    Expression = Expression.toLowerCase();
    RefString = "abcdefghijklmnopqrstuvwxyz-' ";

    if (Expression.length < 1) 
        return (false);

    for (var i = 0; i < Expression.length; i++) 
    {
        var ch = Expression.substr(i, 1)
        var a = RefString.indexOf(ch, 0)
        if (a == -1)
            return (false);
    }
    return(true);
}

/**************************************************************
 IsEmail: Returns a boolean if the specified Expression is a
          valid e-mail address. If Expression is null, false
          is returned.

 Parameters:
      Expression = e-mail to validate.

 Returns: boolean
***************************************************************/
function IsEmail(Expression)
{
    if (Expression == null)
        return (false);

    var supported = 0;
    if (window.RegExp)
    {
        var tempStr = "a";
        var tempReg = new RegExp(tempStr);
        if (tempReg.test(tempStr)) supported = 1;
    }
    if (!supported) 
        return (Expression.indexOf(".") > 2) && (Expression.indexOf("@") > 0);
    var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
    var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
    return (!r1.test(Expression) && r2.test(Expression));
}

/**************************************************************
 IsDate: Returns a Boolean (true) if the date is true, false
         is not

 Parameters:
    - DateStr: String date in format (MM/DD/YYYY or MM-DD-YYYY or YY)

 Returns: Boolean
***************************************************************/
function IsDate(dateStr)
{
    // Checks for the following valid date formats:
    // MM/DD/YYYY   MM-DD-YYYY or YY

    var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;

    var matchArray = dateStr.match(datePat);
    if (matchArray == null)
        return false;

    month = matchArray[1];
    day = matchArray[3];
    year = matchArray[4];
    if (month < 1 || month > 12)
        return false;

    if (day < 1 || day > 31)
        return false;

    if ((month==4 || month==6 || month==9 || month==11) && day==31)
        return false;

    if (month == 2)
    {
        var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
        if (day>29 || (day==29 && !isleap))
            return false;
    }
    
	getnow = new Date();
    //if (year < 1900)    //requirement restraint (between 1900 & current year)
    //    return false; 

    //if (year > getnow.getFullYear())    //requirement restraint (between 1900 & current year)
    //    return false;    


    //if ((year >= 1000) && (year <= 1752))    //DB restraint
    //    return false

    return true;
}

/**************************************************************
 IsNumber: Returns a Boolean value indicating whether an 
                 expression is all Number

 Parameters:
      Expression = Variant containing a numeric expression or 
                   string expression.

 Returns: Boolean
***************************************************************/
function IsNumber(Expression)
{
	var newstring = parseFloat(Expression).toString();
	if(newstring == "NaN") 
	{
		return(false);
	}
    return(true);
}

/**************************************************************
 IsPhone: Returns a Boolean value indicating whether an 
                 expression is a Phone Number

 Parameters:
      Expression = Variant containing a numeric expression or 
                   string expression.

 Returns: Boolean
***************************************************************/
function IsPhone(Expression)
{
    if(Expression.split('-').length == 3)
    {
        // xxx-xxx-xxxx
        if((Expression.split('-')[0].length == 3)&&(Expression.split('-')[1].length == 3)&&(Expression.split('-')[2].length == 4)
			&&(IsNumber(Expression.split('-')[0]))&&(IsNumber(Expression.split('-')[1]))&&(IsNumber(Expression.split('-')[2])))
		{
			return true;
		}
		else return false;
    }
    else if (IsNumber(Expression))
    {
        // xxxxxxxxxx
		if(Expression.length == 10)
		{
			return true;
		}
		else return false;
    }
    else return false;
}

function GoHome()
{
    window.location = "/";
}

//--------------------------------------------------

var Cookie = {
	set: function(name,value,seconds){
		var expiry;
		if(seconds){
			d = new Date();
			d.setTime(d.getTime() + (seconds * 1000));
			expiry = '; expires=' + d.toGMTString();
		}else
			expiry = '';
		document.cookie = name + "=" + value + expiry + "; path=/";
	},
	get: function(name){
		nameEQ = name + "=";
		ca = document.cookie.split(';');
		for(i = 0; i < ca.length; i++){
			c = ca[i];
			while(c.charAt(0) == ' ')
				c = c.substring(1,c.length);
			if(c.indexOf(nameEQ) == 0)
				return c.substring(nameEQ.length,c.length);
		}
		return null
	},
	unset: function(name){
		Cookie.set(name,'',-1);
	}
} 

function gettoolbar(s) {

    var DomainBase = "http://" + window.location.host + "/";
    var toolbar = "";

    if (s.indexOf("Learning Center") >= 1) {
         toolbar += "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
	 toolbar += "    <tbody>";
	 toolbar += "        <tr>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "learningcenter/customerstories\">Customer Stories</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "learningcenter/enewsletter\">eNewsletter</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "learningcenter/courses\">Courses</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "learningcenter/mybusinessis\">My Business Is...</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "learningcenter/biztips\">Biz Tips</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "learningcenter/toolsdemos\">Tools &amp; Demos</a></td>";
	 toolbar += "            <td width=\"100%\" nowrap=\"nowrap\">&#160;</td>";
	 toolbar += "        </tr>";
	 toolbar += "    </tbody>";
	 toolbar += "</table>";    }

    if (s.indexOf("Community") >= 1) {
         toolbar += "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
	 toolbar += "    <tbody>";
	 toolbar += "        <tr>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "community/expertadvice\">Expert Advice</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "community/webseminars\">Web Seminars</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "community/watercooler\">Watercooler</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "community/womeninbusiness\">Women in Business</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "community/diversityresources\">Diversity Resources</a></td>";
	 toolbar += "            <td width=\"100%\" nowrap=\"nowrap\">&#160;</td>";
	 toolbar += "        </tr>";
	 toolbar += "    </tbody>";
	 toolbar += "</table>";    }

    if (toolbar == "") {
         toolbar += "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
	 toolbar += "    <tbody>";
	 toolbar += "        <tr>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "newsinsights/technology\">Technology</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "newsinsights/marketing\">Marketing</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "newsinsights/finance\">Finance</a></td>";
	 toolbar += "            <td nowrap=\"nowrap\" class=\"tbbtnorg\" onmouseover=\"this.className='tbbtnorghl';\" onmouseout=\"this.className='tbbtnorg';\"><a href=\"" + DomainBase + "newsinsights/hr\">HR</a></td>";
	 toolbar += "            <td width=\"100%\" nowrap=\"nowrap\">&#160;</td>";
	 toolbar += "        </tr>";
	 toolbar += "    </tbody>";
	 toolbar += "</table>";    }

    return toolbar;
	
}


function initTakeover() {
				var toViews = Cookie.get('/takeoverViews');
				if(toViews == null || toViews < 3) {
					Effect.SlideDown('takeOverOpen');
				} else {
					Effect.SlideDown('takeOverClosed');
				}
				toViews = Math.floor((toViews*1) + 1);
				Cookie.set('/takeoverViews',toViews,1209600);
				$('toCloseAnchor').observe('click', function(e) {
					e.preventDefault();
					Effect.SlideUp('takeOverOpen');
					Effect.SlideDown('takeOverClosed');
				});		
				$('toOpenAnchor').observe('click', function(e) {
					e.preventDefault();
					Effect.SlideUp('takeOverClosed');
					Effect.SlideDown('takeOverOpen');
				});		
}
