var swfPath="http://blog.goo.ne.jp/img/portal/misc/spring/goo_springbp.swf";
var swfPathPPC="http://blog.goo.ne.jp/img/portal/misc/spring/goo_springbp_ppc.swf";
var bannerPath="http://blog.goo.ne.jp/img/portal/misc/spring/goo_springba.swf";
//////////////////////////////////////
if(navigator.platform == "MacPPC") var macppcCH=true;
if(navigator.userAgent.indexOf('Opera') != -1) var operaCH=true;
var swfVersion="6";
if(macppcCH){
	swfVersion="8";
	swfPath = swfPathPPC;
}
var bannerWidth="150";
var bannerHeight="190";
//////////////////////////////////////
var VBflash="ShockwaveFlash.ShockwaveFlash."+swfVersion;
var plugin=(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if(plugin){
	plugin=parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= swfVersion;
}else{
	document.write('<script language=VBScript>\non error resume next\nplugin=(IsObject(CreateObject(VBflash)))\n</script\>');
}
if(plugin){
	document.write('<div id="goo_blogparts_spring"><object id="goo_blogparts_spring_object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+bannerWidth+'" height="'+bannerHeight+'" VIEWASTEXT><param name="movie" value="'+ bannerPath +'" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="base"><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><embed src="'+ bannerPath +'" loop="true" quality="high" wmode="transparent" swLiveConnect="false" width="'+bannerWidth+'" height="'+bannerHeight+'" allowScriptAccess="always" type="application/x-shockwave-flash"></embed></object></div>');
	document.getElementById("goo_blogparts_spring").style.width = '150px';
	document.getElementById("goo_blogparts_spring").style.height = '190px';
	document.getElementById("goo_blogparts_spring").style.background='url(http://blog.goo.ne.jp/img/portal/misc/spring/background4_ppc.png) no-repeat';
}
//////////////////////////////////////
var flag=true;
function swfClose(){
	flag=!flag;
	if(macppcCH || operaCH) document.getElementById("goo_blogparts_spring_object").style.display = 'block';
	document.body.removeChild(document.body.firstChild);
	if(macppcCH){
		document.body.removeChild(document.body.firstChild);
		document.body.removeChild(document.body.firstChild);
	}
}
function swfOpen(){
	if(flag){
		flag=!flag;
		if(macppcCH || operaCH) document.getElementById("goo_blogparts_spring_object").style.display = 'none';
		//For MacPPC Write
		if(macppcCH){
			var insertImgLeft=document.createElement("div");
			insertImgLeft.style.width='100%';
			insertImgLeft.style.height=(windowSize()+'px');
			insertImgLeft.style.display = 'block';
			insertImgLeft.style.position='absolute';
			insertImgLeft.style.zIndex='1001';
			insertImgLeft.style.top='0';
			insertImgLeft.style.left='0';
			insertImgLeft.style.background='url(http://blog.goo.ne.jp/img/portal/misc/spring/background2_ppc.png) no-repeat';
			insertImgLeft.onclick=new Function('swfClose()');
			insertImgLeft.innerHTML='&nbsp;';
			document.body.insertBefore(insertImgLeft,document.body.firstChild);
			var insertImgRight=document.createElement("div");
			insertImgRight.style.width='100%';
			insertImgRight.style.height=(windowSize()+'px');
			insertImgRight.style.display = 'block';
			insertImgRight.style.position='absolute';
			insertImgRight.style.zIndex='1002';
			insertImgRight.style.top='0';
			insertImgRight.style.left='0';
			insertImgRight.style.background='url(http://blog.goo.ne.jp/img/portal/misc/spring/background3_ppc.png) no-repeat right top';
			insertImgRight.onclick=new Function('swfClose()');
			insertImgRight.innerHTML='&nbsp;';
			document.body.insertBefore(insertImgRight,document.body.firstChild);
		}
		//Flash Object Write
		var insertBlock=document.createElement("div");
		insertBlock.style.width='100%';
		insertBlock.style.height=(windowSize()+'px');
		insertBlock.style.display = 'block';
		insertBlock.style.position='absolute';
		insertBlock.style.zIndex='1000';
		insertBlock.style.top='0';
		insertBlock.style.left='0';
		if(macppcCH) insertBlock.style.background='url(http://blog.goo.ne.jp/img/portal/misc/spring/background1_ppc.png) repeat-x';
		insertBlock.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100%" height="100%" id="overlayFlash" align="middle"><param name="movie" value="' + swfPath + '" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><embed src="'+swfPath+'" loop="true" quality="high" wmode="transparent" swLiveConnect="false" width="100%" height="100%" allowScriptAccess="always" type="application/x-shockwave-flash" /></embed></object>';
		document.body.insertBefore(insertBlock,document.body.firstChild);
	}
}
function windowSize(){
	var windowHeight;
	var bodyHeight;
	if(window.scrollMaxY && window.innerHeight){
		bodyHeight=window.innerHeight+window.scrollMaxY;
	}else if(document.body.scrollHeight>document.body.offsetHeight){
		bodyHeight=document.body.scrollHeight;
	}else{
		bodyHeight=document.body.offsetHeight;
	}
	if(self.innerHeight){
		windowHeight=self.innerHeight;
	}else if(document.documentElement && document.documentElement.clientHeight){
		windowHeight=document.documentElement.clientHeight;
	}else if(document.body){
		windowHeight=document.body.clientHeight;
	}
	if(bodyHeight<windowHeight) bodyHeight=windowHeight;
	if(4100<bodyHeight) bodyHeight=4100;
	return bodyHeight;
}
