dom.event.addEventListener(window, 'load', initDocument);
//データ一時格納要素
var flgmntNode = document.createDocumentFragment();
var b;
var bx;
function addBookmark(title,url) {
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,""); 
	} else if( document.all ) { 
		window.external.AddFavorite( url, title); 
	} else if( window.opera && window.print ) { 
		return true; 
	} 
} 
//初期読込
function initDocument() {
	//ハンドラ設定
	b = document.getElementById('searchTab').getElementsByTagName('li');
	bx = document.getElementById('searchBox').getElementsByTagName('ul');
	for(i=0;i<b.length;i++){
		dom.event.addEventListener(b.item(i).getElementsByTagName('a').item(0), 'click', changeTab);
	}
}

function changeTab(req){
	var tabNo = dom.event.target(req);
	dom.event.preventDefault(tabNo);
	for(i=0;i<b.length;i++){
		if(b.item(i).getElementsByTagName('a').item(0).childNodes[0].nodeValue == tabNo.childNodes[0].nodeValue){
			b.item(i).getElementsByTagName('a').item(0).className = 'tabOn';
			if(bx.item(i)){
				bx.item(i).className = '';
			}
			var catAll = document.getElementById('catAll');
			var tab2 = tabNo.childNodes[0].nodeValue.replace(" ","")
			if(tab2 == '目的から探す'){
				catAll.childNodes[0].nodeValue = '>>全ての目的を見る';
				catAll.href = 'intention/';
			}else if(tab2 == '部署から探す'){
				catAll.childNodes[0].nodeValue = '>>全ての部署を見る';
				catAll.href = 'post/';
			}else if(tab2 == '業種から探す'){
				catAll.childNodes[0].nodeValue = '>>全ての業種を見る';
				catAll.href = 'category/';
			}
		}else{
			b.item(i).getElementsByTagName('a').item(0).className = '';
			if(bx.item(i)){
				bx.item(i).className = 'dspNone';
			}
		}
	}
	//伝播防止
	dom.event.preventDefault(req);
}