// JavaScript Document
var body = document['CSS1Compat' == document.compatMode ? 'documentElement' : 'body'];
setHoshitoki();
function setHoshitoki() {
	var rand = '?rand=' + String(Math.floor(Math.random() * 1000000));
	document.open();
	document.write('<div id="hoshitoki_swf" style="width: 150px;height: 240px;margin-left: auto;margin-right: auto;">');
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="150" height="240" id="hoshitokiSwf" align="middle">');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="movie" value="http://p.blog.linkus.jp/hoshitokinotoki/parts/main.swf' + rand + '" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="http://p.blog.linkus.jp/hoshitokinotoki/parts/main.swf' + rand + '" quality="high" wmode="transparent" bgcolor="#ffffff" width="150" height="240" name="hoshitokiSwf" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
	document.write('</div>');
	document.close();
}
function hoshitoki_tobidase(vars) {
var rand = '?rand=' + String(Math.floor(Math.random() * 1000000));
	var layerBig = '';
	layerBig +='<object id="hoshitoki_big" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" align="middle">';
	layerBig +='<param name="allowScriptAccess" value="always" /><param name="FlashVars" value="vars=' + vars + '" />';
	layerBig +='<param name="movie" value="http://p.blog.linkus.jp/hoshitokinotoki/parts/big'+vars+'.swf' + rand + '" /><param name="scale" value="noscale" /><param name="salign" value="lt" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#000000" /><embed src="http://p.blog.linkus.jp/hoshitokinotoki/parts/big' + vars + '.swf' + rand + '" quality="high" FlashVars="vars=' + vars + '" scale="noscale" salign="lt" wmode="transparent" bgcolor="#000000" width="100%" height="100%" name="hoshitoki_big" id="hoshitoki_big" swLiveConnect=true align="middle" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	layerBig +='</object>';
	var bigL = document.createElement('div');
	bigL.setAttribute('id', 'b_layer');
	bigL.style.position = "absolute";
	bigL.style.width = "100%";
	bigL.style.height = "100%";
	bigL.innerHTML = layerBig;
	var bodyL = document.body;
	bodyL.appendChild(bigL);
	hoshitoki_setLayer('b_layer');
}
function hoshitoki_RemoveChild() {
	if (document.getElementById('b_layer') != null) {
		var bodyL = document.body;
		var bigL = document.getElementById('b_layer');
		bodyL.removeChild(bigL);
	}
}
window.onresize = function() {
	hoshitoki_setLayer('b_layer');
};
window.onscroll = function() {
	hoshitoki_setLayer('b_layer');
};
function hoshitoki_checkBrowser() {
	var uName = navigator.userAgent;
	if (uName.indexOf("Safari") > -1) {
		return "Safari";
	}
	if (uName.indexOf("MSIE") > -1) {
		return "MSIE";
	}
	return "Netscape";
}
function hoshitoki_setLayer(b_layer) {
	if (document.getElementById(b_layer) != null){
		var browser = hoshitoki_checkBrowser();
		var XX;
		var YY;
		var WW;
		var HH;
		if (browser == "MSIE") {
			XX = body.scrollLeft;
			YY = body.scrollTop;
			WW = body.clientWidth;
			HH = body.clientHeight;
		} else {
			XX = window.pageXOffset;
			YY = window.pageYOffset;
			WW = window.innerWidth - 17;
			HH = window.innerHeight;
		}
		var dX = 0;
		if (browser == "Netscape") {
		}
		var hoshitoki_Layer = document.getElementById(b_layer);
		hoshitoki_Layer.style.left = XX + 'px';
		hoshitoki_Layer.style.width = WW + 'px';
		hoshitoki_Layer.style.height = HH + 'px';
		hoshitoki_Layer.style.top = YY + 'px';
	}
}
