(function($){
	//add classes to form inputs based on their type
	for (var i = 0, len = document.getElementsByTagName('input').length; i < len; i++) {
	    document.getElementsByTagName('input')[i].className += ' ' + document.getElementsByTagName('input')[i].type;
	}
	
	//open external links in a new window
	var hostname = window.location.hostname,
		anchors = document.getElementsByTagName('a') || document.getElementsByTagName('area');
	
	for (var i = 0, len = anchors.length; i < len; i++) {
	    if (/^https?:\/\/(www.)?/i.test(anchors[i].href) && anchors[i].href.toLowerCase().indexOf(hostname) == -1) {
	        anchors[i].target = "_blank";
	        anchors[i].className += ' external';
	    }
	}
	
	//validate forms
	$('form').each(function(){
		$(this).validate({
			errorClass: "invalid",
			validClass: "valid"
		});
	});
	
	//fallback to Cufon for browsers that don't support @font-face
    if (!Modernizr.fontface) {
        //Cufon.replace('selector goes here; either a DOM collection or a jQuery object');
    }
	
	//browser hacks
	$('#header .menu li:first-child').addClass('first-child');
	
	//featured projects
	$('#featured-projects ul').bxSlider({
		'displaySlideQty': 3
	});
	
	//featured yuotube video
	$('#placeholder').click(function(){
		$(this).hide().prev('iframe').show();
		
		return false;
	});
})(jQuery);
