var MM_contentVersion = 8;
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 pbk_mainFlash(){
	if ( MM_FlashCanPlay ) {

		var obj_attr = new Object();
		obj_attr.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
		obj_attr.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
		obj_attr.id = 'main';
		obj_attr.width = '700';
		obj_attr.height = '400';
		obj_attr.align = '';

		var param_values = new Object();
		param_values.movie = 'img/pbk_image.swf';
		param_values.base = 'img/';
		param_values.menu = 'false';
		param_values.quality = 'high';
		param_values.bgcolor = '#FFFFFF';
		param_values.wmode = 'transparent';

		var emb_attr = new Object();
		emb_attr.src = 'img/pbk_image.swf';
		emb_attr.base = 'img/';
		emb_attr.menu = 'false';
		emb_attr.quality = 'high';
		emb_attr.bgcolor = '#FFFFFF';
		emb_attr.swLiveConnect = 'false';
		emb_attr.width = '700';
		emb_attr.height = '400';
		emb_attr.name = 'main';
		emb_attr.align = '';
		emb_attr.wmode = 'transparent';
		emb_attr.type = 'application/x-shockwave-flash';
		emb_attr.pluginspage = 'http://www.adobe.com/go/getflashplayer';

		cig_run_active_contents(obj_attr,param_values,emb_attr);

	} else{
		var n = (Math.floor(Math.random()*3)+1);
		document.write('<img src="img/pbk_image'+n+'.jpg" width="700" height="400" border="0" alt="" usemap="#map_gallery"><br>');
		document.write('<map name="map_gallery"><area shape="circle" coords="584,142,110" href="pbk_gallery/index.html" target="cigsecond" onclick="return cigsecond()" alt="みんなの Photobook ギャラリー"></map>');
	}
}



//Flash To Link//

MAC = navigator.userAgent.indexOf('Mac') != -1;
NN = navigator.appName.indexOf('Netscape') != -1;
IE = navigator.appName.indexOf('Microsoft') != -1;
VER = navigator.appVersion.charAt(0);


function pbk_gallery(){
var url = 'pbk_gallery/index.html';
var s = "newwindow = window.open(url,'cigsecond','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');";
	eval(s);
	if (NN) {
		setTimeout('newwindow.focus()',0);
	}
	else
	{
		newwindow.focus();
	}
}


function pbkDetail(){
var url = '../st/pbk/sample/index.html';
var s = "newwindow = window.open(url,'ciglarge','width=700,height=500,resizable=yes,location=no,directories=no,menubar=no,toolbar=no,scrollbars=yes,status=no');";
	eval(s);
	if (NN) {
		setTimeout('newwindow.focus()',0);
	}
	else
	{
		newwindow.focus();
	}
}

