Cufon.replace('#vertical-slider h4, .tabs li a', {fontFamily:"Rockwell"});
Cufon.replace('.tab_container h4, #home_column_two h3', {fontFamily:"Rockwell", hover: true});
Cufon.replace('#columncontainer h3, .tab_container h3, #map-header h1', {fontFamily:"Rockwell"});
Cufon.replace('div.uta-feature-content h3',{fontFamily:"Frutiger LT Std",fontWeight:400, hover: true});
Cufon.replace('div.uta-feature-content h2',{fontFamily:"Frutiger LT Std",fontWeight:850, hover: true});

$(document).ready(function() 
{
  	// Set cookie scope based on page name.
  	var url = window.location.href,
  		  page_start = url.substr(url.lastIndexOf('/')+1, 2),
  		  cookie_scope = (page_start == '') ? 'in' : page_start;

	$('.news_tab').click(function() 
	{
		$(this).siblings().removeClass('on');
		$(this).addClass('on');
		
		// $(this).siblings().each(function(){ Cufon.refresh(this);});
		Cufon.refresh('#vertical-slider h4, .tabs li a');
		
		$('#tab1').show();
		$('#tab2').hide();
		$.cookie(cookie_scope+'-ne-tab','news');
	});
	
	$('.events_tab').click(function() {
		$(this).siblings().removeClass('on');
		$(this).addClass('on');
		Cufon.refresh('#vertical-slider h4, .tabs li a');
		$('#tab1').hide();
		$('#tab2').show();
		$.cookie(cookie_scope+'-ne-tab','events');
	});
	
	$('#vertical-slider').accordion({
		changestart: function(e,ui) {
			$('#vertical-slider .content').hide();
			$('#vertical-slider h4').removeClass('selected');
			ui.newHeader.addClass('selected');
		},
		change: function(e,ui) {
			ui.newContent.find('.content').fadeIn(300);
			$.cookie(cookie_scope+'-vtab',(ui.newHeader.prevAll().length/2));
		}
	});
    
    
	// Check cookies to see if news/events tab is specified.
	var news_events_tab = $.cookie(cookie_scope+'-ne-tab');
	if (news_events_tab == 'news')
		$('.news_tab').click();
	if (news_events_tab == 'events')
		$('.events_tab').click();
		
	// Check cookies to see if vertical-slider tab is specified.
	var vslider_tab = $.cookie(cookie_scope+'-vtab');
	if (vslider_tab !== null && Number(vslider_tab) > 0)
		$('#vertical-slider').accordion('activate', Number(vslider_tab));
});
 
