﻿// JavaScript Document
var	myCookie	= document.cookie;
var	fontSize	= new Number(3);
if (myCookie.match(/fontSize/ig)) {
	fontSize = myCookie.replace(/.*fontSize=(\d.?).*/ig,'$1').replace(/\;/ig,'')
}
document.write ('<link  href="/css/css-size'+ fontSize +'.css" rel="stylesheet" type="text/css">');
function setCookie(num){
	if(!num)	var	num	= document.FORM.fontSize.selectedIndex+1;
	var	idate	= new Date();
	var	yy		= idate.getYear();
	if (yy < 2000)	yy += 1901;	else	yy += 1;
	idate		= new Date(yy,idate.getMonth(),idate.getDate());
	var dayArray	= new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
	var monArray	= new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
	var	key		= 'fontSize='+num+'; expires='+dayArray[idate.getDay()]+', '+idate.getDate()+'-'+monArray[idate.getMonth()]+'-'+yy+' 0:0:0;; path=/'
	document.cookie = key ;
	if (navigator.userAgent.match(/msie/ig)) {
		document.createStyleSheet('/css/css-size'+ num +'.css')
		document.FORM.fontSize.selectedIndex	= num-1;
	}else{
		window.location.reload([true])
	}
}
function reSizeWin(){
	document.FORM.fontSize.selectedIndex=fontSize-1;
}
function makeInnerHTML(){
	var	w	= window.location;	//ロケーションオブジェクト取得
	if(w.port > 0){
		var hostName	= w.hostname.split('.');
		var jsName		= hostName[0]+'-'+w.port+'.js';
		var js = new ImportJS('/js/'+jsName);
	}

	var	HTML	= new String();
	if(window['key']){
		if(key=='com')	{
			HTML	+=	'<div style="text-align:right;"><a href="/rule/index.html">規約一覧</a>　　</div>'
		}else if(key=='rec')	{
			HTML	+=	'<div style="text-align:right;"><a href="http://www.sourcenext.com/privacy/jinji.html">採用に関する個人情報の取り扱いについて</a>　　</div>'
		}else if(key=='par')	{
			HTML	+=	'<div style="text-align:right;"><a href="http://www.sourcenext.com/privacy/partner.html">個人情報の取り扱いについて</a>　　</div>'
		}else if(key=='sup')	{
			HTML	+=	'<div style="text-align:right;"><img src="/test/img/support/powerdby.gif">　　</div>'
		}
	}


	var anc=document.getElementsByTagName('A');
	for(var i=0; i<anc.length; i++){
		if(anc[i].getAttribute('href')){
			if(anc[i].getAttribute('href').match(/\/agree\?/)){
				var temp=anc[i].getAttribute('href').split('?');
//				anc[i].attributes.removeNamedItem('href');
				anc[i].setAttribute('href','/titles/agree/?'+temp[1]);
				anc[i].setAttribute('target','_blank');
			}
		}
	}


	HTML	+=	'当サイトでは　■文字の大きさを調節できます　';
	HTML	+=	'<form name="FORM" style="display:inline;">';
	HTML	+=	'<select name="fontSize" onChange="setCookie()">';
	HTML	+=	'<option>極小</option>';
	HTML	+=	'<option>小</option>';
	HTML	+=	'<option>中</option>';
	HTML	+=	'<option>大</option>';
	HTML	+=	'<option>特大</option>';
	HTML	+=	'</select>';
	HTML	+=	'</form>';
	HTML	+=	'　　■ロゴマークをクリックするといつでもトップページに戻れます';
	
	HTML	+=	'<div style="text-align:right">Copyright (C) SOURCENEXT CORPORATION All Rights Reserved.<a href="http://www.sourcenext.com/privacy/"><img src="http://www.sourcenext.com/img/common_img/trustejp.gif" align="absmiddle" border="0" height="34" width="116" style="margin-left:1em"></a></div>';
	var obj	= document.getElementById('footer');
	obj.innerHTML = HTML;
	obj.style.backgroundColor = document.bgColor;
	reSizeWin();
//追加分

}
function $(ID){
	return(document.getelementbyid(ID))
}