Cufon.replace('h2, h3, .tagline', { hover: 'true' });

$(document).ready(function() {
    
    $('a[href^="http://"]').attr("target", "_blank");
     
    $('input[rel!=""]').hint();
     
    $('a.image-thumb[href^="http://"]').append("<strong>View project in new window</strong>");
    $(".image-thumb strong").fadeTo(1, 0);
    
    var lewastart = $("#sntxt").offset().left;
    
    $("#sntxt").animate({ 
            opacity: 0,
            left:"0"
          }, 1 );
    
    $(".social a").hover(
    	function () {
    		$(this).children("img").stop().animate({ 
    		        opacity: 0.4,
    		        top:"-7px"
    		      }, 250 );
    		
    		var title = $(this).children("img").attr("alt");
    		
    		var lewa = $(this).offset().left - lewastart;
    		
    		$("#sntxt").text(title).stop().animate({ 
    		        opacity: 1,
    		        left: lewa
    		      }, 250 );
    	},
    	function () {
    		$(this).children("img").stop().animate({ 
    		        opacity: 1,
    		        top:"0"
    		      }, 250 );
    		
    		$("#sntxt").stop().animate({ 
    		        opacity: 0,
    		        left: "0"
    		      }, 250 ).text('');
    	}
    );
    
    $("a.image-thumb").hover(
    	function () {
    		$(this).children("img").stop().fadeTo("normal", 0.5);
    		$(this).children("strong").stop().fadeTo("normal", 1.0);
    	},
    	function () {
    		$(this).children("img").stop().fadeTo("normal", 1);
    		$(this).children("strong").stop().fadeTo("normal", 0);
    	}
    );
    
    
    $("#twitter").getTwitter({
    		userName: "pixsoul",
    		numTweets: 5,
    		loaderText: "Loading tweets...",
    		slideIn: true,
    		showHeading: false,
    		headingText: "Latest Tweets",
    		showProfileLink: false
    });
        
    
    $('#contact-form').submit(function () {
    										
    	$('#contact-form').validate();
    	var validated = $('#contact-form').valid();
    						 
    	if (validated == true) {
    		
    		var options = { 
    			target: '#alert'
    			}
    		
    		$('#contact-form').ajaxSubmit(options); 
    		return false;
    		
    	}
    	else {
    		return false;
    	}
    });
    
    
});