$(document).ready(function() {

	// Cufon
	Cufon.replace('.contact-info dd', { hover: true } );
	Cufon.replace('#navigation li a', { hover: true } );
	Cufon.replace('.login a', { hover: true } );
	Cufon.replace('#intro .photo a', { textShadow: '#000 1px 1px', hover: true } );
	Cufon.replace('#navigation p', { textShadow: '#fff 1px 1px', color: '-linear-gradient(#1d1a1a, #4c494a)' } );
	Cufon.replace('.container h1' );
	Cufon.replace('.container h2' );
	Cufon.replace('#intro h2' );
	Cufon.replace('.container h3' );
	
	// First/Last child's
	$("#footer li:last-child").addClass("last");

	// 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");
		
		// PNG support
		var PNG_fix_selectors = [
    	".contact-info dl",
    	".container span.top",
    	".container",
    	"#footer",
    	"#intro",
    	"#navigation li a",
    	"#intro .photo span",
    	".contact-info dl dt",
    	".logo .site-name",
    	"#navigation .serving p",
    	"#navigation",
    	".wrapper",
    	".login a",
    	"#header"
		];
		 
		if (typeof DD_belatedPNG !== "undefined") {
			DD_belatedPNG.fix(PNG_fix_selectors.join(","));
		}
		
	}

});
