      TabControl = function(control_id, options) {
            var id = "#" + control_id;
            $$(id+' ul.tabs li a').each(function(a) {
                var page = a.getAttribute('href').match(/[-_\w]+$/i)[0];
                if (page != options['current']) { $(page).hide() } 
                else { $(a).addClassName('selected') }

                Event.observe(a, 'click', function(e) {
                    $$(id+' ul.tabs li a').each(function(e) { e.removeClassName('selected'); })
                    $$(id+' .TabPage[id!='+page+']').each(function(e) { e.hide() });
                    $(a).addClassName('selected');
                    $(page).show();
                    Event.stop(e);
                });
            });
        }

function removeWhitespace(node) 
{
	var loopIndex;
	
	for (loopIndex = 0; loopIndex < node.childNodes.length; 
	  loopIndex++) {
	
	  var currentNode = node.childNodes[loopIndex];
	
	  if (currentNode.nodeType == 1) {
		removeWhitespace(currentNode);
	  }
	
	  if (((/^\s+$/.test(currentNode.nodeValue))) &&   
		(currentNode.nodeType == 3)) {
		  node.removeChild(node.childNodes[loopIndex--]);
	  }
	}
}

function init_mainsearch()
{
	$('mainSearch').onblur = function (e)
	{
		if (!e) var e = window.event;
		if(this.value == '')
		{
			this.value = 'Search';
		}
	}
	if ($('mainSearch').captureEvents) $('mainSearch').captureEvents(Event.ONBLUR);
	
	$('mainSearch').onfocus = function (e)
	{
		if (!e) var e = window.event;
		if(this.value == 'Search')
		{
			this.value = '';
		}
	}
	if ($('mainSearch').captureEvents) $('mainSearch').captureEvents(Event.ONFOCUS);
}


function init_tooltips()  //Initializes any stangdard tool tips
{
	//ADD Page Tooltips here
	//USAGE - 
	var tooltips = $$('A.tooltip');	
	tooltips.each(function(s) {
		var temptitle = s.title;
		s.title = '';
	  if(s.rel != '')
	  {	
		new Tip(s, 
		s.rel,
			{
				title: temptitle,      
				effect: 'appear',
				offset: {x:0, y:8},
				hook: { target: 'bottomLeft', tip: 'topLeft' }
			}
		); 
	  }
	});
}


//Bookmark tool tip
function init_bookmark()
{
	new Tip($('bookmarks'), 
		$('bookmarkcontent').innerHTML,
			{
				className: 'bookmarks_small',
				closeButton: true,
				showOn: 'click',
				title: 'BookMark and Share',      
				effect: 'blind',
				hideOn: { element: '.close',
                                event: 'click' },  
				offset: {x:0, y:8},
				hook: { target: 'bottomRight', tip: 'topRight' }
			}
		); 
}

// START ALL Category functions
function init_allcategory()
{
	$('allcat').onclick = function (e)
	{
		if (!e) var e = window.event;
		show_allcategoriesDiv();
	}
	if ($('allcat').captureEvents) $('allcat').captureEvents(Event.ONCLICK);
}

var showCatDropDown = false;

function show_allcategoriesDiv()
{
	showCatDropDown = true;
	if ( document.getElementById('homeintro_0') ) {
		rotatecontent();
	}
	var mouseoutTimerId = 0;
	new Effect.BlindDown('allcategories', 
	{
		duration:.5,
		afterFinish:  function ()
		{	
		},
		beforeStart:  function ()
		{
			$('allcat').onmouseout = function (e)
			{
				if (!e) var e = window.event;
				alertTimerId = setTimeout ( "hide_allcategoriesDiv()", 500 );
			}
			if ($('allcat').captureEvents) $('allcat').captureEvents(Event.ONMOUSEOUT);
			
			$('allcat').onmouseover = function (e)
			{
				if (!e) var e = window.event;
				clearTimeout ( alertTimerId );
			}
			if ($('allcat').captureEvents) $('allcat').captureEvents(Event.ONMOUSEOVER);
			
			
			$('allcat_btn').onmouseout = function (e)
			{
				if (!e) var e = window.event;
				alertTimerId = setTimeout ( "hide_allcategoriesDiv()", 500 );
			}
			if ($('allcat_btn').captureEvents) $('allcat_btn').captureEvents(Event.ONMOUSEOUT);
			
			$('allcat_btn').onmouseover = function (e)
			{
				if (!e) var e = window.event;
				clearTimeout ( alertTimerId );
			}
			if ($('allcat_btn').captureEvents) $('allcat_btn').captureEvents(Event.ONMOUSEOVER);
			
			
			$('allcats_content').onmouseout = function (e)
			{
				if (!e) var e = window.event;
				alertTimerId = setTimeout ( "hide_allcategoriesDiv()", 500 );
			}
			if ($('allcats_content').captureEvents) $('allcats_content').captureEvents(Event.ONMOUSEOUT);
			
			$('allcats_content').onmouseover = function (e)
			{
				if (!e) var e = window.event;
				clearTimeout ( alertTimerId );
			}
			if ($('allcats_content').captureEvents) $('allcats_content').captureEvents(Event.ONMOUSEOVER);
		}
	});
}

function hide_allcategoriesDiv()
{
	showCatDropDown = false;

	new Effect.BlindUp('allcategories', 
	{
		duration:.5,
		afterFinish:  function ()
		{
		},
		beforeStart:  function ()
		{
		}
	}); 
}
// END ALL Category functions

//START headline module functions
function init_headlinemodule()
{
	var headlinelinks = $('module_headline_links').getElementsByTagName('a');
	
	for(var i=0; i < headlinelinks.length; i++)
	{
		headlinelinks[i].id = '';
	}
}

function turnonlink(currenta)
{
	init_headlinemodule();
	currenta.id = 'module_headline_linksOn';
}
function showdiv(divtoshow)
{
	removeWhitespace($('headlineDivs')) ;
	var headlineDivs = $('headlineDivs').childNodes;
	for(var i=0; i<headlineDivs.length; i++)
	{
		headlineDivs[i].style.display = 'none';
	}
	$(divtoshow).style.display = 'block';
}
//END headline module functions


//START Today's Features functions
function settodayfeaturebullet(index)
{
	var bullets = $('todaysfeatures_controls').getElementsByTagName('img');
	for(var i =0; i<bullets.length; i++)
	{
		bullets[i].src = 'grey_bulletv2.gif';
	}
	for(var i =0; i<bullets.length; i++)
	{
		if((index-1) == i)
		{	bullets[i].src = 'orange_bullet.gif'; }
	}
	if(index == 'last')
	{	bullets[bullets.length-1].src = 'orange_bullet.gif'; }
}

//END Today's Features functions

//START LOGIN BOX FUNCTIONS
function openloginbox(objectDiv, width)
{
showCatDropDown = true;
	if ( document.getElementById('homeintro_0') ) {
		rotatecontent();
	}

	var forms = $('cmstable').getElementsByTagName('form');
	for(var i=0; i < forms.length; i++)
	{
		forms[i].style.visibility = 'hidden';
	}
	
	new Effect.Opacity($('greyedout_bg'),
	{ 
		duration: .25, 
		transition: Effect.Transitions.linear, 
		from: 0.0, to: 0.35,
		beforeStart : function ()
		{
			$('greyedout_bg').style.display = 'block';
			$('greyedout_bg').style.filter = 'alpha(opacity=0)';
			$('greyedout_bg').style.MozOpacity = '.0';
			$('greyedout_bg').style.opacity = '.0';
		},
		afterFinish : function ()
		{
			$('greyedout_bg').style.filter = 'alpha(opacity=35)';
			$('greyedout_bg').style.MozOpacity = '.35';
			$('greyedout_bg').style.opacity = '.35';
			$('greyedout_bg').onclick = function (e)
			{
				if (!e) var e = window.event;
				closethickbox(objectDiv);
			}
			if ($('greyedout_bg').captureEvents) $('greyedout_bg').captureEvents(Event.ONCLICK);
		}
	});
	
        if ( objectDiv == 'signin_wrapper' ) {
  	    new Effect.BlindDown(objectDiv, 
	    {
		duration:1.0,
		afterFinish:  function ()
		{	
		},
		beforeStart:  function ()
		{
		}
	    });
        } else {
  	    new Effect.BlindDown(objectDiv, 
	    {
		duration:2.0,
		afterFinish:  function ()
		{	
		},
		beforeStart:  function ()
		{
		}
	    });

        }

	new Effect.Opacity($(objectDiv),
	{ 
		duration: .25, 
		transition: Effect.Transitions.linear, 
		from: 0.0, to: 1.0,
		beforeStart : function ()
		{
			$(objectDiv).style.display = 'block';
			$(objectDiv).style.filter = 'alpha(opacity=0)';
			$(objectDiv).style.MozOpacity = '.0';
			$(objectDiv).style.opacity = '.0';
			$(objectDiv).style.position = 'absolute';
			$(objectDiv).style.left = getWindowSize('width')/2 - width/2 + 'px';
		},
		afterFinish : function ()
		{
			$(objectDiv).style.filter = 'alpha(opacity=100)';
			$(objectDiv).style.MozOpacity = '1.0';
			$(objectDiv).style.opacity = '1.0';
			$(objectDiv).style.zIndex = '100';
			$('greyedout_bg').style.zIndex = '1';
		}
	});
}
function closethickbox(objectDiv)
{
	showCatDropDown = false;

	
	new Effect.Opacity($('greyedout_bg'),
	{ 
		duration: .25, 
		transition: Effect.Transitions.linear, 
		from: 0.35, to: 0.0,
		beforeStart : function ()
		{
			$('greyedout_bg').style.filter = 'alpha(opacity=35)';
			$('greyedout_bg').style.MozOpacity = '.35';
			$('greyedout_bg').style.opacity = '.35';
		},
		afterFinish : function ()
		{
			$('greyedout_bg').style.display = 'none';
			$('greyedout_bg').style.filter = 'alpha(opacity=0)';
			$('greyedout_bg').style.MozOpacity = '.0';
			$('greyedout_bg').style.opacity = '.0';
			var forms = $('cmstable').getElementsByTagName('form');
			for(var i=0; i < forms.length; i++)
			{
				forms[i].style.visibility = 'visible';
			}
		}
	});
	
	new Effect.Opacity($(objectDiv),
	{ 
		duration: .25, 
		transition: Effect.Transitions.linear, 
		from: 1.0, to: 0.0,
		beforeStart : function ()
		{
			$(objectDiv).style.filter = 'alpha(opacity=100)';
			$(objectDiv).style.MozOpacity = '1.0';
			$(objectDiv).style.opacity = '1.0';
			$(objectDiv).style.zIndex = '100';
			$('greyedout_bg').style.zIndex = '1';
		},
		afterFinish : function ()
		{
			$(objectDiv).style.display = 'none';
			$(objectDiv).style.filter = 'alpha(opacity=0)';
			$(objectDiv).style.MozOpacity = '.0';
			$(objectDiv).style.opacity = '.0';
			$(objectDiv).style.position = 'absolute';
		}
	});
}
//END LOGIN BOX FUNCTIONS

function getWindowSize(type) {
  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;
  }
  
	if(type == 'width')
	{
		return myWidth;
	}
	if(type == 'height')
	{
		return myHeight;
	}
}

function getScrollY() {
  scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && document.body.scrollTop ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  return scrOfY;
}

//START TEXT SIZE FUNCTIONS
function increaseText()
{
	
	if($('baseTextsize').style.fontSize == '')
	{
		$('baseTextsize').style.fontSize = '16px';
	}
	else
	{
		var size = parseInt($('baseTextsize').style.fontSize);
		$('baseTextsize').style.fontSize = size + 2 + 'px';
		if(parseInt($('baseTextsize').style.fontSize) <= 18)
		{
			$('fontIncrease').style.display = 'inline';
			$('fontDecrease').style.display = 'inline';
		}
		else
		{
			$('fontIncrease').style.display = 'none';
		}
	}
}
function decreaseText()
{
	
	if($('baseTextsize').style.fontSize == '')
	{
		$('baseTextsize').style.fontSize = '12px';
		$('fontDecrease').style.display = 'none';
	}
	else
	{
		var size = parseInt($('baseTextsize').style.fontSize);
		$('baseTextsize').style.fontSize = size - 2 + 'px';
		if(parseInt($('baseTextsize').style.fontSize) <= 10)
		{
			$('fontDecrease').style.display = 'none';
		}
		else
		{
			$('fontDecrease').style.display = 'inline';
			$('fontIncrease').style.display = 'inline';
		}
	}
}

//END TEXT SIZE FUNCTIONs