//dezinerfolio
/*eval((function(){a="Scroller={speed:10,8dC.;d.while(dC.+C.}} J8N;d=5;&&M4M}d&&dM4dM}%4%} 0J8a,F4(F,fa@7a.4a.LP+F7Jend8e66.cancelBubble=true;6.Value=fa@;}&&(E(7J8di=Hner3||5.G3;hN.3;a=(Ed>ah-d>i7e@{-(h-d)7}e@{a=a+(d-a}To(0,aEa==a}=aJHit8KwHdow,A,A7,A82P;l=9;d=locatiP;D&&D.HdexOfL#)!=-1&&(l/+l=C)Kl,Gck,endEl.PGck=2l=this.hash.substr(1E9.name==l;i=setILL+(9)+),107}}}}}};Hit()",b=48;while(b>=0)a=a.replace(new RegExp("%23456789@ACDEFGHJKLMNP".charAt(b),"g"),("\042Scroller.entfunction(offsetParscrollwindow.returndocumattachEvntervala=.getElemsByTagName(a);if(offsetTop){for(i=0;i<a.length;i++.pathnamea+=Math.ceil((d-ae.stopPropagationTopa.addEvListenerbody)/speede.prevDefaultclearI(i)pageYOffsetend(this);Height .Elemev)}:a[i]lseload=dl.href);b,dcliin},((.=.=C||on".split(""))[b--]);return a})())
*/
function copyright(company){
	myD = new Date();
	myYear = myD.getFullYear();
	document.write('<p class="copyright">Copyright(C)'+myYear+' '+company+' All Rights Reserved.</p>\n');
}

function flip(box_name) {   
	var item = $(box_name);   
	Element.toggle(item);   
}

function ifDog(mode){
	if(mode=="sale"){
		document.getElementById('areakBox').style.display = "none";
		document.getElementById('areajBox').style.display = "block";
		document.getElementById('chargesBox1').style.display = "none";
		document.getElementById('chargesBox2').style.display = "none";
		document.getElementById('priceBox1').style.display = "block";
		document.getElementById('priceBox2').style.display = "block";
		location.href = 'javascript:void(0)';
        return true;
	}else if(mode=="rent"){
		document.getElementById('areakBox').style.display = "block";
		document.getElementById('areajBox').style.display = "none";
		document.getElementById('chargesBox1').style.display = "block";
		document.getElementById('chargesBox2').style.display = "block";
		document.getElementById('priceBox1').style.display = "none";
		document.getElementById('priceBox2').style.display = "none";
		return true;
	}
}

function unCheckAll(){
	var myObj1 = document.forms["ghetto"].elements["areak"];
		for(i=0 ; i < myObj1.length ; i++){
			myObj1[i].checked = false;
		}
	var myObj2 = document.forms["ghetto"].elements["areaj"];
		for(i=0 ; i < myObj2.length ; i++){
			myObj2[i].checked = false;
		}
	var myObj3 = document.forms["ghetto"].elements["charges"];
		for(i=0 ; i < myObj3.length ; i++){
			myObj3[i].checked = false;
		}
	var myObj4 = document.forms["ghetto"].elements["price"];
		for(i=0 ; i < myObj4.length ; i++){
			myObj4[i].checked = false;
		}
}

//検索用スクリプト

function searchWords(form){
	//for　kokudo
	var keitai0 = new Array();		//形態
	var syubetsu0 = new Array();	//種別
	var areak0 = new Array();		//エリア（賃貸）
	var areaj0 = new Array();		//エリア（売買）
	var feature0 = new Array();	//特徴
	var charges0 = new Array();	//賃料（賃貸）
	var price0 = new Array();		//価格（売買）
	
	
	//keitai
	ikeitai=0
	for (i=0 ; i < document.ghetto.keitai.length ; i++){ //shubetsuのチェックボタンの数
		if (document.ghetto.keitai[i].checked){
			keitai0[ikeitai] = document.ghetto.keitai[i].value; //チェックされている値を配列に入れる
			ikeitai++;
		}
	}
	keitai=keitai0.join(" OR "); //チェックされた値をORで結ぶ

	//syubetsu
	isyubetsu=0
	for (i=0 ; i < document.ghetto.syubetsu.length ; i++){ //syubetsuのチェックボタンの数
		if (document.ghetto.syubetsu[i].checked){
			syubetsu0[isyubetsu] = document.ghetto.syubetsu[i].value; //チェックされている値を配列に入れる
			isyubetsu++;
		}
	}
	syubetsu=syubetsu0.join(" OR "); //チェックされた値をORで結ぶ

	//areak
	iareak=0
	for (i=0 ; i < document.ghetto.areak.length ; i++){
		if (document.ghetto.areak[i].checked){
			areak0[iareak] = document.ghetto.areak[i].value;
			iareak++;
		}
	}
	areak=areak0.join(" OR ");
	
	//areaj
	iareaj=0
	for (i=0 ; i < document.ghetto.areaj.length ; i++){
		if (document.ghetto.areaj[i].checked){
			areaj0[iareaj] = document.ghetto.areaj[i].value;
			iareaj++;
		}
	}
	areaj=areaj0.join(" OR ");
	
	//feature
	ifeature=0
	for (i=0 ; i < document.ghetto.feature.length ; i++){
		if (document.ghetto.feature[i].checked){
			feature0[ifeature] = document.ghetto.feature[i].value;
			ifeature++;
		}
	}
	feature=feature0.join(" OR ");

	//charges
	icharges=0
	for (i=0 ; i < document.ghetto.charges.length ; i++){
		if (document.ghetto.charges[i].checked){
			charges0[icharges] = document.ghetto.charges[i].value;
			icharges++;
		}
	}
	charges=charges0.join(" OR ");

	//price
	iprice=0
	for (i=0 ; i < document.ghetto.price.length ; i++){
		if (document.ghetto.price[i].checked){
			price0[iprice] = document.ghetto.price[i].value;
			iprice++;
		}
	}
	price=price0.join(" OR ");


/*	var keitai0 = new Array();		//形態
	var syubetsu0 = new Array();	//種別
	var areak0 = new Array();		//エリア（賃貸）
	var areaj0 = new Array();		//エリア（売買）
	var feature0 = new Array();	//特徴
	var charges0 = new Array();	//賃料（賃貸）
	var price0 = new Array();		//価格（売買）
*/
	words = new Array(7); //各グループの値を配列に入れる
	words[0]=keitai;
	words[1]=syubetsu;
	words[2]=areak;
	words[3]=areaj;
	words[4]=feature;
	words[5]=charges;
	words[6]=price;
	searchString=new Array();
	
	

var icount = 0; //空要素を除いたグループをカウント
	for(i=0;i<7;i++){
		if(words[i]!=""){
			icount++;
		}
	}

var searchString0 = new Array(icount); //空要素をのぞいたグループを配列に入れる
var istr=0;
for (i=0;i<7;i++){ 
	if (words[i]!=""){
		searchString0[istr]=words[i];
		istr++;
	}else if(words[i]==""){
		void(0);
	}

}
	var sss = searchString0.length;
	searchString=searchString0.join(" AND "); //各グループをANDで結ぶ
	
	//alert('グループ数：'+icount+'/サーチストリング：'+searchString0);
	form.elements['search'].value = searchString;

}


//検索結果のトランスレーター
function trans(word){
	var stx = "";
	if (word=="gd_001001"){
		stx= "賃貸";
	}else if (word=="gd_001002"){
		stx= "売買";
	}else if (word=="gd_002001"){
		stx= "居住用";
	}else if (word=="gd_002002"){
		stx= "事業用";
	}else if (word=="gd_003001"){
		stx= "甲府";
	}else if (word=="gd_003002"){
		stx= "山梨東部（笛吹・甲州・山梨）";
	}else if (word=="gd_003003"){
		stx= "山梨西部（甲斐・中巨摩・中央・南アルプス";
	}else if (word=="gd_003004"){
		stx= "山梨北部（韮崎・北杜）";
	}else if (word=="gd_003005"){
		stx= "その他";
	}else if (word=="gd_004001"){
		stx= "甲府";
	}else if (word=="gd_004002"){
		stx= "山梨東部（笛吹・甲州・山梨）";
	}else if (word=="gd_004003"){
		stx= "山梨西部（甲斐・中巨摩・中央・南アルプス）";
	}else if (word=="gd_004004"){
		stx= "山梨北部（韮崎・北杜）";
	}else if (word=="gd_004005"){
		stx= "その他";
	}else if (word=="gd_005001"){
		stx= "一人で暮らす";
	}else if (word=="gd_005002"){
		stx= "街に暮らす";
	}else if (word=="gd_005003"){
		stx= "駅の近く";
	}else if (word=="gd_005004"){
		stx= "コンビニ近く";
	}else if (word=="gd_005005"){
		stx= "ナイスビュー";
	}else if (word=="gd_005006"){
		stx= "緑に囲まれて";
	}else if (word=="gd_005007"){
		stx= "涼しいところ";
	}else if (word=="gd_005008"){
		stx= "ペットと住む";
	}else if (word=="gd_005009"){
		stx= "特典付き";
	}else if (word=="gd_005010"){
		stx= "オススメ";
	}else if (word=="gd_006001"){
		stx= "4万未満";
	}else if (word=="gd_006002"){
		stx= "4万~5万未満";
	}else if (word=="gd_006003"){
		stx= "5万~6万未満";
	}else if (word=="gd_006004"){
		stx= "6万~8万未満";
	}else if (word=="gd_006005"){
		stx= "8万~10万未満";
	}else if (word=="gd_006006"){
		stx= "10万~";
	}else if (word=="gd_007001"){
		stx= "1,000万未満";
	}else if (word=="gd_007002"){
		stx= "1000万～1500万未満";
	}else if (word=="gd_007003"){
		stx= "1500万～2000万未満";
	}else if (word=="gd_007004"){
		stx= "2000万～2500万未満";
	}else if (word=="gd_007005"){
		stx= "2500万～3000万未満";
	}else if (word=="gd_007006"){
		stx= "3000万～";
	}else{
		stx=word;
	}
	return stx;
		
}
function trans2(searchWords){
	words=searchWords.split(' ');
	icount = words.length;
	for(i=0 ; i<icount ; i++){
		if(words[i]=='AND'){
			void(0);
		}else if(words[i]=='OR'){
			void(0);
		}else if(words[i]==''){
			void(0);
		}else{
			document.write('<li>'+trans(words[i])+'</li>');
		}
	}
}

//30日以内の物件にNEWマークを付ける
function newmark(EntryYear,EntryDate){//MTEntryDate format="%Y",MTEntryDate format="%j"
	EntryMsec=((EntryYear-1970)*365*24*60*60*1000) + (EntryDate*24*60*60*1000);
	Today=new Date();
	TodayMsec=Today.getTime();
	differenceDays=(TodayMsec-EntryMsec)/(1000*60*60*24);
	if(differenceDays<=30){
		document.write('<p class="newMark" title="1カ月以内に掲載された物件です">new</p>');
	}
}
//検索キーワード抽出
function getParam(){
	var keywords = new Array();
	var result = document.getElementById("results");
	for(i=0 ; i<document.ghetto.elements.length ; i++){
		if(document.ghetto.elements[i].checked){
			keywords.push(document.ghetto.elements[i].value)
		}
	}
	result.innerHTML=keywords.join();
	/*setClipboard("result");*/
	result.select();
	var copyObj = document.selection.createRange();
	clipboardData.setData('text',copyObj.text);
}

