<!---

var winLeft=0;
var winTop=0;

function getPosition(obj) {
	winLeft = winTop = 0;
	
	do
	{
		winLeft += obj.offsetLeft;
		winTop += obj.offsetTop;
		alert("Cur item left offset: "+obj.offsetLeft+", top offset: "+obj.offsetTop);
	} while (obj = obj.offsetParent);
	
	alert("Left offset: "+winLeft+", top offset: "+winTop);
}

function findPosition( oElement ) {
  if( typeof( oElement.offsetParent ) != 'undefined' ) {
    for( var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) {
      posX += oElement.offsetLeft;
      posY += oElement.offsetTop;
    }
	winLeft = posX;
	winTop = posY;
    return;
  } else {
	winLeft = oElement.x;
	winTop = oElement.y;
    return;
  }
}

function enlargeFlash() {
	//alert("Resizing");]
	findPosition(document.getElementById("_blocksGamePlay"));

	document.getElementById('_blocksGamePlay').style.position = 'absolute';
	document.getElementById('_blocksGamePlay').style.zIndex = '91';
	
	document.getElementById('flashOverlay').style.display = 'block';
	document.getElementById('flashOverlay').style.height = screenHeight() + 'px';
	
	var xPos, yPos;
	
	if(document.all)
	{
		if(document.documentElement.clientHeight)
		{
			yPos = (document.documentElement.clientHeight/2 - 250 + document.body.scrollTop);
			xPos = (document.documentElement.clientWidth/2 - 250);
		}
		else
		{
			yPos = (document.body.clientHeight/2 - 250 + document.body.scrollTop);
			xPos = (document.body.clientWidth/2 - 250);
		}
	}
	else
	{
		yPos = (window.innerHeight/2 - 250 + window.pageYOffset);
		xPos = (window.innerWidth/2 - 250);
	}
	
	document.getElementById('_blocksGamePlay').style.top = (yPos) + 'px';
	document.getElementById('_blocksGamePlay').style.left = (xPos) + 'px';
	
    document.getElementById('_blocksGamePlay').style.width = '500px';
	document.getElementById('_blocksGamePlay').style.height = '500px';
	
	//alert("Top position: "+document.getElementById('_blocksGamePlay').style.top);
	//alert("Left position: "+document.getElementById('_blocksGamePlay').style.left);
	
    //thisMovie("ninjaBlocks").gameReady("Blah");
	//alert("Resized");
    return true;
}

function minimizeFlash() {
	document.getElementById('flashOverlay').style.display = 'none';
	//document.getElementById('_blocksGamePlay').style.position = 'absolute';
	document.getElementById('_blocksGamePlay').style.left = winLeft+'px';
	document.getElementById('_blocksGamePlay').style.top = winTop+'px';
	document.getElementById('_blocksGamePlay').style.zIndex = '1';

    document.getElementById('_blocksGamePlay').style.width = '200px';
	document.getElementById('_blocksGamePlay').style.height = '200px';
	
    //alert("Resized");
    return true;
}

function screenHeight()
{
	var windowHeight, yScroll;
	if(self.innerHeight)
		windowHeight = self.innerHeight;
	else
		windowHeight = document.documentElement.clientHeight;
		
	if(window.innerHeight && window.scrollMaxY)
		yScroll = window.innerHeight + window.scrollMaxY;
	else
		yScroll = document.body.scrollHeight;
		
	if(yScroll > windowHeight)
		return yScroll;
	else
		return windowHeight;
}

function prepOverlay() {
	var objBody = document.getElementsByTagName("body").item(0);
	
	var objOverlay = document.createElement("div");
	objOverlay.setAttribute('id', 'flashOverlay');
	objOverlay.style.display = 'none';
	objOverlay.style.position = 'absolute';
	objOverlay.style.top = '0';
	objOverlay.style.left = '0';
	objOverlay.style.zIndex = '90';
	objOverlay.style.width = '100%';
	objOverlay.style.backgroundImage = "url(http://block.bloglue.jp/overlay.png)";
	objBody.insertBefore(objOverlay, objBody.firstChild);
}

document.write('<div id="game_cont" style="width:200px; height:200px; margin:0px; border=0px; padding:0px;">');
document.write('<div id="_blocksGamePlay" style="width:200px; height:200px; margin:0px; border=0px; padding:0px;">');
document.write('<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" WIDTH="100%" HEIGHT="100%" id="ninjaBlocks">');
document.write('	<param NAME="movie" VALUE="http://block.bloglue.jp/ishigaki.swf">');
document.write('	<param NAME="allowScriptAccess" VALUE="always" />');
document.write('	<param NAME="quality" VALUE="high">');
document.write('	<param name="wmode" value="transparent" />');
document.write('	<EMBED src="http://block.bloglue.jp/ishigaki.swf" quality=high WIDTH="100%" HEIGHT="100%"');
document.write('		allowScriptAccess="always" id="ninjaBlocksIE" ');
document.write('		NAME="ninjaBlocks" ALIGN="" TYPE="application/x-shockwave-flash"');
document.write('		PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write('	</EMBED>');
document.write('</OBJECT></div></div>');

prepOverlay();

-->
