var iframe;

	function doIets(url)
	{
	
		var div = document.createElement('div');
		div.className = "bonsaiBox";
		div.style.position = 'absolute';
		div.style.width = '100%';
		//alert(getDocHeight());
		div.style.height = getDocHeight() + "px";
		div.style.zIndex = '100';
		
		div.style.top = "0px";
		div.style.left = "0px";
		
		div.style.background = '#fff';
		div.style.display = 'none';
		div.onclick = function()
		{
			new Effect.Fade(this, {duration:1, from:0.6, to:0});
			new Effect.Fade(iframe, {duration:1, from:1, to:0});
		}
		
		
		var iframe = document.createElement('iframe');
		
		iframe.style.width = '700px';
		iframe.style.height = '400px';
		iframe.style.border = '4px solid white';
		iframe.style.position = 'absolute';
		iframe.style.zIndex = '200';
		iframe.style.display = 'none';
		iframe.src = url;
		
		//iframe.style.top = ifTop + "px";
		//div.appendChild(iframe);
		document.body.appendChild(iframe);
		document.body.appendChild(div);
		centerWindow(iframe);
		
		new Effect.Appear(div, {duration:1, from:0, to:0.6});
		new Effect.Appear(iframe, {duration:1, from:0, to:1});

	}
	
	function centerWindow(element) {
     if($(element) != null) {
          if(typeof window.innerHeight != 'undefined') {
               $(element).style.top = 
                    Math.round(document.viewport.getScrollOffsets().top + 
                    ((window.innerHeight - $(element).getHeight()))/2)+'px';
               $(element).style.left = 
                    Math.round(document.viewport.getScrollOffsets().left + 
                    ((window.innerWidth - $(element).getWidth()))/2)+'px';
          } else {
               $(element).style.top = 
                    Math.round(document.body.scrollTop + 
                    (($$('body')[0].clientHeight - $(element).getHeight()))/2)+'px';
               $(element).style.left = 
                    Math.round(document.body.scrollLeft + 
                    (($$('body')[0].clientWidth - $(element).getWidth()))/2)+'px';
          }
     }
}

function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}
