// nav js
$(function() {
if (document.all&&document.getElementById) {
	navRoot = document.getElementById("nav_inner");
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI") {
			node.onmouseover=function() {
			this.className+=" over";
			}
			node.onmouseout=function() {
			this.className=this.className.replace(" over", "");
			}
			}
		}
	}
	if (document.getElementById&&!document.all) {
		navRoot = document.getElementById("nav_inner");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
				}
				node.onmouseout=function() {
			}
		}
	}
}
});

$(function() {

// tooltip
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(
		function(e){											  
			this.t = this.title;
			this.title = "";									  
			$("body").append("<p id='tooltip'>"+ this.t +"</p>");
			$("#tooltip")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px")
				.fadeIn("fast");		
		},
		function(){
			this.title = this.t;		
			$("#tooltip").remove();
		}
	);	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});
});
/*$(document).ready(function() {

    $("#nav_inner li").hover(
        function(){ $("ul", this).fadeIn("fast"); }, 
        function() { } 
    );
    if (document.all) {
        $("#nav_inner li").hoverClass ("over");
    }

});

$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
}; */


$(function() {
	$('.toggle').each(function(){
		$(this).empty().prepend("Show Details...");
		var id = $(this).attr("rel");
		$('#'+id).css({display:"none"});
	});
	$('.show_block').each(function(){
		$(this).empty().prepend("");
		var id = $(this).attr("rel");
		$('#'+id).css({display:"block"});
	});

});


// disables and changes text of Submit Buttons
$(function() {
	$('#submit').click(function(){
		$(this).val("Please wait...");
	});

	$('.toggle').click(function(){
		var id = $(this).attr("rel");
		var el = document.getElementById(id);
		 if($(el).css("display") == 'block'){
		   $(el).css({display: "none"});
		   $(this).empty().prepend("Show Details...");
		 } else {
		   $(el).css({display: "block"}); 
		   $(this).empty().prepend("Hide Details...");
		 }
		 window.status='';
		return false;
		
	}).mouseover(function(){
		 window.status='';					
	}).mousedown(function(){
		 return false;					
	});

});

