function IsGecko(){
    if(navigator){
        if(navigator.userAgent){
            if(navigator.userAgent.indexOf("Gecko") != -1){
                return true;
            }
        }
    }
    return false;
}

function alert_browser()
{
	if (typeof document.body.style.maxHeight != "undefined") {
	  // IE7, Mozilla Firefox, Safari, Opera 9
	} else {
	  // IE6 およびそれ以前の古いブラウザ
	 document.writeln('<br /><div class="alert">ブラウザのバージョンにより正しく表示できない場合があります。<br />It may be unable to display correctly by the version of a browser.</div><br />');
	}
}
function draw_title()
{
	document.writeln(
		'<div class="logo">'+
			'<IMG SRC="NvRsrc/ClusterWorksLogoNeueLight34.gif" alt="" border=0 width=470 height=40 />'+
		'</div>'
	);

}

function draw_head(n,m)
{
	draw_title();
	if(m > 0) n = 0;
	
	var a_class = "toolbar_a";
	
	document.writeln('<div class="maintoolbar"><div class="maintoolbar_inner"><table width=400 height=20 cellspacing=0 cellpadding=0 border=0><tr>');
	if(n==1)
		 document.writeln('<td align=left>HOME</td>');
	else
		 document.writeln('<td align=left><a class="' + a_class +'" href="NvClusterWorksHome.html">HOME</a></td>');

	if(n==2)
		 document.writeln('<td align=center>DOWNLOAD</td>');
	else
		 document.writeln('<td align=center><a class="' + a_class +'" href="NvClusterWorksDownload.html">DOWNLOAD</a></td>');

	if(n==3)
		 document.writeln('<td align=center>GALLERY</td>');
	else
		 document.writeln('<td align=center><a class="' + a_class +'" href="NvClusterWorksGallery.html">GALLERY</a></td>');

	if(n==4)
		 document.writeln('<td align=right>ABOUT</td>');
	else
		 document.writeln('<td align=right><a class="' + a_class +'" href="NvClusterWorksAbout.html">ABOUT</a></td>');
					
	document.writeln('</tr></table></div></div>');
	
	//alert_browser();
}

function draw_tail()
{
	document.writeln(
	'<IMG SRC="NvRsrc/WhirlS1-34.gif" alt="" border=0 width=72 height=72 />' +
	'<div class="credit">' +
		'©2008 Hisashi Hoda All rights reserved.<br/><br/>' + 
	'</div>'
	);
}
function xxtgl_moreinfo(x)
{
	
	var element1 = document.getElementById(x);
	var element3 = document.getElementById(x+"_icon");
	
	if( element1.style.display != "block")
	{
		element1.style.display = "block";
		element3.style.backgroundImage = "url(NvRsrc/btn_triangle_down.gif)";
	}
	else
	{	
		element1.style.display = "none";
		element3.style.backgroundImage = "url(NvRsrc/btn_triangle_right.gif)";
	}
}

function tgl_moreinfo(x)
{
	
	var element1 = document.getElementById(x);
	var element3 = document.getElementById(x+"_icon");
	
	if( element1.style.display != "block")
	{
		element1.style.display = "block";
		//element3.style.backgroundImage = "url(NvRsrc/btn_triangle.gif)";
		element3.style.backgroundPosition = "0px -18px";
	}
	else
	{	
		element1.style.display = "none";
		//element3.style.backgroundImage = "url(NvRsrc/btn_triangle.gif)";
		element3.style.backgroundPosition="0px 0px";
	}
}

function moov(path,w,h,autoplay,controller,loop)
{
	if(controller == true) h += 16;
	
	document.writeln(
			'<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"'+
				' CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"'+
				' HEIGHT=' + h +
				' WIDTH=' + w +
			' >'+
			 
			' <PARAM NAME="src" VALUE="'+ path +'" >'+
			' <PARAM NAME="AutoPlay" VALUE="'+autoplay+'" >'+
			' <PARAM NAME="Controller" VALUE="'+controller+'" >'+
			' <PARAM NAME="LOOP" VALUE="'+loop+'" >'+
			 
			' <EMBED SRC="'+ path +'"'+
				' HEIGHT=' + h +
				' WIDTH=' + w +
				' TYPE="video/quicktime"'+
				' PLUGINSPAGE="http://www.apple.com/quicktime/download/"'+
				' AUTOPLAY="'+autoplay+'"'+
				' CONTROLLER="'+controller+'"'+
				' LOOP="'+loop +'"'+
			' />' +
			'</OBJECT>'
		);
}

function stereo_parallel(img,msg1,msg2)
{
	document.writeln(
		'<div style="display: block;">' +
			'<div style="display:  block; width:608px;margin-left:20px;">' +
				'<div style="display: block; float:left;margin:0px;">' +
					'<div style="overflow:hidden; width:300px; margin:0px;margin-bottom:12px;">' +
						'<div style="position:relative;left:-300px;">' + 
							'<img src="' + img + '" width=600 border=0 />' +
						'</div>' +
					'</div>' +
					'<div class="title">' +
						msg1 + '<br />' + msg2 +
					'</div>' +
				'</div>' +
				'<div style="display: block;float:right;margin:0px;">' +
					'<div style="overflow:hidden; width:300px;margin:0px; margin-bottom:12px;">' +
						'<div style="position:relative;left:0px;">' + 
							'<img src="' + img + '" width=600 border=0 />' +
						'</div>' +
					'</div>' +
					'<div class="title">' +
						msg1 + '<br />' + msg2 +
					'</div>' +
				'</div>' +
			'</div>' +
		'</div>'
	);
}

function pageselector(pn,MODE)
{
	if(pn == 1)
	{
		return '<div style="font-size:16px;"><a href="gStereoPair_01.html'+MODE+'"><img src="NvRsrc/circle12.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_02.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_03.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_04.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a></div>';
	}
	else if(pn == 2)
	{
		return'<div style="font-size:16px;"><a href="gStereoPair_01.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_02.html'+MODE+'"><img src="NvRsrc/circle12.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_03.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_04.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a></div>';
	}
	else if(pn == 3)
	{
		return'<div style="font-size:16px;"><a href="gStereoPair_01.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_02.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_03.html'+MODE+'"><img src="NvRsrc/circle12.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_04.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a></div>';
	}
	else if(pn == 4)
	{
		return'<div style="font-size:16px;"><a href="gStereoPair_01.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_02.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_03.html'+MODE+'"><img src="NvRsrc/circle12f.gif" wifth=12 height=12 border=0 /></a>&nbsp;&nbsp;<a href="gStereoPair_04.html'+MODE+'"><img src="NvRsrc/circle12.gif" wifth=12 height=12 border=0 /></a></div>';
	}
	return '';
}
function stereo_parallel_message(pn,msg1,msg2)
{
	document.writeln(
		'<div style="display: block;">' +
			'<div style="display:  block; width:608px;margin-left:20px;">' +
				'<div style="display: block; float:left;margin:0px;">' +
					'<div class="title" style="overflow:hidden; width:300px;margin:0px; margin-bottom:0px;">' +
						msg1 + '<br />' + msg2  + //'<br /><br />' +
				//		pageselector(pn,"#PARALLEL") +
					'</div>' +
				'</div>' +
				'<div style="display: block;float:right;margin:0px;">' +
					'<div class="title" style="overflow:hidden; width:300px;margin:0px; margin-bottom:0px;">' +
						msg1 + '<br />' + msg2 + //'<br /><br />' +
				//		pageselector(pn,"#PARALLEL") +
					'</div>' +
				'</div>' +
			'</div>' +
		'</div>'
	);
}

function cell_stereo_parallel(img,msg1,msg2)
{
	document.writeln(
		'<div class="episode" ><b class="bRBox"><b class="bRBox1"><b></b></b><b class="bRBox2"><b></b></b><b class="bRBox3"></b><b class="bRBox4"></b><b class="bRBox5"></b></b>' +
			'<div class="bRBox_content"  style="text-align:center;padding:32px;padding-bottom:8px;">'
	);
						
	stereo_parallel(img,msg1,msg2);
	
	document.writeln(
					'<div class="clear"></div>' +
				'</div>' +
			'<div class="clear"></div>' +
		'<b class="bRBox"><b class="bRBox5"></b><b class="bRBox4"></b><b class="bRBox3"></b><b class="bRBox2"><b></b></b><b class="bRBox1"><b></b></b></b></div>'
	);
}

function stereo_cross(img,msg1,msg2)
{
	document.writeln(
		'<div style="display: block;">' +
			'<div style="display: block; width:648px;">' +
				'<div style="display: block; float:left;margin:0px;">' +
					'<div style="overflow:hidden; width:320px; margin-bottom:12px;">' +
						'<div style="position:relative;left:0px;">' + 
							'<a href="'+img+'" target="_blank"><img src="' + img + '" width=640 border=0 /></a>' +
						'</div>' +
					'</div>' +
					'<div class="title">' +
						msg1 + '<br />' + msg2 +
					'</div>' +
				'</div>' +
				'<div style="display: block;float:right;margin:0px;">' +
					'<div style="overflow:hidden; width:320px; margin-bottom:12px;">' +
						'<div style="position:relative;left:-320px;">' + 
							'<a href="'+img+'" target="_blank"><img src="' + img + '" width=640 border=0 /></a>' +
						'</div>' +
					'</div>' +
					'<div class="title">' +
						msg1 + '<br />' + msg2 +
					'</div>' +
				'</div>' +
			'</div>' +
		'</div>'
	);
}
function stereo_cross_message(pn,msg1,msg2)
{
	document.writeln(
		'<div style="display: block;">' +
			'<div style="display: block; width:648px;">' +
				'<div style="display: block; float:left;margin:0px;">' +
					'<div class="title" style="overflow:hidden; width:320px; margin-bottom:0px;">' +
						msg1 + '<br />' + msg2  + //'<br /><br />' +
				//		pageselector(pn,"#CROSS") +
					'</div>' +
				'</div>' +
				'<div style="display: block;float:right;margin:0px;">' +
					'<div class="title" style="overflow:hidden; width:320px; margin-bottom:0px;">' +
						msg1 + '<br />' + msg2  + //'<br /><br />' +
				//		pageselector(pn,"#CROSS") +
					'</div>' +
				'</div>' +
			'</div>' +
		'</div>'
	);
}

function stereo_cross_large(img,msg1,msg2)
{
	document.writeln(
		'<div style="display: block;">' +
			'<div style="display: block; width:1280px;">' +
				'<div style="display: block; float:left;margin:0px;">' +
					'<img src="' + img + '" width=1280 border=0 />' +
				'</div>' +
				'<div style="display: block; float:left;margin:0px;">' +
					'<div style="overflow:hidden; width:640px; margin-top:12px;margin-bottom:12px;">' +
						'<div style="position:relative;left:0px;">' + 
							'<div class="title">' +
								msg1 + '<br />' + msg2 +
							'</div>' +
						'</div>' +
					'</div>' +
				'</div>' +
				'<div style="display: block;float:right;margin:0px;">' +
					'<div style="overflow:hidden; width:640px; margin-top:12px;margin-bottom:12px;">' +
						'<div style="position:relative;left:0px;">' + 
							'<div class="title">' +
								msg1 + '<br />' + msg2 +
							'</div>' +
						'</div>' +
					'</div>' +
				'</div>' +
			'</div>' +
		'</div>'
	);
}
function stereo_cross_message_large(pn,msg1,msg2)
{
	document.writeln(
		'<div style="display: block;">' +
			'<div style="display: block; width:1280px;">' +
				'<div style="display: block; float:left;margin:0px;">' +
					'<div class="title" style="overflow:hidden; width:640px; margin-bottom:0px;">' +
						msg1 + '<br />' + msg2 + //'<br /><br />' + 
					//	pageselector(pn,"") +
					'</div>' +
				'</div>' +
				'<div style="display: block;float:right;margin:0px;">' +
					'<div class="title" style="overflow:hidden; width:640px; margin-bottom:0px;">' +
						msg1 + '<br />' + msg2 + //'<br /><br />' + 
					//	pageselector(pn,"") +
					'</div>' +
				'</div>' +
			'</div>' +
		'</div>'
	);
}
function pagemove(pn,mode,u1,u2)
{
	if(pn == 1)
	{
		return '<a class="nav_a_d" href="' + u1 + mode + '">PREV</a>&nbsp;&nbsp;&nbsp;' + '<a class="nav_a"  href="' + u2 + mode + '">NEXT</a>' ;
	}
	else if(pn == 4)
	{
		return '<a class="nav_a" href="' + u1 + mode + '">PREV</a>&nbsp;&nbsp;&nbsp;' +
				'<a class="nav_a_d"  href="' + u2 + mode + '">NEXT</a>' ;
	}
	else
	{
		return	'<a class="nav_a" href="' + u1 + mode + '">PREV</a>&nbsp;&nbsp;&nbsp;' +
				'<a class="nav_a"  href="' + u2 + mode + '">NEXT</a>' ;
	}

}
 
function stereo_nav(pn,mode,u1,u2)
{
	document.writeln(
		'<div style="display: block;">' +
			'<div style="display: block; width:648px;">' +
				'<div style="display: block; float:left;margin:0px;">' +
					'<div style="text-align:center;line-height:18px;font-size:12px;color:#565656;overflow:hidden; width:320px; margin-bottom:0px;">' +
						pageselector(pn,mode) +
						pagemove(pn,mode,u1,u2) +
					'</div>' +
				'</div>' +
				'<div style="display: block;float:right;margin:0px;">' +
					'<div style="text-align:center;line-height:18px;font-size:12px;color:#565656;overflow:hidden; width:320px; margin-bottom:0px;">' +
						pageselector(pn,mode) +
						pagemove(pn,mode,u1,u2) +
					'</div>' +
				'</div>' +
			'</div>' +
		'</div>'
	);
}

function stereo_nav_large(pn,mode,u1,u2)
{
	document.writeln(
		'<div style="display: block;">' +
			'<div style="display: block; width:1280px;">' +
				'<div style="display: block; float:left;margin:0px;">' +
					'<div style="text-align:center;line-height:18px;font-size:12px;color:#565656;overflow:hidden; width:640px; margin-top:12px;margin-bottom:12px;">' +
						pageselector(pn,mode) +
						pagemove(pn,mode,u1,u2) +
					'</div>' +
				'</div>' +
				'<div style="display: block;float:right;margin:0px;">' +
					'<div style="text-align:center;line-height:18px;font-size:12px;color:#565656;overflow:hidden; width:640px; margin-top:12px;margin-bottom:12px;">' +
						pageselector(pn,mode) +
						pagemove(pn,mode,u1,u2) +
					'</div>' +
				'</div>' +
			'</div>' +
		'</div>'
	);
}
function stereo_mirror(img,msg1,msg2)
{
	document.write(
			'<div style="display: block;float:left; width:320px;height:812px;overflow:hidden;border:solid #666666;">' +
				'<div style="display: block;margin:0px;">' +
					'<div style="overflow:hidden; width:320px;height:400px; margin-bottom:12px;">' +
						'<div style="position:relative;left:0px;">' + 
							'<img src="' + img + '" width=640 border=0 />' +
						'</div>' +
					'</div>' +
					//'<div class="title">' +
					//	msg1 + '<br />' + msg2 +
					//'</div>' +
				'</div>' +
				'<div style="display: block;margin:0px;">' +
					'<div style="overflow:hidden; width:320px; height:400px;margin-bottom:12px;">' +
						'<div style="position:relative;left:-320px;">' + 
							'<img src="' + img + '" width=640 border=0 />' +
						'</div>' +
					'</div>' +
					//'<div class="title">' +
					//	msg1 + '<br />' + msg2 +
					//'</div>' +
				'</div>' +
			'</div>'
	);
}
function stereo_mirror_message(msg1,msg2)
{
	/*
	document.writeln(
		'<div style="display: inline;">' +
			'<div style="display: inline; width:320px;">' +
				'<div style="display: block;margin:0px;">' +
					'<div class="title" style="overflow:hidden; width:320px;height:480px; margin-bottom:0px;">' +
						msg1 + '<br />' + msg2 +
					'</div>' +
				'</div>' +
				'<div style="display: block;margin:0px;">' +
					'<div class="title" style="overflow:hidden; width:320px;height:480px; margin-bottom:0px;">' +
						msg1 + '<br />' + msg2 +
					'</div>' +
				'</div>' +
			'</div>' +
		'</div>'
	);
	*/
}

var stereoviewmethod = "CROSS";

function SetStereoMethod()
{
	if(location.hash == "#PARALLEL") 
	{
		stereoviewmethod = "PARALLEL";
	}
}

function cell_stereo(img,msg1,msg2)
{

	document.writeln(
		'<div class="episode" ><b class="bRBox"><b class="bRBox1"><b></b></b><b class="bRBox2"><b></b></b><b class="bRBox3"></b><b class="bRBox4"></b><b class="bRBox5"></b></b>' +
			'<div class="bRBox_content"  style="text-align:center;padding:32px;padding-bottom:8px;">'
	);
	if(location.hash == "#PARALLEL") 
	{
		stereo_parallel(img,msg1,msg2);
	}
	else if(location.hash == "#CROSS") 
	{
		stereo_cross(img,msg1,msg2);
	}
	else
	{
		stereo_cross_large(img,msg1,msg2);
	}
	document.writeln(
					'<div class="clear"></div>' +
				'</div>' +
			'<div class="clear"></div>' +
		'<b class="bRBox"><b class="bRBox5"></b><b class="bRBox4"></b><b class="bRBox3"></b><b class="bRBox2"><b></b></b><b class="bRBox1"><b></b></b></b></div>'
	);
}

function cell_stereo_title(pn)
{
	
	document.writeln(
		'<div class="episode" ><b class="bRBox"><b class="bRBox1"><b></b></b><b class="bRBox2"><b></b></b><b class="bRBox3"></b><b class="bRBox4"></b><b class="bRBox5"></b></b>' +
			'<div class="bRBox_content"  style="text-align:center;padding:32px;padding-top:8px;padding-bottom:8px;">'
	);
	if(location.hash == "#PARALLEL") 
	{
		stereo_parallel_message(pn,"平行法によるステレオ写真","Stereo images - parallel view method");
	}
	else if(location.hash == "#CROSS") 
	{
		stereo_cross_message(pn,"交差法によるステレオ写真","Stereo images - cross-eye method");
	}
	else 
	{
		stereo_cross_message_large(pn,"交差法によるステレオ写真","Stereo images - cross-eye method");
	}
	document.writeln(
					'<div class="clear"></div>' +
				'</div>' +
			'<div class="clear"></div>' +
		'<b class="bRBox"><b class="bRBox5"></b><b class="bRBox4"></b><b class="bRBox3"></b><b class="bRBox2"><b></b></b><b class="bRBox1"><b></b></b></b></div>'
	);
}
function cell_stereo_message(m1,m2)
{
	
	document.writeln(
		'<div class="episode" ><b class="bRBox"><b class="bRBox1"><b></b></b><b class="bRBox2"><b></b></b><b class="bRBox3"></b><b class="bRBox4"></b><b class="bRBox5"></b></b>' +
			'<div class="bRBox_content"  style="text-align:center;padding:32px;padding-top:8px;padding-bottom:8px;">'
	);
	if(location.hash == "#PARALLEL") 
	{
		stereo_parallel_message(0,m1,m2);
	}
	else if(location.hash == "#CROSS") 
	{
		stereo_cross_message(0,m1,m2);
	}
	else 
	{
		stereo_cross_message_large(0,m1,m2);
	}
	document.writeln(
					'<div class="clear"></div>' +
				'</div>' +
			'<div class="clear"></div>' +
		'<b class="bRBox"><b class="bRBox5"></b><b class="bRBox4"></b><b class="bRBox3"></b><b class="bRBox2"><b></b></b><b class="bRBox1"><b></b></b></b></div>'
	);
}
function cell_stereo_nav(pn,m1,m2)
{
	
	document.writeln(
		'<div class="episode" ><b class="bRBox"><b class="bRBox1"><b></b></b><b class="bRBox2"><b></b></b><b class="bRBox3"></b><b class="bRBox4"></b><b class="bRBox5"></b></b>' +
			'<div class="bRBox_content"  style="text-align:center;padding:32px;padding-top:8px;padding-bottom:8px;">'
	);
	
	if(location.hash == "#PARALLEL") 
	{
		stereo_nav(pn,"#PARALLEL",m1,m2);
	}
	else if(location.hash == "#CROSS") 
	{
		stereo_nav(pn,"#CROSS",m1,m2);
	}
	else 
	{
		stereo_nav_large(pn,"",m1,m2);
	}
	document.writeln(
					'<div class="clear"></div>' +
				'</div>' +
			'<div class="clear"></div>' +
		'<b class="bRBox"><b class="bRBox5"></b><b class="bRBox4"></b><b class="bRBox3"></b><b class="bRBox2"><b></b></b><b class="bRBox1"><b></b></b></b></div>'
	);
}
