function EravoteBlogParts(){
	this.initialize.apply(this, arguments);	
}
EravoteBlogParts.prototype ={
	initialize: function(_result){
		this.movie = "http://mainichi.jp/select/seiji/eravote/09votematch/etc/blogparts.swf";
		this.objid = "eravoteBlogParts"+Math.round(Math.random()*255);
		this.result = _result;
		if(this.result != null){
			 document.write('<embed height="490" width="160" flashvars="result='+this.result+'" allowscriptaccess="always" allowfullscreen="false" wmode="transparent" quality="high" name="'+ this.objid+'" id="'+ this.objid+'" style="padding:0;margin:0;" src="'+ this.movie +'" type="application/x-shockwave-flash" />');
		}
	}
}
EravoteBlogParts.setHeight = function(objid,height){
	document.getElementById(objid).setAttribute("height",height);
}

EravoteBlogParts.checkFlash = function(){
	var ua=navigator.userAgent.toLowerCase();
	var flashVersion=-1;
	if(navigator.plugins!=null&&navigator.plugins.length>0){
		var flashPlugin=navigator.plugins['Shockwave Flash'];
		if(typeof flashPlugin=='object'){
			flashVersion=flashPlugin.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".")[0]
		}
	}else if(ua.match(/msie/) && parseInt(navigator.appVersion)>=4){
		var flashplugin=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
		if(flashplugin){
			flashVersion=flashplugin.GetVariable("$version").split(" ")[1].split(",")[0]
		}
	}	
	if(flashVersion>=10){
		return true;
	}
	
	return false;
}

function _eravote_write(_result){	
	if(!_result.match(/[^A-Za-z0-9]/) && EravoteBlogParts.checkFlash()){
		new EravoteBlogParts(_result);
	}
}