var selectedAccountId	= null;
var accountIdArray;
var targetYear;
var targetMonth;
var targetDay;
function changeAccount(id) {
	var tabname		= null;
	var tabObject	= null;
	for(var i=0; i<accountIdArray.length; i++ ) {
		tabname	= 'actab_' + accountIdArray[i];
		tabObject = $(tabname);
		tabObject.style.backgroundColor = '#FFF0F0';
	}
	selectedAccountId	= id;
	tabname	= 'actab_' + id;
	tabObject = $(tabname);
	tabObject.style.backgroundColor = '#FFCCF0';
	document.inputform.account_id.value = selectedAccountId;
	reload_list();
}
var dayBackColor;
var dayFontColor;
function dayOnMouseOver(obj) {
	dayBackColor	= obj.style.backgroundColor;
	dayFontColor	= obj.style.color;
	obj.style.backgroundColor='#FFDDFF';
	obj.style.color = '#8080F0';
}
function dayOnMouseOut(obj) {
	obj.style.backgroundColor=dayBackColor;
	obj.style.color=dayFontColor;
}
function changeTargetDate(year,month,day) {
	var dayObject		= $('daycell_'+targetYear+targetMonth+targetDay);
	dayObject.style.backgroundColor = '#FFFFFF';
	targetYear	= year;
	targetMonth	= month;
	targetDay	= day;
	dayObject		= $('daycell_'+targetYear+targetMonth+targetDay);
	dayObject.style.backgroundColor = '#DDEEFF';
	dayBackColor = '#DDEEFF';
	var datePanel = $('input_date_container');
	datePanel.innerHTML = targetYear + '年' + targetMonth + '月' + targetDay + '日';
	document.inputform.action_date_year.value = targetYear;
	document.inputform.action_date_month.value = targetMonth;
	document.inputform.action_date_day.value = targetDay;
	reload_list();
}
/**
 * 指定月のカレンダーを呼び出す
 */
function load_calendar() {
	httpObj = createXMLHttpRequest(view_calendar);
	var contents = '';
	if (httpObj) {
		var url	= './ajax/calendar.php?hkbcldty='+targetYear+'&hkbcldtm='
			+targetMonth+'&hkbcldtd='+targetDay;
		httpObj.open("GET",url,true);
		httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		httpObj.send(null);
	}
}
function view_calendar() {
	if ((httpObj.readyState == 4) && (httpObj.status == 200)){
		$('calendar_container').innerHTML	= httpObj.responseText;
		changeTargetDate(targetYear,targetMonth,targetDay);
	}else if((httpObj.readyState == 4) && (httpObj.status != 200)){
		$('calendar_container').innerHTML	= 'カレンダーの読み込みに失敗しました';
	}else{
	}
}
function next_month() {
	var iMonth = parseInt(targetMonth);
	iMonth++;
	if( iMonth == 13 ) {
		targetMonth = '01';
		iYear		= parseInt(targetYear);
		iYear++;
		targetYear	= String(iYear);
	} else if ( iMonth < 10 ){
		targetMonth	= '0' + String( iMonth );
	} else {
		targetMonth = String( iMonth );
	}
	targetDay	= '01';
	load_calendar();
}
function prev_month() {
	var iMonth = parseInt(targetMonth);
	iMonth--;
	if( iMonth == 0 ) {
		targetMonth = '12';
		iYear		= parseInt(targetYear);
		iYear--;
		targetYear	= String(iYear);
	} else if ( iMonth < 10 ){
		targetMonth	= '0' + String( iMonth );
	} else {
		targetMonth = String( iMonth );
	}
	targetDay	= '01';
	load_calendar();
}

/**
 * 現在のデータリスト取得関連
 */
var httpObj;
var httpResponse;
var panelList;
function reload_list() {
	panelList	= $('data_list');
	httpObj = createXMLHttpRequest(view_list);
	var contents = '';
	if (httpObj) {
		var url	= './ajax/data_list.php?hkbdaci='+selectedAccountId+'&hkbdty='
			+targetYear+'&hkbdtm='+targetMonth+'&hkbdtd='+targetDay;
		httpObj.open("GET",url,true);
		httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		httpObj.send(null);
	}
}
function view_list() {
	panelList	= $('data_list');
	if ((httpObj.readyState == 4) && (httpObj.status == 200)){
		panelList.innerHTML	= httpObj.responseText;
	}else if((httpObj.readyState == 4) && (httpObj.status != 200)){
		panelList.innerHTML	= 'データの読み込みに失敗しました';
	}else{
	}
}
/**
 * データ登録関連
 */
var isQuickDataPost = false;
function quick_post_data(item_id,amount) {
	alert('アイテムを入力します。\n金額が違う場合は一覧の金額部分をクリックして変更することができます。');
	document.inputform.item_id.value	= item_id;
	document.inputform.amount.value		= amount;
	isQuickDataPost	= true;
	post_data();
}
function post_data() {
	var contents			= "command=0";
	var account_id			= document.inputform.account_id.value;
	var item_id				= document.inputform.item_id.value;
	var action_date_year	= document.inputform.action_date_year.value;
	var action_date_month	= document.inputform.action_date_month.value;
	var action_date_day		= document.inputform.action_date_day.value;
	var amount				= document.inputform.amount.value;
	if( !account_id || account_id.length == 0 ) {
		alert('対象の口座が選択されていません!');
		return false;
	}
	if( isQuickDataPost ) {
		if( ( !item_id || item_id.length == 0 ) ) {
			alert('費目正しくありません!');
			return false;
		}
		isQuickDataPost	= false;
	} else {
		if( 'other' != selectBoxRoot.options[selectBoxRoot.selectedIndex].value
			&& ( !item_id || item_id.length == 0 ) ) {
			alert('費目が選択されていません!');
			return false;
		}
	}
	if( isNaN(num = parseInt(amount)) || num <= 0 ) {
		alert('金額が入力されていません!');
		return false;
	} else if ( parseInt(amount) > 99999999 ) {
		alert('金額は99999999以下で入力してください。');
		return false;
	}
	
	contents	+= "&" + encodeURIComponent('account_id')+ "="+encodeURIComponent(account_id);
	contents	+= "&" + encodeURIComponent('item_id')+ "="+encodeURIComponent(item_id);
	contents	+= "&" + encodeURIComponent('action_date_year')+ "="+encodeURIComponent(action_date_year);
	contents	+= "&" + encodeURIComponent('action_date_month')+ "="+encodeURIComponent(action_date_month);
	contents	+= "&" + encodeURIComponent('action_date_day')+ "="+encodeURIComponent(action_date_day);
	contents	+= "&" + encodeURIComponent('amount')+ "="+encodeURIComponent(amount);
	if( document.inputform.item_name ) {
		contents	+= "&" + encodeURIComponent('item_name')+ "="+encodeURIComponent(document.inputform.item_name.value);
	}
	if( document.inputform.export_target ) {
		var selectedTypeIndex	= document.inputform.export_target.selectedIndex;
		var selectedTypeValue	= document.inputform.export_target.options[selectedTypeIndex].value;
		contents	+= "&" + encodeURIComponent('export_target')+ "="+encodeURIComponent(selectedTypeValue);
	}
	if( document.inputform.taxin.checked ) {
		contents	+= "&" + encodeURIComponent('taxin')+ "="+encodeURIComponent('false');
	}
	httpObj = createXMLHttpRequest(post_data_result);
	if (httpObj) {
		httpObj.open("POST",'./ajax/write.php',true);
		httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		httpObj.send(contents);
	}
}
/*
 * データ削除関連
 */
function delete_data( data_id ) {
	if( !data_id || data_id.length == 0 ) {
		alert('削除するデータを指定して下さい!');
		return false;
	}
	if( confirm('この操作は取り消せません!\n本当に削除してよろしいですか?') ) {
		var contents			= "command=0";
		contents	+= "&" + encodeURIComponent('hkb_data_id')+ "="+encodeURIComponent(data_id);
		httpObj = createXMLHttpRequest(post_data_result);
		if (httpObj) {
			httpObj.open("POST",'./ajax/delete.php',true);
			httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			httpObj.send(contents);
		}
	}
}
function post_data_result() {
	if ((httpObj.readyState == 4) && (httpObj.status == 200)){
		alert( httpObj.responseText );
		reload_list();
	}else if((httpObj.readyState == 4) && (httpObj.status != 200)){
		alert('不明な原因でデータの保存に失敗しました。しばらくしてからもう一度トライしてみてください。');
	}else{
	}
}
/**
 * マニュアル入力 費目選択関連ファンクション
 */
var itemHttpObj;
var selectBoxRoot;
var selectBoxChild;
var selectBoxGchild;
var selectBoxGGchild;
var itemIdInputBox;
function changeRootItem(obj) {
	selectBoxRoot		= obj;
	var selectedIndex	= selectBoxRoot.selectedIndex;
	var selectedValue	= selectBoxRoot.options[selectedIndex].value;
	$('child_select').innerHTML	= '';
	$('gchild_select').innerHTML	= '';
	$('ggchild_select').innerHTML		= '';
	$('other_text').innerHTML		= '';
	if( 0 == selectedIndex ) {
		itemIdInputBox.value	= '';
	} else if ( 'other' == selectedValue ) {
		itemIdInputBox.value	= '';
		viewCreateItemForm();
	} else {
		itemIdInputBox.value	= selectBoxRoot.options[selectedIndex].value;
		itemHttpObj = createXMLHttpRequest(changeRootItemResult);
		var contents = '';
		if (itemHttpObj) {
			itemHttpObj.open("GET",'./ajax/item_select.php?hkbitemi='+itemIdInputBox.value,true);
			itemHttpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			itemHttpObj.send(null);
		}
	}
}
function changeRootItemResult() {
	var panelChildSelect	= $('child_select');
	if ((itemHttpObj.readyState == 4) && (itemHttpObj.status == 200)){
		panelChildSelect.innerHTML	= itemHttpObj.responseText;
		var childSelectName			= 'childs_' + selectBoxRoot.options[selectBoxRoot.selectedIndex].value;
		var childSelectBox			= $(childSelectName);
		childSelectBox.onchange		= function() { changeChildItem(childSelectBox) };
	}else if((itemHttpObj.readyState == 4) && (itemHttpObj.status != 200)){
		panelChildSelect.innerHTML	= 'データの読み込みに失敗しました';
	}else{
	}
}
function changeChildItem(obj) {
	selectBoxChild		= obj;
	var selectedIndex	= selectBoxChild.selectedIndex;
	var selectedValue	= selectBoxChild.options[selectedIndex].value;
	$('gchild_select').innerHTML	= '';
	$('ggchild_select').innerHTML		= '';
	$('other_text').innerHTML		= '';
	if( 0 == selectedIndex ) {
		itemIdInputBox.value	= selectBoxRoot.options[selectBoxRoot.selectedIndex].value;
	} else if ( 'other' == selectedValue ) {
		itemIdInputBox.value	= selectBoxRoot.options[selectBoxRoot.selectedIndex].value;
		viewCreateItemForm();
	} else {
		itemIdInputBox.value	= selectBoxChild.options[selectedIndex].value;
		itemHttpObj = createXMLHttpRequest(changeChildItemResult);
		var contents = '';
		if (itemHttpObj) {
			itemHttpObj.open("GET",'./ajax/item_select.php?hkbitemi='+selectBoxChild.options[selectedIndex].value,true);
			itemHttpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			itemHttpObj.send(null);
		}
	}
}
function changeChildItemResult() {
	var panelChildSelect	= $('gchild_select');
	if ((itemHttpObj.readyState == 4) && (itemHttpObj.status == 200)){
		panelChildSelect.innerHTML	= itemHttpObj.responseText;
		var childSelectName			= 'childs_' + selectBoxChild.options[selectBoxChild.selectedIndex].value;
		var childSelectBox			= $(childSelectName);
		childSelectBox.onchange		= function() { changeGrandChildItem(childSelectBox) };
	}else if((itemHttpObj.readyState == 4) && (itemHttpObj.status != 200)){
		panelChildSelect.innerHTML	= 'データの読み込みに失敗しました';
	}else{
	}
}
function changeGrandChildItem(obj) {
	selectBoxGchild		= obj;
	var selectedIndex	= selectBoxGchild.selectedIndex;
	var selectedValue	= selectBoxGchild.options[selectedIndex].value;
	$('ggchild_select').innerHTML		= '';
	$('other_text').innerHTML			= '';
	if( 0 == selectedIndex ) {
		itemIdInputBox.value	= selectBoxChild.options[selectBoxChild.selectedIndex].value;
	} else if ( 'other' == selectedValue ) {
		itemIdInputBox.value	= selectBoxChild.options[selectBoxChild.selectedIndex].value;
		viewCreateItemForm();
	} else {
		itemIdInputBox.value	= selectBoxGchild.options[selectedIndex].value;
		itemHttpObj = createXMLHttpRequest(changeGrandChildItemResult);
		var contents = '';
		if (itemHttpObj) {
			itemHttpObj.open("GET",'./ajax/item_select.php?hkbitemi='+selectBoxGchild.options[selectedIndex].value,true);
			itemHttpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			itemHttpObj.send(null);
		}
	}
}
function changeGrandChildItemResult() {
	var panelChildSelect	= $('ggchild_select');
	if ((itemHttpObj.readyState == 4) && (itemHttpObj.status == 200)){
		panelChildSelect.innerHTML	= itemHttpObj.responseText;
		var childSelectName			= 'childs_' + selectBoxGchild.options[selectBoxGchild.selectedIndex].value;
		var childSelectBox			= $(childSelectName);
		childSelectBox.onchange		= function() { changeGGrandChildItem(childSelectBox) };
	}else if((itemHttpObj.readyState == 4) && (itemHttpObj.status != 200)){
		panelChildSelect.innerHTML	= 'データの読み込みに失敗しました';
	}else{
	}
}
function changeGGrandChildItem(obj) {
	selectBoxGGchild		= obj;
	var selectedIndex	= selectBoxGGchild.selectedIndex;
	var selectedValue	= selectBoxGGchild.options[selectedIndex].value;
	$('other_text').innerHTML		= '';
	if( 0 == selectedIndex ) {
		itemIdInputBox.value	= selectBoxGchild.options[selectBoxGchild.selectedIndex].value;
	} else if ( 'other' == selectedValue ) {
		itemIdInputBox.value	= selectBoxGchild.options[selectBoxGchild.selectedIndex].value;
		$('other_text').innerHTML	= '<input type="text" name="item_name" size="10" />';
	} else {
		itemIdInputBox.value	= selectBoxGGchild.options[selectedIndex].value;
	}
}
/*
 * 金額変更関連
 */
var editAmountBackValue;
var editNowObject;
var editInputObject;
function edit_amount( object ) {
	if( editNowObject && editNowObject != object ) {
	} else if( !editNowObject ) {
		editAmountBackValue	= object.innerHTML;
		editNowObject		= object;
		editNowObject.style.padding = '0px';
		object.innerHTML	= '<input type="text" id="amount_value" name="amount_value" size="20" '
			+ 'value="' + editAmountBackValue + '" '
			+ 'style="width:100%;height:100%;" onblur="edit_amount_release()" />';
		editInputObject		= $('amount_value');
		editInputObject.onkeydown	= function(e) {
			var keycode;
			if (e != null) {
				if(e.which == 13){ editInputObject.blur(); }
			} else {
				if(event.keyCode == 13){ editInputObject.blur(); }
			} 
		}
		editInputObject.focus();
	} else {
	}
}
function edit_amount_release() {
	if( editNowObject ) {
		var data_id	= editNowObject.id;
		data_id		= data_id.replace("income_", "");
		data_id		= data_id.replace("expense_", "");
		data_id		= data_id.replace("delete_", "");
		data_id		= data_id.replace("\r\n", "");
		data_id		= data_id.replace("\n", "");
		data_id		= data_id.replace(" ", "");
		var amount	= editInputObject.value;
		httpObj = createXMLHttpRequest(edit_amount_release_view);
		if (httpObj) {
			var contents = 'command=0';
			contents	+= "&" + encodeURIComponent('hkb_data_id')+ "="+encodeURIComponent(data_id);
			contents	+= "&" + encodeURIComponent('hkb_amount')+ "="+encodeURIComponent(amount);
			var url	= './ajax/update_amount.php';
			httpObj.open("POST",url,true);
			httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			httpObj.send(contents);
		}
	}
}
function edit_amount_release_view() {
	if ((httpObj.readyState == 4) && (httpObj.status == 200)){
		if( httpObj.responseText.indexOf('OK') >= 0 ) {
			if( editNowObject && editInputObject ){
				editNowObject.innerHTML	= editInputObject.value;
				editNowObject.style.padding = '5px';
				var intBackValue	= parseInt( editAmountBackValue );
				var intNewValue		= parseInt( editInputObject.value );
				var intDeferense	= intNewValue - intBackValue;
				if( editNowObject.id.indexOf('income_') >= 0 ) {
					// 収入のカラムとトータルカラムを変更
					var incomeTotal	= parseIntCellInnerHTML('income_total');
					var amountTotal	= parseIntCellInnerHTML('data_total_amount');
					incomeTotal	+= intDeferense;
					amountTotal += intDeferense;
					$('income_total').innerHTML	= String(incomeTotal);
					$('data_total_amount').innerHTML	= String(amountTotal);
				} else if( editNowObject.id.indexOf('expense_') >= 0 ) {
					var expenseTotal	= parseIntCellInnerHTML('expense_total');
					var amountTotal		= parseIntCellInnerHTML('data_total_amount');
					expenseTotal		+= intDeferense;
					amountTotal			+= intDeferense;
					$('expense_total').innerHTML	= String(expenseTotal);
					$('data_total_amount').innerHTML		= String(amountTotal);
				}
				editNowObject	= null;
				editInputObject	= null;
			}
		} else {
			alert(httpObj.responseText);
			if( editNowObject && editInputObject ){
				editNowObject.innerHTML	= editAmountBackValue;
				editNowObject.style.padding = '5px';
				editNowObject	= null;
				editInputObject	= null;
			}
		}
	}else if((httpObj.readyState == 4) && (httpObj.status != 200)){
		alert('データの読み込みに失敗しました');
		editNowObject	= null;
		editInputObject	= null;
	}else{
	}
}
function parseIntCellInnerHTML(name) {
	var object	= $(name);
	if( object ) {
		var html	= object.innerHTML;
		html		= html.replace("\r\n","");
		html		= html.replace("\r","");
		html		= html.replace("\n","");
		while( html.indexOf(" ") >= 0 ) {
			html		= html.replace(" ","");
		}
		return parseInt( html );
	} else {
		return -1;
	}
}
/*
 * 口座名変更関連ファンクション
 */
var editAccountNameBackValue;
var editAccountNameObject;
var editAccountNameInputObject;
function edit_account_name( object ) {
	if( editAccountNameObject && editAccountNameObject != object ) {
	} else if( !editAccountNameObject ) {
		editAccountNameBackValue	= object.innerHTML;
		editAccountNameObject		= object;
		editAccountNameObject.style.padding = '0px';
		object.innerHTML	= '<input type="text" id="account_name_value" name="account_name_value" size="20" '
			+ 'value="' + editAccountNameBackValue + '" '
			+ 'style="width:100%;height:100%;" onblur="edit_account_name_release()" />';
		editAccountNameInputObject		= $('account_name_value');
		editAccountNameInputObject.onkeydown	= function(e) {
			var keycode;
			if (e != null) {
				if(e.which == 13){ editAccountNameInputObject.blur(); }
			} else {
				if(event.keyCode == 13){ editAccountNameInputObject.blur(); }
			} 
		}
		editAccountNameInputObject.focus();
	} else {
	}
}
function edit_account_name_release() {
	if( editAccountNameObject ) {
		var account_id	= editAccountNameObject.id;
		account_id		= account_id.replace("account_", "");
		account_id		= account_id.replace("\r\n", "");
		account_id		= account_id.replace("\n", "");
		account_id		= account_id.replace(" ", "");
		var account_name	= editAccountNameInputObject.value;
		httpObj = createXMLHttpRequest(edit_account_name_release_view);
		if (httpObj) {
			var contents = 'command=0';
			contents	+= "&" + encodeURIComponent('hkb_account_id')+ "="+encodeURIComponent(account_id);
			contents	+= "&" + encodeURIComponent('hkb_account_name')+ "="+encodeURIComponent(account_name);
			var url	= './ajax/update_account_name.php';
			httpObj.open("POST",url,true);
			httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			httpObj.send(contents);
		}
	}
}
function edit_account_name_release_view() {
	if ((httpObj.readyState == 4) && (httpObj.status == 200)){
		if( httpObj.responseText.indexOf('OK') >= 0 ) {
			if( editAccountNameObject && editAccountNameInputObject ){
				editAccountNameObject.innerHTML	= editAccountNameInputObject.value;
				editAccountNameObject.style.padding = '5px';
				editAccountNameObject	= null;
				editAccountNameInputObject	= null;
			}
		} else {
			alert(httpObj.responseText);
			editAccountNameObject	= null;
			editAccountNameInputObject	= null;
		}
	}else if((httpObj.readyState == 4) && (httpObj.status != 200)){
		alert('データの読み込みに失敗しました');
		editAccountNameObject	= null;
		editAccountNameInputObject	= null;
	}else{
	}
}
/**
 * アカウントを削除
 */
var deleteTargetAccountId;
function delete_account( account_id ) {
	if( !account_id || account_id.length == 0 ) {
		alert('削除するアカウントを指定して下さい!');
		return false;
	}
	deleteTargetAccountId	= account_id;
	if( confirm('この操作は取り消せません!\n本当に削除してよろしいですか?') ) {
		var contents			= "command=0";
		contents	+= "&" + encodeURIComponent('hkb_account_id')+ "="+encodeURIComponent(account_id);
		httpObj = createXMLHttpRequest(post_account_result);
		if (httpObj) {
			httpObj.open("POST",'./ajax/delete_account.php',true);
			httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			httpObj.send(contents);
		}
	}
}
function post_account_result() {
	if ((httpObj.readyState == 4) && (httpObj.status == 200)){
		alert( httpObj.responseText );
		var name	= 'line_' + deleteTargetAccountId;
		$(name).style.visibility = 'hidden';
		$(name).style.height = '0px';
		deleteTargetAccountId	= null;
		account_reload_list();
	}else if((httpObj.readyState == 4) && (httpObj.status != 200)){
		alert('不明な原因でデータの保存に失敗しました。しばらくしてからもう一度トライしてみてください。');
	}else{
	}
}
/**
 * アカウントを作成
 */
function account_create() {
	var contents			= "command=0";
	var account_name		= document.inputform.account_name.value;
	var typeSelected		= document.inputform.account_type.selectedIndex;
	var account_type		= document.inputform.account_type.options[typeSelected].value;
	if( !account_name || account_name.length == 0 ) {
		alert('名称が入力されていません!');
		return false;
	}
	if( !account_type || account_type.length == 0 ) {
		alert('種類が選択されていません!');
		return false;
	}
	contents	+= "&" + encodeURIComponent('account_name')+ "="+encodeURIComponent(account_name);
	contents	+= "&" + encodeURIComponent('account_type')+ "="+encodeURIComponent(account_type);
	httpObj = createXMLHttpRequest(account_create_result);
	if (httpObj) {
		httpObj.open("POST",'./ajax/account_create.php',true);
		httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		httpObj.send(contents);
	}
}
function account_create_result() {
	if ((httpObj.readyState == 4) && (httpObj.status == 200)){
		alert( httpObj.responseText );
		account_reload_list();
	}else if((httpObj.readyState == 4) && (httpObj.status != 200)){
		alert('不明な原因でデータの保存に失敗しました。しばらくしてからもう一度トライしてみてください。');
	}else{
	}
}

/*
 * アカウントリスト読み込み
 */
function account_reload_list() {
	httpObj = createXMLHttpRequest(acount_view_list);
	var contents = '';
	if (httpObj) {
		var url	= './ajax/account_list.php';
		httpObj.open("GET",url,true);
		httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		httpObj.send(null);
	}
}
function acount_view_list() {
	if ((httpObj.readyState == 4) && (httpObj.status == 200)){
		$('data_list').innerHTML	= httpObj.responseText;
	}else if((httpObj.readyState == 4) && (httpObj.status != 200)){
		$('data_list').innerHTML	= 'データの読み込みに失敗しました';
	}else{
	}
}
 