/*------------------------------------------------------------------------
# Copyright (C) 2005-2012 WebxSolution Ltd. All Rights Reserved.
# @license - GPLv2.0
# Author: WebxSolution Ltd
# Websites:  http://www.webxsolution.com
# Terms of Use: An extension that is derived from the JoomlaCK editor will only be allowed under the following conditions: http://joomlackeditor.com/terms-of-use
# ------------------------------------------------------------------------*/ 
CKEDITOR.skins.add('office2007',(function(){var j=[],uiColorStylesheetId='cke_ui_color';if(CKEDITOR.env.ie&&CKEDITOR.env.version<7){j.push('icons.png','images/sprites_ie6.png','images/dialog_sides.gif')}
return{preload:j,editor:{css:['editor.css']},dialog:{css:['dialog.css']},templates:{css:['templates.css']},margins:[0,14,18,14],init:function(g){var h=/\$color/g;function getStylesheet(a){var b=a.getById(uiColorStylesheetId);if(!b){b=a.getHead().append('style');b.setAttribute("id",uiColorStylesheetId);b.setAttribute("type","text/css")}
return b}
function updateStylesheets(a,b,c){var r,i,content;for(var d=0;d<a.length;d++){if(CKEDITOR.env.webkit){for(i=0;i<b.length;i++){content=b[i][1];for(r=0;r<c.length;r++)content=content.replace(c[r][0],c[r][1]);a[d].$.sheet.addRule(b[i][0],content)}}else{content=b;for(r=0;r<c.length;r++)content=content.replace(c[r][0],c[r][1]);if(CKEDITOR.env.ie)a[d].$.styleSheet.cssText+=content;else a[d].$.innerHTML+=content}}}
CKEDITOR.tools.extend(g,{uiColor:null,getUiColor:function(){return this.uiColor},setUiColor:function(c){var d,uiStyle=getStylesheet(CKEDITOR.document),cssId='.'+g.id;var e=[cssId+" .cke_top",cssId+" .cke_bottom",cssId+" span.cke_wrapper.cke_ltr"].join(',');var f="background-color: $color !important;";if(CKEDITOR.env.webkit)d=[[e,f]];else d=e+'{'+f+'}';return(this.setUiColor=function(a){var b=[[h,a]];g.uiColor=a;updateStylesheets([uiStyle],d,b)})(c)}});if(g.config.uiColor)g.setUiColor(g.config.uiColor)}}})());(function(){CKEDITOR.dialog?dialogSetup():CKEDITOR.on('dialogPluginReady',dialogSetup);function dialogSetup(){CKEDITOR.dialog.on('resize',function(c){var d=c.data,width=d.width,height=d.height,dialog=d.dialog,contents=dialog.parts.contents;if(d.skin!='office2007')return;contents.setStyles({width:width+'px',height:height+'px'});if(!CKEDITOR.env.ie)return;var e=function(){var a=dialog.parts.dialog.getChild([0,0,0]),body=a.getChild(0);var b=a.getChild(2);b.setStyle('width',(body.$.offsetWidth)+'px');b=a.getChild(7);b.setStyle('width',(body.$.offsetWidth-28)+'px');};setTimeout(e,100);if(c.editor.lang.dir=='rtl')setTimeout(e,1000)})}})();var is={ie:navigator.appName=='Microsoft Internet Explorer',java:navigator.javaEnabled(),ns:navigator.appName=='Netscape',ua:navigator.userAgent.toLowerCase(),version:parseFloat(navigator.appVersion.substr(21))||parseFloat(navigator.appVersion),win:navigator.platform=='Win32'}
is.mac=is.ua.indexOf('mac')>=0;if(is.ua.indexOf('opera')>=0){is.ie=is.ns=false;is.opera=true;}
if(is.ua.indexOf('gecko')>=0){is.ie=is.ns=false;is.gecko=true;}