//*----------------------------------------------*/
//*　http://www.eco-niigata.jp/[共通CSS]
//*　2006.5.31　Ojas.Inc　Yuuki Kasahara
//*----------------------------------------------*/

// -- クッキー情報をセット -- //
function setCookie(s){
	cName = "EcoNiigata=";
	exp = new Date();
	exp.setTime(exp.getTime() + 31536000000);
	document.cookie = cName + s + "; path=/" + "; expires=" + exp.toGMTString();
}

// -- クッキー情報を入手 -- //
function getCookie(){
	zoom = "";
	cName = "EcoNiigata=";
	tmpCookie = document.cookie + ";";
	start = tmpCookie.indexOf(cName);
	if (start != -1)
	{
		end = tmpCookie.indexOf(";", start);
		zoom = tmpCookie.substring(start + cName.length, end);
		document.getElementById("contents").style.fontSize = zoom;
	} else {
		document.getElementById("contents").style.fontSize = "100%";
	}
}

// -- テキストサイズ変更 -- //
function textSizeUp(){
	currentSize = document.getElementById("contents").style.fontSize;
	selectSize = "";
	if ( currentSize == "100%" ){
		selectSize = "14pt";
	}
	else if ( currentSize == "14pt" ){
		selectSize = "18pt";
	}
	else if ( currentSize == "18pt" ){
		selectSize = "21pt";
	}
	else if ( currentSize == "21pt" ){
		selectSize = "24pt";
	}
	else if ( currentSize == "24pt" ){
		m = escape("これ以上大きくできません。");
		alert(unescape(m));
		selectSize = "24pt";
	}
	else {
		selectSize = "100%";
	}
	document.getElementById("contents").style.fontSize = selectSize;
	setCookie(selectSize);
}

function textSizeReset(){
	currentSize = document.getElementById("contents").style.fontSize;
	m = escape("標準の文字サイズに戻しますか？");
	r = confirm(unescape(m));
	if (r) {
		currentSize = "100%";
		document.getElementById("contents").style.fontSize = currentSize;
	}
	setCookie(currentSize);
}

// -- ロールオーバー -- //
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// -- プリント -- //
function pagePrint(){
	m = escape("印刷します。よろしいですか？");
	r = confirm(unescape(m));
	if (r) self.print();
}

// -- ポップアップ -- //
function worldpop01(){window.open("../earth/pop01.html","worldpop01","width=270,height=340,status=no,scrollbars=no");}
function worldpop02(){window.open("../earth/pop02.html","worldpop02","width=270,height=340,status=no,scrollbars=no");}
function worldpop03(){window.open("../earth/pop03.html","worldpop03","width=270,height=340,status=no,scrollbars=no");}
function worldpop04(){window.open("../earth/pop04.html","worldpop04","width=270,height=340,status=no,scrollbars=no");}
function worldpop05(){window.open("../earth/pop05.html","worldpop05","width=270,height=340,status=no,scrollbars=no");}
function worldpop06(){window.open("../earth/pop06.html","worldpop06","width=270,height=340,status=no,scrollbars=no");}
function worldpop07(){window.open("../earth/pop07.html","worldpop07","width=270,height=340,status=no,scrollbars=no");}
function worldpop08(){window.open("../earth/pop08.html","worldpop08","width=270,height=340,status=no,scrollbars=no");}
function worldpop09(){window.open("../earth/pop09.html","worldpop09","width=270,height=340,status=no,scrollbars=no");}

function map00(){window.open("./about/map01.html","map00","width=570,height=560,status=no,scrollbars=no");}
function map01(){window.open("../about/map01.html","map01","width=570,height=560,status=no,scrollbars=no");}
function i_map01(){window.open("../ecopark/i_map01.html","i_map01","width=570,height=560,status=no,scrollbars=no");}

function inst_shinshutsu_flow(){window.open("../ecopark/inst_shinshutsu_flow.html","inst_shinshutsu_flow","width=830,height=420,status=no,scrollbars=no");}

function kamishibai01(){window.open("../earth/kamishibai_01.html","kamishibai01","width=540,height=480,status=no,scrollbars=no");}
function kamishibai02(){window.open("../earth/kamishibai_02.html","kamishibai02","width=540,height=480,status=no,scrollbars=no");}



