function unsetFlashClass(objId) {
    myObj = document.getElementById(objId);
    if(myObj) myObj.className = '';
}

function ie6header() {
	if($("#content1").css("width")=='802px') {
		return '0';
	} else {
		return '10px';
	}
}

function createCookie(name,value,days) {
	if (document.cookie == "") {
		return false;
	}

	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";

	return true;
}

$(function(){

	// search form
	sstr = "Search Site";
	$("#s").focus(function(){
		if( $(this).val() == sstr )  $(this).val("");
	}).blur(function(){
		if( $(this).val() == "" )  $(this).val(sstr);
	});

	// external Links
	$("a[rel='external']").each(function(){
		if(!$(this).attr("title")) {
            $(this).attr("title",'Link opens in a new window');
        } else if($(this).attr("title").indexOf('Link opens in a new window')== -1) {
            $(this).attr("title",$(this).attr("title")+' - Link opens in a new window');
        }
	}).click(function(){
		window.open($(this).attr("href"));
		return false;
	});

	// prepare H2 for sIFR
	$("#contentColumns h2:not('.smaller')").each(function(){ $(this).addClass("forSIFR")});

	// some spacing issues
	$("h2.smaller + p").css("margin-top", "0");
	$("p.enhanced + ul,p.enhanced + ol,p.enhanced + p").css("margin-top", "2px");

	// fix first-child table aligns for IE6
	if ($.browser.msie && parseInt($.browser.version)<7) {
		$("table.twoCol th").css({width:"70%"});
	}

	// accreditation disclaimer
	$("#accred").tooltip({
		track: true,
		bodyHandler: function() {
        return $("#accred-disclaimer").text();
    }
	});

});
