/************************************************************************************************/
/* 概要：																						*/
/* 　「移住・定住 - ポータル画面用javascript群」														*/
/*																								*/
/* @author  Tsukamoto Yasuyoshi <tsukamoto@bmc.net-bibai.co.jp>									*/
/* @create  2009/03/10																			*/
/* @version 1.0																					*/
/************************************************************************************************/

/********************************************************/
/*	関数名：DetailsShow(formnname)						*/
/*	概要： 引数"formnname"で指定したformをsubmitする			*/
/*	引数：　formのID値										*/
/********************************************************/
function DetailsShow(formnname){
	document.getElementById(formnname).submit();
}

/****************************************************/
/*	関数名：onload関数								*/
/*	概要：初期画面表示								*/
/****************************************************/
window.onload = function migIndex_onload(){
	
	/* ちょっと暮らし情報表示 (id="chotto") */
	var url1    = './migIndexSearch.php';
    var myAjax1= new Ajax.Request(
					url1,
					{
						method: 'post',
						postBody: 'kind=chotto',
						onSuccess: migIndex_chotto_success,
						onFailure: migIndex_chotto_failure
					}
	);
	/* 物件新着情報表示 (id="newsInfo") */
    var myAjax2= new Ajax.Request(
					url1,
					{
						method: 'post',
						postBody: 'kind=newsInfo',
						onSuccess: migIndex_newsInfo_success,
						onFailure: migIndex_newsInfo_failure
					}
	);

	/* 広告表示 (id="ads") */
	var uri    = '../com/adsAJAX.php';
    var pars = '';
    var ajaxResult = new Ajax.Request(
					uri,
					{
						method: 'get', 
						parameters: pars, 
						onComplete: showComplete
					}
	);

	/* サイドメニュー共通項目（移住定住をお決めになる方へ） (id="riMenu2") */
	var url2    = './migSupport.php';
    var pars1 = '';
    var myAjax3 = new Ajax.Request(
					url2,
					{
						method: 'get', 
						parameters: pars1, 
						onComplete: migshowComplete
					}
	);

}

function migIndex_chotto_success(httpObj){
	$('chotto').innerHTML = httpObj.responseText;
}
function migIndex_chotto_failure(httpObj){
	$('chotto').innerHTML = "<h3>■ちょっと暮らし情報を検索できませんでした</h3>";
}
function migIndex_newsInfo_success(httpObj){
	$('newsInfo').innerHTML = httpObj.responseText;
}
function migIndex_newsInfo_failure(httpObj){
	$('newsInfo').innerHTML = "<h3>■新着物件情報を検索できませんでした</h3>";
}
function showComplete(request) {
    $('ads').innerHTML = request.responseText;
}
function migshowComplete(httpObj){
	$('riMenu2').innerHTML = httpObj.responseText;
}

