$(document).ready(function(){
	
	/*
	$('#screen').fadeOut();
	$('#nav a, #cats a').click(function(){
		//$('#screen').fadeIn();
		$('body').fadeOut();
	});
	*/
	
	
	$('#projects li:even').addClass('even');
	
	$('a[rel="external"], a[rel="me"]').attr('target', '_blank');
	
	$('#nav li:not(.current_page_item, .current_page_parent)').hover(function(){
		$(this).animate({'padding-right':'20px'},function(){
			//$(this).addClass('over');
		});
	},
	function(){
		//$(this).removeClass('over');
		$(this).animate({'padding-right':'0px'});
		
	});
	
	
	//swfobject
	if($('#flash').length > 0){
		var url = $('#flash').attr('title');
		var excerpt = $('#flash').html();
		excerpt = excerpt.split('x');
		var width = excerpt[0];
		var height = excerpt[1];
		$('#large').css('height','auto');		//remove height on #large
		swfobject.embedSWF(url,"flash",width,height,"9.0.0",HTPATH+"/js/swfobject/expressInstall.swf");
	}
	
	
	//gallery
	$('#thumbs a').click(function(){
		var the_url = $(this).attr('href');
		$('#large div').fadeOut('fast',function(){
			$('#large div').load(HTPATH+'/cms/wp-content/themes/thechrisvoth/large-img.php',{url:the_url},function(){
				$('#large div').fadeIn('fast');
			});
		});
		$('#thumbs a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	});
	$('#thumbs a:first').trigger('click');
	if($('#thumbs li').length < 3) $('#thumbs li').hide();	//check if only 1 thumb [take into account the extra li tag]
	
	
});

