// JavaScript Document
$(function(){
	$("a[href*='.doc']:not(:has(img))").each( function(){ handleFile(this,"doc");});
	$("a[href*='.ppt']:not(:has(img))").each( function(){ handleFile(this,"ppt");});
	$("a[href*='.xls']:not(:has(img))").each( function(){ handleFile(this,"xls");});
	$("a[href*='.pdf']:has(img)").each(function(){$(this).css({background:"none", padding: "0", display:"inline", textIndent:"0"});});
	
	function handleFile(e,t){
		if (t != "") {
			$(e).attr({target:"_blank"}).css({background:"url(/cgi-bin/images/" + t + ".png) center right no-repeat", padding: "2px 18px 2px 0", display:"inline-block", textIndent:"0px"});
			if ($(e).parents("#nav").length>0){$(e).css({display:"block", marginRight:"4px", padding: "5px 16px 5px 0px"});
		};
	}};
	
	$("#ResourceList ol[id^=sec]").hide();
	$("#ResourceList a").click(function(){$("#ResourceList ol[id^=sec]").hide();$(this).parent("li").children("ol").show();return false});											
});
