//フォントサイズの拡大・縮小
var typenum = "";
typenum = eval(getCookie('style'));
if(!typenum){typenum=2;}
var typeList=new Array('small','medium','large');
value_style=typeList[typenum-1];


//ボタンの表示
function size_btn(){
document.write('<p><img src="common/size_txt.gif" width="60" height="13" alt="文字サイズ">');
document.write('<a href="#" onclick="setStyle(-1);return false;"><img src="common/size_minus.gif" width="14" height="13" alt="文字を小さくします"></a>');
document.write('<img src="common/size_'+value_style+'.gif" alt="'+value_style+'" width="13" height="13">');
document.write('<a href="#" onclick="setStyle(+1);return false;" ><img src="common/size_plus.gif" width="14" height="13" alt="文字を大きくします"></a></p>');
}

//読み込んだときにCookieからstyleを読み込んでcssを書き出す
function setCss(){
document.write( '<link href="lib/style-'+value_style+'.css" rel="stylesheet" type="text/css" media="all">');
}

//Cookieの取り出し（慣用的）
function getCookie(name){
var cookieStr = document.cookie
var existNum = cookieStr.indexOf(name)
if(existNum != -1){
start = existNum + name.length + 1
end = cookieStr.indexOf(";" , start)
if(end == -1){
end = cookieStr.length
}
var cookieValue = cookieStr.substring(start,end)
return cookieValue
} else {
return ""
}
}

//Cookieに選択したタイプ（sss,ss,s,m,l,ll,lll）を書き込む
function setStyle(num,Lv){
if(num){
typenum+=num;
if( 1 > typenum ){ typenum="1"; }else if( typenum > 3){ typenum="3"; }
}
styletype=typenum;
sizeString='style=' ;
sizeString+=escape(styletype);
//sizeString+= "; domain=bc-6.com";
sizeString+= "; path=/";
document.cookie =sizeString ;
window.location.reload();
}
setCss();

function sav_cook() {
coknam = "jssample";
coktxt = document.frm1.txt1.value;
day0 = new Date();
day0.setTime(day0.getTime()+60*60*24*1000);
endday = day0.toGMTString();
document.cookie = coknam+"="+escape(coktxt)+";expires="+endday;
}

//ポップアップウィンドウ
openwin = new Array() ;
function owd(jsn, url, ww, hh) {
own = jsn ;
openwin[own]=window.open(url, own , "width="+ww+",height="+hh+",resizable=yes,scrollbars=yes") ;
openwin[own].focus();
        }

//FLASH
var MM_contentVersion = 5;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
                {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
                }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');

}

function swf_play(swfID) {
if ( MM_FlashCanPlay ) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
	document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
	document.write(' id="top01" width="771" height="226" align="">');
	document.write(' <param name="movie" value="images/top.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#ffffff">  '); 
	document.write(' <embed src="images/top.swf" quality="high" bgcolor="#ffffff" ');
	document.write(' swliveconnect="false" width="771" height="226" name="top01" align="" ');
	document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write(' </embed>');
	document.write(' </object>');
} else{
	document.write('<img src="images/top_noflash.jpg" width="771" height="226" alt="新光電気" border="0">');
}
}