////文字の大きさ//////////////////////////////////////////////////////////////////////////////
var target = "contents";	
//
function setCookie(s){
	cName = "FontSize=";
	exp = new Date();
	exp.setTime(exp.getTime() + 31536000000);
	document.cookie = cName + s + "; path=/; expires=" + exp.toGMTString();
}
//
function getCookie(){
	zoom = "";
	cName = "FontSize=";
	tmpCookie = document.cookie + ";";
	start = tmpCookie.indexOf(cName);
	if (start != -1)
	{
		end = tmpCookie.indexOf(";", start);
		zoom = tmpCookie.substring(start + cName.length, end);
		document.getElementById(target).style.fontSize = zoom;
	} else {
		document.getElementById(target).style.fontSize = "100%";
	}
}
//
function textSizeUp(){
	currentSize = document.getElementById(target).style.fontSize;
	selectSize = "";
	if ( currentSize=="100%" || currentSize=="1.0em"){
		selectSize = "120%";
	} else if(currentSize=="120%") {
		alert("これ以上、文字を大きくすることはできません。");
		selectSize = "120%";
	} else {
		selectSize = "100%";
	}
	document.getElementById(target).style.fontSize = selectSize;
	setCookie(selectSize);
}

function textSizeDefault(){
	currentSize = document.getElementById(target).style.fontSize;
	selectSize = "100%";
	document.getElementById(target).style.fontSize = selectSize;
	setCookie(selectSize);
}

function textSizeDown(){
	currentSize = document.getElementById(target).style.fontSize;
	selectSize = "";
	if ( currentSize=="100%" || currentSize=="1.0em"){
		selectSize = "80%";
	} else if(currentSize=="80%") {
		alert("これ以上、文字を小さくすることはできません。");
		selectSize = "80%";
	} else {
		selectSize = "100%";
	}
	document.getElementById(target).style.fontSize = selectSize;
	setCookie(selectSize);
}

//// DO IT ACTION /////////////////////////////////////////////////////////////////////////////
function doIt(act)
{
	document.Form.Action.value = act;
	document.Form.submit();
}
//// MESSAGE EFFECT /////////////////////////////////////////////////////////////////////////////
function execEffect()
{
	//new Effect.SlideDown($("msg"));
	new Effect.Appear($("msg"));
}
function execBlindUp()
{
	new Effect.BlindUp($("msg"));
}
function upDown(){
	a = document.getElementById('dmy').style;
	if(a.display == "none"){
		execEffect();
	  a.display="block";
	}
	else	{
		execBlindUp();
		a.display="none"
	}
}

//// MESSAGE EFFECT /////////////////////////////////////////////////////////////////////////////
function execjEffect() {
	$("#msg").slideDown("slow");
}
function execjBlindUp() {
	$("#msg").hide();
}
function jupDown() {
	a = document.getElementById('dmy').style;
	if(a.display == "none"){
		execjEffect();
		a.display="block";
	}
	else	{
		execjBlindUp();
		a.display="none"
	}
}

////スローダウンスクロール////////////////////////////////////////////////////////////////////
function slowdownScroll() {
	if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat") {
		sctop = document.body.parentNode.scrollTop;
	}
	else if(window.pageYOffset){
		sctop = window.pageYOffset;
	} else {
		sctop = document.body.scrollTop;
	}
	if(sctop){
		scup = Math.ceil(sctop*.2);
		scrollBy(0,-scup);
		if (sctop-scup) setTimeout("slowdownScroll()",20);
	}
}

function backToTop() {
  var x1 = x2 = x3 = 0;
  var y1 = y2 = y3 = 0;
  if (document.documentElement) {
      x1 = document.documentElement.scrollLeft || 0;
      y1 = document.documentElement.scrollTop || 0;
  }
  if (document.body) {
      x2 = document.body.scrollLeft || 0;
      y2 = document.body.scrollTop || 0;
  }
  x3 = window.scrollX || 0;
  y3 = window.scrollY || 0;
  var x = Math.max(x1, Math.max(x2, x3));
  var y = Math.max(y1, Math.max(y2, y3));
  window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));
  if (x > 0 || y > 0) {
      window.setTimeout("backToTop()", 25);
  }
}

//-->
