$.ajaxSetup({
	cache: false
});


window.onload = function() {
    pHistory();
    timerID = setInterval("pHistory()",3000);
}

function pHistory(){
	$("#news").load("realtime.txt");
	$("#time").text(clocknow());
}

function clocknow() {

    weeks = new Array("日","月","火","水","木","金","土") ;
    now = new Date() ;
    y = now.getFullYear() ;
    mo = now.getMonth() + 1 ;
    d = now.getDate() ;
    w = weeks[now.getDay()] ;
    h = now.getHours(); 
    mi = now.getMinutes(); 
    s = now.getSeconds(); 

    // 月、日、時、分、秒が一桁のとき、頭に0を付加します
    if ( mo < 10 ) { mo = "0" + mo ; } 
    if ( d < 10 ) { d = "0" + d ; } 
    if ( h < 10 ) { h = "0" + h ; } 
    if ( mi < 10 ) { mi = "0" + mi ; } 
    if ( s < 10 ) { s = "0" + s ; } 

    v = "更新日時:" + y + "年" + mo + "月" + d + "日(" + w + ")" + h + "時" + mi + "分" + s + "秒";
    return v;
}

