var strId = null;



function createXMLHttpRequest( strFunction ) {


	var objXmlHttp = null;

	if ( window.XMLHttpRequest ) {

		objXmlHttp = new XMLHttpRequest();

	}
	else if ( window.ActiveXObject ) {

		try {

			objXmlHttp = new ActiveXObject( "Msxml2.XMLHTTP.3.0" );

		}
		catch ( e ) {

			try {

				objXmlHttp = new ActiveXObject( "Msxml2.XMLHTTP.6.0" );

			}
			catch ( e ) {

				return null;

			}

		}

	}

	if ( objXmlHttp ) {

		objXmlHttp.onreadystatechange = strFunction;

		return objXmlHttp;

	}


}



function loadDataTT( strTargetId, strUriPath, strCallBackFunc ) {


	bFlagPost = 1;

	strId = strTargetId;


	objSelectStation = document.getElementById( 'select_station' );

	strStation = objSelectStation.options[objSelectStation.selectedIndex].value;

	objHttp = createXMLHttpRequest( strCallBackFunc );

	if ( objHttp ) {

		// POST送信
		if ( bFlagPost ) {

			objHttp.open( "POST", strUriPath, true );
			objHttp.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' ); 

			objHttp.setRequestHeader( 'Pragma', 'no-cache' );
			objHttp.setRequestHeader( 'Cache-Control', 'no-cache' );

			objHttp.send( 'code_station_from=' + encodeURI( strStation ) );

		}
		else {

			objHttp.open( "GET", strUriPath, true );

			objHttp.setRequestHeader( 'Pragma', 'no-cache' );
			objHttp.setRequestHeader( 'Cache-Control', 'no-cache' );

			objHttp.send( null );

		}

	}
	else {

		// 処理なし

	}


}



function displayHtml() {


	if (
		   ( objHttp.readyState == 4 )
		&& ( objHttp.status == 200 ) ) {

		document.getElementById( strId ).innerHTML = objHttp.responseText;

	}
	else if (  ( objHttp.readyState == 4 )
			&& ( objHttp.status == 404 ) ) {

		document.getElementById( strId ).innerHTML = '<div></div>';

	}
	else {

			//document.getElementById( strId ).innerHTML = '<div>Now Loading...</div>';

	}


}

