/* 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 FullPage(c){this.editor=c;var a=c.config;a.fullPage=true;var b=this;a.registerButton("FP-docprop",this._lc("Document properties"),c.imgURL("docprop.gif","FullPage"),false,function(d,e){b.buttonPress(d,e)});a.addToolbarElement(["separator","FP-docprop"],"separator",-1)}FullPage._pluginInfo={name:"FullPage",version:"1.0",developer:"Mihai Bazon",developer_url:"http://dynarch.com/mishoo/",c_owner:"Mihai Bazon",sponsor:"Thycotic Software Ltd.",sponsor_url:"http://thycotic.com",license:"htmlArea"};FullPage.prototype._lc=function(a){return Xinha._lc(a,"FullPage")};FullPage.prototype.buttonPress=function(e,a){var q=this;switch(a){case"FP-docprop":var k=e._doc;var n=k.getElementsByTagName("link");var l="";var j="";var d="";var m="";var b="";for(var c=n.length;--c>=0;){var g=n[c];if(/stylesheet/i.test(g.rel)){if(/alternate/i.test(g.rel)){j=g.href}else{l=g.href}}}var f=k.getElementsByTagName("meta");for(var c=f.length;--c>=0;){var p=f[c];if(/content-type/i.test(p.httpEquiv)){r=/^text\/html; *charset=(.*)$/i.exec(p.content);b=r[1]}else{if((/keywords/i.test(p.name))||(/keywords/i.test(p.id))){d=p.content}else{if((/description/i.test(p.name))||(/description/i.test(p.id))){m=p.content}}}}var h=k.getElementsByTagName("title")[0];h=h?h.innerHTML:"";var o={f_doctype:e.doctype,f_title:h,f_body_bgcolor:Xinha._colorToRgb(k.body.style.backgroundColor),f_body_fgcolor:Xinha._colorToRgb(k.body.style.color),f_base_style:l,f_alt_style:j,f_charset:b,f_keywords:d,f_description:m,editor:e};e._popupDialog("plugin://FullPage/docprop",function(i){q.setDocProp(i)},o);break}};FullPage.prototype.setDocProp=function(q){var j="";var u=this.editor._doc;var d=u.getElementsByTagName("head")[0];var b=u.getElementsByTagName("link");var a=u.getElementsByTagName("meta");var o=null;var n=null;var c=null;var f=null;var g=null;var l=null;for(var m=b.length;--m>=0;){var e=b[m];if(/stylesheet/i.test(e.rel)){if(/alternate/i.test(e.rel)){n=e}else{o=e}}}for(var m=a.length;--m>=0;){var h=a[m];if(/content-type/i.test(h.httpEquiv)){r=/^text\/html; *charset=(.*)$/i.exec(h.content);c=r[1];f=h}else{if((/keywords/i.test(h.name))||(/keywords/i.test(h.id))){g=h}else{if((/description/i.test(h.name))||(/description/i.test(h.id))){l=h}}}}function k(v){var i=u.createElement("link");i.rel=v?"alternate stylesheet":"stylesheet";d.appendChild(i);return i}function p(i,v,w){var x=u.createElement("meta");if(i!=""){x.httpEquiv=i}if(v!=""){x.name=v}if(v!=""){x.id=v}x.content=w;d.appendChild(x);return x}if(!o&&q.f_base_style){o=k(false)}if(q.f_base_style){o.href=q.f_base_style}else{if(o){d.removeChild(o)}}if(!n&&q.f_alt_style){n=k(true)}if(q.f_alt_style){n.href=q.f_alt_style}else{if(n){d.removeChild(n)}}if(f){d.removeChild(f);f=null}if(!f&&q.f_charset){f=p("Content-Type","","text/html; charset="+q.f_charset)}if(!g&&q.f_keywords){g=p("","keywords",q.f_keywords)}else{if(q.f_keywords){g.content=q.f_keywords}else{if(g){d.removeChild(g)}}}if(!l&&q.f_description){l=p("","description",q.f_description)}else{if(q.f_description){l.content=q.f_description}else{if(l){d.removeChild(l)}}}for(var m in q){var t=q[m];switch(m){case"f_title":var s=u.getElementsByTagName("title")[0];if(!s){s=u.createElement("title");d.appendChild(s)}else{while(node=s.lastChild){s.removeChild(node)}}if(!Xinha.is_ie){s.appendChild(u.createTextNode(t))}else{u.title=t}break;case"f_doctype":this.editor.setDoctype(t);break;case"f_body_bgcolor":u.body.style.backgroundColor=t;break;case"f_body_fgcolor":u.body.style.color=t;break}}};