
jQuery(document).ready(function($) {

	// fade in images
	/*$( '.post img' ).hide().load(function() {
		$(this).fadeIn(1800);
	});*/

	// search bar	
	$( '#search-bar #s' ).hide().click(
		function(){
			$(this).val('');
		}	
	);
	$( '#search-bar' ).mouseover(
		  function(){
			$( '#search-bar #s' ).fadeIn('slow');
		}).mouseout(function(){

		});
	
	// textbox wipe
		$( '#comment-fields input' ).click(
		function(){
			$(this).val('');
		}	
	);
	
	
	// portfolio slider

		$('.portfolio-image').anythingSlider({
			autoPlay	:false,
			animationTime	: 200
		});
		
		$('.portfolio-image img').click(function() {
			$('.portfolio-image').data('AnythingSlider').goForward();
			window.setTimeout(function() { $('.thumbNav .cur').click(); }, 300);
		});

		
	// portfolio thumb animation
	$('.porfolio-thumbnails .thumb').mouseover(function() {
		var speed = 150;
		var distance = 223;
		var thumb = $(this);
			thumb.x = 0;
		window.t = window.setInterval(function() {
			if (thumb.x == -1115){
				thumb.css('backgroundPosition',  (0) + 'px 0');
			return }
			thumb.x -= distance;
			thumb.css('backgroundPosition',  (thumb.x) + 'px 0');
		}, speed);	
		
	}).mouseout(function() {
		window.clearInterval(window.t);
		$(this).css( {backgroundPosition: "0 0"} );
	});
	
});

