function create_http_request(){
	var http_request=null;
	try{
		http_request=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
			http_request=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(sc){
			http_request=null;
		}
	}
	if(!http_request&&typeof XMLHttpRequest!="undefined"){
		http_request=new XMLHttpRequest();
	}
	return http_request;
}

//----------------------------------------------------------------
// MAC対策用UTF変換関数です
//----------------------------------------------------------------
function get_response_text( text ) {
	if ( navigator.appVersion.indexOf( "KHTML" ) > -1 ) {
		var esc = escape( text );
		if ( esc.indexOf("%u") < 0 && esc.indexOf("%") > -1 ) {
			text = decodeURIComponent( esc );
		}
	}
	return text;
}

//----------------------------------------------------------------
// function http_request
// javascriptからリクエストを送信し、その結果を直接htm内に反映
// させます
// 
// @1: リクエストの方法(GET or POST)
// @2: リクエストURI
// @3: リクエストの際の送信する値(&区切り)
// @4: 結果を反映させるhtmlタグのname及びid
//----------------------------------------------------------------
function http_request( method, uri, vars, display_tag ) {
	var http_request=create_http_request();
	if (http_request) {
		http_request.onreadystatechange = function(){
			if (
				http_request.readyState == 4
				&& http_request.status == 200
			){
				// set data to html object
//				alert( http_request.responseText );
				document.getElementById(display_tag).innerHTML
					= get_response_text( http_request.responseText );
			}
		};
		http_request.open(method, uri, true);
		http_request.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded");
		http_request.send(vars);
	}
}
// 呼び出し
function Onload_showinfo(){
	myDate = new Date();
	cur_date = (1900 + (myDate.getYear() % 1900) )*10000;
	cur_date += ( myDate.getMonth() + 1 )*100;
	cur_date += myDate.getDate();
	year = (1900 + (myDate.getYear() % 1900) );
	month = ( myDate.getMonth() + 1 );
	day = myDate.getDate();
	http_request( 'post', './ajax/whatsnew_top.php', 'year='+year+'&month='+month+'&day='+day, 'whatsnew' );
}
// -->

