$(document).ready(function() {

	$(".projects-list li:nth-child(6)").css("clear","left");
	$(".projects-list li:nth-child(11)").css("clear","left");
	$(".projects-list li:nth-child(16)").css("clear","left");
	$(".projects-list li:nth-child(21)").css("clear","left");
	$(".projects-list li:nth-child(26)").css("clear","left");
	$(".projects-list li:nth-child(31)").css("clear","left");
	$(".projects-list li:nth-child(36)").css("clear","left");
	$(".projects-list li:nth-child(41)").css("clear","left");

	// Accessible input values
  $("input.propagate").each(function(){
    var $this = $(this);
    var val = $('label[for=' + $this.attr('id') + ']').html();
    if($this.val() == '') $this.val(val);
    $this.focus(function(){
        if($this.val() == val) $this.val('');
    }).blur(function(){
        if($this.val() == '') $this.val(val);
    });
  });
  
  // External links
	$('a[rel=_blank]').click(function(){
		this.target = "_blank";
	});

	// Browser support
	if ($.browser.webkit) {
    $("body").addClass("webkit");
 	}
 	
	if ($.browser.opera) {
    $("body").addClass("opera");
 	}
 	
	if ($.browser.mozilla) {
    $("body").addClass("mozilla");
 	}
 	
	if (($.browser.msie) && ($.browser.version == "8.0")) {
    $("body").addClass("ie8");
 	}
 	
	if (($.browser.msie) && ($.browser.version == "7.0")) {
    $("body").addClass("ie7");
 	}

	if (($.browser.msie) && ($.browser.version == "6.0")){
		
		$("body").addClass("ie6");
		
		// Dropdown support
		$("#navigation li,#sidebar li").hover(
			function () {
				$(this).addClass("hover");
			},
			function () {
				$(this).removeClass("hover");
			}
		);
		
		// PNG support
		var PNG_fix_selectors = [
    	"#home-navigation img",
    	".site-name span",
    	"#navigation",
    	".social-bg",
    	".footer-boxes .input-text",
    	".footer-boxes button",
    	".home-navigation-bg",
    	".tips"
		];
		 
		if (typeof DD_belatedPNG !== "undefined") {
			DD_belatedPNG.fix(PNG_fix_selectors.join(","));
		}
		
	}
	
	/*  Footer Height  */
	if ($('.footer-boxes').length && $('.footer-boxes-bg').length) {
		var h = parseInt($('.footer-boxes').height());
		$('.footer-boxes-bg').height(h); 
	}

});
