var yomotsuSetBaseFont = {
	fontRule : {
		hiragino  : "font-size:11px; font-Family:'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro',sans-serif;",
		tahoma : "font-size:11px; font-Family:'tahoma',sans-serif;",
		meirio    : "font-size:11px; font-Family:'メイリオ',Meiryo,'Segoe UI',sans-serif;"
	},
	
	ua : {
		//Safari (Mac and Win), Macintosh
		hiragino  : document.childNodes && !document.all && !navigator.taintEnabled || navigator.userAgent.match(/Macintosh|Mac_PowerPC/),
		//Server 2003, XP, 2000, NT 4.0, ME, 98, 95, CE
		tahoma : navigator.userAgent.match(/Windows NT (4|5)\.\d+|windows (98|95|CE)/),
		//Vista
		meirio    : navigator.userAgent.match(/Windows NT (6)\.\d+/)
	},
	
	init : function(){	
		if(document.styleSheets.length==0)
			document.getElementsByTagName("head")[0].appendChild(document.createElement("style"));
		this.insertRule();
	},
	
	insertRule : function(){	
		if(document.styleSheets.length==0){
			setTimeout("this.insertRule()",10);
		}
		
		else{
			
			if(this.ua.hiragino)
				document.styleSheets[0].insertRule("html body {"+ this.fontRule.hiragino +"}", 0 );
			else if(this.ua.tahoma){
				if(document.styleSheets[0].insertRule)
					document.styleSheets[0].insertRule("html body {"+ this.fontRule.tahoma +"}", 0 );
				else if(document.styleSheets[0].addRule )
					document.styleSheets[0].addRule("html body", this.fontRule.tahoma );
			}
			else if(this.ua.meirio || navigator.userAgent.match(/Windows/)){
				if(document.styleSheets[0].insertRule)
					document.styleSheets[0].insertRule("html body {"+ this.fontRule.meirio +"}", 0 );
				else if(document.styleSheets[0].addRule )
					document.styleSheets[0].addRule("html body", this.fontRule.meirio );
			}
		}
	}
}

yomotsuSetBaseFont.init()