/* 2004.1 */
/* Copyright(C) RYOIN BIWAJIMA CO., LTD. All Rights Reserved.*/
/* j[9-36][ss-x] */
/* ex1.<span class="j9ss" id="j9ss"></span>*/
/* ex2(chFontsize())
  <script langage="javascript" type="text/javascript">
  <!--
  if(dameflag){
	;
  }else{
	document.write("<a href=\"javascript:void(0);\" onClick=\"chFontsize(+1)\">Large</a>\n");
	document.write("<a href=\"javascript:void(0);\" onClick=\"chFontsize(-1)\">Small</a>\n");
	document.write("<a href=\"javascript:void(0);\" onClick=\"reFontsize()\">Reset</a>\n");
  }
  //-->
  </script>

  //HTML
  <span class="j9ss" id="j9ss[0-maxUniqueID]">ABCDEFG</span>
*/

/*Star write CSS */

var aF_size = new Array(9,10,12,14,18,24,30,36);
var aF_height = new Array('ss','s','m','l','x');
var aF_link = new Array('link','hover','active','visited');

var formOp = "";//input,textarea,select
var Font_fm = "";//Fontfamily
var hF_height = new Object();

var sizeP = 2;//Default body's font position
var heiP = 3;//Default body's font line space position
var maxUniqueID = 10;


var hF_list = new Object();
var hF_link = new Object();
var hLinkOp = new Object(); //Link option@text-decoration,background-color etc...

hF_link = { 'link':"#006699", 'hover':"#6699CC", 'active':"#99CCFF", 'visited':"#996600"};

var F_name = "";
var mList = false;
var initial = "j";

/*-----------------------------------------------------------------*/
document.write("<style type='text/css'><!--");


if(wi7 || wi6 || wi5){
	formOp = "border:#4682B4 1px solid; background:#EBEDF0; color:#333333; margin:2px";
	hF_height = { 'ss':"110%", 's':"130%", 'm':"150%", 'l':"170%", 'x':"190%"};
	hLinkOp = { 'link':"text-decoration:none;", 'hover':"text-decoration:none;border-bottom:1px dotted #6699CC;", 'active':"text-decoration:none;", 'visited':"text-decoration:none;"};

	Font_fm = "Arial";

	//body,th,td
	document.write("body,th,td {font-family:" + "\"" + Font_fm + "\"; font-size:" + aF_size[sizeP] +"px; line-height:" + hF_height[aF_height[heiP]] + "}");

	//9-36px
	mkFlistFam(initial, Font_fm, aF_size.length);

	//hover,link
	mkFlistFamLink(initial, Font_fm, aF_size.length);

	document.write("input,textarea,select {" + formOp + "}");

}else if(wi4){
	formOp = "border:#4682B4 1px solid; background:#EBEDF0; color:#333333; margin:2px";
	hF_height = { 'ss':"110%", 's':"130%", 'm':"160%", 'l':"170%", 'x':"190%"};
	hLinkOp = { 'link':"text-decoration:none;", 'hover':"text-decoration:none;border-bottom:1px dotted #6699CC;", 'active':"text-decoration:none;", 'visited':"text-decoration:none;"};

	Font_fm = "Arial";

	document.write("body,th,td {font-family:" + "\"" + Font_fm + "\"; font-size:" + aF_size[sizeP] +"px; line-height:" + hF_height[aF_height[heiP]] + "}");

	//9-36px
	mkFlistFam(initial, Font_fm, aF_size.length);

	//hover,link
	mkFlistFamLink(initial, Font_fm, aF_size.length);


	document.write("input,textarea,select {" + formOp + "}");

}else if(wn6 || wn7){
	formOp = "border:#4682B4 1px solid; background:#EBEDF0; color:#333333; margin:2px; padding-bottom:6px";
	hF_height = { 'ss':"110%", 's':"130%", 'm':"155%", 'l':"170%", 'x':"190%"};
	hLinkOp = { 'link':"text-decoration:none;", 'hover':"text-decoration:none;border-bottom:1px dotted #6699CC;", 'active':"text-decoration:none;", 'visited':"text-decoration:none;"};

	Font_fm = "Arial";

	document.write("body,th,td {font-family:" + "\"" + Font_fm + "\"; font-size:" + aF_size[sizeP] +"px; line-height:" + hF_height[aF_height[heiP]] + "}");

	mkFlistFam(initial, Font_fm, aF_size.length);

	//hover,link
	mkFlistFamLink(initial, Font_fm, aF_size.length);


	document.write("input,textarea,select {" + formOp + "}");

}else if(wn4){

	hF_height = { 'ss':"110%", 's':"130%", 'm':"150%", 'l':"160%", 'x':"180%"};

	mkFlist(initial, aF_size.length);


}else if(wo6 || wo7){

	formOp = "border:#4682B4 1px solid; background:#EBEDF0; color:#333333; margin:2px";
	hF_height = { 'ss':"110%", 's':"140%", 'm':"160%", 'l':"170%", 'x':"195%"};
	hLinkOp = { 'link':"text-decoration:none;", 'hover':"text-decoration:none;border-bottom:1px dotted #6699CC;", 'active':"text-decoration:none;", 'visited':"text-decoration:none;"};
	Font_fm = "Arial";

	document.write("body,th,td {font-family:" + "\"" + Font_fm + "\"; font-size:" + aF_size[sizeP] +"px; line-height:" + hF_height[aF_height[heiP]] + "}");

	mkFlistFam(initial, Font_fm, aF_size.length);

	//hover,link
	mkFlistFamLink(initial, Font_fm, aF_size.length);



	document.write("input,textarea,select {" + formOp + "}");

}else if(wmoz){

	formOp = "border:#4682B4 1px solid; background:#EBEDF0; color:#333333; margin:2px";
	hF_height = { 'ss':"110%", 's':"135%", 'm':"155%", 'l':"170%", 'x':"195%"};
	hLinkOp = { 'link':"text-decoration:none;", 'hover':"text-decoration:none;border-bottom:1px dotted #6699CC;", 'active':"text-decoration:none;", 'visited':"text-decoration:none;"};
	Font_fm = "Arial";

	document.write("body,th,td {font-family:" + "\"" + Font_fm + "\"; font-size:" + aF_size[sizeP] +"px; line-height:" + hF_height[aF_height[heiP]] + "}");

	mkFlistFam(initial, Font_fm, aF_size.length);

	//hover,link
	mkFlistFamLink(initial, Font_fm, aF_size.length);


	document.write("input,textarea,select {" + formOp + "}");

}else if(mi5 || mi4){

	formOp = "border:#4682B4 1px solid; background:#EEEEEE; color:#333333; margin:2px";
	hF_height = { 'ss':"110%", 's':"130%", 'm':"155%", 'l':"170%", 'x':"190%"};
	hLinkOp = { 'link':"text-decoration:none;", 'hover':"text-decoration:none;border-bottom:1px dotted #6699CC;", 'active':"text-decoration:none;", 'visited':"text-decoration:none;"};
	Font_fm = "Osaka";

	document.write("body,th,td {font-family:" + "\"" + Font_fm + "\"; font-size:" + aF_size[sizeP] +"px; line-height:" + hF_height[aF_height[heiP]] + "}");

	mkFlistFam(initial, Font_fm, aF_size.length);

	//hover,link
	mkFlistFamLink(initial, Font_fm, aF_size.length);

	document.write("input,textarea,select {" + formOp + "}");

}else if(mn6 || mn7){

	formOp = "border:#4682B4 1px solid; background:#EBEDF0; color:#333333; margin:2px";
	hF_height = { 'ss':"115%", 's':"135%", 'm':"165%", 'l':"170%", 'x':"195%"};
	hLinkOp = { 'link':"text-decoration:none;", 'hover':"text-decoration:none;border-bottom:1px dotted #6699CC;", 'active':"text-decoration:none;", 'visited':"text-decoration:none;"};
	Font_fm = "Osaka";


	if ( document.defaultView && document.styleSheets ) window.onload = init;
	document.write("body,th,td {font-family:" + "\"" + Font_fm + "\"; font-size:" + aF_size[sizeP] +"px; line-height:" + hF_height[aF_height[heiP]] + "}");

	mkFlistFam(initial, Font_fm, aF_size.length);

	//hover,link
	mkFlistFamLink(initial, Font_fm, aF_size.length);


	document.write("input,textarea,select {" + formOp + "}");

}else if(mn4){

	hF_height = { 'ss':"115%", 's':"135%", 'm':"165%", 'l':"170%", 'x':"195%"};

	mkFlist(initial, aF_size.length);

}else if(saf){

	hF_height = { 'ss':"110%", 's':"135%", 'm':"160%", 'l':"170%", 'x':"195%"};
	hLinkOp = { 'link':"text-decoration:none;", 'hover':"text-decoration:none;border-bottom:1px dotted #6699CC;", 'active':"text-decoration:none;", 'visited':"text-decoration:none;"};

	document.write("body,th,td {font-size:" + aF_size[sizeP] +"px; line-height:" + hF_height[heiP] + "}");

	mkFlist(initial, aF_size.length);

	//hover,link
	mkFlistLink(initial, aF_size.length);


}else if(mo6){

	hF_height = { 'ss':"110%", 's':"135%", 'm':"160%", 'l':"170%", 'x':"195%"};
	hLinkOp = { 'link':"text-decoration:none;", 'hover':"text-decoration:none;border-bottom:1px dotted #6699CC;", 'active':"text-decoration:none;", 'visited':"text-decoration:none;"};
	Font_fm = "Osaka";

	document.write("body,th,td {font-family:" + "\"" + Font_fm + "\"; font-size:" + aF_size[sizeP] +"px; line-height:" + hF_height[aF_height[heiP]] + "}");

	mkFlistFam(initial, Font_fm, aF_size.length);

	//hover,link
	mkFlistFamLink(initial, Font_fm, aF_size.length);


}else{
		;
}

document.write("-->");
document.write("</style>");

//FontFamilly
function mkFlistFam(Ini, FoFM, FsL){
 for (i=0;i<FsL; i++){
  for (j=0; j<aF_height.length;j++){
	document.write("." + Ini + aF_size[i] + aF_height[j] + " {font-family:" + "\"" + FoFM + "\"; font-size:" + aF_size[i] +"px; line-height:" + hF_height[aF_height[j]] + "}");
  }
 }
}

//no FontFamilly
function mkFlist(Ini, FsL){

 for (i=0;i<FsL; i++){
  for (j=0; j<aF_height.length;j++){
	document.write("." + Ini + aF_size[i] + aF_height[j] + " {font-size:" + aF_size[i] +"px; line-height:" + hF_height[aF_height[j]] + "}");
  }
 }
}

//FontFamilly
function mkFlistFamLink(Ini, FoFM, FsL){
 for (i=0;i<FsL; i++){
   for(j=0;j<aF_link.length;j++){
     for(k=0;k<aF_height.length;k++){
  	document.write("a." + Ini + aF_size[i] + aF_height[k] + ":" + aF_link[j] + "{color:" + hF_link[aF_link[j]] + ";font-family:" + "\"" + FoFM + "\"; font-size:" + aF_size[i] +"px; line-height:" + hF_height[aF_height[k]] + ";" + hLinkOp[aF_link[j]] +"}");
    }
  }
 }
}

//no FontFamilly Link info
function mkFlistLink(Ini, FsL){
 for (i=0;i<FsL; i++){
   for(j=0;j<aF_link.length;j++){
     for(k=0;k<aF_height.length;k++){
  	document.write("a." + Ini + aF_size[i] + aF_height[k] + ":" + aF_link[j] + "{color:" + hF_link[aF_link[j]] + ";font-size:" + aF_size[i] +"px; line-height:" + hF_height[aF_height[k]] + ";" + hLinkOp[aF_link[j]] +"}");
    }
  }
 }
}

//--------------------------------------------------------------------------------------------------------------------------------------

//Start change font's size.
function chFontsize(vl){

initializeFontslist();

	if(wi4 || wi5 || wi6 || wi7 || wo7 || mi5 || mi4){
		for(j=0; j<aF_size.length; j++){
			for(k=0; k<aF_height.length; k++){
				for(x=0; x<maxUniqueID; x++){
					if(document.all["j" + aF_size[j] + aF_height[k] + [x]]){
						F_name= "j" + aF_size[j] + aF_height[k] + [x];
						if(vl > 0 && (j+1+hF_list[F_name]) <= 7){
							document.all["j" + aF_size[j] + aF_height[k] + [x]].style.fontSize = aF_size[j+1+hF_list[F_name]];
							document.all["j" + aF_size[j] + aF_height[k] + [x]].style.lineHeight = hF_height[aF_height[k]];
							hF_list[F_name] += vl;
						}else if(vl < 0 && (j+hF_list[F_name]-1) >= j){
							document.all["j" + aF_size[j] + aF_height[k] + [x]].style.fontSize = aF_size[j+hF_list[F_name]-1];
							document.all["j" + aF_size[j] + aF_height[k] + [x]].style.lineHeight = hF_height[aF_height[k]];
							hF_list[F_name] += vl;
						}
					}
				}
			}
		}
	}else if(wn6 || wn7 || mn6 || mn7 || wmoz || saf){//mo6Ή
		for(j=0; j<aF_size.length; j++){
			for(k=0; k<aF_height.length; k++){
				for(x=0; x<maxUniqueID; x++){
					if(document.getElementById("j" + aF_size[j] + aF_height[k] + [x])){
						F_name= "j" + aF_size[j] + aF_height[k] + [x];
						if(vl > 0 && (j+1+hF_list[F_name]) <= 7){
							document.getElementById("j" + aF_size[j] + aF_height[k] + [x]).style.fontSize = aF_size[j+1+hF_list[F_name]];
							document.getElementById("j" + aF_size[j] + aF_height[k] + [x]).style.lineHeight = hF_height[aF_height[k]];
							hF_list[F_name] += vl;
						}else if(vl < 0 && (j+hF_list[F_name]-1) >= j){
							document.getElementById("j" + aF_size[j] + aF_height[k] + [x]).style.fontSize = aF_size[j+hF_list[F_name]-1];
							document.getElementById("j" + aF_size[j] + aF_height[k] + [x]).style.lineHeight = hF_height[aF_height[k]];
							hF_list[F_name] += vl;
						}
					}
				}
			}
		}
	}
}
//End change font's size.

//Start make font's List & initialize

function initializeFontslist(){
	if(!mList){
		if(wi4 || wi5 || wi6 || wi7 || wo7 || mi5 || mi4){
			for(j=0; j<aF_size.length; j++){
				for(k=0; k<aF_height.length; k++){
					for(x=0; x<maxUniqueID; x++){
						if(document.all["j" + aF_size[j] + aF_height[k] + [x]]){
							F_name = "j" + aF_size[j] + aF_height[k] + [x];
							hF_list[F_name] = 0;
						}
					}
				}
			}
			mList = true;

		}else if(wn6 || wn7 || mn6 || mn7 || wmoz || saf){
			for(j=0; j<aF_size.length; j++){
				for(k=0; k<aF_height.length; k++){
					for(x=0; x<maxUniqueID; x++){
						if(document.getElementById("j" + aF_size[j] + aF_height[k] + [x]) && !document.all){
								F_name = "j" + aF_size[j] + aF_height[k] + [x];
								hF_list[F_name] = 0;
						}
					}
				}
			}
			mList = true;
		}
	}
}

//End make font's List & initialize

//Start reset font's List & initialize
function reFontsize(){

	if(wi4 || wi5 || wi6 || wi7 || wo7 || mi5 || mi4){
		for(j=0; j<aF_size.length; j++){
			for(k=0; k<aF_height.length; k++){
				for(x=0; x<maxUniqueID; x++){
					if(document.all["j" + aF_size[j] + aF_height[k] + [x]]){
						F_name= "j" + aF_size[j] + aF_height[k] + [x];
						document.all["j" + aF_size[j] + aF_height[k] + [x]].style.fontSize = aF_size[j];
						document.all["j" + aF_size[j] + aF_height[k] + [x]].style.lineHeight = hF_height[aF_height[k]];
	
					}
				}
			}
		}

	}else if(wn6 || wn7 || mn6 || mn7 || wmoz || saf){
		for(j=0; j<aF_size.length; j++){
			for(k=0; k<aF_height.length; k++){
				for(x=0; x<maxUniqueID; x++){
					if(document.getElementById("j" + aF_size[j] + aF_height[k] + [x])){
						F_name= "j" + aF_size[j] + aF_height[k] + [x];
						document.getElementById("j" + aF_size[j] + aF_height[k] + [x]).style.fontSize = aF_size[j];
						document.getElementById("j" + aF_size[j] + aF_height[k] + [x]).style.lineHeight = hF_height[aF_height[k]];
					}
				}
			}
		}
	}

	mList = false;
	initializeFontslist();
}
//End reset font's List & initialize

//--------------------------------------------------------------------------------------------------


function init() {
	sSheet = document.styleSheets[document.styleSheets.length-1];
	if ( document.defaultView.getComputedStyle(document.body,"").getPropertyValue("font-size") == "14px" ){
		sSheet.insertRule("body {font-size: 16px}",sSheet.cssRules.length);
	}
}
