$j(document).ready(function() {
	
	$j(".accordion").accordion({
		autoHeight: false,
		collapsible: true,
		active: false
	});
	
	
	
	/*
	$j("x.accordion-expanded").accordion({
		autoHeight: false,
		collapsible: false
		//active: false
	});
	*/	
	
	$j(".tabbox").tabs();
	$j(".tabbed").tabs();
	
	if ($j('.slideshow').length > 0) {
		$j('.slideshow').cycle({
			'cleartype':true,
			'cleartypeNoBg':true
		});
	}
	
	$j('#headerBG-alt').width(($j('body').width() - 961)/2+200);

	// # IE Helpers
	$j('#nav>li:last-child').addClass('_last-child');
	$j('._featurebox:last-child').addClass('_last-child'); 
	$j('fieldset:last-child').addClass('_last-child'); 
	$j('p:last-child').addClass('_last-child'); 
	$j('#content table td:last-child, #content table th:last-child').addClass('_last-child'); 

	$j('a.submit').unbind();
	$j('a.submit').click(function(e){
		e.preventDefault();
		var href = $j(this).attr('href');
		var form = $j(this).parents('form');
		if (href != '' && href != '#') {
			form.attr('action',href);
		}
		form.submit();		
	});	
	
	//$j('#_site-functions a.font-larger').appendTo('span.extras');
	//$j('span.extras').append(' | ');
	//$j('#_site-functions a.font-smaller').appendTo('span.extras');
	$j('#_site-functions').appendTo('span.extras');
	$j('#title h2').clone().appendTo('#title').addClass('title-background');
	
	$j('.alert-button a').click(function(e){
		e.preventDefault();
		$j('.alert-msg').fadeOut();
	});
	
});

if ($j.browser.msie && ($j.browser.version == "6.0")) {
}
else {
	Cufon.replace('#title h2', { fontFamily: 'Rockwell', hover: false });
	Cufon.replace('#nav.cms li a', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('#nav.site-map>li>a', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('#topnav a', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('#searchbar a.p_members', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('a.button', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('span.Button', { fontFamily: 'Rockwell', hover: true });		
	Cufon.replace('input._submit', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('a.Button', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('._featurebox ._title', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('.tabbox ul.ui-tabs-nav a', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('._featurebox h2', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('div._featurebox .BigBlue', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('.rockwell-green-header', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('._widget ._title', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('._widget li.active>a', { fontFamily: 'Rockwell', hover: false });
	Cufon.replace('.splash .quote .wrap', { fontFamily: 'Rockwell', hover: false });
	Cufon.replace('h3', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('._advlist .row', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('.tabbed li a', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('.readmore', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('.news-list .entry .title', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('div.searchable-table div.dataTables_paginate', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('._event ._title', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('._event .learnmore', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('._calendar ._header', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('._top-header', { fontFamily: 'Rockwell', hover: true });
	Cufon.replace('#service-centers a', { fontFamily: 'Rockwell', hover: true });
}
