/*
	CSS FIXES
	This adds classes to work around shortcomings in older browsers (*cough* Internet Explorer *cough*)
*/
function cssFixes() {

	if ($(".IE6").size() > 0) {
		DD_belatedPNG.fix("img, #hcontainer, #container");	
	}

	/* This helps when attribute selector support is lacking (*cough* IE6) */
	$("#container input[type='text']").addClass("text");
	$("#container input[type='radio']").addClass("radio");
	$("#container input[type='checkbox']").addClass("checkbox");
	$("#container input[type='password']").addClass("password");
	$("#container input[type='submit']").addClass("submit");

	/* This helps when :last-child support is lacking */
	$("#content :last-child").addClass("last-child");

	/* Awesomepersands - http://patrickhaney.com/thinktank/2008/08/19/automatic-awesompersands */
    $("*:contains('&')", document.body).contents().each(function() {
        if( this.nodeType === 3 ) {
            $(this).replaceWith(this.nodeValue.replace( /&/g, "<span class='amp'>&</span>"));
        }
    });

}

/*
	ONLOAD FUNCTION
	These functions are fired as soon as the DOM is ready
*/
$(document).ready(function () {
	cssFixes();
});