/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/
*/

(function()
{var sDefaultFieldPrefix="Field";var sContentIsValid="Content is valid.";var sWindowsMediaVideo="Windows Media Video";var sContinueSaving="Continue saving invalid document?";function restorePosition(win)
{win.focus();var content=win.document.body.innerHTML;win.document.body.innerHTML=content;}
function insertContent(editor,content,strCommandTitle,oOrigElem)
{if("object"==typeof content&&content&&"undefined"==typeof content.nodeType&&typeof content.length!="undefined")
{var elems=content;if(elems.length>0)
{content="";for(var i=0;i<elems.length;i++)
{content+=Ektron.Xml.serializeXhtml(elems[i]);}}
else
{content="";}}
else if("object"==typeof content&&content!=oOrigElem)
{content=Ektron.Xml.serializeXhtml(content);}
if("string"==typeof content)
{if(oOrigElem&&$ektron(oOrigElem).hasClass("design_richarea"))
{oOrigElem=null;}
content=editor.filter.GetDesignContent(content);if(typeof editor.ContentWindow.getSelection=="function")
{var selection=editor.ContentWindow.getSelection();var started=selection.anchorOffset;var ended=selection.focusOffset;if(selection.anchorNode&&1==selection.anchorNode.nodeType&&selection.anchorNode.tagName.toUpperCase()!="BODY"&&0==started&&0==ended)
{restorePosition(editor.ContentWindow);}}
editor.PasteHtml(content,strCommandTitle,true,true,true);}
else
{editor.contentCache=null;}}
function replaceElement(editor,content,oOrigElem)
{if("object"==typeof content&&content!=oOrigElem)
{content=Ektron.Xml.serializeXhtml(content);}
if("string"==typeof content)
{content=editor.filter.GetDesignContent(content);editor.contentCache=null;var oParent=oOrigElem.parentNode;var oPlaceHolder=oParent.ownerDocument.createElement("div");oPlaceHolder.innerHTML=content;oParent.replaceChild(oPlaceHolder.firstChild,oOrigElem);oOrigElem=null;oPlaceHolder=null;}
editor.sfInstance.setSelectedField(null);}
function createCmdArgs(editor,oFieldElem)
{var bIsRootLoc=editor.sfInstance.isRootLocation();var oContentElement=editor.sfInstance.getContentElement();var uniqueId=getDDUniqueId(editor,oContentElement);var args={selectedField:oFieldElem,isRootLocation:bIsRootLoc,fieldPrefix:editor.GetLocalizedString("sDefaultFieldPrefix",sDefaultFieldPrefix),fieldId:uniqueId,scrolling:"auto"};return args;}
function createCmdArgsWTree(editor,oFieldElem,sExcludeClass,sDatatype)
{var sContent=editor.getContent();var xmlTree=getContentTree(editor,oFieldElem,sContent,null,sDatatype);var args=createCmdArgs(editor,oFieldElem);args.contentTree=xmlTree;return args;}
function getContentTree(editor,oFieldElem,sContent,sExcludeClass,sDatatype)
{var srcPath=editor.ekParameters.srcPath;var skinPath=editor.ekParameters.skinPath;var strXSLT="DesignToFieldTree.xslt";var args=[{name:"configUrl",value:srcPath+"ValidateSpec.xml"},{name:"srcPath",value:srcPath},{name:"skinPath",value:skinPath}];if("string"==typeof sExcludeClass)
{args.push({name:"excludeClass",value:sExcludeClass});}
if(oFieldElem||"string"==typeof sDatatype)
{if(oFieldElem)
{sDatatype=(oFieldElem.getAttribute("ektdesignns_datatype")||sDatatype||"");}
args.push({name:"currentDatatype",value:sDatatype});}
var sFieldList=editor.ekXml.xslTransform(sContent,strXSLT,args);return sFieldList;}
function getDDUniqueId(editor,oContent)
{var nFieldNum=1;var bFoundElem=true;var strFieldId="";while(true==bFoundElem)
{strFieldId=editor.GetLocalizedString("sDefaultFieldPrefix",sDefaultFieldPrefix)+nFieldNum;var oFoundElem=oContent.ownerDocument.getElementById(strFieldId);if(oFoundElem)
{bFoundElem=true;nFieldNum=nFieldNum+1;}
else
{bFoundElem=false;}}
return nFieldNum;}
function createErrorString(editor,err)
{var errmsg="";if("object"==typeof err&&err.length>0)
{errmsg=err.join("\n\n\n");}
else if("object"==typeof err&&"string"==typeof err.msg)
{errmsg=editor.GetLocalizedString("sContentIsValid",sContentIsValid)+"\n\n"+err.msg;}
else
{errmsg=err;}
return errmsg;}
function cleanText(strTextData)
{return strTextData.replace(/<\/?(P|TD|LI)[^>]*>|\n|\r/gi,"");}
function checkIfTextEmpty(textToCheck)
{return/^(\s|\xA0|&nbsp;|&#160;)*$/.test(textToCheck);}
RadEditorCommandList["EkFieldProp"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();if(oFieldElem)
{var targetCommandName="";switch(oFieldElem.tagName.toLowerCase())
{case"fieldset":targetCommandName="EkGroupBox";break;case"table":targetCommandName="EkTabularDataBox";break;case"input":if("checkbox"==oFieldElem.type)
{targetCommandName="EkCheckBoxField";}
else if(oFieldElem.className.indexOf("design_calculation")>-1)
{targetCommandName="EkCalculatedField";}
else
{targetCommandName="EkTextField";}
break;case"div":case"span":$ektron.each((oFieldElem.className).split(/\s+/),function(i,className){if("ektdesignns_choices"==className)
{targetCommandName="EkChoicesField";}
else if("ektdesignns_calendar"==className)
{targetCommandName="EkCalendarField";}
else if("ektdesignns_richarea"==className)
{targetCommandName="EkTextField";}
else if("ektdesignns_imageonly"==className)
{targetCommandName="EkImageOnlyField";}
else if("ektdesignns_filelink"==className)
{targetCommandName="EkFileLinkField";}});break;case"select":targetCommandName="EkChoicesField";break;default:targetCommandName="";break;}
if(targetCommandName.length>0)
{RadEditorCommandList[targetCommandName](targetCommandName,editor,oTool);}}};RadEditorCommandList["EkGroupBox"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgs(editor,oFieldElem);var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/groupbox.aspx",args,450,430,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkTabularDataBox"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgs(editor,oFieldElem);var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/tabulardatabox.aspx",args,450,550,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkCheckBoxField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgsWTree(editor,oFieldElem);var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/checkboxfield.aspx",args,620,440,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkTextField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgsWTree(editor,oFieldElem);var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/textfield.aspx",args,620,500,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkChoicesField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgs(editor,oFieldElem);var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/choicesfield.aspx",args,480,570,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkCalculatedField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgsWTree(editor,oFieldElem);var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/calculatedfield.aspx",args,620,535,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkCalendarField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgsWTree(editor,oFieldElem,null,"date");var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/calendarfield.aspx",args,620,440,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkImageOnlyField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgs(editor,oFieldElem);args.EditorObj=editor;var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/imageonlyfield.aspx",args,600,520,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkFileLinkField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgs(editor,oFieldElem);args.EditorObj=editor;var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/filelinkfield.aspx",args,600,570,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkMergeField"]=function(commandName,editor,oTool)
{if(typeof editor.formContent!="string")throw new TypeError(Ektron.String.format("Error: formContent must be a string. formContent is of type '{0}'.",typeof editor.formContent));if(typeof editor.fieldListArray!="object")throw new TypeError(Ektron.String.format("Error: fieldListArray must be an object. fieldListArray is of type '{0}'.",typeof editor.fieldListArray));var oFieldElem=editor.sfInstance.getSelectedField();var sExcludeClass="";var xmlTree=getContentTree(editor,null,editor.formContent,sExcludeClass);if("string"==typeof editor.fieldListArray.newRoot)
{xmlTree=xmlTree.replace(/\/root\//gi,editor.fieldListArray.newRoot);}
else if("undefined"==typeof editor.fieldListArray.newRoot)
{xmlTree=xmlTree.replace(/\/root\//gi,"/*/Data/");}
var args={selectedField:oFieldElem,contentTree:xmlTree,fieldListArray:editor.fieldListArray};var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/mergefield.aspx",args,450,430,callback,null,sTitle);return false;function callback(returnValue)
{if("string"==typeof returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}}};RadEditorCommandList["EkValidateDesign"]=function(commandName,editor,oTool)
{var err=editor.validateDesign();if(null==err)
{alert(editor.GetLocalizedString("sContentIsValid",sContentIsValid));}
else
{alert(createErrorString(editor,err));}
return false;};RadEditorCommandList["EkValidateData"]=function(commandName,editor,oTool)
{var err=editor.validateXmlContent();if(null==err)
{alert(editor.GetLocalizedString("sContentIsValid",sContentIsValid));}
else
{alert(createErrorString(editor,err));}
return false;};RadEditorCommandList["EkRichAreaSource"]=function(commandName,editor,oTool)
{var sTitle=editor.Localization[commandName];var oFieldElem=editor.sfInstance.getSelectedField();var sContent=Ektron.Xml.serializeXhtml(oFieldElem.childNodes);var objFilter=new EkContentFilter(editor);sContent=objFilter.GetHtmlContent(sContent);var args={title:sTitle,EditorObj:editor,content:sContent,contentType:"xhtml"};editor.ShowDialog(editor.GetDialogUrl("MozillaPasteHelperDlg"),args,700,550,callback,null,sTitle);return false;function callback(returnValue)
{if("string"==typeof returnValue)
{sContent=objFilter.GetDesignContent(returnValue);oFieldElem.innerHTML=sContent;Ektron.SelectionRange.wrapBodyText(oFieldElem);Ektron.SelectionRange.ensureCursorSelectability(oFieldElem);editor.SmartForm.validateElement(oFieldElem);}
editor.sfInstance.setSelectedField(null);}
objFilter=null;};RadEditorCommandList["EkCalendarPopup"]=function(commandName,editor,oTool)
{var oFieldBtn=editor.sfInstance.getSelectedField();var oFieldElem=editor.SmartForm.getFieldFromFieldButton(oFieldBtn);var args={selectedField:oFieldElem};editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/calendarpopup.aspx",args,200,320,callback,null,editor.Localization[commandName]);return false;function callback(returnValue)
{replaceElement(editor,returnValue,oFieldElem);editor.SmartForm.prevalidateElement(oFieldElem);editor.sfInstance.setSelectedField(null);}};RadEditorCommandList["EkFileLinkPopup"]=function(commandName,editor,oTool)
{var oFieldBtn=editor.sfInstance.getSelectedField();var oFieldElem=editor.SmartForm.getFieldFromFieldButton(oFieldBtn);var folderId=editor.ekParameters.FolderId;var args=getFileLinkArgument(oFieldElem);args.editor=editor;args.folderId=folderId;var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.GetDialogUrl("LinkManager"),args,600,470,callback,{cmdName:sTitle},sTitle);return false;function callback(returnValue)
{if(returnValue)
{var objAnch=null;var strUrl=returnValue.href;var sText=returnValue.text;while(oFieldElem.firstChild)
{oFieldElem.removeChild(oFieldElem.firstChild);}
if(strUrl.length>0)
{objAnch=oFieldElem.ownerDocument.createElement("a");oFieldElem.appendChild(objAnch);objAnch.setAttribute("href",strUrl);objAnch.setAttribute("data-ektron-url",strUrl);if(returnValue.title.length>0)
{objAnch.setAttribute("title",returnValue.title);}
if(returnValue.target.length>0)
{objAnch.setAttribute("target",returnValue.target);}
if(returnValue.className.length>0)
{objAnch.className=returnValue.className;}
$ektron(objAnch).text(sText);var objTextNode=oFieldElem.ownerDocument.createTextNode(" ");oFieldElem.appendChild(objTextNode);}
oFieldElem.appendChild(oFieldBtn);insertContent(editor,oFieldElem,sTitle,oFieldElem);editor.SmartForm.prevalidateElement(oFieldElem);editor.sfInstance.setSelectedField(null);}}
function getFileLinkArgument(oFieldElem)
{editor.SetFocus();var argument={realLinkObject:null,href:"",className:"",text:"",target:"",name:"",title:"",showText:false,documentAnchors:document.anchors,CssClasses:[]};var joElem=$ektron(oFieldElem).find("a");var oElem=joElem.get(0);if(joElem.length>0)
{argument.realLinkObject=oElem;argument.href=RadEditorNamespace.GetAnchorToCurrentPage(oElem,editor.IsIE);argument.className=oElem.className;argument.text=$ektron.htmlDecode(joElem.html());argument.target=oElem.target;argument.name=oElem.name;argument.title=oElem.title;editor.SelectElement(oElem);}
argument.CssClasses=editor.GetCssClassesByTagName("A",editor.Document);if(!RadEditorNamespace.Utils.Trim(argument.text))
{argument.text="";}
argument.showText=!RadEditorNamespace.Utils.HasHtmlContent(argument.text);return argument;}};RadEditorCommandList["EkImageOnlyPopup"]=function(commandName,editor,oTool)
{var oFieldBtn=editor.sfInstance.getSelectedField();var oFieldElem=editor.SmartForm.getFieldFromFieldButton(oFieldBtn);var folderId=editor.ekParameters.FolderId;commandName="SetImageProperties";var oImg=$ektron(oFieldElem).find("img").get(0);if(editor.sfInstance.isFieldButton(oImg))
{var args=null;editor.ShowDialog(editor.workareaPath+"mediamanager.aspx?actiontype=library&action=ViewLibraryByCategory&scope=images&text=imgonlyselect&autonav="+folderId,args,790,550,callback,null,editor.Localization[commandName]);}
else
{var cssClasses=editor.GetCssClassesByTagName("IMG",editor.Document);var argument={imageToModify:oImg,EditorObj:editor,CssClasses:cssClasses,ThumbnailSuffix:editor.ThumbSuffix,InternalParameters:editor.GetDialogInternalParameters(commandName),folderId:folderId,commandType:"imgpopupmediaselect"};var callBackParam={CommandTitle:editor.Localization[commandName],OriginalImage:oImg};editor.ShowDialog(editor.GetDialogUrl(commandName),argument,600,470,callback,callBackParam,editor.Localization[commandName]);}
return false;function callback(returnValue)
{if(returnValue)
{var objImg=null;var sAttrSrc=null;if(returnValue.src)
{sAttrSrc=returnValue.getAttribute("src");}
var strUrl=(returnValue.href||sAttrSrc||returnValue.sFilename);while(oFieldElem.firstChild)
{oFieldElem.removeChild(oFieldElem.firstChild);}
if(strUrl&&strUrl.length>0&&strUrl!=returnValue.baseURI)
{if("IMG"==returnValue.tagName)
{objImg=returnValue;}
else
{objImg=oFieldElem.ownerDocument.createElement("img");objImg.setAttribute("src",strUrl);objImg.setAttribute("data-ektron-url",strUrl);objImg.alt=returnValue.sCaption;}
oFieldElem.appendChild(objImg);var objTextNode=oFieldElem.ownerDocument.createTextNode(" ");oFieldElem.appendChild(objTextNode);}
oFieldElem.appendChild(oFieldBtn);insertContent(editor,oFieldElem,"Insert Image",oFieldElem);editor.SmartForm.prevalidateElement(oFieldElem);editor.sfInstance.setSelectedField(null);}}};RadEditorCommandList["EkLibrary"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();if(typeof oFieldElem!="undefined"&&oFieldElem)
{var sTag=oFieldElem.tagName;if(!isAllowedObject(sTag))
{if(false==ekCanHaveChildren(oFieldElem))return;if("TEXTAREA"==sTag)return;}}
if(false==editor.isSelectionEditable())return;var selElemSafari=null;if($ektron.browser.safari)
{var cursorLocation=editor.GetSelectedElement();if(cursorLocation&&cursorLocation.firstChild&&"BR"==cursorLocation.firstChild.tagName)
{selElemSafari=cursorLocation.firstChild;}}
var args=null;var folderId=editor.ekParameters.FolderId;editor.ShowDialog(editor.workareaPath+"mediamanager.aspx?actiontype=library&scope=all&autonav="+folderId,args,790,550,callback,null,editor.Localization[commandName]);return false;function callback(returnValue)
{if(returnValue)
{var sHtml="";var sCaption=$ektron.htmlEncode(returnValue.sCaption);oFieldElem=(editor.sfInstance.getSelectedField()||selElemSafari);switch(returnValue.sType.toLowerCase())
{case"images":sHtml="<img src=\""+returnValue.sFilename+"\" alt=\""+sCaption+"\" title=\""+sCaption+"\" />";insertContent(editor,sHtml,"Insert Library Image",oFieldElem);break;case"thumbnail":sHtml=returnValue.sFilename;insertContent(editor,sHtml,"Insert Thumbnail",oFieldElem);break;case"files":case"hyperlinks":case"quicklinks":default:var selectedHtml=editor.GetSelectionHtml();var replacedHtml=cleanText(selectedHtml);if(typeof replacedHtml!="undefined"&&replacedHtml!=null&&false==checkIfTextEmpty(replacedHtml))
{var oSelElem=editor.GetSelectedElement();var joHtml=$ektron(replacedHtml);if(joHtml.length>=1)
{var sTag=joHtml.get(0).tagName;if(isAllowedObject(sTag))
{}
else if($ektron.isEditableElement(oSelElem))
{replacedHtml=$ektron.removeTags(replacedHtml);}
else
{replacedHtml=sCaption;}}
else if(!$ektron.isEditableElement(oSelElem))
{replacedHtml=sCaption;}
sHtml='<a href="'+returnValue.sFilename+'" title="'+sCaption+'">'+replacedHtml+'</a>'+" ";}
else
{sHtml='<a href="'+returnValue.sFilename+'" title="'+sCaption+'">'+sCaption+'</a>'+" ";}
insertContent(editor,sHtml,"Insert Library Link",oFieldElem);break;}}}
function isAllowedObject(tagName)
{var bAllowed=false;tagName=tagName.toUpperCase();switch(tagName)
{case"IMG":case"APPLET":case"OBJECT":case"IFRAME":bAllowed=true;break;default:bAllowed=false;break;}
return bAllowed;}};RadEditorCommandList["EkTranslate"]=function(commandName,editor,oTool)
{var args={"content":editor.getContent()};var targetlanguage=(editor.ekParameters.contentLanguage||jsContentLanguage||0);var sourcelanguage=(jsDefaultContentLanguage||0);var editorname=editor.Id;var contentid=jsId;editor.ShowDialog(editor.ekParameters.srcPath+"../worldlingo.aspx?LangType="+targetlanguage+"&DefaultContentLanguage="+sourcelanguage+"&htmleditor="+encodeURIComponent(editorname)+"&id="+contentid,args,550,553,callback,null,editor.Localization[commandName]);return false;function callback(returnValue)
{if(returnValue)
{if("string"==typeof returnValue)
{editor.setContent("document",returnValue);}}}};RadEditorCommandList["EkAddLinkPage"]=function(commandName,editor,oTool)
{var selectedObj=editor.GetSelection();var strTextData=$ektron.trim(selectedObj.GetHtmlText());var replacedText=cleanText(strTextData);if(checkIfTextEmpty(replacedText)==true)
{alert('You must select some text.');}
else
{var wikititle="";var target="";var strArticleTitle=(selectedObj.GetText()||$ektron(strTextData).attr("alt")||strTextData);var folderId=editor.ekParameters.FolderId;var args={selectedText:strArticleTitle,selectedHTML:strTextData,scrolling:"auto"};var myRe=new RegExp("folderid=\"([^\">])*");var ar=myRe.exec(strTextData);if(ar!=null&&ar.length>0)
{folderId=ar[0].replace("folderid=\"","");}
myRe=new RegExp("wikititle=\"([^\">])*");ar=myRe.exec(strTextData);if(ar!=null&&ar.length>0)
{wikititle="&wikititle="+ar[0].replace("wikititle=\"","");}
myRe=new RegExp("target=\"([^\">])*");ar=myRe.exec(strTextData);if(ar!=null&&ar.length>0)
{target="&target="+ar[0].replace("target=\"","");}
editor.ShowDialog(editor.ekParameters.srcPath+"../ewebeditpro/wikipopup.aspx?editorName="+escape(editor.Id)+"&FolderID="+folderId+wikititle+target,args,680,385,callback,null,editor.Localization[commandName]);}
return false;function callback(returnValue)
{if(returnValue)
{if("string"==typeof returnValue.sHtml)
{editor.PasteHtml(returnValue.sHtml);}}}};RadEditorCommandList["EkHtmlFieldProp"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();if(oFieldElem)
{var targetCommandName="";switch(oFieldElem.tagName.toLowerCase())
{case"input":if("checkbox"==oFieldElem.type)
{targetCommandName="EkHtmlCheckBoxField";}
else
{targetCommandName="EkHtmlTextField";}
break;case"textarea":targetCommandName="EkHtmlTextField";break;case"div":case"span":$ektron.each(oFieldElem.className.split(/\s+/),function(i,className)
{if("ektdesignns_choices"==className||"ektdesignns_checklist"==className)
{targetCommandName="EkHtmlChoicesField";}
else if("ektdesignns_calendar"==className)
{targetCommandName="EkHtmlCalendarField";}});break;case"select":targetCommandName="EkHtmlChoicesField";break;default:targetCommandName="";break;}
if(targetCommandName.length>0)
{RadEditorCommandList[targetCommandName](targetCommandName,editor,oTool);}}};RadEditorCommandList["EkHtmlCheckBoxField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgsWTree(editor,oFieldElem);var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/htmlcheckboxfield.aspx",args,620,440,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["InsertWMV"]=function(commandName,editor,oTool)
{var sTitle=editor.Localization[commandName];var args={content:sTitle};editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/WindowsMediaVideo.aspx",args,400,200,callback,null,sTitle);return false;function callback(returnValue)
{if(returnValue)
{var strWmvSrc=returnValue.url;var strHtml=Ektron.String.format('<embed name="MediaPlayer" type="application/x-mplayer2" width="200" height="160" src="{0}" title="{1}" autostart="0"></embed>',$ektron.htmlEncode(strWmvSrc),$ektron.htmlEncode(editor.GetLocalizedString("sWindowsMediaVideo",sWindowsMediaVideo)))+" ";insertContent(editor,strHtml,sTitle);}}};RadEditorCommandList["EkEmoticonSelect"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var sTitle=editor.Localization[commandName];var args={content:sTitle};editor.ShowDialog(editor.workareaPath+"threadeddisc/emoticon_select.aspx",args,270,160,callback,null,sTitle);return false;function callback(returnValue)
{if(returnValue)
{var sHtml="";var sCaption=$ektron.htmlEncode(returnValue.sCaption);oFieldElem=editor.sfInstance.getSelectedField();sHtml="<img src=\""+returnValue.sFilename+"\" alt=\""+sCaption+"\" title=\""+sCaption+"\" />";insertContent(editor,sHtml,sTitle,oFieldElem);}}};RadEditorCommandList["EkHtmlTextField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgsWTree(editor,oFieldElem);var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/htmltextfield.aspx",args,620,450,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkHtmlChoicesField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgs(editor,oFieldElem);var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/htmlchoicesfield.aspx",args,480,570,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkHtmlCalendarField"]=function(commandName,editor,oTool)
{var oFieldElem=editor.sfInstance.getSelectedField();var args=createCmdArgsWTree(editor,oFieldElem,null,"date");var sTitle=editor.Localization[commandName];editor.ShowDialog(editor.ekParameters.srcPath+"dialogs/htmlcalendarfield.aspx",args,620,440,callback,null,sTitle);return false;function callback(returnValue)
{insertContent(editor,returnValue,sTitle,oFieldElem);}};RadEditorCommandList["EkInContextSave"]=function(commandName,editor,oTool)
{var err=editor.validateDesign();if(err!=null)
{var checkLevel=editor.ekParameters.AccessChecks.toLowerCase();if("enforce"==checkLevel)
{alert(createErrorString(editor,err));return false;}
else if("warn"==checkLevel)
{if(false==confirm(createErrorString(editor,err)+"\n\n"+editor.GetLocalizedString("sContinueSaving",sContinueSaving)))
{return false;}}}
var strContent=editor.getContent();editor.destroyEditor();$ektron("#"+editor.Id+"_wrapper").parent().ajaxCallback(editor.uniqueCallbackId,$ektron.extend({command:"save",content:strContent},editor.callbackData));};RadEditorCommandList["EkInContextCancel"]=function(commandName,editor,oTool)
{editor.destroyEditor();$ektron("#"+editor.Id+"_wrapper").parent().ajaxCallback(editor.uniqueCallbackId,$ektron.extend({command:"cancel"},editor.callbackData));};})();

