

/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version 2.1.2
 */
(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery);

/*
 * positionBy 1.0.7 (2008-01-29)
 *
 * Copyright (c) 2006,2007 Jonathan Sharp (http://jdsharp.us)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://jdsharp.us/
 *
 * Built upon jQuery 1.2.2 (http://jquery.com)
 * This also requires the jQuery dimensions plugin
 */
(function($){var A=function(a,b,c,d){this.x1=a;this.x2=c;this.y1=b;this.y2=d};A.prototype.contains=function(a){return(this.x1<=a.x1&&a.x2<=this.x2)&&(this.y1<=a.y1&&a.y2<=this.y2)};A.prototype.transform=function(x,y){return new A(this.x1+x,this.y1+y,this.x2+x,this.y2+y)};$.fn.positionBy=function(q){var r=new Date();if(this.length==0){return this}var q=$.extend({target:null,targetPos:null,elementPos:null,x:null,y:null,positions:null,addClass:false,force:false,container:window},q);if(q.x!=null){var s=q.x;var t=q.y;var u=0;var v=0}else{var w=$($(q.target)[0]);var u=w.outerWidth();var v=w.outerHeight();var x=w.offset();var s=x.left;var t=x.top}var y=s+u;var z=t+v;return this.each(function(){var c=$(this);if(!c.is(':visible')){c.css({left:-3000,top:-3000}).show()}var d=c.outerWidth();var e=c.outerHeight();var f=[];var g=[];f[0]=new A(y,t,y+d,t+e);g[0]=[1,7,4];f[1]=new A(y,z-e,y+d,z);g[1]=[0,6,4];f[2]=new A(y,z,y+d,z+e);g[2]=[1,3,10];f[3]=new A(y-d,z,y,z+e);g[3]=[1,6,10];f[4]=new A(s,z,s+d,z+e);g[4]=[1,6,9];f[5]=new A(s-d,z,s,z+e);g[5]=[6,4,9];f[6]=new A(s-d,z-e,s,z);g[6]=[7,1,4];f[7]=new A(s-d,t,s,t+e);g[7]=[6,0,4];f[8]=new A(s-d,t-e,s,t);g[8]=[7,9,4];f[9]=new A(s,t-e,s+d,t);g[9]=[0,7,4];f[10]=new A(y-d,t-e,y,t);g[10]=[0,7,3];f[11]=new A(y,t-e,y+d,t);g[11]=[0,10,3];f[12]=new A(y-d,t,y,t+e);g[12]=[13,7,10];f[13]=new A(y-d,z-e,y,z);g[13]=[12,6,3];f[14]=new A(s,z-e,s+d,z);g[14]=[15,1,4];f[15]=new A(s,t,s+d,t+e);g[15]=[14,0,9];if(q.positions!==null){var h=q.positions[0]}else if(q.targetPos!=null&&q.elementPos!=null){var h=[];h[0]=[];h[0][0]=15;h[0][1]=7;h[0][2]=8;h[0][3]=9;h[1]=[];h[1][0]=0;h[1][1]=12;h[1][2]=10;h[1][3]=11;h[2]=[];h[2][0]=2;h[2][1]=3;h[2][2]=13;h[2][3]=1;h[3]=[];h[3][0]=4;h[3][1]=5;h[3][2]=6;h[3][3]=14;var h=h[q.targetPos][q.elementPos]}var i=f[h];var j=h;if(!q.force){$window=$(window);var k=$window.scrollLeft();var l=$window.scrollTop();var m=new A(k,l,k+$window.width(),l+$window.height());var n;if(q.positions){n=q.positions}else{n=[h]}var o=[];while(n.length>0){var p=n.shift();if(o[p]){continue}o[p]=true;if(!m.contains(f[p])){if(q.positions===null){n=jQuery.merge(n,g[p])}}else{i=f[p];break}}}c.parents().each(function(){var a=$(this);if(a.css('position')!='static'){var b=a.offset();i=i.transform(-b.left,-b.top);return false}});c.css({left:i.x1,top:i.y1});if(q.addClass){c.removeClass('positionBy0 positionBy1 positionBy2 positionBy3 positionBy4 positionBy5 '+'positionBy6 positionBy7 positionBy8 positionBy9 positionBy10 positionBy11 '+'positionBy12 positionBy13 positionBy14 positionBy15').addClass('positionBy'+p)}})}})(jQuery);


/*
 * Metadata - jQuery plugin for parsing metadata from elements
 *
 * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.metadata.js 3620 2007-10-10 20:55:38Z pmclanahan $
 *
 */
(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)data=attr;}if(data.indexOf('{')<0)data="{"+data+"}";data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);

/*
 * jQuery Media Plugin for converting elements into rich media content.
 *
 * Examples and documentation at: http://malsup.com/jquery/media/
 * Copyright (c) 2007-2008 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * @author: M. Alsup
 * @version: 0.92 (24-SEP-2009)
 * @requires jQuery v1.1.2 or later
 * $Id: jquery.media.js 2460 2007-07-23 02:53:15Z malsup $
 *
 * Supported Media Players:
 *	- Flash
 *	- Quicktime
 *	- Real Player
 *	- Silverlight
 *	- Windows Media Player
 *	- iframe
 *
 * Supported Media Formats:
 *	 Any types supported by the above players, such as:
 *	 Video: asf, avi, flv, mov, mpg, mpeg, mp4, qt, smil, swf, wmv, 3g2, 3gp
 *	 Audio: aif, aac, au, gsm, mid, midi, mov, mp3, m4a, snd, rm, wav, wma
 *	 Other: bmp, html, pdf, psd, qif, qtif, qti, tif, tiff, xaml
 *
 * Thanks to Mark Hicken and Brent Pedersen for helping me debug this on the Mac!
 * Thanks to Dan Rossi for numerous bug reports and code bits!
 * Thanks to Skye Giordano for several great suggestions!
 * Thanks to Richard Connamacher for excellent improvements to the non-IE behavior!
 */
;(function($){$.fn.media=function(options,f1,f2){if(options=='undo'){return this.each(function(){var $this=$(this);var html=$this.data('media.origHTML');if(html)$this.replaceWith(html)})}return this.each(function(){if(typeof options=='function'){f2=f1;f1=options;options={}}var o=getSettings(this,options);if(typeof f1=='function')f1(this,o);var r=getTypesRegExp();var m=r.exec(o.src.toLowerCase())||[''];o.type?m[0]=o.type:m.shift();for(var i=0;i<m.length;i++){fn=m[i].toLowerCase();if(isDigit(fn[0]))fn='fn'+fn;if(!$.fn.media[fn])continue;var player=$.fn.media[fn+'_player'];if(!o.params)o.params={};if(player){var num=player.autoplayAttr=='autostart';o.params[player.autoplayAttr||'autoplay']=num?(o.autoplay?1:0):o.autoplay?true:false}var $div=$.fn.media[fn](this,o);$div.css('backgroundColor',o.bgColor).width(o.width);if(o.canUndo){var $temp=$('<div></div>').append(this);$div.data('media.origHTML',$temp.html())}if(typeof f2=='function')f2(this,$div[0],o,player.name);break}})};$.fn.media.mapFormat=function(format,player){if(!format||!player||!$.fn.media.defaults.players[player])return;format=format.toLowerCase();if(isDigit(format[0]))format='fn'+format;$.fn.media[format]=$.fn.media[player];$.fn.media[format+'_player']=$.fn.media.defaults.players[player]};$.fn.media.defaults={standards:false,canUndo:true,width:400,height:400,autoplay:0,bgColor:'#ffffff',params:{wmode:'transparent'},attrs:{},flvKeyName:'file',flashvars:{},flashVersion:'7',expressInstaller:null,flvPlayer:'mediaplayer.swf',mp3Player:'mediaplayer.swf',silverlight:{inplaceInstallPrompt:'true',isWindowless:'true',framerate:'24',version:'0.9',onError:null,onLoad:null,initParams:null,userContext:null}};$.fn.media.defaults.players={flash:{name:'flash',title:'Flash',types:'flv,mp3,swf',mimetype:'application/x-shockwave-flash',pluginspage:'http://www.adobe.com/go/getflashplayer',ieAttrs:{classid:'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',type:'application/x-oleobject',codebase:'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+$.fn.media.defaults.flashVersion}},quicktime:{name:'quicktime',title:'QuickTime',mimetype:'video/quicktime',pluginspage:'http://www.apple.com/quicktime/download/',types:'aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3gp',ieAttrs:{classid:'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',codebase:'http://www.apple.com/qtactivex/qtplugin.cab'}},realplayer:{name:'real',title:'RealPlayer',types:'ra,ram,rm,rpm,rv,smi,smil',mimetype:'audio/x-pn-realaudio-plugin',pluginspage:'http://www.real.com/player/',autoplayAttr:'autostart',ieAttrs:{classid:'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'}},winmedia:{name:'winmedia',title:'Windows Media',types:'asx,asf,avi,wma,wmv',mimetype:$.browser.mozilla&&isFirefoxWMPPluginInstalled()?'application/x-ms-wmp':'application/x-mplayer2',pluginspage:'http://www.microsoft.com/Windows/MediaPlayer/',autoplayAttr:'autostart',oUrl:'url',ieAttrs:{classid:'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6',type:'application/x-oleobject'}},iframe:{name:'iframe',types:'html,pdf'},silverlight:{name:'silverlight',types:'xaml'}};function isFirefoxWMPPluginInstalled(){var plugs=navigator.plugins;for(var i=0;i<plugs.length;i++){var plugin=plugs[i];if(plugin['filename']=='np-mswmp.dll')return true}return false}var counter=1;for(var player in $.fn.media.defaults.players){var types=$.fn.media.defaults.players[player].types;$.each(types.split(','),function(i,o){if(isDigit(o[0]))o='fn'+o;$.fn.media[o]=$.fn.media[player]=getGenerator(player);$.fn.media[o+'_player']=$.fn.media.defaults.players[player]})};function getTypesRegExp(){var types='';for(var player in $.fn.media.defaults.players){if(types.length)types+=',';types+=$.fn.media.defaults.players[player].types};return new RegExp('\\.('+types.replace(/,/ig,'|')+')\\b')};function getGenerator(player){return function(el,options){return generate(el,options,player)}};function isDigit(c){return'0123456789'.indexOf(c)>-1};function getSettings(el,options){options=options||{};var $el=$(el);var cls=el.className||'';var meta=$.metadata?$el.metadata():$.meta?$el.data():{};meta=meta||{};var w=meta.width||parseInt(((cls.match(/w:(\d+)/)||[])[1]||0));var h=meta.height||parseInt(((cls.match(/h:(\d+)/)||[])[1]||0));if(w)meta.width=w;if(h)meta.height=h;if(cls)meta.cls=cls;var a=$.fn.media.defaults;var b=options;var c=meta;var p={params:{bgColor:options.bgColor||$.fn.media.defaults.bgColor}};var opts=$.extend({},a,b,c);$.each(['attrs','params','flashvars','silverlight'],function(i,o){opts[o]=$.extend({},p[o]||{},a[o]||{},b[o]||{},c[o]||{})});if(typeof opts.caption=='undefined')opts.caption=$el.text();opts.src=opts.src||$el.attr('href')||$el.attr('src')||'unknown';return opts};$.fn.media.swf=function(el,opts){if(!window.SWFObject&&!window.swfobject){if(opts.flashvars){var a=[];for(var f in opts.flashvars)a.push(f+'='+opts.flashvars[f]);if(!opts.params)opts.params={};opts.params.flashvars=a.join('&')}return generate(el,opts,'flash')}var id=el.id?(' id="'+el.id+'"'):'';var cls=opts.cls?(' class="'+opts.cls+'"'):'';var $div=$('<div'+id+cls+'>');if(window.swfobject){$(el).after($div).appendTo($div);if(!el.id)el.id='movie_player_'+counter++;swfobject.embedSWF(opts.src,el.id,opts.width,opts.height,opts.flashVersion,opts.expressInstaller,opts.flashvars,opts.params,opts.attrs)}else{$(el).after($div).remove();var so=new SWFObject(opts.src,'movie_player_'+counter++,opts.width,opts.height,opts.flashVersion,opts.bgColor);if(opts.expressInstaller)so.useExpressInstall(opts.expressInstaller);for(var p in opts.params)if(p!='bgColor')so.addParam(p,opts.params[p]);for(var f in opts.flashvars)so.addVariable(f,opts.flashvars[f]);so.write($div[0])}if(opts.caption)$('<div>').appendTo($div).html(opts.caption);return $div};$.fn.media.flv=$.fn.media.mp3=function(el,opts){var src=opts.src;var player=/\.mp3\b/i.test(src)?$.fn.media.defaults.mp3Player:$.fn.media.defaults.flvPlayer;var key=opts.flvKeyName;src=encodeURIComponent(src);opts.src=player;opts.src=opts.src+'?'+key+'='+(src);var srcObj={};srcObj[key]=src;opts.flashvars=$.extend({},srcObj,opts.flashvars);return $.fn.media.swf(el,opts)};$.fn.media.xaml=function(el,opts){if(!window.Sys||!window.Sys.Silverlight){if($.fn.media.xaml.warning)return;$.fn.media.xaml.warning=1;alert('You must include the Silverlight.js script.');return}var props={width:opts.width,height:opts.height,background:opts.bgColor,inplaceInstallPrompt:opts.silverlight.inplaceInstallPrompt,isWindowless:opts.silverlight.isWindowless,framerate:opts.silverlight.framerate,version:opts.silverlight.version};var events={onError:opts.silverlight.onError,onLoad:opts.silverlight.onLoad};var id1=el.id?(' id="'+el.id+'"'):'';var id2=opts.id||'AG'+counter++;var cls=opts.cls?(' class="'+opts.cls+'"'):'';var $div=$('<div'+id1+cls+'>');$(el).after($div).remove();Sys.Silverlight.createObjectEx({source:opts.src,initParams:opts.silverlight.initParams,userContext:opts.silverlight.userContext,id:id2,parentElement:$div[0],properties:props,events:events});if(opts.caption)$('<div>').appendTo($div).html(opts.caption);return $div};function generate(el,opts,player){var $el=$(el);var o=$.fn.media.defaults.players[player];if(player=='iframe'){var o=$('<iframe'+' width="'+opts.width+'" height="'+opts.height+'" >');o.attr('src',opts.src);o.css('backgroundColor',o.bgColor)}else if($.browser.msie){var a=['<object width="'+opts.width+'" height="'+opts.height+'" '];for(var key in opts.attrs)a.push(key+'="'+opts.attrs[key]+'" ');for(var key in o.ieAttrs||{}){var v=o.ieAttrs[key];if(key=='codebase'&&window.location.protocol=='https:')v=v.replace('http','https');a.push(key+'="'+v+'" ')}a.push('></ob'+'ject'+'>');var p=['<param name="'+(o.oUrl||'src')+'" value="'+opts.src+'">'];for(var key in opts.params)p.push('<param name="'+key+'" value="'+opts.params[key]+'">');var o=document.createElement(a.join(''));for(var i=0;i<p.length;i++)o.appendChild(document.createElement(p[i]))}else if(o.standards){var a=['<object type="'+o.mimetype+'" width="'+opts.width+'" height="'+opts.height+'"'];if(opts.src)a.push(' data="'+opts.src+'" ');a.push('>');a.push('<param name="'+(o.oUrl||'src')+'" value="'+opts.src+'">');for(var key in opts.params){if(key=='wmode'&&player!='flash')continue;a.push('<param name="'+key+'" value="'+opts.params[key]+'">')}a.push('<div><p><strong>'+o.title+' Required</strong></p><p>'+o.title+' is required to view this media. <a href="'+o.pluginspage+'">Download Here</a>.</p></div>');a.push('</ob'+'ject'+'>')}else{var a=['<embed width="'+opts.width+'" height="'+opts.height+'" style="display:block"'];if(opts.src)a.push(' src="'+opts.src+'" ');for(var key in opts.attrs)a.push(key+'="'+opts.attrs[key]+'" ');for(var key in o.eAttrs||{})a.push(key+'="'+o.eAttrs[key]+'" ');for(var key in opts.params){if(key=='wmode'&&player!='flash')continue;a.push(key+'="'+opts.params[key]+'" ')}a.push('></em'+'bed'+'>')}var id=el.id?(' id="'+el.id+'"'):'';var cls=opts.cls?(' class="'+opts.cls+'"'):'';var $div=$('<div'+id+cls+'>');$el.after($div).remove();($.browser.msie||player=='iframe')?$div.append(o):$div.html(a.join(''));if(opts.caption)$('<div>').appendTo($div).html(opts.caption);return $div}})(jQuery);


/*!
 * jQuery blockUI plugin
 * Version 2.31 (06-JAN-2010)
 * @requires jQuery v1.2.3 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2008 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */

;(function($){if(/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery)||/^1.1/.test($.fn.jquery)){alert('blockUI requires jQuery v1.2.3 or later!  You are using v'+$.fn.jquery);return}$.fn._fadeIn=$.fn.fadeIn;var noOp=function(){};var mode=document.documentMode||0;var setExpr=$.browser.msie&&(($.browser.version<8&&!mode)||mode<8);var ie6=$.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!mode;$.blockUI=function(opts){install(window,opts)};$.unblockUI=function(opts){remove(window,opts)};$.growlUI=function(title,message,timeout,onClose){var $m=$('<div class="growlUI"></div>');if(title)$m.append('<h1>'+title+'</h1>');if(message)$m.append('<h2>'+message+'</h2>');if(timeout==undefined)timeout=3000;$.blockUI({message:$m,fadeIn:700,fadeOut:1000,centerY:false,timeout:timeout,showOverlay:false,onUnblock:onClose,css:$.blockUI.defaults.growlCSS})};$.fn.block=function(opts){return this.unblock({fadeOut:0}).each(function(){if($.css(this,'position')=='static')this.style.position='relative';if($.browser.msie)this.style.zoom=1;install(this,opts)})};$.fn.unblock=function(opts){return this.each(function(){remove(this,opts)})};$.blockUI.version=2.31;$.blockUI.defaults={message:'<h1>Please wait...</h1>',title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:'30%',top:'40%',left:'35%',textAlign:'center',color:'#000',border:'3px solid #aaa',backgroundColor:'#fff',cursor:'wait'},themedCSS:{width:'30%',top:'40%',left:'35%'},overlayCSS:{backgroundColor:'#000',opacity:0.6,cursor:'wait'},growlCSS:{width:'350px',top:'10px',left:'',right:'10px',border:'none',padding:'5px',opacity:0.6,cursor:'default',color:'#fff',backgroundColor:'#000','-webkit-border-radius':'10px','-moz-border-radius':'10px'},iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank',forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4};var pageBlock=null;var pageBlockEls=[];function install(el,opts){var full=(el==window);var msg=opts&&opts.message!==undefined?opts.message:undefined;opts=$.extend({},$.blockUI.defaults,opts||{});opts.overlayCSS=$.extend({},$.blockUI.defaults.overlayCSS,opts.overlayCSS||{});var css=$.extend({},$.blockUI.defaults.css,opts.css||{});var themedCSS=$.extend({},$.blockUI.defaults.themedCSS,opts.themedCSS||{});msg=msg===undefined?opts.message:msg;if(full&&pageBlock)remove(window,{fadeOut:0});if(msg&&typeof msg!='string'&&(msg.parentNode||msg.jquery)){var node=msg.jquery?msg[0]:msg;var data={};$(el).data('blockUI.history',data);data.el=node;data.parent=node.parentNode;data.display=node.style.display;data.position=node.style.position;if(data.parent)data.parent.removeChild(node)}var z=opts.baseZ;var lyr1=($.browser.msie||opts.forceIframe)?$('<iframe class="blockUI" style="z-index:'+(z++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>'):$('<div class="blockUI" style="display:none"></div>');var lyr2=$('<div class="blockUI blockOverlay" style="z-index:'+(z++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var lyr3;if(opts.theme&&full){var s='<div class="blockUI blockMsg blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:fixed">'+'<div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(opts.title||'&nbsp;')+'</div>'+'<div class="ui-widget-content ui-dialog-content"></div>'+'</div>';lyr3=$(s)}else{lyr3=full?$('<div class="blockUI blockMsg blockPage" style="z-index:'+z+';display:none;position:fixed"></div>'):$('<div class="blockUI blockMsg blockElement" style="z-index:'+z+';display:none;position:absolute"></div>')}if(msg){if(opts.theme){lyr3.css(themedCSS);lyr3.addClass('ui-widget-content')}else lyr3.css(css)}if(!opts.applyPlatformOpacityRules||!($.browser.mozilla&&/Linux/.test(navigator.platform)))lyr2.css(opts.overlayCSS);lyr2.css('position',full?'fixed':'absolute');if($.browser.msie||opts.forceIframe)lyr1.css('opacity',0.0);var layers=[lyr1,lyr2,lyr3],$par=full?$('body'):$(el);$.each(layers,function(){this.appendTo($par)});if(opts.theme&&opts.draggable&&$.fn.draggable){lyr3.draggable({handle:'.ui-dialog-titlebar',cancel:'li'})}var expr=setExpr&&(!$.boxModel||$('object,embed',full?null:el).length>0);if(ie6||expr){if(full&&opts.allowBodyStretch&&$.boxModel)$('html,body').css('height','100%');if((ie6||!$.boxModel)&&!full){var t=sz(el,'borderTopWidth'),l=sz(el,'borderLeftWidth');var fixT=t?'(0 - '+t+')':0;var fixL=l?'(0 - '+l+')':0}$.each([lyr1,lyr2,lyr3],function(i,o){var s=o[0].style;s.position='absolute';if(i<2){full?s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"'):s.setExpression('height','this.parentNode.offsetHeight + "px"');full?s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):s.setExpression('width','this.parentNode.offsetWidth + "px"');if(fixL)s.setExpression('left',fixL);if(fixT)s.setExpression('top',fixT)}else if(opts.centerY){if(full)s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');s.marginTop=0}else if(!opts.centerY&&full){var top=(opts.css&&opts.css.top)?parseInt(opts.css.top):0;var expression='((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';s.setExpression('top',expression)}})}if(msg){if(opts.theme)lyr3.find('.ui-widget-content').append(msg);else lyr3.append(msg);if(msg.jquery||msg.nodeType)$(msg).show()}if(($.browser.msie||opts.forceIframe)&&opts.showOverlay)lyr1.show();if(opts.fadeIn){var cb=opts.onBlock?opts.onBlock:noOp;var cb1=(opts.showOverlay&&!msg)?cb:noOp;var cb2=msg?cb:noOp;if(opts.showOverlay)lyr2._fadeIn(opts.fadeIn,cb1);if(msg)lyr3._fadeIn(opts.fadeIn,cb2)}else{if(opts.showOverlay)lyr2.show();if(msg)lyr3.show();if(opts.onBlock)opts.onBlock()}bind(1,el,opts);if(full){pageBlock=lyr3[0];pageBlockEls=$(':input:enabled:visible',pageBlock);if(opts.focusInput)setTimeout(focus,20)}else center(lyr3[0],opts.centerX,opts.centerY);if(opts.timeout){var to=setTimeout(function(){full?$.unblockUI(opts):$(el).unblock(opts)},opts.timeout);$(el).data('blockUI.timeout',to)}};function remove(el,opts){var full=(el==window);var $el=$(el);var data=$el.data('blockUI.history');var to=$el.data('blockUI.timeout');if(to){clearTimeout(to);$el.removeData('blockUI.timeout')}opts=$.extend({},$.blockUI.defaults,opts||{});bind(0,el,opts);var els;if(full)els=$('body').children().filter('.blockUI').add('body > .blockUI');else els=$('.blockUI',el);if(full)pageBlock=pageBlockEls=null;if(opts.fadeOut){els.fadeOut(opts.fadeOut);setTimeout(function(){reset(els,data,opts,el)},opts.fadeOut)}else reset(els,data,opts,el)};function reset(els,data,opts,el){els.each(function(i,o){if(this.parentNode)this.parentNode.removeChild(this)});if(data&&data.el){data.el.style.display=data.display;data.el.style.position=data.position;if(data.parent)data.parent.appendChild(data.el);$(el).removeData('blockUI.history')}if(typeof opts.onUnblock=='function')opts.onUnblock(el,opts)};function bind(b,el,opts){var full=el==window,$el=$(el);if(!b&&(full&&!pageBlock||!full&&!$el.data('blockUI.isBlocked')))return;if(!full)$el.data('blockUI.isBlocked',b);if(!opts.bindEvents||(b&&!opts.showOverlay))return;var events='mousedown mouseup keydown keypress';b?$(document).bind(events,opts,handler):$(document).unbind(events,handler)};function handler(e){if(e.keyCode&&e.keyCode==9){if(pageBlock&&e.data.constrainTabKey){var els=pageBlockEls;var fwd=!e.shiftKey&&e.target==els[els.length-1];var back=e.shiftKey&&e.target==els[0];if(fwd||back){setTimeout(function(){focus(back)},10);return false}}}if($(e.target).parents('div.blockMsg').length>0)return true;return $(e.target).parents().children().filter('div.blockUI').length==0};function focus(back){if(!pageBlockEls)return;var e=pageBlockEls[back===true?pageBlockEls.length-1:0];if(e)e.focus()};function center(el,x,y){var p=el.parentNode,s=el.style;var l=((p.offsetWidth-el.offsetWidth)/2)-sz(p,'borderLeftWidth');var t=((p.offsetHeight-el.offsetHeight)/2)-sz(p,'borderTopWidth');if(x)s.left=l>0?(l+'px'):'0';if(y)s.top=t>0?(t+'px'):'0'};function sz(el,p){return parseInt($.css(el,p))||0}})(jQuery);

;(function($){

$.ModalWindow = {
		TXT_OK				: '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ok&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
		TXT_CANCEL			: 'Cancelar',
		TXT_ALERT_TITLE		: 'Aviso',
		TXT_CONFIRM_TITLE	: 'Confirme',
		RESULT			: null,//OK = true; CANCEL = false
		Hide			:function(resultado, callback){
										var self = this;
										self.RESULT = resultado;
										if(typeof(callback) == 'function')
											callback(resultado);
										self.RESULT = null;
										$.unblockUI();
									},
		Confirm			: function(options){
										var self = this;
										options = $.extend({
											'title'		: self.TXT_CONFIRM_TITLE,
											'msg'		: ' -- ',
											'callback'	: null
										}, options || {});
										var html =	'<table border="0" cellspacing="0" cellpadding="0" width="100%">'+
													'<tr><td style="height:20px;line-height:20px;background-color:#cccccc;font-weight:bold;color:#ffffff;font-family:verdana,arial,sans-serif;font-size:12px;padding-left:8px;">'+ options.title +'</td></tr>'+
													'<tr><td style="height:6px;"></td></tr>'+
													'<tr><td style="text-align:justify;font-family:verdana,arial,sans-serif;font-size:11px;padding:6px;">'+ options.msg +'</td></tr>'+
													'<tr><td style="text-align:center;padding:6px;"><button id="myModalWindow_idok">'+ self.TXT_OK +'</button>&nbsp;&nbsp;&nbsp;&nbsp;<button id="myModalWindow_idcancel">'+ self.TXT_CANCEL +'</button></td></tr></table>';
										$.blockUI({ message: html , css: { cursor: 'default' }  });
										$('#myModalWindow_idok').click(		function(){self.Hide(true, options.callback )});
										$('#myModalWindow_idcancel').click(	function(){self.Hide(false, options.callback )});
										setTimeout(function(){$('#myModalWindow_idok').focus();},50);
									},
		Alert			: function(options){
										var self = this;
										options = $.extend({
											'title'		: self.TXT_ALERT_TITLE,
											'msg'		: ' -- ',
											'callback'	: null
										}, options || {});
										var html = 	'<table border="0" cellspacing="0" cellpadding="0" width="100%" style="cursor:default;">'+
													'<tr><td style="height:20px;line-height:20px;background-color:#cccccc;font-weight:bold;color:#ffffff;font-family:verdana,arial,sans-serif;font-size:12px;padding-left:8px;">'+ options.title +'</td></tr>'+
													'<tr><td style="height:6px;"></td></tr>'+
													'<tr><td style="text-align:justify;font-family:verdana,arial,sans-serif;font-size:11px;padding:6px;">'+ options.msg +'</td></tr>'+
													'<tr><td style="text-align:center;padding:6px;"><button id="myModalWindow_idok">'+ self.TXT_OK +'</button></td></tr>'+
													'</table>';
										$.blockUI({ message: html , css: { cursor: 'default' }  });
										$('#myModalWindow_idok').click(function(){self.Hide(true, options.callback )});
									}
	}

})(jQuery);

/*
 * jdMenu 1.4.1 (2008-03-31)
 *
 * Copyright (c) 2006,2007 Jonathan Sharp (http://jdsharp.us)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://jdsharp.us/
 *
 * Built upon jQuery 1.2.1 (http://jquery.com)
 * This also requires the jQuery dimensions >= 1.2 plugin
 */

// This initializes the menu
jQuery(function() {
	jQuery('ul.jd_menu').jdMenu();
});

(function($){
	function addEvents(ul) {
		var settings = $.data( $(ul).parents().andSelf().filter('ul.jd_menu')[0], 'jdMenuSettings' );
		$('> li', ul)
			.bind('mouseenter.jdmenu mouseleave.jdmenu', function(evt) {
				$(this).toggleClass('jdm_hover');
				var ul = $('> ul', this);
				if ( ul.length == 1 ) {
					clearTimeout( this.$jdTimer );
					var enter = ( evt.type == 'mouseenter' );
					var fn = ( enter ? showMenu : hideMenu );
					this.$jdTimer = setTimeout(function() {
						fn( ul[0], settings.onAnimate, settings.isVertical );
					}, enter ? settings.showDelay : settings.hideDelay );
				}
			})
			.bind('click.jdmenu', function(evt) {
				var ul = $('> ul', this);
				if ( ul.length == 1 && 
					( settings.disableLinks == true || $(this).hasClass('accessible') ) ) {
					showMenu( ul, settings.onAnimate, settings.isVertical );
					return false;
				}
				
				// The user clicked the li and we need to trigger a click for the a
				if ( evt.target == this ) {
					var link = $('> a', evt.target).not('.accessible');
					if ( link.length > 0 ) {
						var a = link[0];
						if ( !a.onclick ) {
							window.open( a.href, a.target || '_self' );
						} else {
							$(a).trigger('click');
						}
					}
				}
				if ( settings.disableLinks || 
					( !settings.disableLinks && !$(this).parent().hasClass('jd_menu') ) ) {
					$(this).parent().jdMenuHide();
					evt.stopPropagation();
				}
			})
			.find('> a')
				.bind('focus.jdmenu blur.jdmenu', function(evt) {
					var p = $(this).parents('li:eq(0)');
					if ( evt.type == 'focus' ) {
						p.addClass('jdm_hover');
					} else { 
						p.removeClass('jdm_hover');
					}
				})
				.filter('.accessible')
					.bind('click.jdmenu', function(evt) {
						evt.preventDefault();
					});
	}

	function showMenu(ul, animate, vertical) {
		var ul = $(ul);
		if ( ul.is(':visible') ) {
			return;
		}
		ul.bgiframe();
		var li = ul.parent();
		ul	.trigger('jdMenuShow')
			.positionBy({ 	target: 	li[0], 
							targetPos: 	( vertical === true || !li.parent().hasClass('jd_menu') ? 1 : 3 ), 
							elementPos: 0,
							hideAfterPosition: true
							});
		if ( !ul.hasClass('jdm_events') ) {
			ul.addClass('jdm_events');
			addEvents(ul);
		}
		li	.addClass('jdm_active')
			// Hide any adjacent menus
			.siblings('li').find('> ul:eq(0):visible')
				.each(function(){
					hideMenu( this ); 
				});
		if ( animate === undefined ) {
			ul.show();
		} else {
			animate.apply( ul[0], [true] );
		}
	}
	
	function hideMenu(ul, animate) {
		var ul = $(ul);
		$('.bgiframe', ul).remove();
		ul	.filter(':not(.jd_menu)')
			.find('> li > ul:eq(0):visible')
				.each(function() {
					hideMenu( this );
				})
			.end();
		if ( animate === undefined ) {
			ul.hide()
		} else {
			animate.apply( ul[0], [false] );
		}

		ul	.trigger('jdMenuHide')
			.parents('li:eq(0)')
				.removeClass('jdm_active jdm_hover')
			.end()
				.find('> li')
				.removeClass('jdm_active jdm_hover');
	}
	
	// Public methods
	$.fn.jdMenu = function(settings) {
		// Future settings: activateDelay
		var settings = $.extend({	// Time in ms before menu shows
									showDelay: 		200,
									// Time in ms before menu hides
									hideDelay: 		500,
									// Should items that contain submenus not 
									// respond to clicks
									disableLinks:	false
									// This callback allows for you to animate menus
									//onAnimate:	null
									}, settings);
		if ( !$.isFunction( settings.onAnimate ) ) {
			settings.onAnimate = undefined;
		}
		return this.filter('ul.jd_menu').each(function() {
			$.data(	this, 
					'jdMenuSettings', 
					$.extend({ isVertical: $(this).hasClass('jd_menu_vertical') }, settings) 
					);
			addEvents(this);
		});
	};
	
	$.fn.jdMenuUnbind = function() {
		$('ul.jdm_events', this)
			.unbind('.jdmenu')
			.find('> a').unbind('.jdmenu');
	};
	$.fn.jdMenuHide = function() {
		return this.filter('ul').each(function(){ 
			hideMenu( this );
		});
	};

	// Private methods and logic
	$(window)
		// Bind a click event to hide all visible menus when the document is clicked
		.bind('click.jdmenu', function(){
			$('ul.jd_menu ul:visible').jdMenuHide();
		});
})(jQuery);


/*
 ### jQuery CKEditor Plugin v0.31 - 2010-01-21 ###
 * http://www.fyneworks.com/ - diego@fyneworks.com
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 ###
 Project: http://jquery.com/plugins/project/CKEditor/
 Website: http://www.fyneworks.com/jquery/CKEditor/
*/
/*
 USAGE: $('textarea').ckeditor({ path:'/path/to/ckeditor/editor/' }); // initialize CKEditor
 ADVANCED USAGE: $.ckeditor.update(); // update value in textareas of each CKEditor instance
*/

if(!window.CKEDITOR_BASEPATH)
	var CKEDITOR_BASEPATH = 'pagina/includes/ckeditor/';

/*# AVOID COLLISIONS #*/
;if(window.jQuery) (function($){
/*# AVOID COLLISIONS #*/

$.extend($, {
 ckeditor:{
  waitFor: 10,// in seconds, how long should we wait for the script to load?
  config: { 
	filebrowserBrowseUrl :		'pagina/includes/ckfinder/ckfinder.html',
	filebrowserImageBrowseUrl :	'pagina/includes/ckfinder/ckfinder.html?Type=Images',
	filebrowserFlashBrowseUrl :	'pagina/includes/ckfinder/ckfinder.html?Type=Flash',
	filebrowserUploadUrl : 		'pagina/includes/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
	filebrowserImageUploadUrl :	'pagina/includes/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
	filebrowserFlashUploadUrl :	'pagina/includes/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
  }, // default configuration
  path: 'pagina/includes/ckeditor/', // default path to CKEditor directory
  selector: 'textarea.ckeditor', // jQuery selector for automatic replacements
  editors: [], // array of element ids pointing to CKEditor instances
  loaded: false, // flag indicating whether CKEditor script is loaded
  intercepted: null, // variable to store intercepted method(s)
  
  // utility method to load instance of CKEditor
  instance: function(i){
			var x = CKEDITOR.instances[i];
			//console.log(['ckeditor.instance','x',x]);
			// Look for textare with matching name for backward compatibility
			if(!x){
				x = $('#'+i.replace(/\./gi,'\\\.')+'')[0];
				//console.log(['ckeditor.instance','ele',x]);
				if(x) x = CKEDITOR.instances[x.id];
			};
			//console.log(['ckeditor.instance',i,x]);
			return x;
		},
		
  // utility method to read contents of CKEditor
  content: function(i, v){
			//console.log(['ckeditor.content',arguments]);
			var x = this.instance(i);
			if(!x){
				alert('CKEditor instance "'+i+'" could not be found!');
				return '';
			};
			if(v!=undefined){
 			//console.log(['ckeditor.content',x,'x.setData',v]);
				x.setData(v);
			};
			//console.log(['ckeditor.content','getData',x.getData(true)]);
   return x.getData(true);
  }, // ckeditor.content function
  
  // inspired by Sebastián Barrozo <sbarrozo@b-soft.com.ar>
  setHTML: function(i, v){
			//console.log(['ckeditor.setHTML',arguments]);
   if(typeof i=='object'){
    v = i.html;
    i = i.name || i.instance;
   };
   return $.ckeditor.content(i, v);
  },
  
  // utility method to update textarea contents before ajax submission
  update: function(){
			// Remove old non-existing editors from memory
			$.ckeditor.clean();
			// loop through editors
			//console.log(['ckeditor.update','before',$.ckeditor.editors/*,CKEDITOR.instances*/]);
			//$.each($.ckeditor.editors,function(i,name){
			for(var i=0;i<$.ckeditor.editors.length;i++){
				var name = $.ckeditor.editors[i];
				//console.log(['ckeditor.update',name,CKEDITOR.instances[name]]);
				var area = $('#'+name.replace(/\./g,'\\.'));
				if(area.length>0){
 				var data = this.content(name);
  			//console.log(['ckeditor.update','-->',area,data.length]);
	 			area.val( data ).text( data );
				};
   //});
			};
			//console.log(['ckeditor.update','done',$.ckeditor.editors/*,CKEDITOR.instances*/]);
  }, // ckeditor.update
  
  // utility method to clear orphan instances from memory
  clean: function(){
			if(!window.CKEDITOR) return;
			//console.log(['ckeditor.clean','before',$.ckeditor.editors]);
			//console.log(['ckeditor.clean','before(B)',CKEDITOR.instances]);
			for(var i=0;i<$.ckeditor.editors.length;i++){
				var name = $.ckeditor.editors[i];
 			//console.log(['ckeditor.clean',name,CKEDITOR.instances[name]]);
				var area = $('#'+name.replace(/\./g,'\\.'));
 			//console.log(['ckeditor.clean',name,'textarea:',area]);
 			//console.log(['ckeditor.clean',name,'CKEDITOR:',CKEDITOR.instances[name]]);
 			//console.log(['ckeditor.clean',name,'CKEDITOR.textarea:',CKEDITOR.instances[name]?CKEDITOR.instances[name].textarea:null]);
				var inst = CKEDITOR.instances[name];
				if(area.length==0 || !inst || inst.textarea!=area[0]){
					//console.log(['ckeditor.clean',name,'DOES NOT EXIST']);
					//console.log(['ckeditor.clean',name,'editors.splice('+i+')']);
				 $.ckeditor.editors.splice(i);
					////console.log(['ckeditor.clean',name,'delete CKEDITOR.instances['+name+']']);
				 delete CKEDITOR.instances[name];
					////console.log(['ckeditor.clean',name,'CKEDITOR.instances['+name+'].destroy()']);
					//inst.destroy();
				};
   //});
			};
			//console.log(['ckeditor.clean','after',$.ckeditor.editors]);
			//console.log(['ckeditor.clean','after(B)',CKEDITOR.instances]);
  }, // ckeditor.clean
  
  // utility method to create instances of CKEditor (if any)
  create: function(options){
			// Create a new options object
   var o = $.extend({}/* new object */, $.ckeditor.config || {}, options || {});
   // Normalize plugin options
   $.extend(o, {
    selector: o.selector || $.ckeditor.selector,
    basePath: o.path || o.basePath || (window.CKEDITOR_BASEPATH ? CKEDITOR_BASEPATH : $.ckeditor.path)
   });
			//console.log(['ckeditor.create','o',o]);
   // Find ckeditor.editor-instance 'wannabes'
   var e = o.e ? $(o.e) : undefined;
   if(!e || !e.length>0) e = $(o.selector);
			//console.log(['ckeditor.create','e',e]);
   if(!e || !e.length>0) return;
			//console.log(['ckeditor.create','loaded?',$.ckeditor.loaded]);
			//console.log(['ckeditor.create','loading?',$.ckeditor.loading]);
   // Load script and create instances
   if(!$.ckeditor.loading && !$.ckeditor.loaded){
 			//console.log(['ckeditor.create','load script']);
    $.ckeditor.loading = true;
    $.getScript(
     o.basePath+'ckeditor.js',
     function(){ $.ckeditor.loaded = true; }
    );
   };
   // Start editor
   var start = function(){//e){
				//console.log(['ckeditor.create','start','loaded?',$.ckeditor.loaded]);
    if($.ckeditor.loaded){
     //console.log(['ckeditor.create','start','loaded!',e,o]);
     $.ckeditor.editor(e,o);
    }
    else{
     //console.log(['ckeditor.create','start','waiting:',e,o]);
     if($.ckeditor.waited<=0){
      alert('jQuery.CKEditor plugin error: The CKEditor script did not load.');
     }
     else{
      $.ckeditor.waitFor--;
      window.setTimeout(start,1000);
     };
    }
   };
   start(e);
   // Return matched elements...
   return e;
  },
  
  // utility method to integrate this plugin with others...
  intercept: function(){
   if($.ckeditor.intercepted) return;
   // This method intercepts other known methods which
   // require up-to-date code from CKEditor
   $.ckeditor.intercepted = {
    ajaxSubmit: $.fn.ajaxSubmit || function(){}
   };
   $.fn.ajaxSubmit = function(){
				//console.log(['ckeditor.intercepted','$.fn.ajaxSubmit',CKEDITOR.instances]);
    $.ckeditor.update(); // update html
    return $.ckeditor.intercepted.ajaxSubmit.apply( this, arguments );
   };
			// Also attach to conventional form submission
			//$('form').submit(function(){
   // $.ckeditor.update(); // update html
   //});
  },
  
  // utility method to create an instance of CKEditor
  editor: function(e /* elements */, o /* options */){
   // Create a local over-loaded copy of the default configuration
			o = $.extend({}, $.ckeditor.config || {}, o || {});
   // Make sure we have a jQuery object
   e = $(e);
   //console.log(['ckeditor.editor','E',e,'o',o]);
   if(e.size()>0){
    // Go through objects and initialize ckeditor.editor
    e.each(
     function(i,t){
      //console.log(['ckeditor.editor','each','t',i,t]);
						if((t.tagName||'').toLowerCase()!='textarea')
							return alert(['An invalid parameter has been passed to the $.CKEditor.editor function','tagName:'+t.tagName,'name:'+t.name,'id:'+t.id].join('\n'));
      
      //console.log(['ckeditor.editor','each','t.ckeditor',t.ckeditor]);
      var T = $(t);// t = element, T = jQuery
      if(!t.ckeditor/* not already installed */){
							// make sure the element has an id
							t.id = t.id || 'ckeditor'+($.ckeditor.editors.length+1);
							$.ckeditor.editors[$.ckeditor.editors.length] = t.id;
							// make sure the element has a name
							t.name = t.name || t.id;
       //console.log(['ckeditor.editor','metadata',T.metadata()]);
							// Accept settings from metadata plugin
							var config = $.extend({}, o,
								($.meta ? T.data()/*NEW metadata plugin*/ :
								($.metadata ? T.metadata()/*OLD metadata plugin*/ : 
								null/*metadata plugin not available*/)) || {}
							);
							// normalize configuration one last time...
							config = $.extend(config, {
								width: (o.width || o.Width || T.width() || '100%'),
								height: (o.height || o.Height || T.height() || '500px'),
								basePath: (o.path || o.basePath),
								toolbar: (o.toolbar || o.ToolbarSet || undefined)// 'Default')
							});
       //console.log(['ckeditor.editor','make','t',t]);
       //console.log(['ckeditor.editor','make','t.id',t.id]);
       //console.log(['ckeditor.editor','make','config',config]);
							// create CKEditor instance
       var editor = CKEDITOR.replace(t.id, config);
							// Store reference to element in CKEditor object
       editor.textarea = t;
							// Store reference to CKEditor object in element
       t.ckeditor = editor;
							// Mark this editor so we know if a new editor
							// with the same id has taken its place
       T.addClass('is-ckeditor');
      };
     }
    );
				// Remove old non-existing editors from memory
				$.ckeditor.clean();
   };
   // return jQuery array of elements
   return e;
  }, // ckeditor.editor function
  
  // start-up method
  start: function(o/* options */){
			// Drop dead instances
			//console.log(['ckeditor.start','clean']);
			$.ckeditor.clean();
   // Attach itself to known plugins...
			//console.log(['ckeditor.start','intercept']);
			$.ckeditor.intercept();
			// Create CKEDITOR
   return $.ckeditor.create(o);
  } // ckeditor.start
  
 } // ckeditor object
 //##############################
 
});
// extend $
//##############################


$.extend($.fn, {
	ckeditor: function(o){
		//console.log(['ckeditor',this]);
		
		// Provide quick access to CKEditor Instance Object
		if(this.length==1 && this[0].id && window.CKEDITOR){
			var e = CKEDITOR.instances[this[0].id];
			if(e==this[0]){
		 //console.log(['ckeditor','already exists:',CKEDITOR.instances[this[0].id]]);
			return CKEDITOR.instances[this[0].id];
			}
			else{
		 //console.log(['ckeditor','edit not created for:',this[0]]);
			 $.ckeditor.clean();
			};
		};
		
		//console.log(['ckeditor','make editors for:',this]);
		
		// Let's make some editors! :-)
		return $(this).each(function(){
			//console.log(['ckeditor','each','t',this]);
			$.ckeditor.start(
						$.extend(
							{}, // create a new options object
							o || {}, // overload with this call's options parameter
							{e: this} // store reference to self
						) // $.extend
					); // $.ckeditor.start
		}); // each element
		
		//console.log(['ckeditor','done','editors:',$.editor.editors]);
		
	} //$.fn.ckeditor
});
// extend $.fn
//##############################

/*# AVOID COLLISIONS #*/
})(jQuery);
/*# AVOID COLLISIONS #*/

jQuery(function(){jQuery('textarea.ckeditor').ckeditor();});
