function saveComment(){
	var content = $('#content').val();
	var newsid = $('#newsid').val();
	if(content != ""){
		$("#comments").load('/commentadd',{"content":content, "newsid":newsid}, function(){
			$("#comment_send").click(function() {
				saveComment();
			});
		});
	}
	else{
		alert("You must enter a comment before saving");
	}
}


function dashboard_init(){
	
	$('.dboard').click(function(){
		
		$('.dnav').removeClass('selected');
		$(this).parent().addClass('selected');
		var show = $(this).attr('rel');
		dashboard_load(show);
		return false;
	})
	
	if(window.location.hash){
		$(window.location.hash).click();
	}else
		dashboard_load('dashboard_news');
	
	$("#portal_welcome").fadeIn();
}


function dashboard_load(e){
	$("#portal_welcome").html("");
	var page = '/members/'+e;
	//alert(page);
	$("#portal_welcome").load(page, {}, function(){
		$('#dashboard_glider').loopedSlider({
		containerClick:false,
		container: 'dcontainer',	
		addPagination:true
		});
	
	});	

	
}


