//window.onerror=null;

/* cookie define */
var cookieTime = 86400000; // 24h*60m*60s*1000ms = 1 day
var cookieName = 'shionogiFontSize';

 
if(navigator.appVersion.indexOf("Win") != -1){
	var isWinIE  = (document.documentElement.getAttribute("style")==document.documentElement.style);
}else{
	var isWinIE = false;
}

/* f, v? */
var fontImage = new Array(0, 0, 0);
var fontSizePercentage = new Array('100', '110', '120');

var initializeFontSize=readCookie(cookieName);

//ヘッダ画像のちらつき対策 0910野田

var styleStr= '<style type="text/css">';
styleStr= styleStr+"\n"+'body{font-size:'+fontSizePercentage[initializeFontSize]+'%}';
styleStr= styleStr+'</style>';
document.write(styleStr);

var fMenu = true;

var ulValue = 'gll';
var liValue = 'gl';
var lnValue = 'gn';

var normalImage = '_f.gif';
var overImage = '_o.gif';
var currentImage = '_s.gif';
var chosenImage = '_v.gif';

var menuNum = 5;

var pathId='';

var action = new Array();
var menuEraseTime = 600;
var menuAppearTime = 100;
var globalNum;
var globalTimer;



/* */
var chainId = new Array('mainContainerInfo', 'mainContainer', 'mainContainerMedTemp', 'SITENAVIGATIONMedCon','medicine-mainContainer','medicine-mainContainer02');
var chainIdLen = chainId.length;

var paths = location.pathname.split('/');
var gPth = paths[1];
var isMed = ((gPth=="med") || (gPth=="member"));
var pathsLen = paths.length;

var isZaikei = (paths[2] == 'zaikei');

var isEn = (gPth.indexOf('_en') != -1);

//英語トップページのファイル名のみ「_e」なため、英語トップページ用の分岐isEnTopを作成、追加0726
var isEnTop = (paths[1] == 'index_e.html');



//alert(gPth);

if ((gPth=='') || (gPth=='index.html')){
	isTop=true;
}else{
	isTop=false;
}

for(var i=2;i<pathsLen-1;i++){
	pathId += (i+1 == pathsLen) ? paths[i] : paths[i] + '-';
}
dirId = pathId+'+';
dirId = dirId.replace('-+', '');
pathId += (i+1 == pathsLen) ? paths[i] : paths[i] + '-';

pathId = pathId.replace('.html', '');

var loadIsDone=0;
var loadTimer;

if (!isWinIE){
	loadTimer=setInterval('altanatibeOnload()',250);
}else{
	loadTimer=setInterval('altanatibeOnload()',500);
}

//added
window.onload = function(e) {

	loadIsDone=1;
	clearInterval(loadTimer);
	setEventOnMenu();
	if(isMed==false){
		removeAnchorInLeftMenu();
		removeUlInLeftMenu();
		highlightMenu();
	}
	
//added till here


		var tempDat = readCookie(cookieName);
		if (tempDat == null){
				tempDat = 0;
		}
		for(var i=0;i<fontSizePercentage.length;i++){
				fontImage[i] = (tempDat == i) ? 1 : 0;
				if (fontImage[i]){
						//changeFontSize('font' + (i + 1));
				}
		}
		setFontSizeImage();
	if(isMed==true){
	try{
		openNewWinAdded();
	}catch(e){
	}
	}
}

var firstDone = 0;

function altanatibeOnload(){

if (firstDone==0){
	firstDone=1;
	return;
}

//alert('Done');
if (loadIsDone==1){
	clearInterval(loadTimer);
}else{
	clearInterval(loadTimer);
	try{
//begin
	loadIsDone=1;
	setEventOnMenu();
	if(isMed==false){
		removeAnchorInLeftMenu();
		removeUlInLeftMenu();
		highlightMenu();
	}
	
//added till here
	
		var tempDat = readCookie(cookieName);
		if (tempDat == null){
				tempDat = 0;
		}
		for(var i=0;i<fontSizePercentage.length;i++){
				fontImage[i] = (tempDat == i) ? 1 : 0;
				if (fontImage[i]){
						//changeFontSize('font' + (i + 1));
				}
		}
		setFontSizeImage();
	if(isMed==true){
	try{
		openNewWinAdded();
	}catch(e){
	}
	}
//end

	loadIsDone=1;
	clearInterval(loadTimer);
	}catch(e){
	loadIsDone=0;
	loadTimer=setInterval('altanatibeOnload()',200);
	}
}

if (!isWinIE){

}else{
	clearInterval(loadTimer);
}

}


/* 画像の先読み */
if (document.images) {
		var smallImgArchiveArr = new Array('/common/img/fonts_f.gif', '/common/img/fonts_o.gif', '/common/img/fonts_v.gif');
		var mediumImgArchiveArr = new Array('/common/img/fontn_f.gif', '/common/img/fontn_o.gif', '/common/img/fontn_v.gif');
		var bigImgArchiveArr = new Array('/common/img/fontb_f.gif', '/common/img/fontb_o.gif', '/common/img/fontb_v.gif');

		var smallImgArr = new Array();
		for(i = 0;i < smallImgArchiveArr.length-1; i++){
				smallImgArr[i] = new Image();
				smallImgArr[i].src = smallImgArchiveArr[i];
		}
		var mediumImgArr = new Array();
		for(i = 0;i < mediumImgArchiveArr.length-1; i++){
				mediumImgArr[i] = new Image();
				mediumImgArr[i].src = mediumImgArchiveArr[i];
		}
		var bigImgArr = new Array();
		for(i = 0;i < bigImgArchiveArr.length-1; i++){
				bigImgArr[i] = new Image();
				bigImgArr[i].src = bigImgArchiveArr[i];
		}
		new Image().src = '/common/img/lead_top_o.gif';
		
}
/* 画像の先読み 終わり */

//**********************現在位置のアンカーを消す***********************//

function removeAnchorInLeftMenu(){
	try{
		var pathElem = document.getElementById(pathId);
		var anchorText = document.createTextNode(pathElem.childNodes[0].childNodes[0].nodeValue);
		pathElem.removeChild(pathElem.childNodes[0]);
		pathElem.appendChild(anchorText);
		}catch(e){
	}
}

//**********************現在位置のULを表示させる***********************//
//※現在位置以外を消す



function removeUlInLeftMenu(){

try{
		var leftMenuUl = document.getElementById('localMenu').getElementsByTagName('ul');
		var leftMenuUlLen = leftMenuUl.length;
		var perId;
		for(var i=1;i<leftMenuUlLen;i++){ // leftMenuUl[0] は 要素をまとめている ul
			perId = leftMenuUl[i].getAttribute('id');
			if (perId){
				if(dirId != perId){
					perIdVar = document.getElementById(perId);
					perIdVar.style.display = 'none';
					
				}
			}
		}
	}catch(e){
	}
}


//*********************** 上部メニューの現在地を示す  ***********************/
function highlightMenu(){

		var pathList = new Array('', 'company', 'wellness', 'med', 'ir', 'recruit');
		var pathListLen = pathList.length;
		for (i=1;i<=pathListLen;i++){
			if (gPth == pathList[i]){
				var calledId = liValue + '0' + i;
				var imgSrc = document.getElementById(calledId).childNodes[0].childNodes[0].src;
				document.getElementById(calledId).childNodes[0].childNodes[0].src = imgSrc.replace(normalImage, currentImage);
			}
		}
	
	
	//英語プルダウン追加 野田0910
	if ((isEn) || (isEnTop)){	
		var pathList = new Array('', 'company_en','ir_en');
		var pathListLen = pathList.length;
		for (i=1;i<=pathListLen;i++){
			if (gPth == pathList[i]){			
				var calledId = liValue + '0' + i;
				var imgSrc = document.getElementById(calledId).childNodes[0].childNodes[0].src;
				document.getElementById(calledId).childNodes[0].childNodes[0].src = imgSrc.replace(normalImage,currentImage);
				//alert(imgSrc.replace(normalImage, currentImage));
			}
		}
	}	
}


// ナビゲーションにイベントを追加する
function setEventOnMenu(){
			//alert(1);
	try{
	if(isMed == true){
	if (isZaikei){
		setEventPerId('m3login');
		setEventPerId('closeBt');
	}
	}
				//alert(2);
	if (!isZaikei){
				//alert(3);
	if (document.getElementById('leadTop') || document.getElementById('leadTopInfo') || document.getElementById('leadTop2')|| document.getElementById('medicine-pagetop')){
			//alert(4);
		try{
			if (document.getElementById('leadTop')){
					var leadTopAnchor = document.getElementById('leadTop').getElementsByTagName('a')[0];
			} else if(document.getElementById('medicine-pagetop')){
					var leadTopAnchor = document.getElementById('medicine-pagetop').getElementsByTagName('a')[0];
			} else if(document.getElementById('leadTop2')){
					var leadTopAnchor = document.getElementById('leadTop2').getElementsByTagName('a')[0];
			} else {
					var leadTopAnchor = document.getElementById('leadTopInfo').getElementsByTagName('a')[0];
			}
		}catch(e){

		}
			
//			if(body.getAttribute('style') == body.style) {

			//alert(5);
			if (document.documentElement.getAttribute("style")==document.documentElement.style){
					leadTopAnchor.setAttribute('onmouseover', new Function('changeImg(\'leadTopImg\')'));
					leadTopAnchor.setAttribute('onmouseout', new Function('returnImg(\'leadTopImg\')'));
					leadTopAnchor.setAttribute('onfocus', new Function('changeImg(\'leadTopImg\')'));
					leadTopAnchor.setAttribute('onblur', new Function('returnImg(\'leadTopImg\')'));
				} else {
					leadTopAnchor.setAttribute('onmouseover', 'changeImg(\'leadTopImg\')');
					leadTopAnchor.setAttribute('onmouseout', 'returnImg(\'leadTopImg\')');
					leadTopAnchor.setAttribute('onfocus', 'changeImg(\'leadTopImg\')');
					leadTopAnchor.setAttribute('onblur', 'returnImg(\'leadTopImg\')');
			}
	}
	}
	}catch(e){

	}
	
	if(isMed==false){
		var body = document.getElementsByTagName('body')[0];
					//alert(6);
		var otherRelString = new Array('otherRel01', 'otherRel02');
		for (i = 0;i < 2;i++){
				if (document.getElementById(otherRelString[i])){
						var otherRel = document.getElementById(otherRelString[i]);
//						if (body.getAttribute('style') == body.style){
						if (document.documentElement.getAttribute("style")==document.documentElement.style){
								otherRel.parentNode.setAttribute('onmouseover', new Function('changeImg(\'' + otherRelString[i] + '\')'));
								otherRel.parentNode.setAttribute('onmouseout', new Function('returnImg(\'' + otherRelString[i] + '\')'));
								otherRel.parentNode.setAttribute('onfocus', new Function('changeImg(\'' + otherRelString[i] + '\')'));
								otherRel.parentNode.setAttribute('onblur', new Function('returnImg(\'' + otherRelString[i] + '\')'));
						} else {
								otherRel.parentNode.setAttribute('onmouseover', 'changeImg(\'' + otherRelString[i] + '\')');
								otherRel.parentNode.setAttribute('onmouseout', 'returnImg(\'' + otherRelString[i] + '\')');
								otherRel.parentNode.setAttribute('onfocus', 'changeImg(\'' + otherRelString[i] + '\')');
								otherRel.parentNode.setAttribute('onblur', 'returnImg(\'' + otherRelString[i] + '\')');
						}
				}
		}		
		
					//alert(7);
		for(var i=1;i<=menuNum;i++){
				var number = '0' + i;
				var liID = liValue + number;
				
				if(!document.getElementById(liID)){
					return;
				}
				
				var parentLi = document.getElementById(liID);
				var parentLiAnchor = parentLi.getElementsByTagName('a')[0];


//added 0829 no pulldown menues on Recruit category byKogene				
				if (i == 5){
						var ulElem = document.createElement('ul');
						ulElem.setAttribute('id', 'gll05');
						parentLi.appendChild(ulElem);
				}
//till here added 0829 no pulldown menues on Recruit category byKogene								

				var ulId = ulValue + number;
				var listAnchors = document.getElementById(ulId).getElementsByTagName('a');
				var listAnchorsLen = listAnchors.length;

				for(var j=0;j<listAnchorsLen;j++){

						var listAnchor = listAnchors[j];
						var listAnchorEventId = listAnchor.getElementsByTagName('img')[0].id;
//						if(body.getAttribute('style') == body.style) {
						if (document.documentElement.getAttribute("style")==document.documentElement.style){
								listAnchor.setAttribute('onmouseover', new Function('showAndChange(\'' + listAnchorEventId + '\', \'' + number + '\');'));
								listAnchor.setAttribute('onmouseout', new Function('hideAndReturn(\'' + listAnchorEventId + '\', \'' + number + '\');'));
								listAnchor.setAttribute('onfocus', new Function('showAndChange(\'' + listAnchorEventId + '\', \'' + number + '\');'));
								listAnchor.setAttribute('onblur', new Function('hideAndReturn(\'' + listAnchorEventId + '\', \'' + number + '\');'));
						} else {
								
								listAnchor.setAttribute('onmouseover', 'changeImg(\'' + listAnchorEventId + '\')\;');
								listAnchor.setAttribute('onmouseout', 'returnImg(\'' + listAnchorEventId + '\')\;');
								listAnchor.setAttribute('onfocus', 'changeImg(\'' + listAnchorEventId + '\')\;');
								listAnchor.setAttribute('onblur', 'returnImg(\'' + listAnchorEventId + '\')\;');
								listAnchor.parentNode.setAttribute('onmouseover', 'showMenu2(\'' + number + '\')\;');
								listAnchor.parentNode.setAttribute('onfocus', 'showMenu2(\'' + number + '\')\;');
								listAnchor.parentNode.setAttribute('onmouseout', 'hideMenu2(\'' + number + '\')\;');
								listAnchor.parentNode.setAttribute('onblur', 'hideMenu2(\'' + number + '\')\;');
						}
				}
			//alert(8);
//				if(body.getAttribute('style') == body.style) {
				if (document.documentElement.getAttribute("style")==document.documentElement.style){
						parentLi.childNodes[0].setAttribute('onmouseover', new Function('showMenu2(\'' + number + '\')\;'));
						parentLi.childNodes[0].setAttribute('onfocus', new Function('showMenu2(\'' + number + '\')\;'));
						parentLi.childNodes[0].setAttribute('onmouseout', new Function('hideMenu2(\'' + number + '\')\;'));
						parentLi.childNodes[0].setAttribute('onblur', new Function('hideMenu2(\'' + number + '\')\;'));
				} else {
						parentLi.childNodes[0].setAttribute('onmouseover', 'showMenu2(\'' + number + '\')\;');
						parentLi.childNodes[0].setAttribute('onfocus', 'showMenu2(\'' + number + '\')\;');
						parentLi.childNodes[0].setAttribute('onmouseout', 'hideMenu2(\'' + number + '\')\;');
						parentLi.childNodes[0].setAttribute('onblur', 'hideMenu2(\'' + number + '\')\;');
				}
		}
		}
			//alert(9);
}


function showAndChange(listAnchorEventId, num){
		changeImg(listAnchorEventId);
		showMenu2(num);
}

function hideAndReturn(listAnchorEventId, num){
		returnImg(listAnchorEventId);
		hideMenu2(num);
}

// class menu
function showMenu(num){
		totalMenu(num, normalImage, overImage, 'block');
}

function showMenu2(num){
		for(var ii=1;ii<=menuNum;ii++){
				if (num == ('0' + ii)){
						clearTimeout(action[ii]);
				}
		}
		globalNum = num;
		globalTimer = setTimeout('showMenu3(\'' + num + '\')', menuAppearTime);
}

function showMenu3(num){
		if (num == globalNum){
				showMenu(num);
		}
}

function hideMenu(num){
		totalMenu(num, overImage, normalImage, 'none');
}

function hideMenu2(num){
		globalNum = '';
		for(var ii=1;ii<=menuNum;ii++){
				if (num == ('0' + ii)){
						action[ii] = setTimeout('hideMenu(\'0\' + ' + ii + ')', menuEraseTime);
				}
		}
}

function totalMenu(num, image1, image2, styleDisp){
		var showObject = ulValue + num;
		var activeButton = lnValue + num;
		var buttonSrc = document.getElementById(activeButton).src;
		if (buttonSrc.indexOf(currentImage) != -1){ // _s.gif
				if (image1 == normalImage){
						image1 = currentImage;
				} else {
						image2 = currentImage;
				}
		}
		document.getElementById(activeButton).src = (buttonSrc.indexOf(image2) == -1) ?
			buttonSrc.split(image1)[0] + image2 : buttonSrc;
		document.getElementById(showObject).style.display = styleDisp;
		highlightMenu();
}
// end of class::menu

// class img
function changeImg(imgID){
		totalImg(imgID, normalImage, overImage);
}

function returnImg(imgID){
		totalImg(imgID, overImage, normalImage);
}

function totalImg(imgID, image1, image2){
		var imgSrc = document.getElementById(imgID).src;
		document.getElementById(imgID).src = (imgSrc.indexOf(image2) == -1) ?
			imgSrc.split(image1)[0] + image2 : imgSrc;
}
// end of class::img


function insSearchBx(){
	var serchBtnImgURL="/common/img/search_button.gif";
	document.write("<input value=\"\" alt=\"検索\" id=\"searchButton\" name=\"searchButton\"");
	document.write("type=\"image\" src=\"");
	document.write(serchBtnImgURL);
	document.write("\" onclick=\"document.searchForm.submit();\" />");
}

// search button change for En 0913 by Kogane

function insSearchBxen(){
	var serchBtnImgURL="/common/img/search_buttonen.gif";
	document.write("<input value=\"\" alt=\"Search\" id=\"searchButton\" name=\"searchButton\"");
	document.write("type=\"image\" src=\"");
	document.write(serchBtnImgURL);
	document.write("\" onclick=\"document.searchForm.submit();\" />");
}


/* ロールオーバー処理 */
function setEventPerId(idName){
		var body = document.getElementsByTagName('body')[0];
		if (document.getElementById(idName)){
				var m3login = document.getElementById(idName);
//				if(body.getAttribute('style') == body.style) {
				if (document.documentElement.getAttribute("style")==document.documentElement.style){			
						m3login.setAttribute('onmouseover', new Function('changeImg(\'' + idName + '\')'));
						m3login.setAttribute('onmouseout', new Function('returnImg(\'' + idName + '\')'));
						m3login.setAttribute('onfocus', new Function('changeImg(\'' + idName + '\')'));
						m3login.setAttribute('onblur', new Function('returnImg(\'' + idName + '\')'));
				} else {
						m3login.setAttribute('onmouseover', 'changeImg(\'' + idName + '\')');
						m3login.setAttribute('onmouseout', 'returnImg(\'' + idName + '\')');
						m3login.setAttribute('onfocus', 'changeImg(\'' + idName + '\')');
						m3login.setAttribute('onblur', 'returnImg(\'' + idName + '\')');
				}
		}
}


function setEventPerId2(idName){
		var body = document.getElementsByTagName('body')[0];
		if (document.getElementById(idName)){
				var m3login = document.getElementById(idName);
//				if(body.getAttribute('style') == body.style) {
				if (document.documentElement.getAttribute("style")==document.documentElement.style){
						m3login.setAttribute('onmouseover', new Function('changeImg2(\'' + idName + '\')'));
						m3login.setAttribute('onmouseout', new Function('returnImg2(\'' + idName + '\')'));
						m3login.setAttribute('onfocus', new Function('changeImg2(\'' + idName + '\')'));
						m3login.setAttribute('onblur', new Function('returnImg2(\'' + idName + '\')'));
				} else {
						m3login.setAttribute('onmouseover', 'changeImg2(\'' + idName + '\')');
						m3login.setAttribute('onmouseout', 'returnImg2(\'' + idName + '\')');
						m3login.setAttribute('onfocus', 'changeImg2(\'' + idName + '\')');
						m3login.setAttribute('onblur', 'returnImg2(\'' + idName + '\')');
				}
		}
}

function changeImg2(imgID){
		for (var i=1;i<=3;i++){
				if (imgID == 'font' + i){
						if (!fontImage[i-1]){
								totalImg2(imgID, normalImage, overImage);
						}
						break;
				}
		}
}

function returnImg2(imgID){
		for (var i=1;i<=3;i++){
				if (imgID == 'font' + i){
						if (!fontImage[i-1]){
								totalImg2(imgID, overImage, normalImage);
						}
						break;
				}
		}
}

function totalImg2(imgID, image1, image2){
		var imgSrc = document.getElementById(imgID).src;
		document.getElementById(imgID).src = (imgSrc.indexOf(image2) == -1) ?
			imgSrc.split(image1)[0] + image2 : imgSrc;
}

/* ロールオーバー処理 終わり */

/* 初期状態の設定 */
function setFontSizeImage(){
	if(fMenu){
		for(var i=0;i<chainIdLen;i++){
				if (document.getElementById(chainId[i])){
						//現在の位置を指定
						//英語トップページのファイル名のみ「_e」なため、英語トップページ用の分岐isEnTopを作成、追加0726
					if ((isEn) || (isEnTop)){	
						var addHtml = '\r\n<li class="l1"><img src="/common/img/fontEn.gif" width="94" height="16" alt="Change Fontsize" /></li>\r\n';
					}else{
						var addHtml = '\r\n<li class="l1"><img src="/common/img/font.gif" width="94" height="16" alt="文字サイズの変更" /></li>\r\n';					
					}
					
					
						// フォントサイズ小
						if (fontImage[0]){
								var addImage = chosenImage;
								var anchorTagBegin = '';
								var anchorTagEnd = '';
						} else {
								var addImage = normalImage;
								var anchorTagBegin = '<a href="#" onclick="changeFontSize(\'font1\'); return false;">';
								var anchorTagEnd = '</a>';
						}
						
					if ((isEn) || (isEnTop)){	
						addHtml += '<li class="l2">' + anchorTagBegin + '<img src="/common/img/fontsEn' + addImage + '" width="22" height="16" alt="Smaller" id="font1" />' + anchorTagEnd + '</li>\r\n';
					}else{
						addHtml += '<li class="l2">' + anchorTagBegin + '<img src="/common/img/fonts' + addImage + '" width="22" height="16" alt="文字サイズ変更「標準」" id="font1" />' + anchorTagEnd + '</li>\r\n';
					}
						// フォントサイズ中
						if (fontImage[1]){
								var addImage = chosenImage;
								var anchorTagBegin = '';
								var anchorTagEnd = '';
						} else {
								var addImage = normalImage;
								var anchorTagBegin = '<a href="#" onclick="changeFontSize(\'font2\'); return false;">';
								var anchorTagEnd = '</a>';
						}
					if ((isEn) || (isEnTop)){	
						addHtml += '<li class="l3">' + anchorTagBegin + '<img src="/common/img/fontnEn' + addImage + '" width="22" height="16" alt="Default size" id="font2" />' + anchorTagEnd + '</li>\r\n';
					}else{
						addHtml += '<li class="l3">' + anchorTagBegin + '<img src="/common/img/fontn' + addImage + '" width="22" height="16" alt="文字サイズ変更「大」" id="font2" />' + anchorTagEnd + '</li>\r\n';
					}
						// フォントサイズ大
						if (fontImage[2]){
								var addImage = chosenImage;
								var anchorTagBegin = '';
								var anchorTagEnd = '';
						} else {
								var addImage = normalImage;
								var anchorTagBegin = '<a href="#" onclick="changeFontSize(\'font3\'); return false;">';
								var anchorTagEnd = '</a>';
						}
						
					if ((isEn) || (isEnTop)){
						addHtml += '<li class="l2">' + anchorTagBegin + '<img src="/common/img/fontbEn' + addImage + '" width="22" height="16" alt="Lager" id="font3" />' + anchorTagEnd + '</li>\r\n';
					}else{
						addHtml += '<li class="l2">' + anchorTagBegin + '<img src="/common/img/fontb' + addImage + '" width="22" height="16" alt="文字サイズ変更「最大」" id="font3" />' + anchorTagEnd + '</li>\r\n';
					}
						var addId = document.createElement('ul');

						addId.className = 'fontChange';

						addId.id = 'fontChange';
						addId.innerHTML = addHtml;
						var useId = document.getElementById(chainId[i]);
						if (document.getElementById('fontChange')){
								var tempId = document.getElementById('fontChange');
								tempId.parentNode.removeChild(tempId);
						}
						useId.appendChild(addId);

						break;
				}
		}
		setEventPerId2('font1');
		setEventPerId2('font2');
		setEventPerId2('font3');
	}
}
/* 初期状態の設定 終わり */

/* フォントサイズ変更 */
function changeFontSize(imgID){
		for (var i=1;i<=3;i++){
				fontImage[i-1] = (imgID == 'font' + i) ? 1 : 0;
				if (fontImage[i-1]){
						var currentFontSizeSelection = fontSizePercentage[i-1];
						createCookie(cookieName, (i-1), 365);
				}
		}
		setFontSizeImage();
		document.body.style.fontSize = currentFontSizeSelection + '%';
//		document.body.style.backgroundColor = 'red';
		// フレーム対応追加 20060612 野田
		//if (parent.frames[1]){
			//parent.frames[1].document.body.style.fontSize = currentFontSizeSelection + '%';
		//}
		// 野田追加ここまで
		
//iframe対応 0910野田

if (document.getElementById('ifra01')){
	if (document.getElementById('ifra01').contentWindow){
 		document.getElementById('ifra01').contentWindow.location.reload();
 	}else{
 		document.ifra01.location.reload();		
	}
}

if (document.getElementById('ifra02')){
	if (document.getElementById('ifra02').contentWindow){
 		document.getElementById('ifra02').contentWindow.location.reload();
 	}else{
 		document.ifra02.location.reload();		
	}
}
}


/* フォントサイズ変更 終わり */

function createCookie(name, value, days) {
		if (days) {
				var date = new Date();
				date.setTime(date.getTime()+(days * cookieTime));
				var expires = "; expires="+date.toGMTString();
		}
		else expires = '';
		document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
		var nameEQ = name + '=';
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
				var c = ca[i];
				while (c.charAt(0) == ' ') c = c.substring(1, c.length);
				if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
		}
		return null;
}


// Add openNewWin function
function openNewWinAdded(){
		var body = document.getElementsByTagName('body')[0];
		var anchors = document.getElementsByTagName('a');
		for (var i = 0; i < anchors.length; i++) {
				var e = anchors[i];
				var newWinfunc = "openNewWin('" + e.href + "');";
				if (e.className == "openNewWin") {
						if(body.getAttribute("style") == body.style) {
								e.setAttribute("onclick", new Function(newWinfunc + "return false;"));
						} else {
								e.setAttribute("onclick", newWinfunc + "return false;");
						}
				}
		}
}

// Window Manipulate
function openNewWin(url){
		var theWin = window.open(url, 'other', 'width=800,height=650,toolbar=yes,scrollbars=yes,menubar=yes,location=no,status=yes,directories=yes,resizable=yes');
		theWin.focus();
}
// 
function closeWin(){
		document.write('<p class="closeBt"><a href="#" onclick="window.close(); return false;"><img src="/common/img/closeBt_f.gif" width="102" height="24" alt="閉じる" id="closeBt"/></a></p>');
}
// end of Window Manipulate

//namazu cgi handle
   var pth = window.location.pathname;
   var query = window.location.search;

   if ((pth=='/cgi-bin/namazu.cgi.exe') && (query=='')){
     location.replace("http://www.shionogi.co.jp/cgi-bin/namazu.cgi.exe?idxname=general");
   }






//*********************** 領域別情報サブメニュー by GROOVY ***********************/
var timerID="";
function mn(n){
if(timerID!=""){
clearTimeout(timerID);
}
var val = n;
dlt2();
document.getElementById(val).style.visibility="visible";
document.getElementById(val).style.zIndex="1";
}
function dlt(){
timerID=setTimeout("dlt2()",600);
}
function dlt2(){
for (i=1;i<5;i++){
var val2 = "submenu" + i;
document.getElementById(val2).style.visibility="hidden";
document.getElementById(val2).style.zIndex="0";
}
}

//**********************開閉式　ajax ***********************/
var dat 
function md1(ddd) {
   document.getElementById(ddd).style.display=(document.getElementById(ddd).style.display=='none')?'':'none'
}
