$(document).ready(function(){
	
	if (!$.browser.msie) {
		Cufon.replace('h1');
		Cufon.replace('h2');
		Cufon.replace('h3');
		Cufon.replace('.home h4');
		Cufon.replace('#header_contact');
		Cufon.replace('.content_top');
		Cufon.replace('.content_right blockquote');
		Cufon.replace('#footer_social strong');
		Cufon.replace('.event_info');
		Cufon.now();
	}
	
	$('.searchbox')
		.focus(function(){
			if ('SEARCH' == $(this).val()) $(this).val('');
		})
		.blur(function(){
			if ('' == $(this).val()) $(this).val('SEARCH');
		});
	
	if ('' == $('.searchbox').val())
		$('.searchbox').val('SEARCH');	
	
    $('#home_features').cycle({ fx: 'fade', speed: 1500, timeout: 5000 });

	$('#secondary_nav ul:first').children('li').each(function(){
		if (!$(this).hasClass('nav_header') && 0 < $(this).find('li').length){
			$(this).addClass('has_subpages');
							
			$(this).click(function(){
				if ($(this).hasClass('active')) {
					$(this).removeClass('active');
				} else {
					$(this).addClass('active');
				}
			});
			
			$(this).find('a').click(function(event){
				event.stopPropagation();
			});
		}
	});
});
