/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */
/* This file is part of version 0.96beta2 released Fri, 20 Mar 2009 11:01:14 +0100 */
function FullScreen(c,b){this.editor=c;c._superclean_on=false;var a=c.config;a.registerIcon("fullscreen",[_editor_url+a.imgURL+"ed_buttons_main.png",8,0]);a.registerIcon("fullscreenrestore",[_editor_url+a.imgURL+"ed_buttons_main.png",9,0]);a.registerButton("fullscreen",this._lc("Maximize/Minimize Editor"),a.iconList.fullscreen,true,function(f,g,d){f._fullScreen()});a.addToolbarElement("fullscreen","popupeditor",0)}FullScreen._pluginInfo={name:"FullScreen",version:"1.0",developer:"James Sleeman",developer_url:"http://www.gogo.co.nz/",c_owner:"Gogo Internet Services",license:"htmlArea",sponsor:"Gogo Internet Services",sponsor_url:"http://www.gogo.co.nz/"};FullScreen.prototype._lc=function(a){return Xinha._lc(a,{url:_editor_url+"modules/FullScreen/lang/",context:"FullScreen"})};Xinha.prototype._fullScreen=function(){var g=this;var f=g.config;function j(){if(!g._isFullScreen||g._sizing){return false}g._sizing=true;var n=Xinha.viewportSize();var i=n.y-g.config.fullScreenMargins[0]-g.config.fullScreenMargins[2];var e=n.x-g.config.fullScreenMargins[1]-g.config.fullScreenMargins[3];g.sizeEditor(e+"px",i+"px",true,true);g._sizing=false;if(g._toolbarObjects.fullscreen){g._toolbarObjects.fullscreen.swapImage(f.iconList.fullscreenrestore)}}function l(){if(g._isFullScreen||g._sizing){return false}g._sizing=true;g.initSize();g._sizing=false;if(g._toolbarObjects.fullscreen){g._toolbarObjects.fullscreen.swapImage(f.iconList.fullscreen)}}function a(){if(g._isFullScreen){window.scroll(0,0);window.setTimeout(a,150)}}if(typeof this._isFullScreen=="undefined"){this._isFullScreen=false;if(g.target!=g._iframe){Xinha._addEvent(window,"resize",j)}}if(Xinha.is_gecko){this.deactivateEditor()}if(this._isFullScreen){this._htmlArea.style.position="";if(!Xinha.is_ie){this._htmlArea.style.border=""}try{if(Xinha.is_ie&&document.compatMode=="CSS1Compat"){var b=document.getElementsByTagName("html")}else{var b=document.getElementsByTagName("body")}b[0].style.overflow=""}catch(g){}this._isFullScreen=false;l();var d=this._htmlArea;while((d=d.parentNode)&&d.style){d.style.position=d._xinha_fullScreenOldPosition;d._xinha_fullScreenOldPosition=null}if(Xinha.ie_version<7){var h=document.getElementsByTagName("select");for(var c=0;c<h.length;++c){h[c].style.visibility="visible"}}window.scroll(this._unScroll.x,this._unScroll.y)}else{this._unScroll={x:(window.pageXOffset)?(window.pageXOffset):(document.documentElement)?document.documentElement.scrollLeft:document.body.scrollLeft,y:(window.pageYOffset)?(window.pageYOffset):(document.documentElement)?document.documentElement.scrollTop:document.body.scrollTop};var d=this._htmlArea;while((d=d.parentNode)&&d.style){d._xinha_fullScreenOldPosition=d.style.position;d.style.position="static"}if(Xinha.ie_version<7){var h=document.getElementsByTagName("select");var m,k;for(var c=0;c<h.length;++c){m=h[c];k=false;while(m=m.parentNode){if(m==this._htmlArea){k=true;break}}if(!k&&h[c].style.visibility!="hidden"){h[c].style.visibility="hidden"}}}window.scroll(0,0);this._htmlArea.style.position="absolute";this._htmlArea.style.zIndex=999;this._htmlArea.style.left=g.config.fullScreenMargins[3]+"px";this._htmlArea.style.top=g.config.fullScreenMargins[0]+"px";if(!Xinha.is_ie&&!Xinha.is_webkit){this._htmlArea.style.border="none"}this._isFullScreen=true;a();try{if(Xinha.is_ie&&document.compatMode=="CSS1Compat"){var b=document.getElementsByTagName("html")}else{var b=document.getElementsByTagName("body")}b[0].style.overflow="hidden"}catch(g){}j()}if(Xinha.is_gecko){this.activateEditor()}this.focusEditor()};