var MM_contentVersion = 7;
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 printMovie ( $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=8,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="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" 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;
	}
}

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;
		window.open(url);
	}else{
		success_flag = true;
		window.opener.location.href=url;
	}
}

function error_open()
{
	if(!success_flag)
	{
		window.open(url_temp);
		window.close();
	}
}

function newWindow(url, winname){
	var chw = window.open(url,winname);
	chw.focus();
}


function fullWindow(url, winname){

	var aH = screen.availHeight;
	var aW = screen.availWidth;
	var chw = window.open(url, winname,'top=0,left=0,width=' + aW + ',height=' + aH);
	chw.moveTo(0,0);
//	chw.resizeTo(aW,aH);
	chw.focus();
}

