
//index.htmlの更新遍歴のウィンドウオープン
        function disp(url){
                window.open(url,"","scrollbars=1,resizable=0,width=300,height=520,Left=10pixels,Top=10pixels,");
        }

//prof.htmlのＭＡＰのウィンドウオープン
        function disp2(url){
                w=window.open(url,"","scrollbars=1,resizable=0,width=330,height=380,Left=10pixels,Top=10pixels,");
        }

//gallery.htmlのg-top.htmlのギャラリーについてのウィンドウオープン
        function disp3(url){
                w=window.open(url,"","scrollbars=1,resizable=0,width=300,height=560,Left=10pixels,Top=10pixels,");
        }

//リンク各項目のステータスバーへの表示
		function StatusMsg(msgStr) { //v1.0
		  status=msgStr;
		document.returnValue = true;
		}

//トップページの画像処理

var mblock	= null;
var mimg		= null;
var midx		= 0;
var mcontainer= null;
var mtimeout	= 6000;

function montage( href, src, caption, width, animate )
{
	var cycle	= Math.floor( Math.random() * href.length );

	var m_montage	= ( typeof(animate) != "undefined" ? animate : hasBroadband() );
	
	if( m_montage == false || src.length <= 1 || !( isIE4 || isW3C ) )
	{
		montagePicker( href, src, caption, cycle );
		return;
	}
	
	midx		= cycle;

	document.writeln( "<div id=\"container\" style=\"width:" + width +"px;height:149px\">" );

	for( i = 0; i < src.length; i++ )
	{
		document.writeln( "\t<div id=\"montage" + i + "\" style=\"display:none\">" );
		
		montagePicker( href, src, caption, i );

		document.writeln( "\t</div>" );
	}

	document.writeln( "</div>" );

	mblock	= new Array( src.length );
	mimg		= new Array( src.length );

	for( i = 0; i < src.length; i++ )
	{
		mblock[i]	= document.getElementById( "montage" + i ).style;
		mimg[i]	= document.getElementById( "mimg" + i );
		
		if( mimg[i] == null )
		{
			montagePicker( href, src, caption, i );
			return;
		}
	}

	mcontainer = document.getElementById("container");
	
	montageEffects();
}

function montageEffects()
{
	var nextImage	= (midx + 1) % mimg.length;
	
	if( readIEVer() >= 4.0 )
	{
		mcontainer.style.filter = "blendTrans(duration=1.5) revealTrans(duration=1.0,transition=7)";
	
		mcontainer.filters(0).apply();
		mcontainer.filters(1).apply();
		
 		montageSelect( nextImage );
		
		mcontainer.filters(0).play();
		mcontainer.filters(1).play();
	}
	else
	{
		montageSelect( nextImage );
	}

	setTimeout( "montageSwap()", mtimeout );
}

function montageSelect( nextImage )
{
	mblock[midx].display = "none";
	midx = nextImage;
	mblock[midx].display = "block";
}		

function montageSwap()
{
	if( mimg[midx].complete )
	{
		montageEffects();
	}
	else
	{
		setTimeout( "montageSwap()", 3000 );
	}
}

function montagePicker( href, src, caption, cycle )
{
	if( href[cycle] != null ) 
	{
		document.writeln( "\t\t<A HREF=\"" + href[cycle] + "\"><IMG SRC=\"" + src[cycle] + "\" alt=\"" + caption[cycle] + "\" BORDER=\"0\" ID=\"mimg" + cycle + "\"></a>" );
	}
	else
	{
		document.writeln( "\t\t<IMG SRC=\"" + src[cycle] + "\" ID=\"mimg" + cycle + "\">" );
	}
}

var isCSS 			= false;
var isW3C 			= false;
var isIE4 			= false;
var isNN4 			= false;
var isIE6 			= false;
var isGecko 		= false;
var isOpera 		= false;
var isDHTML 		= false;
var suppressMenus	= false;
var legacyMode		= false;
var timerID			= null;
var subtimerID		= null;

function autoconfig()
{
    if(document && document.images)
    {
        isCSS		= (document.body && document.body.style) ? true : false;
        isW3C		= (isCSS && document.getElementById) ? true : false;
        isIE4		= (isCSS && document.all && readIEVer() >= 4.0) ? true : false;
        isNN4		= (document.layers) ? true : false;
        isGecko		= (isCSS && navigator && navigator.product && navigator.product == "Gecko");
        isOpera		= (isCSS && navigator.userAgent.indexOf( "Opera") != -1 );
		isIE6CSS	= (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
		isIE6		= ( isIE6CSS && readIEVer() >= 6.0 );
        isDHTML		= isCSS && ( isIE4 || isGecko || isOpera );
        
        if( suppressMenus || ( isOpera && readOperaVer() < 7 ) || ( isGecko && navigator.productSub <= 20011022 ) || ( isGecko && navigator.productSub == 20030107 ) )
        {
			isDHTML	= false;
        }
    }
}

function readIEVer()
{
	var agent	= navigator.userAgent;
	var offset	= agent.indexOf( "MSIE" );
	if( offset < 0 )
	{
		return 0;
	}
	return parseFloat( agent.substring( offset + 5, agent.indexOf( ";", offset ) ) );
}

var m_mhFixed		= false;
var m_production	= true;

function mhFixupLink( href, extra )
{
	if( typeof(extra) == "undefined" )
	{
		extra = "&~ck=mn";
	}
	
	if( href )
	{
		var anchor		= null;
		var anchorix	= href.indexOf( "#" );
		
		if( anchorix != -1 )
		{
			anchor		= href.substr( anchorix );
			href		= href.substr( 0, anchorix );
		}
		
		if( href.indexOf( "?" ) == -1 )
		{
			extra = "?" + extra.substr( 1 );
		}

		if( href.toLowerCase().indexOf( "javascript:" ) == -1 )
		{
			href += extra;
		}
		else
		{
			start = href.indexOf( "?" );
			
			if( start != -1 )
			{
				ix = href.indexOf( "\'", start );
				
				if( ix == -1 )
				{
					ix = href.indexOf( "\\", start );

					if( ix == -1 )
					{
						ix = href.indexOf( "\"", start );
					}
				}
				
				if( ix != -1 )
				{
					href = href.substr( 0, ix ) + extra + href.substr( ix );
				}
			}
		}
		
		if( anchor )
		{
			href += anchor;
		}
	}
	
	return href;
}

function menuItem( text, href )
{
	this.Text			= text;
	this.Href			= mhFixupLink( href, "&~ck=mn" );
	this.IsSeparator	= false;
	this.IsCaption		= false;
	this.MenuItems		= null;
}

function writeMH( phoneTitle, phoneMsg, phoneTariff, segmentTitle, hasLocale, logoLink, pnmsg )
{
	autoconfig();

	if( !m_production && typeof(m_menuBar) == "undefined" )
	{
		document.write( "There is a problem with the menu definition. " );
		
		return;
	}
	
	m_mhFixed	= true;

}


function mhLink( text, href, icon, extra )
{
	href = mhFixupLink( href, extra );

	this.Text			= text;
	this.Href			= href;
	this.Icon			= icon;
}