function jyunmiyakeSetting() {
	//初期設定
	this.base_url = "www.junmiyake.com/blogparts/";
	this.parts_swf = "index.swf";
	
	if (document.URL.match(/^https/)) {
		this.protocol = "http://";
	}else{
		this.protocol = "http://";
	}
	this.target = "";
	
	this.height = 230;
	this.width = 160;
};

jyunmiyakeSetting.prototype.setTarget = function(t) {
	this.target = t;
}

jyunmiyakeSetting.prototype.getTarget = function() {
	return this.target;
}

jyunmiyakeSetting.prototype.getWidth = function() {
	return this.width;
}

jyunmiyakeSetting.prototype.getHeight = function() {
	return this.height;
}

jyunmiyakeSetting.prototype.getURL = function() {
	return this.protocol + this.base_url + this.parts_swf;
}

jyunmiyakeSetting.prototype.addEvent = function (elm, evType, func, useCapture) {
	if(elm.addEventListener){
		elm.addEventListener(evType, func, useCapture);
		return true;
	} else if(elm.attachEvent){
		var r = elm.attachEvent('on' + evType, func);
		return r;
	} else {
		elm['on' + evType] = func;
	}
}

jyunmiyakeSetting.prototype.create = function () {	
	var flashVars = '';
	var target = document.getElementById('jyunmiyakeContent');
	target.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="' + jyunmiyake.protocol + 'fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="jyunmiyakeFlash_external2" width="' + jyunmiyake.width + '" height="' + jyunmiyake.height + '" align="top"><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="movie" value="' + jyunmiyake.getURL() + '" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="' + flashVars + '" /><embed src="' + jyunmiyake.getURL() + '" wmode="transparent" quality="high" bgcolor="#ffffff" width="' + jyunmiyake.width + '" height="' + jyunmiyake.height + '" flashvars="' + flashVars + '" name="jyunmiyakeFlash_external" id="jyunmiyakeFlash_external" align="top" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="' + jyunmiyake.protocol + 'www.macromedia.com/go/getflashplayer" /></object>';
}


//==========================================================================
//  flashplayer check
//==========================================================================
var flash_version = 9;
var FlashInstalled = false;
var pv = 6;

//Windows IE
if(navigator.appName == "Microsoft Internet Explorer"){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('contentVersion = ' + flash_version + ' \n');
	document.write('FlashInstalled = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & contentVersion))) \n');
	document.write('</SCR' + 'IPT\> \n');
//Others
}else if(navigator.plugins["Shockwave Flash"]){
	var sp = navigator.plugins["Shockwave Flash"].description.indexOf("Flash");
	var ep = navigator.plugins["Shockwave Flash"].description.lastIndexOf(" ");
	var aver = parseFloat(navigator.plugins["Shockwave Flash"].description.substring(sp+pv,ep));
	if(aver >= flash_version){
		FlashInstalled = true;
	}
}

var jyunmiyake;

function jmInsert(string) {
	if(FlashInstalled){
		jyunmiyake = new jyunmiyakeSetting();
		
		document.write('<style type="text/css" media="all">');
		document.write('@import "' + jyunmiyake.protocol + jyunmiyake.base_url + 'stylesheets/jm_blogparts.css";');
		document.write('</style>');
		
		document.write("<div id='jyunmiyake'><div id='jyunmiyakeContent'></div></div>");
		
		if(document.all){
			jyunmiyake.create();
		}else{
			jyunmiyake.addEvent( window, 'load', jyunmiyake.create, false);
		}
			
	}else{
		//表示されない場合
		document.write('<a href="http://www.adobe.com/go/getflashplayer" target="_blank">このコンテンツをご覧いただくにはFlash Playerが必要です。</a>');
	}
}