// JavaScript functions and methods used throughout the website
function ApplyCufon() {
	Cufon.replace('.neosans', { fontFamily: 'NeoSans' });
	Cufon.replace('.neosans-medium', { fontFamily: 'NeoSans Medium' });
	Cufon.replace('.neosans-light', { fontFamily: 'NeoSans Light' });
	Cufon.replace('.neosans-black', { fontFamily: 'NeoSans Black' });
	Cufon.now();
}

$= jQuery;
$(document).ready(function() {
	// Apply Cufon
	ApplyCufon();

    // Apply slideshow effects
	var objSlideshow = $('#slideshow');
    if (objSlideshow.length > 0) {
		objSlideshow.cycle({
			fx:     'fade',       
			speedIn:'500',
			speedOut: '3000',
			timeout: '6000',
			pager:  '#nav',
			slideExpr: 'li'		
		});
		
		// Setup the links
		$('li', objSlideshow).each(function() {
			var objHeaderLink = $('a.nav', this);
			if (objHeaderLink.length > 0) {
				$(this).click(function() {
					window.location.assign(objHeaderLink.attr('href'));
					return false;
				}).css({'cursor':'pointer'});
			}
		});
	}
});
