/* css change
----------------------------------------------- */
function changeStyleseet(n) {
	var links = document.getElementsByTagName("link");
	for (i = 0; i <= 2; i++) {
		links.item(i).disabled = true;
	}
	links.item(eval(n)).disabled = false;
	setCookie("style",eval(n));
}

function styleCheck() {
	var style = getCookie("style");
	if (style == "") { style = 1; }
	changeStyleseet(style);
}



/* Cookie
----------------------------------------------- */
function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
	tmp1 = " " + document.cookie + ";";
	xx1 = xx2 = 0;
	len = tmp1.length;
	while (xx1 < len) {
		xx2 = tmp1.indexOf(";", xx1);
		tmp2 = tmp1.substring(xx1 + 1, xx2);
		xx3 = tmp2.indexOf("=");
		if (tmp2.substring(0, xx3) == key) { return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1))); }
		xx1 = xx2 + 1;
	}
	return("");
}
function setCookie(key, val, tmp) {
	tmp = key + "=" + escape(val) + "; ";
	tmp += "domain=gosite.jp; ";
	tmp += "path=/webcolor/mitsui_org/html/; ";
	tmp += "expires=Fri, 31-Dec-2030 23:59:59; ";
	document.cookie = tmp;
}
function clearCookie(key) { document.cookie = key + "=" + "xx; expires=1-Jan-1997 00:00:00;"; }


/* 表示位置固定
----------------------------------------------- */
window.onresize = function() { positioning(); }
window.onload = function() { positioning(); }

function positioning() {
	var nv = navigator.userAgent;
	var bt = document.getElementById("pgup");
	if (nv.match(new RegExp("MSIE 6", "i"))) { floatbt(); }
	else if (nv.match(new RegExp("MSIE 7", "i"))) {
		bt.style.position = "fixed";
		bt.style.left = (document.body.offsetWidth / 2) + 381 + "px";
		bt.style.bottom = "100px";
	}
	else {
		bt.style.position = "fixed";
		bt.style.left = (document.body.offsetWidth / 2) + 380 + "px";
		bt.style.bottom = "100px";
	}
	
	try{ tabCheck(); }
	catch(e){}
}
function floatbt() {
	var bt = document.getElementById("pgup");
	bt.style.position = "absolute";
	bt.style.left = (document.body.offsetWidth / 2) + 370 + "px";
	bt.style.top = document.body.offsetHeight + document.body.scrollTop - 150 + "px";
	setTimeout("floatbt()", 10);
}

/* page up
----------------------------------------------- */
function pageup() {
	var mode = (document.compatMode && document.compatMode=="CSS1Compat");
	if (mode) { posi = document.documentElement.scrollHeight; }
	else { posi = document.body.scrollHeight; }
	moveObje(posi);
}
function moveObje(position) {
	move = position / 10;
	point = parseInt(position - move);
	scrollTo(0,point);
	if (point > 0) { setTimeout("moveObje(point)",1); }
}

