window.onload=function(){
                         
	            
	var url="http://web.pts.org.tw/php/programX/ajax_getdata.php";  
    
	ajaxAction="updateContent";    
	var data = "?Channel="+Channel+"&ID="+ID;
	url += data;
	httpRequest("GET",url,true);
	
	
   // httpRequest("POST", url, true, data);

}

//==========================================================================
function getRequest(fURL){

    var Request = new Object(); 
    if(fURL.indexOf("?")!=-1) { 
        var str = fURL.substr(1); 
        strs = str.split("&"); 
        for(var i=0;i<strs.length;i++)  
            Request[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
    } 
    return Request;


}


//==========================================================================
function getContent(resp){
                   
	var myProgram=document.getElementById("myProgram");
	myProgram.innerHTML = resp;
}




/***AJAX Module***/

//==========================================================================
var request=null;

var ajaxAction;

//event handler for XMLHttpRequest

function handleResponse(){

    try{

        if(request.readyState == 4){

            if(request.status == 200){

                
               
			
            	var resp = eval(request.responseText.replace("\r\n","\\r\\n")); 
				switch(ajaxAction){

					case "updateContent":
						getContent(resp);

						break;

				}
				

            } else {

                //request.status is 503 

                //if the application isn't available; 

                //500 if the application has a bug

                alert(

                        "A problem occurred with communicating between the "+

                        "XMLHttpRequest object and the server program.");

            }

        }//end outer if

    } catch (err) {

        alert("It does not appear that the server is available "+

             "for this application. Please"+

              " try again very soon. \nError: "+err.message);



    }

}



/***AJAX Module***/

