$(document).ready(function(){
	$(document).pngFix();
	
	$('#s').focus(function () {
		if ($(this).val('') === $(this).attr('defaultValue')) {
			$(this).attr('value', '');	
		}
	});
	$('#s').blur(function () {
		if ($(this).attr('value') === '') {
			$(this).attr('value', $(this).attr('defaultValue'));	
		}
	});
	
	$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
			
	//$("ul.dropdown > li:nth-child(2) > a, ul.dropdown li:nth-child(3) > a, ul.dropdown li:nth-child(6) > a, ul.dropdown li:nth-child(7) > a, ul.dropdown li:nth-child(8) > a").addClass("dir");
	//$("ul.dropdown > li:nth-child(2) > a, ul.dropdown li:nth-child(3) > a, ul.dropdown > li:nth-child(2)").hover().addClass("dir");
	$('ul.dropdown li:nth-child(6) ul').css('width', '160px');
	$('ul.dropdown li:nth-child(7) ul').css('width', '110px');
	$('ul.dropdown ul li:last-child a').css('border-bottom', 'none');
	$('ul.dropdown > li:nth-child(2) > a').addClass('dir');
	$('ul.dropdown > li:nth-child(3) > a').addClass('dir');
	$('ul.dropdown > li:nth-child(6) > a').addClass('dir');
	$('ul.dropdown > li:nth-child(7) > a').addClass('dir');
	$('ul.dropdown > li:nth-child(8) > a').addClass('dir');
	
	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide(); 
	
	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$(".post p.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("fast");
		return false; //Prevent the browser jump to the link anchor
	});
	
	$.featureList(
		$("#tabs li a"),
		$("#output li"), {
			start_item : 0
		}
	);
	
	$('.styledselect').selectbox({ inputClass: "selectbox_styled" });
	
	$('.image_reel a').lightBox();
	$('.affiliations a').lightBox();
	$('.image a').lightBox();
	
	style = 'easeOutQuart';
	$('.boxgrid').hover(
		function() {		
			$(this).children('div').stop(false,true).animate({bottom:0},{duration:150, easing: style});
		},
 
		function() {
			$(this).children('div').stop(false,true).animate({bottom:-100},{duration:150, easing: style});
		}
	);
	
	$('td.country_list').append("<span><?php echo 'Hello World'; ?></span>");
	//$('.navigation a').live('click', function(e){
	//	e.preventDefault();
	//	var link = $(this).attr('href');
	//	$('.content').load(link+' .post');

	//});
	//$(".tip").tipTip({
	//	maxWidth: "250px"
	//});
	
	$('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});

});
