var TinyMCE_EditableSelects={editSelectElm:null,init:function(){var f=document.getElementsByTagName("select"),d,g=document,h;for(d=0;d<f.length;d++){if(f[d].className.indexOf("mceEditableSelect")!=-1){h=new Option("(value)","__mce_add_custom__");h.className="mceAddSelectValue";f[d].options[f[d].options.length]=h;f[d].onchange=TinyMCE_EditableSelects.onChangeEditableSelect}}},onChangeEditableSelect:function(h){var g=document,d,e=window.event?window.event.srcElement:h.target;if(e.options[e.selectedIndex].value=="__mce_add_custom__"){d=g.createElement("input");d.id=e.id+"_custom";d.name=e.name+"_custom";d.type="text";d.style.width=e.offsetWidth+"px";e.parentNode.insertBefore(d,e);e.style.display="none";d.focus();d.onblur=TinyMCE_EditableSelects.onBlurEditableSelectInput;d.onkeydown=TinyMCE_EditableSelects.onKeyDown;TinyMCE_EditableSelects.editSelectElm=e}},onBlurEditableSelectInput:function(){var b=TinyMCE_EditableSelects.editSelectElm;if(b){if(b.previousSibling.value!=""){addSelectValue(document.forms[0],b.id,b.previousSibling.value,b.previousSibling.value);selectByValue(document.forms[0],b.id,b.previousSibling.value)}else{selectByValue(document.forms[0],b.id,"")}b.style.display="inline";b.parentNode.removeChild(b.previousSibling);TinyMCE_EditableSelects.editSelectElm=null}},onKeyDown:function(b){b=b||window.event;if(b.keyCode==13){TinyMCE_EditableSelects.onBlurEditableSelectInput()}}};