
/* ===============================================
	OS、機種により基本文字の大きさが異なる為判別し、
	CSS設定ファイルを切り替えるスクリプト
=============================================== */

var os = (navigator.appVersion.indexOf ("Win", 0) != -1) ? "w" : "m";	/* OS判別用 */
var br = getBrowserName();	/* ブラウザ判別用 */
document.write ('<link rel="STYLESHEET" type="text/css" href="/css/'+ os + '_' + br + '.css">');		/* タグ書き出し */


/* ===============================================
	ブラウザ判別命令セット
		avigator.appName.toUpperCase();
		navigator.userAgent.toUpperCase();
	の2種の命令を使用しなければ判別不可
=============================================== */
function getBrowserName(){
	var aName  = navigator.appName.toUpperCase();
	var uName = navigator.userAgent.toUpperCase();
	if (os == "m")  return "e";
	if (uName.indexOf("FIREFOX") >= 0)  return "n";
	if (aName.indexOf("NETSCAPE") >= 0)  return "n";
	if (aName.indexOf("MICROSOFT") >= 0) return "e";
	if (uName.indexOf("SAFARI") >= 0)  return "e";
	return "e";
}


/* ===============================================
	レイヤーを表示、非表示する命令セット
	document.all使用可能ブラウザ、document.getElementById使用可能ブラウザが存在する為判別
=============================================== */
function LayerDisplay(id){
	if(document.getElementById){
		if(document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = "block";
		} else {
			document.getElementById(id).style.display = "none";
		}
	}
}

/* ===============================================
	レイヤーを表示、非表示する命令セット（子要素が１つの場合は２レイヤー分表示）)
	document.all使用可能ブラウザ、document.getElementById使用可能ブラウザが存在する為判別
=============================================== */
function LayerAllDisplay(id){

	var child_cnt = document.sarform[id+"_cnt"].value;
	
	if(child_cnt == 1){
		if(document.getElementById){
			if(document.getElementById(id).style.display == "none"){
				document.getElementById(id).style.display = "block";
				document.getElementById([id+"_1"]).style.display = "block";
			} else {
				document.getElementById(id).style.display = "none";
				document.getElementById([id+"_1"]).style.display = "none";
			}
		}
	}else{
		if(document.getElementById){
			if(document.getElementById(id).style.display == "none"){
				document.getElementById(id).style.display = "block";
			} else {
				document.getElementById(id).style.display = "none";
			}
		}
	}
}

/* ===============================================
	求人情報詳細画面 /result/detail/
	レイヤーを表示、非表示する命令セット
	sw = on
		レイヤー「company_readtext_all」を表示
		レイヤー「company_readtext_short」を非表示
	sw = off
		レイヤー「company_readtext_all」を非表示
		レイヤー「company_readtext_short」を表示
	document.all使用可能ブラウザ、document.getElementById使用可能ブラウザが存在する為判別
=============================================== */
function LayerDisplaySwich_ResultDetail(sw){
	if( sw == 'off' ){
/* document.all もしくは document.getElementById が使用可能か判別 */
		if(document.all || document.getElementById){
			if(document.all){
/* document.all 使用可能ブラウザ用 */
				document.all('company_readtext_all').style.display = "block";
				document.all('company_readtext_short').style.display = "none";
			} else if(document.getElementById){
/* document.getElementById 使用可能ブラウザ用 */
				document.getElementById('company_readtext_all').style.display = "block";
				document.getElementById('company_readtext_short').style.display = "none";
			}
		}
	} else if ( sw == 'on' ) {
/* document.all もしくは document.getElementById が使用可能か判別 */
		if(document.all || document.getElementById){
			if(document.all){
/* document.all 使用可能ブラウザ用 */
				document.all('company_readtext_all').style.display = "none";
				document.all('company_readtext_short').style.display = "block";
			} else if(document.getElementById){
/* document.getElementById 使用可能ブラウザ用 */
				document.getElementById('company_readtext_all').style.display = "none";
				document.getElementById('company_readtext_short').style.display = "block";
			}
		}
	}
}


/* ===============================================
	求人情報詳細画会員登録：希望条件、スキル・経験入力 /registration/skills/
	レイヤーを表示、非表示する命令セット
		id_block で設定されたレイヤーを表示
		id_none  で設定されたレイヤーを非表示
	document.all使用可能ブラウザ、document.getElementById使用可能ブラウザが存在する為判別
=============================================== */
function LayerDisplaySwich_RegistrationSkills(id){
/* 表示するレイヤー名を設定する */
	var id_block = id + '_add';
/* 非表示するレイヤー名を設定する */
	var id_none = id + '_input';
/* document.all もしくは document.getElementById が使用可能か判別 */
	if(document.all || document.getElementById){
		if(document.all){
/* document.all 使用可能ブラウザ用 */
			document.all(id_block).style.display = "block";
			document.all(id_none).style.display = "none";
		} else if(document.getElementById){
/* document.getElementById 使用可能ブラウザ用 */
			document.getElementById(id_block).style.display = "block";
			document.getElementById(id_none).style.display = "none";
		}
	}
	
	
}


/* ===============================================
	求人情報詳細画会員登録：希望条件、スキル・経験入力 /registration/skills/
	レイヤーを表示、非表示する命令セット
		id_block で設定されたレイヤーを表示
		id_none  で設定されたレイヤーを非表示
	document.all使用可能ブラウザ、document.getElementById使用可能ブラウザが存在する為判別
=============================================== */
function LayerDisplaySwich_RegistrationSkills_type02(id){
/* 表示するレイヤー名を設定する */
	var id_block = id + '_input';
/* 非表示するレイヤー名を設定する */
	var id_none = id + '_add';
/* document.all もしくは document.getElementById が使用可能か判別 */
	if(document.all || document.getElementById){
		if(document.all){
/* document.all 使用可能ブラウザ用 */
			document.all(id_block).style.display = "block";
			document.all(id_none).style.display = "none";
		} else if(document.getElementById){
/* document.getElementById 使用可能ブラウザ用 */
			document.getElementById(id_block).style.display = "block";
			document.getElementById(id_none).style.display = "none";
		}
	}

	
}

/* ===============================================
	指定された idの style:display設定を変更
	id = 元レイヤー名
	dis = 設定
=============================================== */
var click_cnt = 1;
var str;
var strName;
function changeDisplayMain(IdNum){
	eval("document.edit.work_disp"+ IdNum+".value= 1");
} 
/*function changeDisplayMain(id,dis){
	eval("document.edit.work_disp"+ IdNum+".value= 1");
	click_cnt = click_cnt + 1
	str = id + click_cnt
	changeDisplay(str,dis)
	eval("document.edit.work_disp"+ click_cnt+".value= 1"); 
} */
/* ===============================================
	指定された idの style:display設定を変更　プロフィール編集用
	id = 元レイヤー名
	dis = 設定
=============================================== */
var str;
var strName;
function changeDisplayMain_P(IdNum){
	eval("document.profile.work_disp"+ IdNum+".value= 1");
} 

/* ===============================================
	指定された idの style:display設定を変更
	id = レイヤー名
	dis = 設定
=============================================== */
function changeDisplay(id,dis){
	if(document.all || document.getElementById){
		if(document.all){
			document.all(id).style.display = dis;
		}else if(document.getElementById){
			document.getElementById(id).style.display = dis;
		}
	}
}


/* ===============================================
	指定された idの背景色変更
	id = レイヤー名
	bgc = 色情報
=============================================== */
function changeBgColor(id,bgc){
	if(document.all || document.getElementById){
		if(document.all){
			document.all(id).style.background = bgc;
		}else if(document.getElementById){
			document.getElementById(id).style.background = bgc;
		}
	}
}

/* ===============================================
	新規ウインドウオープン
=============================================== */
var win_set;
function opWin(opUrl,winName,winWidth,winHeight){
	win_set = 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width='+winWidth+',height='+winHeight;
	openWindow = window.open(opUrl,winName,win_set);
	openWindow.focus();
}



/* ===============================================
	新規ウインドウオープン（MyPageスカウト用）
=============================================== */
var win_set;
function opWinMypageScout(opUrl,winName,winWidth,winHeight,sid,sValue){
	win_set = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+winWidth+',height='+winHeight;
	openWindow = window.open(opUrl,winName,win_set);
	openWindow.focus();
}

function delCookie(name) {
 cName = name+"=";
 dTime = new Date();
 dTime.setYear(dTime.getYear() - 1);
 document.cookie = cName + ";expires=" + dTime.toGMTString(); }

delCookie("ac_adsvr");






