var ajax_pb_interval = 15000;
var PreImgArray = new Array(4);
PreImgArray [0] = new Image();
PreImgArray [1] = new Image();
PreImgArray [2] = new Image();
PreImgArray [3] = new Image();

function reload_chart(chart_id, trg_chart_path, chart_alt, idx){
    img_path= trg_chart_path + "?" + getUID();
    PreImgArray[idx].src = img_path;
    PreImgArray[idx].onerror = function(){
//  画像が読み込めない時のエラー処理
//       alert('画像が読み込めない->' + PreImgArray[idx].src);  
       return(true);
    }
    $(chart_id).src = img_path;
       return(true);
//    var tmp_img = new Image();
//    PreLoad(img_path); 
}

function PreLoad(URL) {
    tmp_img = new Image();
    tmp_img.src = URL;
    tmp_img.onerror = function(){
        alert('画像が読み込めない->' + tmp_img.src);  
    }
}

function getUID(){
    var date = new Date();

    yy = date.getYear();            // 0 = 1900 年
    mm = date.getMonth();           // 0 = 1 月
    dd = date.getDate();
    yb = date.getDay();             // 0 = 日曜日
    hh = date.getHours();
    mn = date.getMinutes();
    sc = date.getSeconds();
    ms = date.getTime();            // ミリセカンド換算値
    gm = date.getTimezoneOffset();  // GMT との差(分単位)
    
    return (yy + "" + mm + ""+ yb + "" + hh + "" + mn + "" + sc + "" +ms);
}


