// ヘッダー検索窓 -------------------------------------------------------------
function onFocusHead(obj){
	$("searchtxt").value = "";
}

function onBlur(obj){
	if($("searchtxt").value == ""){
		$("searchtxt").value = "サイト内検索";
	}
}

function initSearchText() {
	$("searchtxt").value = "サイト内検索";
}

function init() {
	// 『この企業の全ての募集職種を見る』を表示する
	//var open_button = '<p id="open_another_list" class="end">この企業の全ての募集職種を見る</p>';
	//new Insertion.After("default_list",open_button);
	
	// <ul id="another_list">を非表示にする
	Element.setStyle($("another_list"),{
		'display':'none'
	});
	
	Event.observe($("open_another_list"),"click",open_another_list);
	Event.observe($("open_another_list"),"mouseover",list_ovr);
	Event.observe($("open_another_list"),"mouseout",list_out);
	Event.observe($("open_another_list"),"mouseover",list_ovr_c);
	Event.observe($("open_another_list"),"mouseout",list_out_c);
}

function open_another_list(event) {
	Element.setStyle($("open_another_list"),{
		'display':'none'
	});
	Event.observe($("close_another_list"),"click",close_another_list);
	Element.setStyle($("another_list"),{
		'display':'block'
	});
	Element.setStyle($("close_another_list"),{
		'display':'block'
	});
}

function close_another_list(event) {
	Element.setStyle($("open_another_list"),{
		'display':'block'
	});
	Element.setStyle($("another_list"),{
		'display':'none'
	});
	Element.setStyle($("close_another_list"),{
		'display':'none'
	});
}

function list_ovr(event) {
	Element.setStyle($("open_another_list"),{
		'text-decoration':'underline'
	});
}
function list_out(event) {
	Element.setStyle($("open_another_list"),{
		'text-decoration':'none'
	});
}

function list_ovr_c(event) {
	Element.setStyle($("close_another_list"),{
		'text-decoration':'underline'
	});
}
function list_out_c(event) {
	Element.setStyle($("close_another_list"),{
		'text-decoration':'none'
	});
}


if(window.addEventListener) {
	window.addEventListener("load", init, false);
	window.addEventListener("load", initSearchText , false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", init);
	window.attachEvent("onload", initSearchText);
}



