<!-- ブラウザ情報取得 -->
nn4 = (document.layers) ? true:false;
ie4 = (document.all) ? true:false;
nn6 = (document.getElementById)? true:false;
if (ie4) nn6 = false;

<!-- レイヤー・配列設定 -->
var mainLayers = new Array(
	'Africa',
	'Europe',
	'Fareast',
	'Oceania',
	'Samerica',
	'Namerica'
	);

var subLayers = new Array(
	'area_Africa',
	'area_Europe',
	'area_Fareast',
	'area_Oceania',
	'area_Samerica',
	'area_Namerica'
	);

getImages();

function init() {
	squishTransDiv();
	setCaptures();
}

function setCaptures() {
	if(nn4) {
			// reset when transdiv is rolled over
		document.layers['transDiv'].captureEvents(Event.MOUSEOVER);
		document.layers['transDiv'].onmouseover = reset;
	} else if(ie4) {
			// reset when transdiv is rolled over
		document.all.transDiv.onmouseover = reset;
	} else if(nn6) {
		document.getElementById('transDiv').onmouseover = reset;
	}
}

function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()');
		eval(imgObj+'.src = "'+imgSrc+'"');
	}
}

function changeImage(layer,imgName,imgObj) {
	if (nn4) {
		eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src');
	} else {
		document.images[imgName].src = eval(imgObj+".src");
	}
}

function show(divid) {
	if(nn4)
		document.layers[divid].visibility = "show";
	else if(ie4)
		document.all[divid].style.visibility = "visible";
	else if (nn6)
		document.getElementById(divid).style.visibility = "visible";
}

function hide(divid) {
	if(nn4)
		document.layers[divid].visibility = "hide";
	else if(ie4)
		document.all[divid].style.visibility = "hidden";
	else if (nn6)
		document.getElementById(divid).style.visibility = "hidden";
}

function set(layerName) {
	reset();
	show(layerName);
	stretchTransDiv();
}

function reset() {
	for (var i=0; i<subLayers.length; i++) {
		hide(subLayers[i]);
	}
	squishTransDiv();
}

function stretchTransDiv() {
	if(nn4) {
		document.layers['transDiv'].clip.width = window.innerWidth - 20;
		document.layers['transDiv'].clip.height = window.innerHeight - 20;
		// stretch main nav
//		document.layers['productsDiv'].clip.height = 100;
	} else if(ie4) {
		document.all.transDiv.style.width = document.body.clientWidth - 20;
		document.all.transDiv.style.height = document.body.clientHeight - 20;
		// stretch main nav
//		document.all.productsDiv.style.height = 100;
	} else if(nn6) {
		document.getElementById('transDiv').style.width = window.innerWidth - 20;
		document.getElementById('transDiv').style.height = window.innerHeight - 20;	
		// stretch main nav
//		document.getElementById('productsDiv').style.height = 100;
	}
}

function squishTransDiv() {
	if(nn4) {
		document.layers['transDiv'].clip.width = 0;
		document.layers['transDiv'].clip.height = 0;
		// squish main nav
//		document.layers['productsDiv'].clip.height = 30;
	} 
	else if(ie4) {
		document.all.transDiv.style.width = 0;
		document.all.transDiv.style.height = 0;
		// squish main nav
//		document.all.productsDiv.style.height = 30;
	}
	else if(nn6) {
		document.getElementById('transDiv').style.width = 0;
		document.getElementById('transDiv').style.height = 0;
		// squish main nav
//		document.getElementById('productsDiv').style.height = 0;
	}
}


<!-- 画像・事前読込 -->
function getImages() {
var mainIMG = new Array(
	'af_main',
	'eu_main',
	'fe_main',
	'oc_main',
	'sa_main',
	'na_main'
	)
	
var subIMG = new Array(
	'af_feea',
	'af_jahosas',
	'af_jwaac',
	'af_jwans',
	'af_wafeac',
	'af_wafens',
	'af_awata',
	'af_feci',
	'eu_jefc',
	'eu_jmfc',
	'eu_jcfc',
	'eu_jgarspc',
	'fe_bobcon',
	'fe_fesamec',
	'fe_jcfc',
	'fe_iada',
	'fe_jhsfa',
	'fe_jpfc',
	'fe_jtfc',
	'fe_jtjcfc',
	'oc_anzesc',
	'oc_jspfc',
	'sa_jla',
	'sa_jwcsa',
	'sa_awcsa',
	'sa_jmex',
	'sa_brazil',
	'sa_riverplate',
	'sa_wcsafc',
	'sa_acta',
	'na_tsa',
	'na_wtsa',
	'na_ctsa',
	'na_cwtsa'
	);
	
for (var i=0; i<subIMG.length; i++) {
	eval("preload('"+subIMG[i]+"_1','./image/"+subIMG[i]+"_1.gif')");
	eval("preload('"+subIMG[i]+"_0','./image/"+subIMG[i]+"_0.gif')");
	}
	for (var i=0; i<mainIMG.length; i++) {
		eval("preload('"+mainIMG[i]+"_1','./image/"+mainIMG[i]+"_1.gif')");
		eval("preload('"+mainIMG[i]+"_0','./image/"+mainIMG[i]+"_0.gif')");
	}
}

// begin resize code
if (nn4) {
	origWidth = innerWidth;
	origHeight = innerHeight;
}

