$(document).ready(function(){

	$("img.png24").pngfix();

	$("ul.dropdown li").dropdown();

	/* Fragments */

	if($(".tabs").length) {

		$(".tabs li > a.on").show_fragment();

		$(".tabs li a").click(function(){
			var parent = $(this).parents(".tabs");
			$("li > a.on", parent).hide_fragment();
			$(this).show_fragment();
			return false;
		});

	}


});

$.fn.show_fragment = function() {
	var fragment = $(this).attr("href");
	$(this).addClass("on");
	$(fragment).show();
}

$.fn.hide_fragment = function() {
	var fragment = $(this).attr("href");
	$(this).removeClass("on");
	$(fragment).hide();
}

$.fn.dropdown = function() {

	$(this).hover(function(){
		$(this).addClass("hover");
		$('> .dir',this).addClass("open");
		$('.box:first',this).show();
	},function(){
		$(this).removeClass("hover");
		$('.open',this).removeClass("open");
		$('.box:first',this).hide();
	});

}
