/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

(function(){(function(){CKEDITOR.plugins.add('embedmedia',{requires:['iframedialog'],init:function(a){var b=this;CKEDITOR.dialog.add('EmbedMediaDialog',function(c){var d=CKEDITOR.currentInstance.id;return{title:'Embed Media Dialog',minWidth:550,minHeight:200,contents:[{id:'iframe',label:'Embed Media',expand:true,elements:[{type:'html',id:'pageEmbedMedia',label:'Embed Media',style:'width : 100%;',html:'<iframe src="'+b.path+'/dialogs/embedmedia.html" frameborder="0" name="iframeEmbedMedia_'+d+'" id="iframeEmbedMedia" allowtransparency="1" style="width:100%;margin:0;padding:0;height:165px;"></iframe>'}]}],onOk:function(e){for(var f=0;f<window.frames.length;f++){if(window.frames[f].name=='iframeEmbedMedia_'+d)var g=window.frames[f].document.getElementById('embed').value;}final_html='EmbedMediaInsertData|---'+escape('<div class="embed_media">'+g+'</div>')+'---|EmbedMediaInsertData';c.insertHtml(final_html);updated_editor_data=c.getData();clean_editor_data=updated_editor_data.replace(final_html,'<div class="embed_media">'+g+'</div>');c.setData(clean_editor_data);}};});a.addCommand('EmbedMedia',new CKEDITOR.dialogCommand('EmbedMediaDialog'));a.ui.addButton('EmbedMedia',{label:'Embed Media',command:'EmbedMedia',icon:this.path+'images/icon.gif'});}});})();})();
