$(document).ready(function() {
	
	// Remove borders for linked images
	$('#content a > img').parent().addClass('linkedImage');

	// Datagrid striping
	$('table tr:nth-child(2n)').addClass('even');
	$('table tr:nth-child(2n+1)').addClass('odd');

	// Members
	$('#members div:nth-child(3n)').addClass('thirdChild');

	// Country dropdown
	$('#countryDD').hover(function() {
		$('#countryList').show();
	});
	
	$('#countryList').hover(function() {
		// Nothing
	}, function() {
		$(this).hide();
	});
	
	// Adds a class focus to input.input-text and textarea when focused
	function focusfix(selector, className) {
		$(selector).focus(function() {
			$(this).addClass(className);
		});
		// Removes class when focus is lost
		$(selector).blur(function() {
			$(this).removeClass(className);
		});
	}

	$("#banner_slide").cycle({ 
		fx:     'fade', 
		timeout: 6500, 
		pager:  '#banner_slide_nav' 
	});

	focusfix('input.inputText', 'focus');
	focusfix('textarea', 'focus');
	
});

