// +++++++++++++++++++++++++++++++++++
// style.js
// +++++++++++++++++++++++++++++++++++

var gUa = navigator.userAgent.toUpperCase();
var gBrw = navigator.appName.toUpperCase();
var gPlf = navigator.platform.toUpperCase();
var gVer = navigator.appVersion;
var gPlugin = navigator.plugins;

//::::Get Platform
var gWin = (gUa.indexOf("WIN", 0) != -1);
var gMacX = false;
if (gPlugin) {
	for (var p = 0; p < gPlugin.length; p++) {
		if (gPlugin[p].filename.indexOf("QuickTime Plugin.plugin", 0) != -1) {
			gMacX = true;
		}
	}
}
var gMacC = false;
if (!gMacX) {
	gMacC = (gUa.indexOf("MAC", 0) != -1);
}

//::::Get Browser
var gIE = (gBrw.indexOf("MICROSOFT INTERNET EXPLORER", 0) != -1);
var gNN = (gBrw.indexOf("NETSCAPE", 0) != -1);
var gGecko = (gUa.indexOf("GECKO", 0) != -1);
var gSafari = (gUa.indexOf("APPLEWEBKIT", 0) != -1);
var gOpera = (gUa.indexOf("OPERA", 0) != -1);
var gFire = (gUa.indexOf("FIRE", 0) != -1);

//::::Get Version
var gIE3 = (gVer.indexOf("MSIE 3", 0) != -1);
var gIE4 = (gVer.indexOf("MSIE 4", 0) != -1);
var gIE5 = (gVer.indexOf("MSIE 5", 0) != -1);
var gIE6 = (gVer.indexOf("MSIE 6", 0) != -1);
var gNN4 = (gNN && (gVer.indexOf("4.", 0) != -1));
var gNN6 = (gGecko && (gUa.indexOf("/6", 0) != -1));
var gNN7 = (gGecko && (gUa.indexOf("/7", 0) != -1));


document.write("<style type=\"text/css\">");
document.write("<!--");

// CSS Set For Windows Major Browsers
if (gWin) {
	document.write(".fs1 { font-size:11px; line-height:120%; }");
	document.write(".fs2 { font-size:12px; line-height:120%; }");
	document.write(".fs3 { font-size:14px; line-height:120%; }");
	document.write(".fs4 { font-size:18px; line-height:120%; }");
	document.write(".fs1x { font-size:11px; line-height:140%; }");
	document.write(".fs2x { font-size:12px; line-height:140%; }");
	document.write(".fs3x { font-size:14px; line-height:140%; }");
	document.write(".fs4x { font-size:18px; line-height:140%; }");
	document.write(".fs1xx { font-size:11px; line-height:160%; }");
	document.write(".fs2xx { font-size:12px; line-height:160%; }");
	document.write(".fs3xx { font-size:14px; line-height:160%; }");
	document.write(".fs4xx { font-size:18px; line-height:160%; }");
}

// CSS Set For MacOS Major Browsers
if (gMacC || gMacX) {
	document.write(".fs1 { font-size:10px; line-height:120%; }");
	document.write(".fs2 { font-size:12px; line-height:120%; }");
	document.write(".fs3 { font-size:14px; line-height:120%; }");
	document.write(".fs4 { font-size:18px; line-height:120%; }");
	document.write(".fs1x { font-size:10px; line-height:140%; }");
	document.write(".fs2x { font-size:12px; line-height:140%; }");
	document.write(".fs3x { font-size:14px; line-height:140%; }");
	document.write(".fs4x { font-size:18px; line-height:140%; }");
	document.write(".fs1xx { font-size:10px; line-height:160%; }");
	document.write(".fs2xx { font-size:12px; line-height:160%; }");
	document.write(".fs3xx { font-size:14px; line-height:160%; }");
	document.write(".fs4xx { font-size:18px; line-height:160%; }");
}

// CSS Set For NN4 (merge)
if (gNN4) {
	document.write(".fs1 { line-height:140%; }");
	document.write(".fs2 { line-height:140%; }");
	document.write(".fs3 { line-height:140%; }");
	document.write(".fs4 { line-height:140%; }");
	document.write(".fs1x { line-height:160%; }");
	document.write(".fs2x { line-height:160%; }");
	document.write(".fs3x { line-height:160%; }");
	document.write(".fs4x { line-height:160%; }");
	document.write(".fs1xx { line-height:180%; }");
	document.write(".fs2xx { line-height:180%; }");
	document.write(".fs3xx { line-height:180%; }");
	document.write(".fs4xx { line-height:180%; }");
}

// CSS Set For NN6 (merge)
if (gNN6) {
	document.write(".fs1 { line-height:1.2em; }");
	document.write(".fs2 { line-height:1.2em; }");
	document.write(".fs3 { line-height:1.2em; }");
	document.write(".fs4 { line-height:1.2em; }");
	document.write(".fs1x { line-height:1.4em; }");
	document.write(".fs2x { line-height:1.4em; }");
	document.write(".fs3x { line-height:1.4em; }");
	document.write(".fs4x { line-height:1.4em; }");
	document.write(".fs1xx { line-height:1.6em; }");
	document.write(".fs2xx { line-height:1.6em; }");
	document.write(".fs3xx { line-height:1.6em; }");
	document.write(".fs4xx { line-height:1.6em; }");
}

document.write("-->");
document.write("</style>")


//====_ Root-Sea, Inc. JavaScript Library _====//
/*-----------------------------------------------------
== Image Library == [2002/3/14]
2001-2004 (C) Root-Sea, Inc. All Rights Reserved.
Author:yoshihiro fujita
-----------------------------------------------------*/

//::::Image preload
function imagePreload() {
	var imgObj = new Array();
	if (document.images) {
		for (var i in gImgSrc) {
			imgObj[i] = new Image();
			imgObj[i].src = gImgSrc[i];
		}
		gPreloadFlag = true;
	}
}


//::::Image swap
function changeImg() {
	var parentObj, chgImgArg;
	if (gPreloadFlag) {
		chgImgArg = changeImg.arguments;
		chgImgArg.length % 2 == 0 ? parentObj = window : parentObj = document.layers[chgImgArg[chgImgArg.length - 1]];
		for (var i = 0; i < chgImgArg.length; i += 2) {
			if (i >= chgImgArg.length - 1) break;
			parentObj.document.images[chgImgArg[i]].src = chgImgArg[i + 1];
		}
	}
}


//::::Get image src
function getImgSrc(imgName,layName) {
	var srcVal;
	if (!!layName && document.layers) {
		srcVal = document.layers[layName].document.images[imgName].src;
	}
	else {
		srcVal = document.images[imgName].src;
	}
	if (srcVal.match(/:\/{2,3}[^\/]+(\/[^\\]+){2}/)) {
		return RegExp.$1;
	}
	else {
		return null;
	}
}


//::::Get image alt
function getImgAlt(imgName,layName) {
	var altVal;
	if (!!layName && document.layers) {
		altVal = document.layers[layName].document.images[imgName].alt;
	}
	else {
		altVal = document.images[imgName].alt;
	}
	return altVal;
}
