﻿ function startKeepConnection()
 {
	window.status = "アップロードを開始しました。" ;
	keepConnection() ;
	setInterval( "keepConnection()", 30000 ) ;
	return true ;
 }
 
 function keepConnection()
 {
	httpObj = createXMLHttpRequest( displayMessage );
    if (httpObj)
    {
       dd = new Date();
       httpObj.open("GET","keepConnection.xml?" + dd.getTime(), true);
       httpObj.send(null);
    }
 }
 
 function displayMessage()
 {
    if ((httpObj.readyState == 4) && (httpObj.status == 200))
    {
       window.status = "アップロード中です..." ;
    }
 }
 
 function createXMLHttpRequest(cbFunc)
 {
    var XMLhttpObject = null;
    try{
       XMLhttpObject = new XMLHttpRequest();
    }catch(e){
       try{
           XMLhttpObject = new ActiveXObject("Msxml2.XMLHTTP");
       }catch(e){
           try{
                XMLhttpObject = new ActiveXObject("Microsoft.XMLHTTP");
           }catch(e){
                return null;
           }
      }
    }
    if (XMLhttpObject) XMLhttpObject.onreadystatechange = cbFunc;
        return XMLhttpObject;
}
