function retNull(){
	 null;
}


// Flashのバージョン reqVersion
// Flash Player のチェック

function validFlash(){
	var v = get_flash_version();
	v =parseInt(v.substring(v.indexOf(".")-1))
	//v = v.indexOf(".")-1)
	//alert(v+":"+reqVersion);
	if(v>=reqVersion || v == "0"  || v == "1"  || v == "2" || v == "3" || v == "4" || v == "5"){
		return true;
	}else{
		return false;
	}
}

function get_flash_version() {
 var version='0.0.0';
 if(navigator.plugins && navigator.mimeTypes['application/x-shockwave-flash']){
  var plugin=navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin;
  // the code below is used in SWFObject
  //var plugin=navigator.plugins['Shockwave Flash'];
  if (plugin && plugin.description) {
   // convert the description like 'Shockwave Flash 9.0 r28' into version string like '9.0.8';
   // regex is provided by SWFObject
   version=plugin.description.replace(/^[A-Za-z\s]+/, '').replace(/(\s+r|\s+b[0-9]+)/, ".");
  }
  
 } else { // in the case of Win IE
  var x='';
  try {
   // for ver.7 and later
   var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
   x=axo.GetVariable("$version");
  } catch(e) {
   try {
    // for ver.6
    axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
    x="WIN 6,0,21,0";
    /*
     * GetVariable() crashes player version 6.0.22-29, and
     * players which have those versions throws when access 
     * to AllowScriptAccess
     */
    axo.AllowScriptAccess="always";
    x=axo.GetVariable("$version");
   } catch(e) {
    if (!x.match(/^WIN/)) {
     try {
      // for 4.x,5.x
      axo=null;
      axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
      // version 3 player throws when you call GetVariale().
      x=axo.GetVariable("$version");
     } catch(e) {
      if (axo) {
       // for 3.x
       x="WIN 3,0,18,0";
      } else {
       try {
        // for 2.x
        axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
        x="WIN 2,0,0,11";
       } catch(e) {
        x="WIN 0,0,0,0";
       }
      }
     }
    }
   }
  }
  // convert ActiveX version string to our version string like '9.0.28'
  version=x.replace(/^WIN /,'').replace(/,[0-9]+$/,'').replace(/,/g,'.');
 }
 // check version string format
 // Quicktime enabled Safari returns a description in natural language
 if (version.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) {
  return version;
 } else {
  return '0.0.0';
 }
}

// MAIN部の書き出し
function writeFlashMAIN(){
	if(!validFlash()){
		document.open();  
		document.write(altContent);
		document.close();
	} else {

		if(!swfQuality){var swfQuality="high";}
		if(!swfLiveConnect){var swfLiveConnect="false";}
		if(!swfMenu){var swfMenu="false";}

// .swf ファイルの定義
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write(' codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"');
		document.write(' id="' + swfId + '" width="' + swfWidth + '" height="' + swfHeight + '">');
		
		if(!swfBgcolor){
			document.write('<param name="wmode" value="transparent">');
			var bg='" wmode="transparent';
			
		}else{
			document.write('<param name="bgcolor" value="' + swfBgcolor + '">');
			var bg='" bgcolor="' + swfBgcolor ;
		}

		/*if(!swfScale){swfScale="noScale";}
		if(!swfAlign){swfScale="TL";}*/
		var swfScale="noScale";
		var swfAlign="TL";
		document.write('<param name="movie" value="' + swfFile + '">');
		document.write('<param name="quality" value="' + swfQuality + '">');
		document.write('<param name="menu" value="' + swfMenu + '">');
		document.write('<param name="scale" value="' + swfScale + '">');
		document.write('<param name="salign" value="' + swfAlign + '">');
		document.write('<embed src="' + swfFile + '" width="' + swfWidth + '" height="' + swfHeight + '" scale="' + swfScale + '" salign="' + swfAlign + '" menu="' + swfMenu + '" quality="' + swfQuality + '" swLiveConnect="' + swfLiveConnect +  bg + '" id="' + swfId+ '" name="' + swfId + '" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
		document.write('</object>');
	}
}

function rewriteMenu(myHeigh){
	var obj = document.getElementById("content");
	obj.style.zIndex=90;
	//alert(obj.height);
	//obj.height=100
	//obj.offsetHeight=100
/*
		var str="";
		str+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		str+=' codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"';
		str+=' id="gMenu" width="1000" height="' + myHeigh + '">';

		str+='<param name="movie" value="./menu.swf">';
		str+='<param name="quality" value="high">';
		str+='<param name="menu" value="false">';
		str+='<embed src="./menu.swf" width="1000" height="' + myHeigh + '" menu="false" quality="heigh" swLiveConnect="false" wmode="transparent" name="topMenu" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
		str+='</object>';
	obj.innerHTML = str;
*/
}

function SB(SoutIMG,SoverIMG,Sw,Sh,SgoURL,Starget,SonFunc,SonFuncP,SoffFunc,SoffFuncP){
	//alert("SB");
	reqVersion=8;
	swfId="swfbtn";
	swfFile ="btn.swf";
	onImgName=SoverIMG;
	offImgName=SoutIMG;
	goURL=SgoURL;
	targetWin = Starget;
	swfWidth = Sw;
	swfHeight = Sh;
	if(SonFunc){onFunc = SonFunc;}else{onFunc = "on_fade";}
	if(SonFuncP){onFuncP = SonFuncP;}else{onFuncP = 10;}
	if(SoffFunc){offFunc = SoffFunc;}else{offFunc = "off_fade";}
	if(SoffFuncP){offFuncP = SoffFuncP;}else{offFuncP = 1;}
	swfBtn();
}

function FB(SWFDIR,IMGDIR,SoutIMG,SoverIMG,Sw,Sh,SgoURL,Starget,SonFunc,SonFuncP,SoffFunc,SoffFuncP){
	reqVersion=8;
	swfId="swfbtn";
	swfFile =SWFDIR+"btn.swf";
	onImgName=SWFDIR+IMGDIR+SoverIMG;
	offImgName=SWFDIR+IMGDIR+SoutIMG;
	goURL=SgoURL;
	targetWin = Starget;
	swfWidth = Sw;
	swfHeight = Sh;
	if(SonFunc){onFunc = SonFunc;}else{onFunc = "on_fade";}
	if(SonFuncP){onFuncP = SonFuncP;}else{onFuncP = 10;}
	if(SoffFunc){offFunc = SoffFunc;}else{offFunc = "off_fade";}
	if(SoffFuncP){offFuncP = SoffFuncP;}else{offFuncP = 1;}
	swfBtn();
}

function swfBtn(){

	if(targetWin){
		targetSTR = '&targetWin=' + targetWin ;
	}else{
		targetSTR ="";
	}
	
	swfFile = swfFile + "?onFunc="+onFunc+"&onFuncP="+onFuncP+"&offFunc="+offFunc+"&offFuncP="+offFuncP+"&onImgName="+onImgName+"&offImgName="+offImgName+"&goURL="+goURL+targetSTR;
	//alert(swfFile);
	swfBgcolor="#FFFFFF";
	swfQuality="high";
	swfLiveConnect="false";
	swfMenu="false";


	if(!validFlash()){
		document.open();  
		document.write(altContent);
		document.close();
	} else {
// .swf ファイルの定義
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write(' codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"');
		document.write(' id="' + swfId + '" width="' + swfWidth + '" height="' + swfHeight + '">');
		document.write('<param name="wmode" value="transparent">');
		document.write('<param name="movie" value="' + swfFile + '">');
		document.write('<param name="quality" value="' + swfQuality + '">');
		document.write('<param name="bgcolor" value="' + swfBgcolor + '">');
		document.write('<param name="menu" value="' + swfMenu + '">');
		document.write('<embed src="' + swfFile + '" width="' + swfWidth + '" height="' + swfHeight + '" menu="' + swfMenu + '" quality="' + swfQuality + '" swLiveConnect="' + swfLiveConnect + '" bgcolor="' + swfBgcolor + '"name="' + swfId + '" wmode="transparent" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
		document.write('</object>');
	}
}


//---------------------------------------------------------------------------
// 変数
//---------------------------------------------------------------------------

    var Name = new Array();
    var Value = new Array();
    var Keys = 0;

//---------------------------------------------------------------------------
// 変数を追加する(内部用)
//---------------------------------------------------------------------------
function AddString(name, value)
{
    Name[Keys]  = name;
    Value[Keys] = value;
    Keys++;
}

//---------------------------------------------------------------------------
// 指定された変数の登録番号を返す(内部用)
//---------------------------------------------------------------------------
function SearchString(name)
{
    var num = -1;

    for(ct = 0; ct <= Keys; ct++){
        if(name == Name[ct]){
            num = ct;
            break;
        }
    }
    return num;
}

//---------------------------------------------------------------------------
// 指定された変数の値を返す
//---------------------------------------------------------------------------
function GetString(name)
{
    var value = '';

    if((num = SearchString(name)) >= 0){
        value = Value[num];
    }
    return value;
}

//---------------------------------------------------------------------------
// 変数を追加・修正する
//---------------------------------------------------------------------------
function SetString(name, value)
{
    if(name.length == 0){
        return 0;
    }

    if((num = SearchString(name)) >= 0){
        Value[num] = value;
    }
    else{
        AddString(name, value);
    }
    return 0;
}

//---------------------------------------------------------------------------
// 変数を削除する
//---------------------------------------------------------------------------
function DeleteString(name)
{
    if((num = SearchString(name)) >= 0){
        Name[num]  = '';
        Value[num] = '';
    }
    return 0;
}

//---------------------------------------------------------------------------
// クエリ文字列を解析する
//---------------------------------------------------------------------------
function CreateQuetyStringList()
{
    var name  = '';
    var value = '';
    var flag  = false;

    for(ct = 1; ct <= location.search.length - 1; ct++){
        ch = location.search.charAt(ct);
        if(ch == '?'){
            flag = false;
            continue;
        }
        if(ch == '='){
            flag = true;
            if(value.length > 0){
                name = value;
            }
            value = '';
            continue;
        }
        if((ch == '&') || (ch == '#')){
            flag = false;
            if((name.length > 0) && (value.length > 0)){
                AddString(name, value);
            }
            name  = '';
            value = '';
            continue;
        }
        value += ch;
    }
    if(value.length > 0){
        if(flag == true){
            AddString(name, value);
        }
    }
    return 0;
}


    /* /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    charset = shift_jis

    +++ UTF8/16 ライブラリ +++


    LastModified : 2006-11/08
    
    Powered by kerry
    https://202.248.69.143/~goma/
    
    動作ブラウザ :: IE4+ , NN4.06+ , Gecko , Opera6+



    * [RFC 2279] UTF-8, a transformation format of ISO 10646
    ftp://ftp.isi.edu/in-notes/rfc2279.txt
    
    * [RFC 1738] Uniform Resource Locators (URL)
    ftp://ftp.isi.edu/in-notes/rfc1738.txt

    /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    
    Usage:
    
    // 文字列を UTF16 (文字コード) へ
    utf16code_array = utf.unpackUTF16( my_string );

    // 文字列を UTF8 (文字コード) へ
    utf8code_array = utf.unpackUTF8( my_string );
    
    // UTF8 (文字コード) から文字列へ。 utf.unpackUTF8() したものを元に戻す
    my_string = utf.packUTF8( utf8code_array );

    // UTF8/16 (文字コード) を文字列へ
    my_string = utf.packChar( utfCode_array );
    
    // UTF16 (文字コード) から UTF8 (文字コード) へ
    utf8code_array = utf.toUTF8( utf16code_array );
    
    // UTF8 (文字コード) から UTF16 (文字コード) へ
    utf16code_array = utf.toUTF16( utf8code_array );



    // URL 文字列へエンコード
    url_string = utf.URLencode( my_string );

    // URL 文字列からデコード
    my_string = utf.URLdecode( url_string );

    /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ */



utf = new function()
{
    this.unpackUTF16 = function(_str)
    {
        var i, utf16=[];
        for (i=0; i<_str.length; i++) utf16[i] = _str.charCodeAt(i);
        return utf16;
    }
    
    this.unpackChar = function(_str) 
    {
    	var utf16 = this.unpackUTF16(_str);
    	var i,n, tmp = [];
    	for (n=i=0; i<utf16.length; i++) {
    		if (utf16[i]<=0xff) tmp[n++] = utf16[i];
    		else {
    			tmp[n++] = utf16[i] >> 8;
    			tmp[n++] = utf16[i] &  0xff;
    		}	
    	}
    	return tmp;
    }
    
    this.packChar  =
    this.packUTF16 = function(_utf16)
    {
        var i, str = "";
        for (i in _utf16) str += String.fromCharCode(_utf16[i]);
        return str;
    }

    this.unpackUTF8 = function(_str)
    {
       return this.toUTF8( this.unpackUTF16(_str) );
    }

    this.packUTF8 = function(_utf8)
    {
        return this.packUTF16( this.toUTF16(_utf8) );
    }
    
    this.toUTF8 = function(_utf16)
    {
        var utf8 = [];
        var idx = 0;
        var i, j, c;
        for (i=0; i<_utf16.length; i++)
        {
            c = _utf16[i];
            if (c <= 0x7f) utf8[idx++] = c;
            else if (c <= 0x7ff)
            {
                utf8[idx++] = 0xc0 | (c >>> 6 );
                utf8[idx++] = 0x80 | (c & 0x3f);
            }
            else if (c <= 0xffff)
            {
                utf8[idx++] = 0xe0 | (c >>> 12 );
                utf8[idx++] = 0x80 | ((c >>> 6 ) & 0x3f);
                utf8[idx++] = 0x80 | (c & 0x3f);
            }
            else
            {
                j = 4;
                while (c >> (6*j)) j++;
                utf8[idx++] = ((0xff00 >>> j) & 0xff) | (c >>> (6*--j) );
                while (j--) 
                utf8[idx++] = 0x80 | ((c >>> (6*j)) & 0x3f);
            }
        }
        return utf8;
    }
    
    this.toUTF16 = function(_utf8)
    {
        var utf16 = [];
        var idx = 0;
        var i,s;
        for (i=0; i<_utf8.length; i++, idx++)
        {
            if (_utf8[i] <= 0x7f) utf16[idx] = _utf8[i];
            else 
            {
                if ( (_utf8[i]>>5) == 0x6)
                {
                    utf16[idx] = ( (_utf8[i] & 0x1f) << 6 )
                                 | ( _utf8[++i] & 0x3f );
                }
                else if ( (_utf8[i]>>4) == 0xe)
                {
                    utf16[idx] = ( (_utf8[i] & 0xf) << 12 )
                                 | ( (_utf8[++i] & 0x3f) << 6 )
                                 | ( _utf8[++i] & 0x3f );
                }
                else
                {
                    s = 1;
                    while (_utf8[i] & (0x20 >>> s) ) s++;
                    utf16[idx] = _utf8[i] & (0x1f >>> s);
                    while (s-->=0) utf16[idx] = (utf16[idx] << 6) ^ (_utf8[++i] & 0x3f);
                }
            }
        }
        return utf16;
    }
    
    this.URLencode = function(_str)
    {
        return _str.replace(/([^a-zA-Z0-9_\-\.])/g, function(_tmp, _c)
            { 
                if (_c == "\x20") return "+";
                var tmp = utf.toUTF8( [_c.charCodeAt(0)] );
                var c = "";
                for (var i in tmp)
                {
                    i = tmp[i].toString(16);
                    if (i.length == 1) i = "0"+ i;
                    c += "%"+ i;
                }
                return c;
            } );
    }

    this.URLdecode = function(_dat)
    {
        _dat = _dat.replace(/\+/g, "\x20");
        _dat = _dat.replace( /%([a-fA-F0-9][a-fA-F0-9])/g, 
                function(_tmp, _hex){ return String.fromCharCode( parseInt(_hex, 16) ) } );
        return this.packChar( this.toUTF16( this.unpackUTF16(_dat) ) );
    }
}




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_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_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];}
}

if(navigator.userAgent.indexOf("Opera") != -1){ // 文字列に「Opera」が含まれている場合
	document.write('<LINK rel="stylesheet" href="css/font_ie.css" type="text/css" />');
}
else if(navigator.userAgent.indexOf("Firefox") != -1){ // 文字列に「Firefox」が含まれている場合
	document.write('<LINK rel="stylesheet" href="css/font.css" type="text/css" />');
}
else{
	document.write('<LINK rel="stylesheet" href="css/font_ie.css" type="text/css" />');
}


function setDivPosition(){
	var _h1 = document.getElementById("header01");
	var _h2 = document.getElementById("header02");
	var _f = document.getElementById("footer");
	var _c = document.getElementById("content");
	//alert(pageID);
	_c.style.display="block";
	if(pageID=="index"){
		_c.style.top = "260px";
		_f.style.top = _h1.offsetHeight+_h2.offsetHeight+_c.offsetHeight+200+"px";
	}else{
		_f.style.top = _h1.offsetHeight+_h2.offsetHeight+_c.offsetHeight+"px";
	}
	//alert(_h1.offsetHeight+_h2.offsetHeight+_c.offsetHeight);
}

function inintContent(){
	Shadowbox.init();
	setDivPosition();
	focusToHtml();
	rollover();
}


function focusToHtml(){
	var obj = document.getElementById("content");
	obj.style.zIndex=90;
	if(document.getElementById("topScrollFrash")!=null){
		var obj2 = document.getElementById("topScrollFrash");
		obj2.style.zIndex=91;
	}
	//alert("html");
}
function focusToSwf(){
	var obj = document.getElementById("content");
	obj.style.zIndex=1;
	//alert("flash");
	if(document.getElementById("topScrollFrash")!=null){
		var obj2 = document.getElementById("topScrollFrash");
		obj2.style.zIndex=0;
	}
}

function movePage(pname){
	//alert("test");
	//alert(pname);
	if(pageID=="blog"){
		location.href="/"+pname+".html";
	}else{
		location.href=pname+".html";
	}
}

/*---------------------------
GOOGLE SEARCH
----------------------------*/
function gsearch(){
	document.googleSearch.submit();
}
/*---------------------------
ROLL OVER
----------------------------*/
	function rollover(){
		var targetClassName = "hoverImg";
		var suffix = "_ov";

		var overReg = new RegExp("^(.+)(\\.[a-z]+)$");
		var outReg = new RegExp("^(.+)" + suffix + "(\\.[a-z]+)$");

		var preload = new Array();
		var images = document.getElementsByTagName("img");

		for (var i = 0, il = images.length; i < il; i++) {
			var classStr = images[i].getAttribute("class") || images[i].className;
			var classNames = classStr.split(/\s+/);
			for(var j = 0, cl = classNames.length; j < cl; j++){
				if(classNames[j] == targetClassName){

					//preload
					preload[i] = new Image();
					preload[i].src = images[i].getAttribute("src").replace(overReg, "$1" + suffix + "$2");

					//mouseover
					images[i].onmouseover = function() {
						this.src = this.getAttribute("src").replace(overReg, "$1" + suffix + "$2");
					}

					//mouseout
					images[i].onmouseout = function() {
						this.src = this.getAttribute("src").replace(outReg, "$1$2");
					}
				}
			}
		}
	}

window.onload = inintContent;