var MM_contentVersion = 9;
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 = 0 \n');
	document.write('MM_FlashCanPlay = MM_FlashCanPlay or ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('For vi = MM_contentVersion + 1 to MM_contentVersion + 5\n');
	document.write('MM_FlashCanPlay = MM_FlashCanPlay or ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & vi)))\n');
	document.write('Next\n');
	document.write('<\/SCR' + 'IPT\> \n');
}


function printMovie2 ( $swffile, $width, $height, $bgcolor, $change_image, $change_url )
{
	// 初期化
	var selectTmp = "";
	var selectNo = "";
	// URL取得
	var selectTmp = location.href;
	// selectナンバー取得
	selectAry = selectTmp.split('select=');
	if(selectAry.length > 1)
		selectNo = selectAry[1];
	else
		selectNo = '';

	if ( MM_FlashCanPlay )
	{
		document.write (
			'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+MM_contentVersion+',0,0,0" width="'+$width+'" height="'+$height+'" align="middle">'+
			'<param name="allowScriptAccess" value="sameDomain">'+
			'<param name="movie" value="'+$swffile+'">'+
			'<param name="quality" value="high">'+
			'<param name="scale" value="noscale">'+
			'<param name="salign" value="mb">'+
			'<param name="wmode" value="transparent">'+
	//		'<param name="bgcolor" value="'+$bgcolor+'">' +
			(selectNo != ''?'<param name="flashvars" value="select=' + selectNo + '">' : '') +
			'<embed src="'+$swffile+'" quality="high" scale="noscale" salign="mb" bgcolor="'+$bgcolor+'" width="'+$width+'" height="'+$height+'" align="middle" wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" '+
			(selectNo != ''?'flashvars="select=' + selectNo + '"' : '') +
			'\/>' +
			'<\/object>'
		);
	}
	else
	{
		if($change_image)
			document.write('<img src="' + $change_image + '" width="' + $width + '" height="' + $height + '" border="0" />\n');
		if($change_url)
			document.location.href = $change_url;
			
			
		document.write ('');
		
	}
}

var success_flag = false;
var url_temp = "";
function parentWindowLink( url ){
	success_flag = false;
	url_temp = url;
	window.setTimeout("error_open()", 1000);

	if(!window.opener||window.opener.closed){
		success_flag = true;
		var chw = window.open(url);
		chw.focus();
	}else{
		success_flag = true;
		window.opener.location.href=url;
		window.opener.focus();
	}
}

function error_open()
{
	if(!success_flag)
	{
		var chw = window.open(url_temp);
		window.close();
		chw.focus();
	}
}

function newWindow(url, winname){
	var chw = window.open(url,winname);
	chw.focus();
}

//再描画.
/*
$(function() {
	$('#snavi').append(document.createTextNode("a"));
});
*/

