var _browser;
var base_skin = 2;
var sizeData = ["","","",""];

if (Win && IE) {
	_browser = 0;
} else if (Win && NN) {
	_browser = 1;
} else if (Mac && IE) {
	_browser = 2;
} else if (Mac && NN) {
	_browser = 3;
} else {
	_browser = 2;
}

function changeSkinType(n)	{	
	base_skin = n;
	if (base_skin > 3) base_skin = 2;
	if (base_skin < 1) base_skin = 2;

	var my_tag = document.getElementsByTagName("td");
	
	for (var i = 0; i < my_tag.length; i++) {
		my_tag[i].style.fontSize = sizeData[_browser][base_skin];
	}
	alert("set"+base_skin);
	setCookie(base_skin);
}

function setCookie(val) {	
  cName = "NAME=";
  cDays = 30;
  setPre = new Date();
  setPre.setTime(setPre.getTime() + (cDays*1000*24*3608));
  prd = setPre.toGMTString();
	document.cookie = cName + val + ";expires=" + prd + ";path=/";
}

function getCookie() {
  cData = "";
  cName = "NAME=";
  cCookie = document.cookie+";";
  str = cCookie.indexOf(cName);
  if(str != -1) {
    end = cCookie.indexOf(";",str);
    cData = unescape(cCookie.substring(str + cName.length, end));
		
		return cData;
  } else {
		return null;
	}
}


function initSkin() {
		var _cookie = getCookie();
		if (_cookie != null) base_skin = Number(_cookie);
		return base_skin;
}

function setSkinType(){

	base_skin = initSkin();

if(Mac){
if (base_skin == 2) {
		if(document.all){ document.all("myFormMes").size="50" };
		if(document.getElementById){ document.getElementById("myFormMes").setAttribute("size","50") };
	}else{
		if(document.all){ document.all("myFormMes").size="30" };
		if(document.getElementById){ document.getElementById("myFormMes").setAttribute("size","33") };
	}
}else{
if (base_skin == 2) {
		if(document.all){ document.all("myFormMes").size="60" };
		if(document.getElementById){ document.getElementById("myFormMes").setAttribute("size","60") };
	}else{
		if(document.all){ document.all("myFormMes").size="35" };
		if(document.getElementById){ document.getElementById("myFormMes").setAttribute("size","35") };
	}
}

	if (base_skin == 2) {
		document.write ("<img src='../images/wide_btn.jpg' alt='ワイド' width='21' height='13' />ワイド表示｜<a href='javascript:location.reload();' onClick='setCookie(1);'><img src='../images/kotei_btn.jpg' alt='固定' width='13' height='13' />幅固定</a>");
		}else{
		document.write ("<a href='javascript:location.reload();' onClick='setCookie(2);'><img src='../images/wide_btn.jpg' alt='ワイド' width='21' height='13' />ワイド表示</a>｜<img src='../images/kotei_btn.jpg' alt='幅固定' width='13' height='13' />幅固定");
	}
}

function setFlashObject(){

	base_skin = initSkin();
	
	if (base_skin == 1) {
		document.write ("");
		document.write ("");
	}else{
		if (base_skin == 2) {
			document.write ("");
			document.write ("");
		}else{
				document.write ("");
				document.write ("");
				}
			}
}


var base_skin = initSkin();

document.write("<STYLE TYPE='text/css'><!--");
//--Macintosh
if(Mac){
	if(IE){
		if(Version >= 5){
			switch(base_skin){
			case 1:
				document.write("#top { width: 800px;}");
				document.write("#header { min-width: 800px; }");
				document.write("#front_header { min-width: 800px; }");
				document.write("#footer { min-width: 800px; }");
				break;
			case 2:
				document.write("#top { width: 95%;}");
				document.write("#front_header_a { background-image: url(../image/header/front_header_w_01.gif); background-repeat: no-repeat; background-position: 100px 0; width: 608px; height: 150px; float: left; }");
				document.write("#front_header_title { background-image: url(../image/header/front_header_w_02.gif); background-repeat: no-repeat; background-position: right 0; width: 100%; height: 150px; }");
				document.write("#top { min-width: 940px; }");
				break;
			default:
				document.write("#top { width: 800px;}");
				document.write("#header { min-width: 800px; }");
				document.write("#front_header { min-width: 800px; }");
				document.write("#footer { min-width: 800px; }");
			}
		}//--NN, IE4.x
	}else{
		if(Version >=5){//--NN6
			switch(base_skin){
			case 1:
				document.write("#top { width: 800px;}");
				document.write("#header { min-width: 800px; }");
				document.write("#front_header { min-width: 800px; }");
				document.write("#footer { min-width: 800px; }");
				break;
			case 2:
				document.write("#top { width: 95%;}");
document.write("#front_header_a { background-image: url(../image/header/front_header_w_01.gif); background-repeat: no-repeat; background-position: 100px 0; width: 608px; height: 150px; float: left; }");
document.write("#front_header_title { background-image: url(../image/header/front_header_w_02.gif); background-repeat: no-repeat; background-position: right 0; width: 100%; height: 150px; }");
document.write("#top { min-width: 940px; }");
				break;
			default:
				document.write("#top { width: 800px;}");
				document.write("#header { min-width: 800px; }");
				document.write("#front_header { min-width: 800px; }");
				document.write("#footer { min-width: 800px; }");
			}
		}else{
			switch(base_skin){
			case 1:
				document.write("#top { width: 800px;}");
				document.write("#header { min-width: 800px; }");
				document.write("#front_header { min-width: 800px; }");
				document.write("#footer { min-width: 800px; }");
				break;
			case 2:
				document.write("#top { width: 95%;}");
document.write("#front_header_a { background-image: url(../image/header/front_header_w_01.gif); background-repeat: no-repeat; background-position: 100px 0; width: 608px; height: 150px; float: left; }");
document.write("#front_header_title { background-image: url(../image/header/front_header_w_02.gif); background-repeat: no-repeat; background-position: right 0; width: 100%; height: 150px; }");
document.write("#top { min-width: 940px; }");
				break;
			default:
				document.write("#top { width: 800px;}");
				document.write("#header { min-width: 800px; }");
				document.write("#front_header { min-width: 800px; }");
				document.write("#footer { min-width: 800px; }");
			}
		}
	}
}
//--Windows
if(Win){
	if(NN){
			switch(base_skin){
			case 1:
				document.write("#top { width: 800px;}");
				document.write("#header { min-width: 800px; }");
				document.write("#front_header { min-width: 800px; }");
				document.write("#footer { min-width: 800px; }");
				break;
			case 2:
				document.write("#top { width: 95%;}");
document.write("#front_header_a { background-image: url(../image/header/front_header_w_01.gif); background-repeat: no-repeat; background-position: 100px 0; width: 608px; height: 150px; float: left; }");
document.write("#front_header_title { background-image: url(../image/header/front_header_w_02.gif); background-repeat: no-repeat; background-position: right 0; width: 100%; height: 150px; }");
document.write("#top { min-width: 940px; }");
				break;
			default:
				document.write("#top { width: 800px;}");
				document.write("#header { min-width: 800px; }");
				document.write("#front_header { min-width: 800px; }");
				document.write("#footer { min-width: 800px; }");
		}
	}else{
		switch(base_skin){
			case 1:
				document.write("#top { width: 800px;}");
				document.write("#header { min-width: 800px; }");
				document.write("#front_header { min-width: 800px; }");
				document.write("#footer { min-width: 800px; }");
				break;
			case 2:
				document.write("#top { width: 95%;}");
document.write("#front_header_a { background-image: url(../image/header/front_header_w_01.gif); background-repeat: no-repeat; background-position: 100px 0; width: 608px; height: 150px; float: left; }");
document.write("#front_header_title { background-image: url(../image/header/front_header_w_02.gif); background-repeat: no-repeat; background-position: right 0; width: 100%; height: 150px; }");
document.write("#top { min-width: 940px; }");
				break;
			default:
				document.write("#top { width: 800px;}");
				document.write("#header { min-width: 800px; }");
				document.write("#front_header { min-width: 800px; }");
				document.write("#footer { min-width: 800px; }");
		}
	}
}
document.write("//--></style>");


