function cond_toggle(sel)
{
	p = sel.parentNode.childNodes;
	
	for ( i=0; i<p.length; i++ )
	{
		if ( p[i].nodeType != 3 && p[i].tagName.match(/^dd$/i) )
		{
			if ( p[i].style.display != "none" ) { return; }
			//Effect.toggle(p[i], 'blind', { duration: 0.3 });
			p[i].style.display = "block";
		}
		if ( p[i].nodeType != 3 && p[i].tagName.match(/^dt$/i) )
		{
			p[i].style.backgroundImage = "url('/shared/images/page/mapsearch/cond_on.png')";
		}
	}
	
	pp = sel.parentNode.parentNode.childNodes;
	for ( i=0; i<pp.length; i++ )
	{
		if ( pp[i].nodeType != 3 && pp[i].tagName.match(/^dl$/i) )
		{
			for ( j=0;j<pp[i].childNodes.length;j++ )
			{
				if ( pp[i].childNodes[j].nodeType != 3 && pp[i].childNodes[j].tagName.match(/^dd$/i)
				     && p != pp[i].childNodes )
				{
					Effect.BlindUp(pp[i].childNodes[j], { duration: 0.3 });
					pp[i].childNodes[j].style.display = "none"
				}
				
				if ( pp[i].childNodes[j].nodeType != 3 && pp[i].childNodes[j].tagName.match(/^dt$/i)
				     && p != pp[i].childNodes )
				{
					pp[i].childNodes[j].style.backgroundImage = "url('/shared/images/page/mapsearch/cond_off.png')";
				}
			}
		}
	}
}

function cond_disable(target,fix_cond,fix_num)
{
	KsGMapSearch.narrow.change(fix_cond,fix_num);
	$(target).style.display = "none";
}

function cond_enable(target)
{
	$(target).style.display = "block";
}


function price(ev, th)
{
	KsGMapFunc.search.narrow.change(ev, th);
}



/* 以下、テストスクリプト */
function cond_add()
{
	dlObj = new document.createElement("dd");
	dtObj = new document.createElement("dt");
	ddObj = new document.createElement("dd");
	
	$("condition_map").appendChild(dlObj);
	dlObj.appendChild(dtObj);
	dlObj.appendChild(ddObj);
	
	$("dtObj").innerHTML = "追加条件";
	$("ddObj").innerHTML = "ほげほげ<br />ふがふが";
}


function change_tab(sel)
{
	tabs = document.getElementsByTagName("li");
	for ( i=0; i<tabs.length; i++ )
	{
		if ( tabs[i].id.match(/^tab_[0-9]+$/) )
		{
			if ( tabs[i].id.replace(/^tab_/,"") == new String(sel) )
			{
				tabs[i].setAttribute("className","sel");
				tabs[i].setAttribute("class","sel");
			}
			else
			{
				tabs[i].setAttribute("className","nosel");
				tabs[i].setAttribute("class","nosel");
			}
		}
	}
	
	tabc = document.getElementsByTagName("div");
	for ( i=0; i<tabc.length; i++ )
	{
		if ( tabc[i].id.match(/^tabc_[0-9]+$/) )
		{
			if ( tabc[i].id.replace(/^tabc_/,"") == new String(sel) )
			{
				tabc[i].style.zIndex  = "2";
			}
			else
			{
				tabc[i].style.zIndex  = "0";
			}
		}
	}
}

