$(function() {
	outsideUrlArrow();
	loadTooltips();
	logoHover();
	clearContactForms();
	loadUniform();
	featuredScroller();
});

function featuredScroller() {
/* 	$("#featured").jCarouselLite({btnNext: ".next",btnPrev: ".prev"}); */
	$('#featured').scrollable({size: 1, speed: 750, clickable: false})().navigator({activeClass:'active'});

}

// Add Arrow to the end of all external links. 

function outsideUrlArrow() {
	$(".links .entry a").filter(function() {
    	return this.hostname && this.hostname !== location.hostname;
	}).append(' &rarr;');
	$(".entry a, .post a, .case_study a").filter(function() {
    	return this.hostname && this.hostname !== location.hostname;
	}).addClass('external');
}

function logoHover() {
	$('#header #logo h1 a img').hover(function(){
		$(this).css('margin-top', '7px');
	}, function() {
		$(this).css('margin-top', '8px');
	});
	$('#header #logo h1 a img').click(function(){
		$(this).css('margin-top', '8px');
		$(this).css('opacity', '.85');
	});
}

function loadTooltips() {
	$("#nav_icons a[title]").tooltip({ 
		position: 'bottom center',
		offset: [-10, 0],
		tip: '#tooltip',  
        effect: 'slide'  
    }).dynamic({ 
	});
}

function clearContactForms() {
	$('#post-45 input').focus(function() {$(this).attr('value', '');});
	$('#post-45 textarea').focus(function() {$(this).attr('value', '');})
}

function loadUniform() {
	$("select, input:checkbox, input:radio, input:file").uniform();
}