var RedBox={showInline:function(id)
{this.showOverlay();new Effect.Appear('RB_window',{duration:0.4,queue:'end'});Element.scrollTo('RB_window');this.cloneWindowContents(id);},loading:function()
{this.showOverlay();Element.show('RB_loading');this.setWindowPosition();},addHiddenContent:function(id)
{this.removeChildrenFromNode($('RB_window'));this.moveChildren($(id),$('RB_window'));Element.hide('RB_loading');new Effect.Appear('RB_window',{duration:0.4,queue:'end'});Element.scrollTo('RB_window');this.setWindowPosition();},close:function()
{new Effect.Fade('RB_window',{duration:0.4});new Effect.Fade('RB_overlay',{duration:0.4});},showOverlay:function()
{if($('RB_redbox'))
{Element.update('RB_redbox',"");new Insertion.Top($('RB_redbox'),'<div id="RB_window" style="display: none;"></div><div id="RB_overlay" style="display: none;"></div>');}
else
{new Insertion.Bottom(document.body,'<div id="RB_redbox" align="center"><div id="RB_window" style="display: none;"></div><div id="RB_overlay" style="display: none;"></div></div>');}
new Insertion.Top('RB_overlay','<div id="RB_loading" style="display: none"></div>');this.setOverlaySize();new Effect.Appear('RB_overlay',{duration:0.4,to:0.6,queue:'end'});},setOverlaySize:function()
{$("RB_overlay").style['height']=document.viewport.getHeight()+'px';},setWindowPosition:function()
{var pagesize=this.getPageSize();$("RB_window").style['width']='auto';$("RB_window").style['height']='auto';var dimensions=Element.getDimensions($("RB_window"));var width=dimensions.width;var height=dimensions.height;$("RB_window").style['left']=((pagesize[0]-width)/2)+"px";$("RB_window").style['top']=((pagesize[1]-height)/2)+"px";},getPageSize:function(){var w=document.viewport.getWidth();var h=document.viewport.getHeight();arrayPageSize=new Array(w,h)
return arrayPageSize;},removeChildrenFromNode:function(node)
{while(node.hasChildNodes())
{node.removeChild(node.firstChild);}},moveChildren:function(source,destination)
{while(source.hasChildNodes())
{destination.appendChild(source.firstChild);}},cloneWindowContents:function(id)
{var content=$(id).cloneNode(true);content.style['display']='block';$('RB_window').appendChild(content);this.setWindowPosition();}}