today = new Date();
year = today.getFullYear();
yyyy = year;
month = today.getMonth();
mm = month + 1;
dd = today.getDate();
tt = today.getTime();
if ( mm < 9 ){ mm = "0" + mm;}


function loadCSV(){
httpObj = createXMLHttpRequest(displayData);
if (httpObj){
httpObj.open("GET","closed_update/list.csv" + "?" + yyyy + mm + dd + tt,true);
httpObj.send(null);
}
}

var ajax_filter = function(t){return t};
if(navigator.appVersion.indexOf( "KHTML" ) > -1){
    ajax_filter = function(t){
        var esc = escape(t);
        return(esc.indexOf("%u") < 0 && esc.indexOf("%") > -1) ? decodeURIComponent(esc) : t
    }
}

function displayData(){
    if ((httpObj.readyState == 4) && (httpObj.status == 200)){
        var text = ajax_filter(httpObj.responseText);
        document.getElementById("result").innerHTML = parseText(text);
    }
}
function parseText(str){
    var resultText="<table cellspacing='0' cellpadding='0' class='table01c width640'>";
    var CR = String.fromCharCode(13);
    var LF = String.fromCharCode(10);
    lineData = str.split(CR);

    for (var i=0; i<lineData.length; i++){
        strText = lineData[i].split(",");
        resultText += "<tr>";
        
        for (var j=0; j<strText.length; j++){
            if (i < lineData.length){
                if(j <= 1 && j >= 0){
                    if (i == 0){
                        resultText += "<th>"+strText[j]+"</th>";
                    }else if (i >= 1){
                        resultText += "<td class='aligncenter'>"+strText[j]+"</th>";
                    }else{
                        resultText += "<td>"+strText[j]+"</td>";
                    }
                }
                if(j < 6 && j >= 2){
                    if (i == 0){
                        resultText += "<th>"+strText[j]+"</th>";
                    }else{
                        resultText += "<td>"+strText[j]+"</td>";
                    }
                }
                if(j == 6){
                    if (i == 0){
                        resultText += "<th class='width200'>"+strText[j]+"</th>";
                    }else{
                        resultText += "<td>"+strText[j]+"</td>";
                    }
                }
            }
        }
        resultText += "</tr>";
    }
    return resultText;
}

