$(document).ready(function(){
						   
	$("#myTable, #myTable2, #myTable3").tablesorter({widgets: ['zebra']});
	
	$("#myTable td").click(function(){
		var obj = $(this).parent();	
		$("#loading").height($("#loading").parent().height()+"px").css("line-height",$("#loading").parent().height()+"px");
		$("#loading").css("width",$("#loading").parent().width()+"px").slideDown(1000, function(){
			$("#fld0").html($(obj).find(":eq(0)").html());
			$("#fld1").html($(obj).find(":eq(1)").html());
			$("#fld2").html($(obj).find(":eq(2)").html());
			$("#fld3").html($(obj).find(":eq(3)").html());
			$("#fld4").html($(obj).find(":eq(4)").html());
			setTimeout('$("#loading").slideUp(1000);', 2000);
		});
	});
	
	$("#search input").focus(function(){
		if ($.trim($(this).attr("value")) == "Search for meetings...")
			$(this).attr("value", "");
		$(this).addClass("normal");
	});
	
	$("#search input").blur(function(){
		if ($.trim($(this).attr("value")) == "") {
			$(this).attr("value", "Search for meetings...");
			$(this).removeClass("normal");
		}
	});
	
	$("#rfp .body").each(function(){
	
		this.onselectstart = function() {
			return false;
		};
		
		this.unselectable = "on";
		this.style.MozUserSelect = "none";
		this.style.cursor = "default";
	});
	
	$(".strechExpand").each(function(){
		$(this).height($(this).parent().height()+"px");
	})

	//$("#rfp .body").height($(window).height()-150+"px");
	
	$(".rfpNavHead").eq(0).each(function(){
		$(this).parent().addClass("selected");
		$(this).next().height($(this).parent().parent().parent().height()-$(this).height()*3 + "px");		
		$(this).next().show();
	});
	
	$(".rfpNavHead").mousedown(function(){
		var obj = this;
		if (!$(this).parent().hasClass("selected") && $(".selected .rfpNavBody").is(":not(:animated)") )
			$(".selected .rfpNavBody").slideUp({ 
				duration: 400, 
				easing: "easeInCubic",
				complete:function(){
					$(".rfpNavBody").hide().parent().removeClass("selected");
					$(obj).parent().addClass("selected");
					$(obj).next().height($(obj).parent().parent().parent().height()-$(obj).height()*3 + "px");		
					$(obj).next().slideDown({ 
						duration: 1000, 
						easing: "easeOutBounce"
					});
				}
			});
		
	});
	
	$(".rfpNavBody li > span").mousedown(function(){
		$(".rfpNavBody li").removeClass("selected");						   
		$(this).parent().addClass("selected");
	});

	$("#v-drag-1").jSize({
		type: 'left-right',
		c1: '.left',
		c2: '.right',
		static: '.left'
	});
						
	$("#h-drag-1").jSize({
		type: 'top-bottom',
		c1: '#meetingList',
		c2: '#meetingContent',
		static: '#meetingList'
	});
});
