//var windowTitle=document.title;
var contentsSwf = "check.swf?"+Math.random();
var flashJudgeVer = "8";
var ieVer = 5.0;
var firefoxVer = 1.0;
var netscapeVer = 8.0;
var safariVer = 312;
var compulsionPSV = false;
var CheckAndLoadContents = { flashID:"flash1", psViewerMode:false };
//---------------------------------
var str="";
var pluginMode=false;
var verCheck=false;
//---------------------------------

//---------------------------------
//Version check
//---------------------------------
var winIE =		(navigator.userAgent.indexOf("MSIE ") != -1	&& navigator.userAgent.indexOf("Windows") != -1);
var winFirefox =	(navigator.userAgent.indexOf("Firefox") != -1 	&& navigator.userAgent.indexOf("Windows") != -1);
var winNetscape =	(navigator.userAgent.indexOf("Netscape") != -1	&& navigator.userAgent.indexOf("Windows") != -1);
var macSafari =		(navigator.userAgent.indexOf("Safari") != -1	&& navigator.userAgent.indexOf("Mac") != -1);
var macFirefox =	(navigator.userAgent.indexOf("Firefox") != -1	&& navigator.userAgent.indexOf("Mac") != -1);
var macNetscape =	(navigator.userAgent.indexOf("Netscape") != -1	&& navigator.userAgent.indexOf("Mac") != -1);

//getVer
if(winIE) var word="MSIE ";
else if(winFirefox) var word="Firefox/";
else if(winNetscape) var word="Netscape/";
else if(macSafari) var word="Safari/";
else if(macFirefox) var word="Firefox/";
else if(macNetscape) var word="Netscape/";
else var word=" ";
var sno=navigator.userAgent.indexOf(word);
var wLen=word.length;
var sLen=wLen+sno;
var ver=Number(navigator.userAgent.substring(sLen, sLen+3));

function addFlash(contentsWidth,  contentsHeight)
{
	//---------------------------------
	//FlashPlayer Plug-in check
	//---------------------------------
	var flashVersion = false;
	var intFla8 = 8;
	var intFla9 = 9;
	if (winIE)
	{	
		flashVersion = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").FlashVersion() >> 16;
	}
	else
	{
		var dot;
		flashVersion = navigator.plugins["Shockwave Flash"].description;
		dot = flashVersion.indexOf(".");
		flashVersion = flashVersion.substring(16, dot);
	}
	//---------------------------------------
	//SWF FileName
	//---------------------------------------
	if(flashVersion == 8)
	{
		strFlaName = "pa_player_mhp.swf?bootVarsion=8";
	}
	else if(flashVersion >= 9)
	{
		strFlaName = "pa_player_f9.swf";		
	}
	//---------------------------------------
	//Load contents
	//---------------------------------------
	var txt = '';
	txt += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + flashVersion + ',0,0,0" width="'+ contentsWidth +'" height="'+ contentsHeight +'" id="pa_player" align="top">';
	txt += '<param name="allowScriptAccess" value="sameDomain" />';
	txt += '<param name="movie" value="'+ strFlaName +'" />';
	txt += '<param name="quality" value="high" />';
	txt += '<param name="salign" value="lt" />';
	txt += '<param name="bgcolor" value="#eeeeee" />';
	txt += '<embed src="' +strFlaName +'" quality="high" salign="lt" bgcolor="#eeeeee" width="'+ contentsWidth +'" height="'+ contentsHeight +'" name="pa_player" align="top" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	txt += '</embed> ';
	txt += '</object>';
	document.open();
	document.write(txt);
	document.close();
}
