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 loadDataDT( strTargetId, strUriPath, strCallBackFunc ) {


	bFlagPost = 1;

	strId = strTargetId;


/*
	objSelectYear = document.getElementById( 'select_year' );
	objSelectMonth = document.getElementById( 'select_month' );

	strYear = objSelectYear.options[objSelectYear.selectedIndex].value;
	strMonth = objSelectMonth.options[objSelectMonth.selectedIndex].value;
*/

	objSelectYearMonth = document.getElementById( 'select_year_month' );
	strYearMonth = objSelectYearMonth.options[objSelectYearMonth.selectedIndex].value;

//	strDate = strYear + '-' + strMonth;

	strDate = strYearMonth.substr( 0, 4 ) + '-' + strYearMonth.substr( 4, 2 );

	if ( strDate ) {

		bFlagPost = 1;

	}

	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( 'date=' + encodeURI( strDate ) );

		}
		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>';

	}


}

