// JavaScript Document

jQuery(document).ready(function() {

	jQuery('#navigation').superfish({
		delay: 800,
		animation: {
			opacity: 'show',
			height: 'show'
		},
		speed: 500,
		autoArrows: true,
		anchorClass: 'sf-with-ul',
		arrowClass: 'sf-sub-indicator',
		dropShadows: false
	});
	
	$('.search_button').hover(function() {
		$(this).addClass('search_button_hover');
	}, function() {
		$(this).removeClass('search_button_hover');
	});
	
	$('.event_list li a').hover(function() {
		$(this).find('.event_name').css('text-decoration', 'none');
	}, function() {
		$(this).find('.event_name').css('text-decoration', 'underline');
	});
	
	$('.input_text_effect').focus(function() {
		if (this.value == this.defaultValue) {
			this.value = '';
			$(this).css('color', '#1d3c54');
		}
		if (this.value != this.defaultValue) {
			this.select();
		}
	});
	$('.input_text_effect').blur(function() {
		if ($.trim(this.value) == '') {
			this.value = (this.defaultValue ? this.defaultValue : '');
			$(this).css('color', '#999');
		}
	});
	
	$('#home_banner').cycle({
		fx: 'fade',
		speed: 'slow',
		after: function(idx, slide) {
			$('#banner_title').html($(slide).children(0).attr('alt'));
		},
		pager: '#banner_page',
		pagerAnchorBuilder: function(idx, slide) {
			return '<li><a href="#">' + (idx + 1) + '</a></li>';
		}
	});
	
	
});

//Functions

function zebra_table() { //zebra table
	jQuery('tbody tr:nth-child(odd)').addClass('odd');
	
}

Cufon.replace('.font_frutiger, ' +
'#navigation li a, ' +
'#header_link_n_search li a, ' +
'#blog_preview li h3.blog_title, ' +
'.basic_style_1 h1, ' +
'.basic_style_1 h2, ' +
'.basic_style_1 h3, ' +
'.basic_style_1 h4, ' +
'.basic_style_1 h5, ' +
'.basic_style_1 h6 ', {
	fontFamily: 'Frutiger',
	hover: true
});
