//2010-01-28 by David
$(document).ready(function(){
    $.fn.delay = function(time, callback){
        // Empty function:
        jQuery.fx.step.delay = function(){};
        // Return meaningless animation, (will be added to queue)
        return this.animate({delay:1}, time, callback);
    }
	$("#index_news_list").load("news.php", {
		ntype: "0"
	});
	
    $("a[rel*=news]").bind("mouseover", function(){
         $("#index_news_list").delay(300, function(){
            //$("#index_news_list").hide();
    		$("#index_news_list").load("news.php", {
    			ntype: "1"
    		});
    		$("#index_news_list").show();
    		return false;
         });
         
	});
	$("a[rel*=news]").bind("click", function(){
		location.href = "news_list.php?n=1";
		return false;
	});
	$("a[rel*=activity]").bind("mouseover", function(){
	   $("#index_news_list").delay(300, function(){
      // $("#index_news_list").hide();
		$("#index_news_list").load("news.php", {
			ntype: "2"
		});
		$("#index_news_list").show();
		return false;
		});
	});
	$("a[rel*=activity]").bind("click", function(){
		location.href = "news_list.php?n=2";
		return false;
	});
		$("a[rel*=announcement]").bind("mouseover", function(){
		$("#index_news_list").delay(300, function(){
        //$("#index_news_list").hide();
        $("#index_news_list").load("news.php", {
			ntype: "3"
		});
		$("#index_news_list").show();
		return false;
		});
	});
	$("a[rel*=announcement]").bind("click", function(){
		location.href = "news_list.php?n=3";
		return false;
	});
	$("#news_area a").bind("mouseout", function(){
        $("#index_news_list").stop();
    });
});