$(document).ready(function(){
	
	//alert($("#nav li div, #nav li ul li").css("background-position"));
	
	$.ifixpng('/js/pixel.gif');
	$(".collapse").prepend("<img class=\"d\" src=\"/js/triangle2.png\"/> ");
	$(".collapse").prepend("<img class=\"r\" src=\"/js/triangle.png\"/> ").children("img.d").toggle();
	$('img[@src$=.png]').ifixpng();
	$(".collapse").next("p").next("div").slideToggle("fast");
	
	$(".read").click( function() {
		$(this).prev("div").slideToggle();
		$(this).toggle();
		$(this).prev("div").prev("p").prev("h3").children("img").toggle();
		$('img[@src$=.png]').ifixpng();
		$(this).prev("div").prev("p").prev("h3").removeClass("up");
		$(this).prev("div").prev("p").prev("h3").addClass("down");
	});
	
	$(".collapse").click( function() {
		$(this).children().toggle();
		$('img[@src$=.png]').ifixpng();
		$(this).next("p").next("div").slideToggle("slow");
		$(this).next("p").next("div").next(".read").toggle();
	});
	
	$("a.pdf").fancybox();
	$("a.fancybox").fancybox();
});



sfHover = function() {
	$("#nav li div, #nav li ul li").mouseover(function() {
		
		//alert($(this).css("background-position"));
		if($(this).css("background-position")=="bottom")
			$(this).addClass("here");
		else
			$(this).css("background-position", "bottom");
	});
	
	$("#nav li div, #nav li ul li").mouseout(function() {
		if($(this).attr("class")!="here")
			$(this).css("background-position", "top");
	});
/*	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].mouseover(function() {
			
		});
		sfEls[i].onmouseout=function() {
		}
	}*/
}

//if (window.attachEvent) {window.attachEvent("onload", sfHover);}