var z;
var NoZoom = false;
var sfTitles = "";
 if ( navigator.userAgent.indexOf("MSIE") == -1) {
  //alert("IEではない");
  NoZoom = true;
 }else{
  document.write('          <link rel="stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom5.css" media="screen,tv" title="zoom50" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom6.css" media="screen,tv" title="zoom60" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom7.css" media="screen,tv" title="zoom70" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom8.css" media="screen,tv" title="zoom80" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom9.css" media="screen,tv" title="zoom90" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom10.css" media="screen,tv" title="zoom100" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom11.css" media="screen,tv" title="zoom110" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom12.css" media="screen,tv" title="zoom120" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom13.css" media="screen,tv" title="zoom130" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom14.css" media="screen,tv" title="zoom140" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom15.css" media="screen,tv" title="zoom150" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom16.css" media="screen,tv" title="zoom160" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom17.css" media="screen,tv" title="zoom170" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom18.css" media="screen,tv" title="zoom180" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom19.css" media="screen,tv" title="zoom190" />');
  document.write('<link rel="alternate stylesheet" type="text/css" href="http://www.miyajimusic.com/js/kakusyuku/zoom20.css" media="screen,tv" title="zoom200" />');
}


/* スタイルシート切り替えスクリプト */

if ( document.styleSheets
 && !(navigator.userAgent.indexOf("Mac_PowerPC") != -1
 && navigator.userAgent.indexOf("MSIE 4") != -1)) {
 /* Scriptでスタイルシートを扱えるブラウザのみ実行される */

 MYJZoom = getCookie("MYJZoom");
 if(!MYJZoom){
   z = 10;
   setCookie("MYJZoom",z);
 }else{
   z = MYJZoom;
 }

 fGetStyleTitles();
 zoom(z);
}else{
  NoZoom = true;
}


function fGetStyleTitles(){

 /* スタイルシートの一覧を取得 */
 sS=document.styleSheets;
 for(i=0; i<sS.length; i++){
  if (sS[i].title){
   if (sfTitles.indexOf(sS[i].title)==-1) {
    sfTitles+=sS[i].title;
    sfTitles+=",";
   }
  }
 }
 sfTitles+="dummy";
 sfTitle=sfTitles.split(",");
}

//--------------------------------------------------------------------------
//　Cookieを参照する関数（Cookieから指定されたデータを抜きだす）
//　成功した時はnull以外、失敗した時はfalseを返す
//--------------------------------------------------------------------------
function getCookie(theName)
{
	theName += "="; //　= を追加
	theCookie = document.cookie+";"; //　検索時最終項目で-1になるのを防ぐ
	start = theCookie.indexOf(theName); //　指定されたセクション名を検索する
	if (start != -1)
	{
		end = theCookie.indexOf(";",start); //　データを抜きだす
		return unescape(theCookie.substring(start+theName.length,end));
	}
	return false;
}


//--------------------------------------------------------------------------
//　Cookieを設定する関数（Cookieにデータを保存する）
//　成功した時はtrue、失敗した時はfalseを返す
//--------------------------------------------------------------------------
function setCookie(theName,theValue)
{
cdays=1; // クッキーの有効日数 0=ブラウザ終了まで
cpath="/"; // サイトのパス

	if ((theName != null) && (theValue != null))
	{
		expDay = new Date(); //　現在の日時を取得
		expDay.setTime(expDay.getTime()+(cdays*1000*60*60*24)); //　Cookie期限の設定
		expDay = expDay.toGMTString();
		document.cookie = theName + "="+escape(theValue)+"; path=" + cpath + "; expires="+expDay; // データ保存
		return true;
	}
	return false;
}


function ChangeSS(brt){
 /* スタイルシートの動的切り替え */
 if(!document.styleSheets){ return}
 ssTitle="zoom" + brt;

 for(i=0; i<sS.length; i++){
  if((sS[i].title==ssTitle)||(!sS[i].title)){
    sS[i].disabled =false;
    }else{
    sS[i].disabled =true;
  }
 }
 setCookie("MYJZoom",z);
 window.focus();
}


function cgz(n){
if (NoZoom == true){
  msg = "現在お使いの「ブラウザ」ではこのボタンは使用できません。\n";
  msg = msg + "（IE 5.5以上のみ対応）\n\n";
  msg = msg + "Netscape、Firefoxをお使いの方は、下記の方法で画面の拡大縮小が出来ます。\n";
  msg = msg + "画面縮小 ： 「Ctrl」キーを押しながら「−」キー\n";
  msg = msg + "画面拡大 ： 「Ctrl」キーを押しながら「＋」キー\n";
  alert(msg);
  return false;
}
  switch (n){
    case 0.9:ZoomOut(); break;
    case 1:ZoomBase(); break;
    case 1.1:ZoomIn(); break;
  }
}


function zoom(n){
brt = n * 10;
  ChangeSS(brt);
}

function ZoomOut(){
 for(i=0; i<sS.length; i++){
  if (sS[i].title=="zoom" + (eval(z)-1) + "0"){
    z=eval(z)-1;
    zoom(z);break;
  }
 }
}

function ZoomBase(){
z=10;
zoom(z);
}

function ZoomIn(){
 for(i=0; i<sS.length; i++){
  if (sS[i].title == "zoom" + (eval(z)+1) + "0"){
    z=eval(z)+1;
    zoom(z);break;
  }
 }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

