/*************************************************
**	
**	
*************************************************/

//「戻る」でpostdataを保持するためのハッシュテーブル
var g_postdata = new Object();

//----------------------------------------------
//	クライアントのブラウザを確認して接続方法(?)を確立
//----------------------------------------------
function ajax_get_xmlhttp() {
	//  If IE7, Mozilla, Safari, etc: Use native object
	if(window.XMLHttpRequest) {
	//alert('IE7, Mozilla, Safari, etc');
		xmlhttp = new XMLHttpRequest();
	// ...otherwise, use the ActiveX control for IE5.x and IE6
	} else if(window.ActiveXObject) {
	//alert('IE5.x and IE6');
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlhttp;
}

//---------------------------------------------
//	ajaxの実行部 POST版
//	
//----------------------------------------------
function ajax_post_exe(id,dofile,postdata){

	//XMLHttpRequestを取得
	xmlhttp	=	ajax_get_xmlhttp();
	

	//alert(id);
	//alert(dofile);
	//alert(postdata);

	var last_modified = 'Thu, 01 Jun 1970 00:00:00 GMT';
	var cached_content = '';
	if (!xmlhttp) return;
	xmlhttp.open('POST', dofile, true);

	if(last_modified){
		xmlhttp.setRequestHeader("If-Modified-Since", last_modified); 
	}

	// サーバから応答があった場合の処理
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status == 200) {
			document.getElementById(id).innerHTML = xmlhttp.responseText;

			if(xmlhttp.getAllResponseHeaders().match("Last-Modified")){ 
				last_modified = xmlhttp.getResponseHeader("Last-Modified"); 
			}

			if(xmlhttp.responseText.length == 0){ 
					document.getElementById(id).innerHTML = cached_content; 
			} else {
					cached_content = xmlhttp.responseText;
			}
		//通信中の表示
		}else{
			//document.getElementById(id).innerHTML ="<p><div align='center'><strong>Now loading....</strong></div>";
		}
	}
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlhttp.send(postdata);
}




// body部ロード完了時イベント
function body_onload(){

//    var menu_flg = document.getElementById('menu_flg').value;

//    switch ( menu_flg )
//    {

//      case "100":
//       break;

//      case "200":
//      change_date("truck_list","./truck/truck_nouhin_truck_list.php");
//       break;

//      default:

//    } //switch

}

