

// import
// ----------------------------------------------------------------------- //

$(function(){

	$.ajaxSetup({
       cashe:	false
	});

//	var timekey = (new Date()).getTime();

	var data_file = "../info/international/topics.dat?";
	$("#infoArea").load(data_file);

	var message_file = "../about/staffblog/message/international.dat?";
	$("#messageArea").load(message_file);

});



// what's new
// ----------------------------------------------------------------------- //

$(function(){

	var pass = 24;
//	var timekey = (new Date()).getTime();

	$.ajaxSetup({
       cashe:	false
	});


	// abroadblog

//	var new_abroadblog_file = "abroadblog/new.dat?" + timekey;
//	$.get(new_abroadblog_file, function(data){
//		data_read("abroadblog",data);
//	});

	var new_abroadblog_file = "abroadblog/new.dat?";
	$.ajax({
		async:	false,
        url:	new_abroadblog_file,
        success:	function(data,status) { data_read("abroadblog",data); pngfix(); }
    });


	function data_read(contentName,data) {
		if(whatsnew(data)) {
			var target = "#" + contentName + "C";
			$(target).addClass("new");
		}
	}

	function whatsnew(last_time) {
		var currentDate = new Date(); 
		time = last_time.split(":");
		var entryDate = new Date(time[0], time[1]-1, time[2], time[3], time[4], time[5]); 
		var now = (entryDate.getTime() - currentDate.getTime())/(60*60*1000); 
		now = Math.ceil(now);
		if(-now <= pass){
			return true;
		}
	}
	
});



// png fix
// ----------------------------------------------------------------------- //

function pngfix(){
     $("#content .cNav li.new a span").pngfix();
};

