/*** 加納追加 ***/
function addList(_num){
	if(!_num) return;
	var now=getCookie('list');
	now=now ? now+'&'+_num : _num;
	setCookie('list',now);
	
	// ModalDialog 非対応ブラウザ
	if(! window.showModalDialog ){
		alert('求人案件を追加しました\n画面右上の「応募リスト」から応募できます');
	}else{
		var _locate=showModalDialog('./js/add_dialog.html');
		if(_locate){
			window.location.href=_locate;
		}
	}
}
function getList(){
	var now=getCookie('list');
	var items=now.split('&');
	return items;
}
function delList(_num){
	var litems=getList();
	var newItems=new Array();
	for(var i=0; i<litems.length; i++){
		if(_num != litems[i]){
			newItems[newItems.length]=litems[i];
//			newItems.push(litems[i].toString());
		}
	}
	setCookie('list',newItems.join('&'));
}
function clearList(){
	clearCookie('list');
}
function setCookie(key,val){
	var tmp=key+"="+escape(val)+";";
	document.cookie=tmp;
}
function getCookie(key){
	var tmp1=" " + document.cookie + ";";
	var xx1=0;
	var xx2=0;
	var len=tmp1.length;
	while(xx1< len){
		xx2=tmp1.indexOf(";", xx1);
		var tmp2=tmp1.substring(xx1+1,xx2);
		var xx3=tmp2.indexOf("=");
		if(tmp2.substring(0,xx3) == key){
			return (unescape(tmp2.substring(xx3+1,xx2-xx1-1)));
		}
		xx1=xx2+1;
	}
	return("");
}
function clearCookie(key){
	document.cookie=key+"="+"xx; expires=Tue, 1-Jan-1980 00:00:00;";
}
