$(document).ready(function(){	

 $("#loading").ajaxStart(function(){
   $(this).show();
 });
 	
 $("#loading").ajaxStop(function(){
   $(this).hide();
 });
 
 $("a#newsletter-list-link").toggle(
	function(){
	$("div#newsletter-list").show("slow");
	},
	function(){
	$("div#newsletter-list").hide("slow");
	}); // <end> toggle
	
}); // <end> document


function midblock(section,action,total) { //action newxt,or previous
	var sections = new Array();
	sections["i"] = new Array();
	sections["ec"] = new Array();
	sections["p"] = new Array();
	sections["fi"] = new Array();
	sections["i"]["name"] = "interviews";
	sections["ec"]["name"] = "ecs";
	sections["p"]["name"] = "projects";
	sections["fi"]["name"] = "files";
	
	page = $("input#"+sections[section]["name"]+"_page").val();
	if(action =="next") {
		page = eval(page) + 1;
		$("input#"+sections[section]["name"]+"_page").val(page);
	}
	else if(action=="previous") {
		page = eval(page) - 1;
		$("input#"+sections[section]["name"]+"_page").val(page);
	}
	$.ajax ({
        type            : 'GET',
        dataType        : 'html',
        url             : 'indexcontent.php?section='+section+'&page='+page,
        success        	: function(data)
        {
        	//alert(data);
        	$("div#"+sections[section]["name"]).html(data);
        }

}); 
        if( page > 1 && total > 1) {
        	$("input#"+sections[section]["name"]+"_previous").css("display","inline");
        } else {
        	$("input#"+sections[section]["name"]+"_previous").hide();
        } // <end> if
      // alert(total + " - " + page);
        if(total == 1 || total == page) {
        	$("input#"+sections[section]["name"]+"_next").hide();
        }else {
       	$("input#"+sections[section]["name"]+"_next").show();
        }
}; // <end> midblock;

function toggleForum(active) {
	
		$.ajax ({
        type            : 'GET',
        dataType        : 'html',
        url             : 'indexforum.php?active=' + active,
        success        	: function(data)
        {
        	$("div#f").html(data);
        }

}); 
}