var $login_area = '';
function login_check(){
	new Ajax.Request("/login/login_check/",{
		method:"post",
		parameters:"cache="+(new Date()).getTime(),
		onSuccess:function(httpObj){
			
			if(httpObj.responseText != 'ようこそ ゲスト さん' && httpObj.responseText){
				//$login_area ='<p class="guest02" id="guest02">'+httpObj.responseText+'</p>';
				//document.getElementById("login_area").innerHTML = $login_area+'<p class="btn01" id="btn01"><a href="/login/login/out/"><img name="login" src="/common/image/header_btn0003.gif" onmouseover="MM_swapImage(\'login\',\'\',\'/common/image/header_btn0003_on.gif\',1)" onmouseout="MM_swapImgRestore()" id ="login" alt="ログインアウト" /></a></p>';
				$login_area ='<p class="guest" id="guest">'+httpObj.responseText+'</p>';
				$login_area =$login_area+'<p class="btn01" id="btn01"><a href="/login/login/out/"><img name="login" src="/common/image/header_btn0003.gif" onmouseover="MM_swapImage(\'login\',\'\',\'/common/image/header_btn0003_on.gif\',1)" onmouseout="MM_swapImgRestore()" id ="login" alt="ログアウト" /></a></p>';
				document.getElementById("login_area").innerHTML =$login_area+'<p class="btn03"><a href="https://www.s-est.co.jp/ssl/formmail/edit.php/login.html" target="_blank">登録内容変更/退会</a></p>';	
				document.getElementById("login-input-area").style.display = "none";
			}else{
				$login_area ='<p class="guest" id="guest">'+httpObj.responseText+'</p>';
				$login_area =$login_area+'<p class="btn01" id="btn01"><a href="/login/index.html"><img name="login" src="/common/image/header_btn0001.gif" onmouseover="MM_swapImage(\'login\',\'\',\'/common/image/header_btn0001_on.gif\',1)" onmouseout="MM_swapImgRestore()" id ="login" alt="ログイン" /></a></p>';
				document.getElementById("login_area").innerHTML =$login_area+'<p class="btn02" id="btn02"><a href="https://www.s-est.co.jp/ssl/formmail/registration.php/form.html" target="_blank">新規会員登録（無料）</a></p>';
			}
		}
	});
}


function countm(){
	new Ajax.Request("/search/relation/cnt_m/",{
		method:"post",
		parameters:"cache="+(new Date()).getTime(),
		onSuccess:function(httpObj){
			if(httpObj.responseText){
				document.getElementById("cnt-m").innerHTML ='（'+httpObj.responseText+'件）';
			}
		}
	});
}
function counth(){
	new Ajax.Request("/search/relation/cnt_h/",{
		method:"post",
		parameters:"cache="+(new Date()).getTime(),
		onSuccess:function(httpObj){
			if(httpObj.responseText){
				document.getElementById("cnt-h").innerHTML ='（'+httpObj.responseText+'件）';
			}
		}
	});
}
function countl(){
	new Ajax.Request("/search/relation/cnt_l/",{
		method:"post",
		parameters:"cache="+(new Date()).getTime(),
		onSuccess:function(httpObj){
			if(httpObj.responseText){
				document.getElementById("cnt-l").innerHTML ='（'+httpObj.responseText+'件）';
			}
		}
	});
}
function counti(){
	new Ajax.Request("/search/relation/cnt_i/",{
		method:"post",
		parameters:"cache="+(new Date()).getTime(),
		onSuccess:function(httpObj){
			if(httpObj.responseText){
				document.getElementById("cnt-i").innerHTML ='（'+httpObj.responseText+'件）';
			}
		}
	});
}
function countw(){
	new Ajax.Request("/search/relation/cnt_w/",{
		method:"post",
		parameters:"cache="+(new Date()).getTime(),
		onSuccess:function(httpObj){
			if(httpObj.responseText){
				document.getElementById("cnt-w").innerHTML ='（'+httpObj.responseText+'件）';
			}
		}
	});
}
var $area ='';
var $class ='';
var $id ='';

function relationb($area,$class,$id){
	new Ajax.Request("/search/relation/get_relation_bottom/"+$area+"/"+$class+"/"+$id,{
		method:"post",
		parameters:"cache="+(new Date()).getTime(),
		onSuccess:function(httpObj){
			if(httpObj.responseText){
				document.getElementById("relation-bottom").innerHTML =httpObj.responseText;
			}else{
				document.getElementById("relation-bottom").style.display = 'none';
			}
		}
	});
}

function relationr($area,$class,$id){
	new Ajax.Request("/search/relation/get_relation_right/"+$area+"/"+$class+"/"+$id,{
		method:"post",
		parameters:"cache="+(new Date()).getTime(),
		onSuccess:function(httpObj){
			if(httpObj.responseText){
				document.getElementById("relation-right").innerHTML =httpObj.responseText;
			}else{
				document.getElementById("relation-right").style.display = 'none';
			}
		}
	});
}

function check_login_icon(i){
	coknam = 'shizunavi_login';
	coktxt = document.cookie+";";
	stano = coktxt.indexOf(coknam);
	if (stano != -1){
		endno = coktxt.indexOf(";",stano);
		txt0 = unescape(coktxt.substring(stano+coknam.length+1,endno));
	}else{
		txt0 = "";
	};
	if(!txt0){
		//alert("menber_banner"+i);
		document.getElementById("menber_banner"+i).innerHTML = '<p class="bg-txt">会員登録すると非公開物件情報も、自由に閲覧できるようになります！</p><div class="service">'+
'<div class="s-in">'+
'<p>希望の物件が見つからない方に、住まい探しに便利なサービス！</p>'+
'<h2>しずなび会員限定サービス</h2>'+
'<ul>'+
'<li>常時4,000件以上の『しずなび』会員限定物件情報を大公開</li>'+
'<li>条件を登録いただくとご希望の物件情報を随時メールでお知らせ！</li>'+
'<li>新サービスやお得なキャンペーン情報をいち早く配信！</li>'+
'</ul>'+
'</div><!-- //s-in -->'+
'<p class="service-btn"><a href="http://www.s-est.co.jp/member/index.html">会員について詳しくはこちら</a></p>'+
'<p class="service-login"><a class="ar0001" href="/login/index.html">登録済みの方はログインへ</a></p>'+
'</div>';
	}
	
}


function check_info($area){
	new Ajax.Request("/search/info/get/"+$area+"/",{
		method:"post",
		parameters:"cache="+(new Date()).getTime(),
		onSuccess:function(httpObj){
			if(httpObj.responseText){
				document.getElementById("information").innerHTML =httpObj.responseText;
			}else{
				document.getElementById("information").style.display = 'none';
			}
		}
	});
}