function ML_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.ML_pgW=innerWidth; document.ML_pgH=innerHeight; onresize=ML_reloadPage; }}
  else if (innerWidth!=document.ML_pgW || innerHeight!=document.ML_pgH) location.reload();
}
ML_reloadPage(true);

function ML_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=ML_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function openWindow(URL, winName, features){
window.open(URL, winName, features);
}


var img_dir = "/lib/cmn_img/";
var css_dir = "/lib/cmn_css/";
var key01   = "fontsize";
var fs_flag = "none";
var fontsize01;

function get_font_size_change(key01){
	temp01=document.cookie+";";
	i=temp01.indexOf(key01,0);
	if(i!=-1){
		i+=(key01.length+1);
		j=temp01.indexOf(";",i);
		value01=temp01.substring(i,j);
		fs_flag="on";
		return(unescape(value01));
	}return("");
}

function getCookie(p){
	//何もしない
}

function set_font_size_change(fsc01){
	document.cookie=key01+"="+fsc01+";path=/;expires=Thu, 1-Jan-2030 00:00:00;";
	location.reload();
}

function fontPicSet(p){
	var onoff=fontsize01;
	var mac_ie="off";
	var mac_ie_true="off";
	if(navigator.userAgent.indexOf("Safari")!=-1){
		//safari
		mac_ie="on";
	}else if(navigator.appVersion.charAt(0) >= "4"){
		if(navigator.appName.charAt(0)=="M" && navigator.platform.charAt(0)=="M"){
			//mac_ie
			mac_ie="on";
			mac_ie_true="on";
		}
	}


//small
	document.write("<a href=");
	if(mac_ie=="on"){
		document.write("javascript:set_font_size_change('small');");
	}else{
		document.write("#");
	}
	document.write(" onclick=set_font_size_change('small')><img src=" + img_dir + "font_s");
	if(onoff=="small"){
		document.write("_h");
	}else{
		document.write("_f");
	}
	document.write(".gif width=18 height=19 alt=SMALL name=small></a>");


	//bormal
	document.write("<a href=");
	if(mac_ie=="on"){
		document.write("javascript:set_font_size_change('normal');");
	}else{
		document.write("#");
	}
	document.write(" onclick=set_font_size_change('normal')><img src=" + img_dir + "font_m");
	if(fs_flag=="none"){
		document.write("_h");
	}else if(onoff=="normal"){
		document.write("_h");
	}else{
		document.write("_f");
	}
document.write(".gif width=18 height=19 alt=NORMAL name=normal></a>");

	//big
	document.write("<a href=");
	if(mac_ie=="on"){
		document.write("javascript:set_font_size_change('big');");
	}else{
		document.write("#");
	}
	document.write(" onclick=set_font_size_change('big')><img src=" + img_dir + "font_l");
	if(onoff=="big"){
		document.write("_h");
	}else{
		document.write("_f");
	}
	document.write(".gif width=18 height=19 alt=BIG name=big></a>");

	if(mac_ie_true=="on"){
		document.write("<br clear=all>");
	}else{
		document.write("");
	}
}


function css_selector(){

	var cssfile = "";
	fontsize01 = get_font_size_change(key01);

	if(fontsize01=="small"){
		cssfile = "font_s.css";
	}else if(fontsize01=="big"){
		cssfile = "font_l.css";
	}else{
		cssfile = "font_m.css";
	}
	
	document.write('<link rel="StyleSheet" type="text/css" href="' + css_dir + cssfile + '">');
}

//run-----------------------
css_selector();
