/* Pop up
------------------------------------------------------------------------------------------------------------------------ */
function getAgent() {
	var ua = "";
	ua = navigator.userAgent.toLowerCase();
	return ua;
}

function MM_openBrWindow(theURL) { //v2.0
	w = 700;h = 600;
	userwidth = screen.availWidth;
	userheight = screen.availHeight;
	p_width = (userwidth-w)/2;
	p_height = (userheight-h)/2;
	features = 'scrollbars=yes,width=' + w + ',height=' + h + ',left=' + p_width + ',top=' + p_height;
	pop = window.open(theURL,'pop',features);
	pop.focus();
}

function openClinic(theURL) { //v2.0
	w = 800;h = 550;
	userwidth = screen.availWidth;
	userheight = screen.availHeight;
	p_width = (userwidth-w)/2;
	p_height = (userheight-h)/2;
	features = 'scrollbars=yes,width=' + w + ',height=' + h + ',left=' + p_width + ',top=' + p_height;
	clinic = window.open(theURL,'clinic',features);
	clinic.focus();
}

/* Up-to-date for theaters
------------------------------------------------------------------------------------------------------------------------ */

function upDate(){
	lastupdate = new Date(document.lastModified);
	year=lastupdate.getFullYear();
	month=lastupdate.getMonth()+1;
	date=lastupdate.getDate();
	document.write(year+"年"+month+"月"+date+"日更新");
}

/* Flash
------------------------------------------------------------------------------------------------------------------------ */

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');
}

/* TOPページ用 */

function makeTop(swffile, subs, fval) {
	w = '100%';
	h = '100%';
	makeFlash(swffile, w, h, subs, fval);
}

/* その他なんでも用 */

function makeFlash(swffile, w, h, subs, fval) {
	if ( MM_FlashCanPlay ) {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write(' id="flashObj" width="' +w+ '" height="' +h+ '" align="">');
		document.write(' <param name="movie" value="' +swffile+ '" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="allowScriptAccess" value="sameDomain" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /> ');
		document.write(' <embed src="' +swffile+ '" ');
		document.write(' swLiveConnect=true width="' +w+ '" height="' +h+ '" name="flashObj" align="" allowScriptAccess="sameDomain" menu=false quality=best wmode="transparent" bgcolor="#ffffff" ');
		document.write(' type="application/x-shockwave-flash"> ');
		document.write(' </embed>');
		document.write(' </object>');
	} else{ 
		if (subs.length==0){
			rs = confirm("このコンテンツをご覧頂くには、\nFLASH PLAYER verion 8以上が必要です。\n\nFLASH PLAYERをインストールしますか？");
			if (rs) window.open("http://www.macromedia.com/jp/shockwave/download/?P1_Prod_Version=ShockwaveFlash&Lang=Japanese");
		} else if (subs.indexOf(".gif")>-1 || subs.indexOf(".jpg")>-1){
			if (fval.length>0) {document.write('<a href="' +fval+ '" >');}
			document.write('<img src="' +subs+ '" height="' +h+ '" width="' +w+ '" />');
			if (fval.length>0) {document.write('</a>');}
		} else {
			window.location = subs;
		}
	}

}