/* TYPOlight Open Source CMS :: Copyright (C) 2005-2010 Leo Feyer :: LGPL license */
var Typobox={preInit:function(){var a;tinyMCEPopup.requireLangPack();if(a=tinyMCEPopup.getParam("external_image_list_url")){document.write('<script language="javascript" type="text/javascript" src="'+tinyMCEPopup.editor.documentBaseURI.toAbsolute(a)+'"><\/script>')}},init:function(){var d=document.forms[0],a=tinyMCEPopup.editor;document.getElementById("srcbrowsercontainer").innerHTML=getBrowserHTML("srcbrowser","src","image","theme_advanced_image");
if(isVisible("srcbrowser")){document.getElementById("src").style.width="180px"}this.fillFileList("image_list","tinyMCEImageList");this.fillRelList("rel_list");TinyMCE_EditableSelects.init();c=a.selection.getContent();if(!c||c.indexOf("image::")==-1){return}c=c.replace(/^.*\{\{image::/gi,"");c=c.replace(/\}\}.*$/i,"");c=c.replace(/\[&amp;\]|\[&\]|&amp;|&/gi,"?");var b=c.split("?");d.src.value=b[0];for(i=1;
i<b.length;i++){sub=b[i].split("=");switch(sub[0]){case"width":d.width.value=sub[1];break;case"height":d.height.value=sub[1];break;case"alt":d.alt.value=sub[1];break;case"class":d.cssClass.value=sub[1];break;case"rel":selectByValue(d,"rel_list",sub[1],true);break}}},fillFileList:function(g,d){var f=tinyMCEPopup.dom,a=f.get(g),e,b;d=window[d];if(d&&d.length>0){a.options[a.options.length]=new Option("","");
tinymce.each(d,function(h){a.options[a.options.length]=new Option(h[0],h[1])})}else{f.remove(f.getParent(g,"tr"))}},fillRelList:function(e){var d=tinyMCEPopup.dom,a=d.get(e),b;a.options[a.options.length]=new Option(tinyMCEPopup.getLang("not_set"),"");a.options[a.options.length]=new Option(tinyMCEPopup.getLang("typolinks_dlg.image_rel_single"),"lightbox");a.options[a.options.length]=new Option(tinyMCEPopup.getLang("typolinks_dlg.image_rel_multi"),"lightbox[multi]")
},update:function(){var j=document.forms[0],b=j.elements,d=tinyMCEPopup.editor,e={},g;tinyMCEPopup.restoreSelection();if(j.src.value==""){tinyMCEPopup.close();return}var a=j.src.value;var h="?";if(j.width.value){a+=h+"width="+j.width.value;h="&amp;"}if(j.height.value){a+=h+"height="+j.height.value;h="&amp;"}if(j.alt.value){a+=h+"alt="+j.alt.value;h="&amp;"}if(j.cssClass.value){a+=h+"class="+j.cssClass.value;
h="&amp;"}if(j.rel_list){a+=h+"rel="+getSelectValue(j,"rel_list")}a="{{image::"+a+"}}";g=d.selection.getNode();d.execCommand("mceInsertRawHTML",false,a);d.undoManager.add();tinyMCEPopup.close()}};Typobox.preInit();tinyMCEPopup.onInit.add(Typobox.init,Typobox);