// JavaScript Document
$(function(){
	$("#nav > ul > h4").click(function(){
		if($(this).nextAll("div").is(":visible")){
			$(this).nextAll("div").slideUp("normal");
		}else{
			$(this).parent().siblings().children().not("h4").slideUp("normal");
			$(this).nextAll("div").slideDown("normal");
			
		}
	})
  	$("#nav > ul > div").click(function(){
		if($(this).nextAll("p").is(":visible")){
			$(this).nextAll("p").slideUp("normal");
		}else{
			
			$(this).parent().siblings().children("p").slideUp("normal");
			$(this).nextAll("p").slideDown("normal");
			
		}								   
	})

	if($("#handle").length>0){
		$("#handle").slider({
			orientation: "vertical",
			range: "max",
			min: 0,
			max: 100,
			value: 100,
			slide: function(event, ui) {
				n=100-ui.value;
				h=$("#content").height();
				h_box=$("#content").parent().height();
				m=h-h_box;
				if(m>0){
					n=parseInt(m*n*0.01)+1;
					n*=-1;
					$("#content").css("top",n);
				}else{
					$("#content").css("top",0);	
				}
			}
		});
	}
		   
})

$(document).bind("contextmenu",function(e){    
    return false;   
});

