/*
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 * This collection of scripts is built on top of the very light weight jQuery library.
 * Credit for jquery menu goes to Myles Angell with a bit of shim correction from Adam Cooper
 */

$(document).ready(function(){ 
	if (document.all){ $("#firstwave li").hoverClass("sfHover"); }
	$(".tools").prepend("<div></div><span>Tools</span>");
	$(".toolsadmin").prepend("<div></div><span>Project Admin</span>");
	$(".subdiv").prepend("<div></div><span>&nbsp;</span>");
	$(".sethide").toggle(function(){ 
		$(this).css("color", "#000");
		$("span.question").html(":");
		$(".obj").css("display", "inline");
	  },function(){
		$(this).css("color", "#039");
		$("span.question").html("?");
		$(".obj").css("display", "none");
	  });
	$("label").click(function(){$(this).find("input[@type='checkbox']").check();});
});
$.fn.hoverClass = function(c) {
        return this.each(function(){
 	if ( jQuery.browser.msie ) { 
        	$(this).hover(
        	        function() { $(this).addClass(c).find("> ul").slideDown("xfast").addShim(); },
                	function() { $(this).removeClass(c).find("> ul").end().removeShim(); }
        	);
	} else {
	        $(this).hover(
                	function() { $(this).addClass(c); },
                	function() { $(this).removeClass(c); }
        	);
	};
        });
};

$.fn.addShim = function() {
        return this.each(function(){
                if(document.all && $("select").size() > 0) {
                        var ifShim = document.createElement('iframe');
                                ifShim.style.width=$(this).width()+1+"px";
                                ifShim.style.height=$(this).find("> li").size()*23+4+"px";
                                ifShim.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
                                ifShim.style.zIndex="0";
                        $(this).prepend(ifShim);
                        $(this).css("zIndex","99");
                }
        });
};

$.fn.removeShim = function() {
        return this.each(function(){
                if (document.all) $("iframe", this).remove();
        });
};
$.fn.check = function() {
	return this.each(function() {
		this.checked = true;
	});
};


