﻿
//http://www.kodomonoe.com/kirakira_prg/img_random.php		tc_file/img_random.php
function img_random(){
	
	sendData= "";
	
	target = "#contents";
	
	httpObj = createXMLHttpRequest(displayData);
	
	if (httpObj){
		httpObj.open("POST","tc_file/img_random.php",true);
		httpObj.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");
		httpObj.send(sendData);
	}
	
}


function displayData(){
	
	if (httpObj.readyState == 4) {
		if (httpObj.status == 200) {
			$(target).html( httpObj.responseText );
	    } else {
			$(target).html("接続に失敗しました。");
		}
    }
	
//	httpObj.send("");
}


function img_random2(){


//	$("#header").html( rss_title );
	
	target = "#contents";
	
	httpObj = createXMLHttpRequest2();

	httpObj.open("POST","tc_file/img_random.php",true);
	httpObj.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");
	httpObj.send();

    httpObj.onreadystatechange = function() 
	{

//	alert("readyState" + httpObj.readyState );
      //readyState値は4で受信完了
		if ((httpObj.readyState == 4) && (httpObj.status == 200)){
			$(target).html( httpObj.responseText );
		}
		
	}
	

}
