// Minified using Javascript Aggregator - see /sites/mediacoop.ca/files2/mc/js/js_0bc1f144c5c0316ec3941201e0248844.js for original source including licensing information.

(function($){Drupal.wysiwygInit=function(){if(/KDE/.test(navigator.vendor)){return;}
jQuery.each(Drupal.wysiwyg.editor.init,function(editor){this(jQuery.extend(true,{},Drupal.settings.wysiwyg.configs[editor]));});};Drupal.behaviors.attachWysiwyg=function(context){if(/KDE/.test(navigator.vendor)){return;}
$('.wysiwyg:not(.wysiwyg-processed)',context).each(function(){var params=Drupal.wysiwyg.getParams(this);var $this=$(this).addClass('wysiwyg-processed');if(($this.is(':input')&&$this.is(':checked'))||$this.is('div')){Drupal.wysiwygAttach(context,params);}
if($this.is(':input')){$this.change(function(){Drupal.wysiwygDetach(context,params);Drupal.wysiwygAttach(context,params);});if($.browser.msie){$this.click(function(){this.blur();});}}
$('#'+params.field).parents('form').submit(function(event){if(event.originalEvent.returnValue===false){return;}
Drupal.wysiwygDetach(context,params);});});};Drupal.wysiwygAttach=function(context,params){if(typeof Drupal.wysiwyg.editor.attach[params.editor]=='function'){Drupal.wysiwyg.instances[params.field]={};jQuery.extend(Drupal.wysiwyg.instances[params.field],params);if(typeof Drupal.wysiwyg.editor.instance[params.editor]=='object'){jQuery.extend(Drupal.wysiwyg.instances[params.field],Drupal.wysiwyg.editor.instance[params.editor]);}
Drupal.wysiwyg.activeId=params.field;if(params.toggle){Drupal.wysiwygAttachToggleLink(context,params);}
else{$('#wysiwyg-toggle-'+params.field).hide();}
if(params.status){Drupal.wysiwyg.editor.attach[params.editor](context,params,(Drupal.settings.wysiwyg.configs[params.editor]?jQuery.extend(true,{},Drupal.settings.wysiwyg.configs[params.editor][params.format]):{}));}
else{Drupal.wysiwyg.editor.attach.none(context,params);Drupal.wysiwyg.instances[params.field].editor='none';}}};Drupal.wysiwygDetach=function(context,params){var editor=Drupal.wysiwyg.instances[params.field].editor;if(jQuery.isFunction(Drupal.wysiwyg.editor.detach[editor])){Drupal.wysiwyg.editor.detach[editor](context,params);}};Drupal.wysiwygAttachToggleLink=function(context,params){if(!$('#wysiwyg-toggle-'+params.field).length){var text=document.createTextNode(params.status?Drupal.settings.wysiwyg.disable:Drupal.settings.wysiwyg.enable);var a=document.createElement('a');$(a).attr({id:'wysiwyg-toggle-'+params.field,href:'javascript:void(0);'}).append(text);var div=document.createElement('div');$(div).addClass('wysiwyg-toggle-wrapper').append(a);$('#'+params.field).after(div);}
$('#wysiwyg-toggle-'+params.field).html(params.status?Drupal.settings.wysiwyg.disable:Drupal.settings.wysiwyg.enable).show().unbind('click.wysiwyg',Drupal.wysiwyg.toggleWysiwyg).bind('click.wysiwyg',{params:params,context:context},Drupal.wysiwyg.toggleWysiwyg);if(params.editor=='none'){$('#wysiwyg-toggle-'+params.field).hide();}};Drupal.wysiwyg.toggleWysiwyg=function(event){var context=event.data.context;var params=event.data.params;if(params.status){params.status=false;Drupal.wysiwygDetach(context,params);Drupal.wysiwyg.editor.attach.none(context,params);Drupal.wysiwyg.instances[params.field]=Drupal.wysiwyg.editor.instance.none;Drupal.wysiwyg.instances[params.field].editor='none';$(this).html(Drupal.settings.wysiwyg.enable).blur();}
else{Drupal.wysiwyg.editor.detach.none(context,params);Drupal.wysiwyg.getParams($('.wysiwyg-field-'+params.field+':checked, div.wysiwyg-field-'+params.field,context).get(0),params);params.status=true;Drupal.wysiwygAttach(context,params);$(this).html(Drupal.settings.wysiwyg.disable).blur();}}
Drupal.wysiwyg.getParams=function(element,params){var classes=element.className.split(' ');var params=params||{};for(var i=0;i<classes.length;i++){if(classes[i].substr(0,8)=='wysiwyg-'){var parts=classes[i].split('-');var value=parts.slice(2).join('-');params[parts[1]]=value;}}
params.format='format'+params.format;params.status=parseInt(params.status,10);params.toggle=parseInt(params.toggle,10);params.resizable=parseInt(params.resizable,10);return params;};Drupal.wysiwygInit();})(jQuery);;
