/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/
*/

if(!Ektron.SmartForm)(function()
{Ektron.SmartForm=function SmartForm(containingElement,settings)
{settings=$ektron.extend({srcPath:"",skinPath:"",editorSkinPath:"",localizedStrings:{},langType:"",CssFilesArray:[],enableExpandCollapse:true,onexception:null},settings);settings.skinPath=settings.skinPath||settings.srcPath;settings.editorSkinPath=settings.editorSkinPath||settings.skinPath||settings.srcPath;settings.langType=settings.langType+"";this.settings=settings;this.onexception=settings.onexception;if("string"==typeof containingElement)
{this.id=containingElement;}
else if("object"==typeof containingElement&&containingElement)
{this.id=containingElement.id;}
if(null==document.getElementById(this.id))throw new RangeError("Failed to find the Smart Form containing element by id. ID = "+this.id);if(Ektron.SmartForm.instances.length>0||this.id!="design_content")
{var bOK=true;if(1==Ektron.SmartForm.instances.length)
{bOK=bOK&&$ektron("#"+Ektron.SmartForm.instances[0].id).hasClass("design_content");}
bOK=bOK&&$ektron("#"+this.id).hasClass("design_content");if(!bOK)throw new Error("Smart Form element must have class 'design_content'.");}
if(Ektron.SmartForm.instances[this.id])throw new RangeError("An instance of SmartForm with this id already exists. ID = "+this.id);Ektron.SmartForm.instances[Ektron.SmartForm.instances.length]=this;Ektron.SmartForm.instances[this.id]=this;this.state="";if(!s_ekXml)s_ekXml=new Ektron.Xml({srcPath:settings.srcPath});Ektron.SmartForm.ekXml=s_ekXml;this.designMode=false;this.selectedField=null;this.isRootLoc=false;Ektron.SmartForm.cache_xmlDocument="";Ektron.SmartForm.prevalidatingForm=false;this.onload=SmartForm_onload;this.onbeforesave=SmartForm_onbeforesave;this.onaftersave=SmartForm_onaftersave;this.localizeString=function(id,defaultString){return this.settings.localizedStrings[id]||defaultString;};this.localizeFormData=SmartForm_localizeFormData;this.isInRichArea=SmartForm_isInRichArea;this.getSelectedField=SmartForm_getSelectedField;this.setSelectedField=SmartForm_setSelectedField;this.getContentElement=Ektron.SmartForm.getContentElement;this.enableExpandCollapse=SmartForm_enableExpandCollapse;this.toggleExpandCollapse=SmartForm_toggleExpandCollapse;this.isRootLocation=SmartForm_isRootLocation;this.autoheight=SmartForm_autoheight;this.qualifySrcPath=SmartForm_qualifySrcPath;this.unqualifySrcPath=SmartForm_unqualifySrcPath;this.replaceSrcPath=SmartForm_replaceSrcPath;this.isFieldButton=Ektron.SmartForm.isFieldButton;this.isDDFieldElement=Ektron.SmartForm.isDDFieldElement;this.selectElement=Ektron.SmartForm.selectElement;for(var i=0;i<Ektron.SmartForm.docEvents.length;i++)
{$ektron(document).bind(Ektron.SmartForm.docEvents[i].name,Ektron.SmartForm.docEvents[i].fnHandler);}
if(!this.repeater)
{this.repeater=new Ektron.SmartForm.Repeater(this.settings);var oElem=document.createElement("div");oElem.id="dsg_validate";oElem.style.display="none";document.body.appendChild(oElem);}
this.state="initialized";};Ektron.SmartForm.onexception=Ektron.OnException.diagException;Ektron.SmartForm.instances=[];var s_ekXml=null;Ektron.SmartForm.findContentElement=function SmartForm_findContentElement(oElem)
{var containingElement=$ektron(oElem).closest(".design_content").get(0);if(!containingElement)containingElement=Ektron.SmartForm.getContentElement();if(!containingElement)return null;return containingElement;};Ektron.SmartForm.findByChildElement=function SmartForm_findByChildElement(oElem)
{var n=Ektron.SmartForm.instances.length;if(1==n)return Ektron.SmartForm.instances[0];if(0==n)return null;var containingElement=Ektron.SmartForm.findContentElement(oElem);if(!containingElement)return null;return Ektron.SmartForm.instances[containingElement.id];};function SmartForm_onload(settings)
{try
{if(settings)$ektron.extend(this.settings,settings);this.settings.langType=this.settings.langType+"";this.repeater.hideContextMenu();if(this.watchdogTimer)
{clearInterval(this.watchdogTimer);this.watchdogTimer=null;}
var oContentElem=this.getContentElement(this.id);if(oContentElem)
{this.designMode=$ektron(oContentElem).hasClass("design_mode_design");var oFormElem=this.getContentElement();this.qualifySrcPath(oFormElem);Ektron.SmartForm.fixMinHeight(oFormElem);Ektron.DataListManager.init({srcPath:this.settings.srcPath,langType:this.settings.langType,ekXml:s_ekXml});Ektron.DataListManager.replaceDataLists(oFormElem);if(this.designMode)
{$ektron("TABLE[ektdesignns_name]").addClass("show_design_border");}
else
{$ektron("TABLE[ektdesignns_name]").removeClass("show_design_border");this.enableExpandCollapse(true,oFormElem);this.localizeFormData(oFormElem);this.repeater.addShortCuts(oFormElem);this.repeater.addMinElements(oFormElem);Ektron.SmartForm.precalcForm(oFormElem);if(this.settings.prevalidate)Ektron.SmartForm.prevalidateForm(oFormElem);}
Ektron.SmartForm.fixContentEditable(oContentElem);}
this.state="loaded";}
catch(ex)
{Ektron.OnException(this,Ektron.OnException.ignoreException,ex,arguments);}}
function SmartForm_onbeforesave()
{try
{if(this.state!="loaded")return;this.repeater.hideContextMenu();if(this.watchdogTimer)
{clearInterval(this.watchdogTimer);this.watchdogTimer=null;}
var oFormElem=this.getContentElement(this.id);if(oFormElem)
{this.setSelectedField(null);Ektron.SmartForm.unfixContentEditable(oFormElem);Ektron.SmartForm.setFormValues(oFormElem);Ektron.SmartForm.recalcForm(oFormElem);if(!this.designMode)
{this.enableExpandCollapse(false,oFormElem);}
Ektron.SmartForm.unfixMinHeight(oFormElem);this.unqualifySrcPath(oFormElem);}
this.state="saving";}
catch(ex)
{Ektron.OnException(this,Ektron.OnException.ignoreException,ex,arguments);}}
function SmartForm_onaftersave()
{try
{if(this.state!="saving")return;var oFormElem=this.getContentElement();if(oFormElem)
{this.qualifySrcPath(oFormElem);Ektron.SmartForm.fixMinHeight(oFormElem);if(!this.designMode)
{this.enableExpandCollapse(true,oFormElem);}
var oContentElem=this.getContentElement(this.id);Ektron.SmartForm.fixContentEditable(oContentElem);}
this.state="loaded";}
catch(ex)
{Ektron.OnException(this,Ektron.OnException.ignoreException,ex,arguments);}}
function SmartForm_localizeFormData(containingElement)
{var oFormElem=this.getContentElement(containingElement);if(!oFormElem)return;var me=this;$ektron(".design_calendar",oFormElem).each(function()
{try
{var strDate=this.getAttribute("datavalue");if(null==strDate||"undefined"==typeof strDate)
{strDate=this.getAttribute("value");}
if("string"==typeof strDate)
{var joElem=$ektron(this).find("input");var oTempDate=Ektron.Xml.parseDate(strDate);if(oTempDate!=null)
{joElem.val(oTempDate.toLocaleDateString());}
else
{joElem.val(strDate);}}}
catch(ex)
{Ektron.OnException(me,Ektron.OnException.ignoreException,ex,arguments);}});}
Ektron.SmartForm.getContentElement=function SmartForm_getContentElement(containingElement)
{var oElem=null;if(!containingElement)
{oElem=document.getElementById(this.id||"design_content");if(Ektron.SmartForm.isEditWithIFrame(oElem))
{oElem=oElem.firstChild.contentWindow.document.body;}
else if(Ektron.SmartForm.isEditWithIFrameCache(oElem))
{oElem=oElem.firstChild.nextSibling;}}
else if("object"==typeof containingElement&&containingElement!=null)
{oElem=containingElement;}
else if("string"==typeof containingElement&&containingElement.length>0)
{oElem=document.getElementById(containingElement);}
else
{oElem=document.getElementById(this.id||"design_content");}
return oElem;};function SmartForm_enableExpandCollapse(bEnable,containingElement)
{if(!this.settings.enableExpandCollapse)return;var oElement=this.getContentElement(containingElement);if(!oElement)return;if(bEnable)
{var sHtml='<a class="design_view_button" href="#" onclick="design_toggleExpandCollapse(this);return false;"><img class="design_view_button" height="11" width="11" border="0" alt="'+this.localizeString("sHide","Hide")+'" title="'+this.localizeString("sHide","Hide")+'" src="'+this.settings.skinPath+'viewcollapsed.gif" /></a>';$ektron("legend:not(:has(a.design_view_button))").prepend(sHtml);}
else
{$ektron("legend > a.design_view_button").remove();}}
function SmartForm_toggleExpandCollapse(oThis)
{try
{if(!oThis)return;var joThis=$ektron(oThis);if(-1==oThis.firstChild.src.indexOf("viewexpanded.gif"))
{oThis.firstChild.src=this.settings.skinPath+"viewexpanded.gif";oThis.firstChild.alt=this.localizeString("sShow","Show");oThis.firstChild.title=this.localizeString("sShow","Show");joThis.parent().next().hide();}
else
{oThis.firstChild.src=this.settings.skinPath+"viewcollapsed.gif";oThis.firstChild.alt=this.localizeString("sHide","Hide");oThis.firstChild.title=this.localizeString("sHide","Hide");joThis.parent().next().show();}}
catch(ex)
{Ektron.OnException(this,Ektron.OnException.ignoreException,ex,arguments);}}
function SmartForm_isRootLocation()
{return this.isRootLoc;}
Ektron.SmartForm.isDDFieldElement=function SmartForm_isDDFieldElement(oElem)
{if(!oElem)return false;if(oElem.nodeType!=1)return false;var name=oElem.getAttribute("ektdesignns_name");if("string"==typeof name&&name.length>0)return true;var bind=oElem.getAttribute("ektdesignns_bind");if("string"==typeof bind&&bind.length>0)return true;return false;};Ektron.SmartForm.isFieldButton=function SmartForm_isFieldButton(oElem)
{if(!oElem)return false;return("IMG"==oElem.tagName&&$ektron(oElem).hasClass("design_fieldbutton"));};Ektron.SmartForm.getFieldFromFieldButton=function SmartForm_getFieldFromFieldButton(oElem)
{var elemField=null;var eField=$ektron(oElem).parents().each(function()
{if($ektron(this).attr("ektdesignns_name")||$ektron(this).attr("ektdesignns_bind"))
{elemField=this;return false;}});return elemField;};function SmartForm_isInRichArea(oElem)
{if(!oElem)return false;var eRichArea=$ektron(oElem).closest(".design_richarea");if(1==eRichArea.length)
{this.selectedField=eRichArea.get(0);return true;}
return false;}
function SmartForm_getSelectedField()
{if(null==this.selectedField)
{var oElem=this.getContentElement();var thisField=getSelectionElement(oElem.ownerDocument);if(Ektron.SmartForm.isDDFieldElement(thisField))
{return thisField;}}
else if(null==this.selectedField.ownerDocument||(this.selectedField.id!=""&&null==this.selectedField.ownerDocument.getElementById(this.selectedField.id)))
{this.selectedField=null;}
else if(null==this.selectedField.parentNode||11==this.selectedField.parentNode.nodeType)
{this.selectedField=null;}
return this.selectedField;}
function SmartForm_setSelectedField(oElem)
{if(oElem)
{this.setSelectedField(null);var joElem=$ektron(oElem);if(this.designMode&&Ektron.SmartForm.isFieldButton(oElem))
{oElem=Ektron.SmartForm.getFieldFromFieldButton(oElem);}
this.selectedField=oElem;if(this.designMode)
{$ektron(this.selectedField).addClass("design_selected_field");}}
else if(this.selectedField!=null)
{$ektron(this.selectedField).removeClass("design_selected_field");this.selectedField=null;}}
Ektron.SmartForm.selectElement=function SmartForm_selectElement(targetElement,selectedField)
{var doc=("#document"==targetElement.nodeName?targetElement:targetElement.ownerDocument);var win=(doc.defaultView?doc.defaultView:doc.parentWindow);var range;if(doc.selection&&!win.opera)
{switch(selectedField.tagName)
{case"TABLE":case"IMG":case"HR":case"INPUT":range=doc.body.createControlRange();range.add(selectedField);break;case"UL":case"OL":range=doc.body.createTextRange();range.moveToElementText(selectedField);var parEl=range.parentElement();if(parEl.tagName!="UL"||parEl.tagName!="OL")
{range.moveEnd("character",-1);}
break;default:range=doc.body.createTextRange();range.moveToElementText(selectedField);break;}
if(range)
{range.select();}}
else if(win.getSelection)
{range=doc.createRange();range.selectNode(selectedField);var selection=win.getSelection();selection.removeAllRanges();selection.addRange(range);}};Ektron.SmartForm.docEvents=[{name:"click",fnHandler:function(event)
{event=(event?event:window.event);var targetElement=(event.target?event.target:event.srcElement);if(targetElement&&targetElement.nodeType!=1)targetElement=targetElement.parentNode;if(targetElement&&targetElement.nodeType!=1)targetElement=null;if(!targetElement)return;var sf=Ektron.SmartForm.findByChildElement(targetElement);if(!sf)return;var selectedField=null;if(sf.designMode)
{sf.setSelectedField(null);var bDone=false;var oElem=targetElement;while(!bDone&&oElem&&oElem.tagName!="BODY")
{switch(oElem.tagName)
{case"INPUT":case"SELECT":case"BUTTON":if(Ektron.SmartForm.isDDFieldElement(oElem))
{selectedField=oElem;bDone=true;}
else
{oElem=oElem.parentNode;}
break;case"TABLE":case"FIELDSET":case"TEXTAREA":if(Ektron.SmartForm.isDDFieldElement(oElem))
{selectedField=oElem;}
else if($ektron(oElem).parent().hasClass("ektdesignns_mergelist"))
{oElem=oElem.parentNode;selectedField=oElem;}
bDone=true;break;case"TD":case"TH":if("false"==oElem.getAttribute("contenteditable"))
{oElem=oElem.parentNode;}
else
{bDone=true;}
break;case"DIV":case"SPAN":if(Ektron.SmartForm.isDDFieldElement(oElem))
{selectedField=oElem;bDone=true;}
else if("design_membrane"==oElem.className.toLowerCase())
{bDone=true;}
else
{oElem=oElem.parentNode;}
break;case"LABEL":var id=oElem.htmlFor;oElem=oElem.ownerDocument.getElementById(id);break;case"IMG":case"A":if(false==Ektron.SmartForm.isDDFieldElement(oElem))
{selectedField=oElem;bDone=true;}
break;default:oElem=oElem.parentNode;break;}}
sf.isRootLoc=false;if(!bDone)
{sf.isRootLoc=true;}
else if(oElem&&oElem.parentNode)
{if(("DIV"==oElem.parentNode.tagName&&this.id==oElem.parentNode.id)||("BODY"==oElem.tagName))
{sf.isRootLoc=true;}
else if(this.selectedField||"BODY"==oElem.parentNode.tagName)
{sf.isRootLoc=true;}}
if(selectedField)
{sf.setSelectedField(selectedField);Ektron.SmartForm.selectElement(targetElement,selectedField);}}
else
{var oElem=targetElement;if("IMG"==oElem.tagName&&"design_fieldbutton"==oElem.className)
{var doc=("#document"==targetElement.nodeName?targetElement:targetElement.ownerDocument);var win=(doc.defaultView?doc.defaultView:doc.parentWindow);Ektron.ContentDesigner.raiseEvent(win,"onFieldButtonClick",[event,win,oElem,sf.settings]);}
else if("A"==oElem.tagName&&(window.name.indexOf("RadEContentIframe")>-1||true==Ektron.SmartForm.isDDFieldElement(oElem.parentNode)))
{return false;}}}}];if($ektron.browser.msie&&parseInt($ektron.browser.version,10)>=8)
{Ektron.SmartForm.docEvents.push({name:"mouseup",fnHandler:function(event)
{setSmartFormSelectedRange(event);}});Ektron.SmartForm.docEvents.push({name:"keyup",fnHandler:function(event)
{setSmartFormSelectedRange(event);}});function setSmartFormSelectedRange(event)
{event=(event?event:window.event);var targetElement=(event.target?event.target:event.srcElement);if(targetElement&&targetElement.nodeType!=1)targetElement=targetElement.parentNode;if(targetElement&&targetElement.nodeType!=1)targetElement=null;if(!targetElement)return;var sf=Ektron.SmartForm.findByChildElement(targetElement);if(!sf)return;if(sf.designMode)
{var doc=("#document"==targetElement.nodeName?targetElement:targetElement.ownerDocument);var win=(doc.defaultView?doc.defaultView:doc.parentWindow);var sel=doc.selection;var rng=ekCreateRange(sel);win.ekSmartFormSelectedRange=rng;}}}
Ektron.SmartForm.fixMinHeight=function SmartForm_fixMinHeight(containingElement)
{if($ektron.browser.msie&&"BackCompat"==document.compatMode)
{var aryElems=containingElement.getElementsByTagName("div");for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];if(oElem.currentStyle.minHeight!="auto")
{oElem.style.height=oElem.currentStyle.minHeight;}}}};Ektron.SmartForm.unfixMinHeight=function SmartForm_unfixMinHeight(containingElement)
{if($ektron.browser.msie&&"BackCompat"==document.compatMode)
{var aryElems=containingElement.getElementsByTagName("div");for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];if(oElem.currentStyle.minHeight!="auto")
{oElem.style.height="";}}}};function SmartForm_qualifySrcPath(containingElement)
{try
{this.replaceSrcPath(containingElement,/.*(\[|%5B)skinpath(\]|%5D)/,this.settings.skinPath);this.replaceSrcPath(containingElement,/.*(\[|%5B)srcpath(\]|%5D)btn/,this.settings.skinPath+"btn");this.replaceSrcPath(containingElement,/.*(\[|%5B)srcpath(\]|%5D)additem.gif/,this.settings.skinPath+"additem.gif");this.replaceSrcPath(containingElement,/.*(\[|%5B)srcpath(\]|%5D)designmenu.gif/,this.settings.skinPath+"designmenu.gif");this.replaceSrcPath(containingElement,/.*(\[|%5B)srcpath(\]|%5D)/,this.settings.srcPath);}
catch(ex)
{Ektron.OnException(this,Ektron.OnException.ignoreException,ex,arguments);}}
function SmartForm_unqualifySrcPath(containingElement)
{try
{this.replaceSrcPath(containingElement,new RegExp(".*"+this.settings.srcPath),"[srcpath]");this.replaceSrcPath(containingElement,new RegExp(".*"+this.settings.skinPath),"[skinpath]");}
catch(ex)
{Ektron.OnException(this,Ektron.OnException.ignoreException,ex,arguments);}}
function SmartForm_replaceSrcPath(containingElement,reSrcPath,strReplacement)
{var oElement=this.getContentElement(containingElement);if(!oElement)return;var imgTags=oElement.getElementsByTagName("img");var strClass;var strSrc;for(var i=0;i<imgTags.length;i++)
{strClass=imgTags[i].className+"";if(0==strClass.indexOf("design_"))
{strSrc=imgTags[i].src+"";if(strSrc.length>0)
{imgTags[i].src=strSrc.replace(reSrcPath,strReplacement);}}}}
function SmartForm_autoheight()
{var me=this;var bindEvents=!this.settings.autoheightActive;this.settings.autoheightActive=true;if(bindEvents)
{$ektron().bind($ektron.fn.autoheight.triggerName,function()
{Ektron.ContentDesigner.raiseEvent(window,"onAutoheight",[me.settings]);});}
$ektron("iframe.contenteditable").autoheight({bindEvents:bindEvents});$ektron("iframe.contenteditable",this.getContentElement()).autoheight({bindEvents:bindEvents});}
if(typeof Ektron.ContentDesigner!="object")Ektron.ContentDesigner={};Ektron.ContentDesigner.raiseEvent=function(win,eventName,args)
{if(win.parent&&win.parent.Ektron&&win.parent.Ektron.ContentDesigner)
{var fnEventHandler=win.parent.Ektron.ContentDesigner[eventName];if("function"==typeof fnEventHandler)
{fnEventHandler.apply(win.parent.Ektron.ContentDesigner,args);}}};if(!Ektron.ContentDesigner.trace)
{Ektron.ContentDesigner.trace=function()
{if(typeof console!="undefined"&&console&&console.log&&document.cookie&&document.cookie.indexOf("ContentDesigner.console=")>-1)
{console.log.apply(console,arguments);}};}})();if(!Ektron.SmartForm.fixContentEditable)(function()
{Ektron.SmartForm.fixContentEditable=function SmartForm_fixContentEditable(containingElement)
{if($ektron.browser.mozilla)
{var oElem=containingElement;if("true"==oElem.getAttribute("contenteditable")&&oElem.className!="design_iframe_membrane")
{Ektron.SmartForm.editContentsWithIFrame(oElem);Ektron.SmartForm.showParentIFrameScrollbars(oElem,false);}
else
{var aryElems=containingElement.getElementsByTagName("div");for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];if("true"==oElem.getAttribute("contenteditable")&&oElem.className!="design_iframe_membrane")
{Ektron.SmartForm.editContentsWithIFrame(oElem);}}}}};Ektron.SmartForm.unfixContentEditable=function SmartForm_unfixContentEditable(containingElement)
{if($ektron.browser.mozilla)
{var oElem=containingElement;if("true"==oElem.getAttribute("contenteditable")&&oElem.className!="design_iframe_membrane")
{Ektron.SmartForm.replaceIFrameWithContents(oElem);Ektron.SmartForm.showParentIFrameScrollbars(oElem,true);}
else
{var aryElems=containingElement.getElementsByTagName("div");for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];if("true"==oElem.getAttribute("contenteditable")&&oElem.className!="design_iframe_membrane")
{Ektron.SmartForm.replaceIFrameWithContents(oElem);}}}}};Ektron.SmartForm.isEditWithIFrame=function SmartForm_isEditWithIFrame(oElem)
{return(oElem&&oElem.hasChildNodes()&&"IFRAME"==oElem.firstChild.tagName&&"contenteditable"==oElem.firstChild.className&&oElem.firstChild.contentWindow&&oElem.firstChild.contentWindow.document);};Ektron.SmartForm.isEditWithIFrameCache=function SmartForm_isEditWithIFrameCache(oElem)
{return(oElem&&oElem.hasChildNodes()&&"IFRAME"==oElem.firstChild.tagName&&"design_cache"==oElem.firstChild.className);};Ektron.SmartForm.removeCachedIFrames=function SmartForm_removeCachedIFrames(oElem)
{$ektron("iframe.design_cache",oElem).remove();$ektron(oElem).find("div.design_iframe_membrane").each(function()
{$ektron(this).unwrap();});};Ektron.SmartForm.editContentsWithIFrame=function SmartForm_editContentsWithIFrame(oElem)
{if(Ektron.SmartForm.isEditWithIFrame(oElem))
{return;}
else if(Ektron.SmartForm.isEditWithIFrameCache(oElem))
{oElem.firstChild.className="contenteditable";oElem.firstChild.nextSibling.innerHTML="";}
else
{var sf=Ektron.SmartForm.findByChildElement(oElem);var strId="";if(oElem.id)
{strId="&id="+oElem.id;}
var strCssFile="";if(sf.settings.CssFilesArray)
{for(var i=0;i<sf.settings.CssFilesArray.length;i++)
{strCssFile="&css"+i+"="+sf.settings.CssFilesArray[i];}}
var strHeight="";if(sf.designMode)
{strHeight="&height=99%";}
var oIFrame=oElem.ownerDocument.createElement("iframe");oIFrame.src=sf.settings.srcPath+"ekformsiframe.aspx?eca="+sf.settings.editorSkinPath+"EditorContentArea.css&skin="+sf.settings.skinPath+"ektron.smartForm.css"+strCssFile+strHeight+strId;oIFrame.className="contenteditable";oIFrame.frameBorder="0";oIFrame.marginHeight=0;oIFrame.marginWidth=0;oElem.contentCache=$ektron(oElem).html();oIFrame.onload=function iframeOnLoad()
{var oWin=this.contentWindow;var oDoc=oWin.document;var eDoc=$ektron(oDoc);if(!sf.designMode)
{$ektron(oDoc.body).addClass("design_richarea");}
for(var i=0;i<Ektron.SmartForm.docEvents.length;i++)
{eDoc.bind(Ektron.SmartForm.docEvents[i].name,Ektron.SmartForm.docEvents[i].fnHandler);}
if(oElem.onblur)
{eDoc.blur(function(event){oElem.onblur();});}
if(oElem.onfocus)
{eDoc.focus(function(event){oElem.onfocus(oElem);});}
eDoc.focus(function(event)
{event=(event?event:window.event);var targetElement=(event.target?event.target:event.srcElement);var oFieldElem=event.explicitOriginalTarget;if(oFieldElem&&"OPTION"==oFieldElem.tagName)
{oFieldElem=oFieldElem.parentNode;}
if("undefined"==typeof oFieldElem)
{var selection=oWin.getSelection();var rng=null;if(selection.getRangeAt)
{if(selection.rangeCount>0)
{rng=selection.getRangeAt(0);var selectedContent=rng.cloneContents();var targetNodes=selectedContent.childNodes;if(11==selectedContent.nodeType&&1==targetNodes.length&&1==targetNodes[0].nodeType&&targetNodes[0].id.length>0)
{oFieldElem=oDoc.getElementById(targetNodes[0].id);}}}}
if(oFieldElem&&"SELECT"==oFieldElem.tagName&&Ektron.SmartForm.isDDFieldElement(oFieldElem))
{sf.selectedField=oFieldElem;Ektron.SmartForm.selectElement(targetElement,sf.selectedField);}
if(!sf.designMode)
{Ektron.ContentDesigner.raiseEvent(oWin,"onContentWindowChange",[oWin,oElem,sf.settings]);}});eDoc.mouseup(function(event)
{event=(event?event:window.event);var targetElement=(event.target?event.target:event.srcElement);var sel=oWin.getSelection();if(sel.rangeCount>0)
{var rng=sel.getRangeAt(0);var selectedContent=rng.cloneContents();var targetNodes=selectedContent.childNodes;if(11==selectedContent.nodeType)
{for(var i=0;i<targetNodes.length;i++)
{var thisNode=targetNodes[i];if(1==thisNode.nodeType&&"SELECT"==thisNode.tagName&&Ektron.SmartForm.isDDFieldElement(thisNode))
{oFieldElem=oDoc.getElementById(thisNode.id);sf.selectedField=oFieldElem;Ektron.SmartForm.selectElement(targetElement,sf.selectedField);break;}}}}});eDoc.bind("contextmenu",function(event)
{event=(event?event:window.event);var targetElement=(event.target?event.target:event.srcElement);var doc=("#document"==targetElement.nodeName?targetElement:targetElement.ownerDocument);var win=(doc.defaultView?doc.defaultView:doc.parentWindow);Ektron.ContentDesigner.raiseEvent(win,"onContextMenu",[event,win,oElem,sf.settings]);});var mc_PreserveUrlAttr="data-ektron-url";var mc_UrlAttrs=["href","src","background","dynsrc"];eDoc.keypress(function(event)
{event=(event?event:window.event);var bContentEditable=true;var oNode=getSelectionElement(this);while(oNode!=null)
{if("function"==typeof oNode.getAttribute)
{var sContEdit=oNode.getAttribute("contenteditable");if("false"==sContEdit)
{bContentEditable=false;break;}
else if("true"==sContEdit)
{bContentEditable=true;break;}}
oNode=oNode.parentNode;}
if(!bContentEditable)
{if("function"==typeof event.preventDefault)event.preventDefault();}
return bContentEditable;});eDoc.keyup(function(event)
{event=(event?event:window.event);if(event.ctrlKey&&"V".charCodeAt(0)==event.keyCode&&!event.shiftKey&&!event.altKey)
{$ektron("["+mc_PreserveUrlAttr+"]",this).each(function()
{for(var i=0;i<mc_UrlAttrs.length;i++)
{var attr=mc_UrlAttrs[i];if(this.hasAttribute(attr))
{var ektValue=this.getAttribute(mc_PreserveUrlAttr);var value=this.getAttribute(attr);if(ektValue!=value)
{this.setAttribute(attr,ektValue);}
break;}}});}});var m_preserveList=[];function m_preserveUrl()
{var bPreserved=false;for(var i=0;i<mc_UrlAttrs.length;i++)
{var attr=mc_UrlAttrs[i];if(this.hasAttribute(attr))
{var value=this.getAttribute(attr);this.setAttribute(mc_PreserveUrlAttr,value);bPreserved=true;}}
if(bPreserved)
{var id=this.id;if(!id)
{id=mc_PreserveUrlAttr+Math.floor(Math.random()*1679616).toString(36);this.id=id;}
m_preserveList.push(id);}}
function m_restoreUrl(event)
{if(m_preserveList.length>0)
{for(var i=0;i<m_preserveList.length;i++)
{var id=m_preserveList[i];var oElem=$ektron("#"+id,oDoc).get(0);if(oElem)
{for(var j=0;j<mc_UrlAttrs.length;j++)
{var attr=mc_UrlAttrs[j];if(oElem.hasAttribute(attr)&&oElem.hasAttribute(mc_PreserveUrlAttr))
{var ektValue=oElem.getAttribute(mc_PreserveUrlAttr);var value=oElem.getAttribute(attr);if(ektValue!=value)
{oElem.setAttribute(attr,ektValue);}
break;}}
if(0==oElem.id.indexOf(mc_PreserveUrlAttr))
{oElem.id="";oElem.removeAttribute("id");}}}
m_preserveList=[];}}
eDoc.mousedown(function(event)
{event=(event?event:window.event);var targetElement=(event.target?event.target:event.srcElement);var sel=oWin.getSelection();if(sel.rangeCount>0)
{var rng=sel.getRangeAt(0);var node=rng.commonAncestorContainer;if(1==node.nodeType)
{$ektron(node).children().each(m_preserveUrl);}}
if(targetElement&&1==targetElement.nodeType)
{$ektron(targetElement).children().andSelf().each(m_preserveUrl);}});eDoc.mouseup(m_restoreUrl);eDoc.mouseout(m_restoreUrl);if(""==oElem.contentCache)
{oElem.contentCache="<p>&#160;</p>";}
try
{oDoc.designMode="on";}
catch(ex)
{Ektron.ContentDesigner.raiseEvent(oWin,"onexception",[new Error("Failed to set designMode. Error: "+ex.message),arguments]);}
$ektron(oDoc.body).html(oElem.contentCache);oElem.contentCache=null;if(sf.designMode)
{Ektron.ContentDesigner.raiseEvent(oWin,"onContentWindowChange",[oWin,oElem,sf.settings]);}
var oFormElem=sf.getContentElement();if(oFormElem)
{if(!sf.designMode)
{Ektron.SmartForm.precalcForm(oFormElem);if(sf.settings.prevalidate)Ektron.SmartForm.prevalidateForm(oFormElem);}}};if(true==sf.settings.autoheightActive)
{$ektron(oIFrame.ownerDocument).bind($ektron.fn.autoheight.triggerName,function()
{Ektron.ContentDesigner.raiseEvent(window,"onAutoheight",[sf.settings]);});$ektron(oIFrame).autoheight();}
else if(!sf.designMode)
{$ektron(oIFrame).autoheight();}
while(oElem.hasChildNodes())
{oElem.removeChild(oElem.firstChild);}
oElem.appendChild(oIFrame);var oMembrane=oElem.ownerDocument.createElement("div");oMembrane.className="design_iframe_membrane";oMembrane.setAttribute("contenteditable","true");oElem.appendChild(oMembrane);oMembrane=null;oIFrame=null;}};Ektron.SmartForm.replaceIFrameWithContents=function SmartForm_replaceIFrameWithContents(oElem)
{if(Ektron.SmartForm.isEditWithIFrame(oElem))
{if("string"==typeof oElem.contentCache)
{$ektron(oElem).html(oElem.contentCache);}
else
{$ektron(oElem.firstChild.nextSibling).html($ektron(oElem.firstChild.contentWindow.document.body).html());oElem.firstChild.className="design_cache";}}};Ektron.SmartForm.showParentIFrameScrollbars=function SmartForm_showParentIFrameScrollbars(oElem,bShow)
{try
{document.body.style.padding=(bShow?"":"0px;");oElem.style.padding=(bShow?"":"0px;");oElem.ownerDocument.defaultView.frameElement.style.overflow=(bShow==false?"hidden":"auto");}
catch(ex)
{Ektron.OnException(Ektron.SmartForm,Ektron.OnException.ignoreException,ex,arguments);}};})();if(typeof Ektron.ContentDesigner!="object")Ektron.ContentDesigner={};if("undefined"==typeof Ektron.ContentDesigner.bubbleUpEvent)
{Ektron.ContentDesigner.bubbleUpEvent=function(eventName)
{if(typeof this[eventName]!="function")
{this[eventName]=function()
{if(window!=window.parent)
{this.raiseEvent(window,eventName,arguments);}};}};Ektron.ContentDesigner.bubbleUpEvent("onexception");Ektron.ContentDesigner.bubbleUpEvent("onContentWindowChange");Ektron.ContentDesigner.bubbleUpEvent("onFieldButtonClick");Ektron.ContentDesigner.bubbleUpEvent("onContextMenu");Ektron.ContentDesigner.bubbleUpEvent("onAutoheight");};if(!Ektron.SmartForm.Repeater)(function()
{Ektron.SmartForm.Repeater=function SmartForm_Repeater(settings)
{this.settings=settings;this.onexception=settings.onexception;this.current=null;this.prototype=null;this.setCurrent_event_srcElement=null;this.localizeString=function(id,defaultString){return this.settings.localizedStrings[id]||defaultString;};this.setFocus=SmartForm_Repeater_setFocus;this.setCurrent=SmartForm_Repeater_setCurrent;this.setPrototype=SmartForm_Repeater_setPrototype;this.getRowSection=SmartForm_Repeater_getRowSection;this.insert=SmartForm_Repeater_insert;this.getTemplateElement=SmartForm_Repeater_getTemplateElement;this.isRow=SmartForm_Repeater_isRow;this.addShortCuts=SmartForm_Repeater_addShortCuts;this.addMinElements=SmartForm_Repeater_addMinElements;this.numElements=SmartForm_Repeater_numElements;this.getMax=SmartForm_Repeater_getMax;this.getMin=SmartForm_Repeater_getMin;this.atMax=SmartForm_Repeater_atMax;this.atMin=SmartForm_Repeater_atMin;this.insertAbove_disabled=SmartForm_Repeater_insertAbove_disabled;this.insertAbove=SmartForm_Repeater_insertAbove;this.insertBelow_disabled=SmartForm_Repeater_insertBelow_disabled;this.insertBelow=SmartForm_Repeater_insertBelow;this.duplicate_disabled=SmartForm_Repeater_duplicate_disabled;this.duplicate=SmartForm_Repeater_duplicate;this.remove_disabled=SmartForm_Repeater_remove_disabled;this.remove=SmartForm_Repeater_remove;this.moveUp_disabled=SmartForm_Repeater_moveUp_disabled;this.moveUp=SmartForm_Repeater_moveUp;this.moveDown_disabled=SmartForm_Repeater_moveDown_disabled;this.moveDown=SmartForm_Repeater_moveDown;this.replace=SmartForm_Repeater_replace;this.insertRows=SmartForm_Repeater_insertRows;this.showContextMenu=SmartForm_Repeater_showContextMenu;this.hideContextMenu=SmartForm_Repeater_hideContextMenu;};Ektron.SmartForm.Repeater.onexception=Ektron.SmartForm.onexception;function SmartForm_Repeater_setFocus(oRow)
{this.setCurrent(null,oRow);var oElem=$ektron(":input:first",oRow).get(0);if(oElem)
{setTimeout(function()
{try
{oElem.focus();}catch(ex){}},1);}}
function SmartForm_Repeater_setCurrent(event,oRow)
{if(event)
{if(this.setCurrent_event_srcElement==event.srcElement)
{return;}
else
{this.setCurrent_event_srcElement=event.srcElement;}}
if(this.current)Ektron.SmartForm.Repeater.highlight(this.current,false);this.current=oRow;var oPrototype=$ektron(oRow).parent().parent().get(0).tFoot.rows[1];this.setPrototype(oPrototype);}
function SmartForm_Repeater_setPrototype(oRow)
{this.prototype=oRow;}
function SmartForm_Repeater_getRowSection(oRow)
{return $ektron(oRow).parent().get(0);}
function SmartForm_Repeater_insert(oPrototype,index)
{var oSection=this.getRowSection(this.current);var oRow=oSection.insertRow(index);Ektron.SmartForm.unfixContentEditable(oPrototype);var newRow=$ektron(oPrototype).clone(true).removeAttr("id").makeIdentifiersUnique();$ektron(oRow).replaceWith(newRow);oRow=oSection.rows[index];Ektron.SmartForm.prevalidateElement(oRow,null);this.setFocus(oRow);Ektron.SmartForm.removeCachedIFrames(oRow);Ektron.SmartForm.fixContentEditable(oPrototype);Ektron.SmartForm.fixContentEditable(oRow);}
function SmartForm_Repeater_getTemplateElement()
{var oElem=null;var oSection=this.getRowSection(this.current);var listitemTemplate=oSection.getAttribute("ektdesignns_listitem_template");if("string"==typeof listitemTemplate)
{oElem=$ektron(oSection).parent().get(0).getElementById(listitemTemplate);}
else
{if(Ektron.SmartForm.isDDFieldElement(this.prototype))
{oElem=this.prototype;}
else
{oElem=$ektron(this.prototype.cells[1]).children().get(0);}}
return oElem;}
function SmartForm_Repeater_isRow(oElem)
{if(!oElem)return false;if(!oElem.onclick)return false;if($ektron(oElem).children().get(0).colSpan>1)return false;return true;}
function SmartForm_Repeater_addShortCuts(containingElement)
{var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(!oFormElem)return;try
{var me=this;$ektron("input:text[ektdesignns_maxoccurs]",oFormElem).keydown(function(e)
{switch(e.which)
{case 8:if(""==this.value)
{setTimeout(function()
{me.remove();},1);}
break;case 13:setTimeout(function()
{me.insertBelow();},1);break;case 38:var oSibling=$ektron(me.current).prev().get(0);if(me.isRow(oSibling))
{setTimeout(function()
{me.setFocus(oSibling);},1);}
break;case 40:var oSibling=$ektron(me.current).next().get(0);if(me.isRow(oSibling))
{setTimeout(function()
{me.setFocus(oSibling);},1);}
break;default:}});}
catch(ex)
{Ektron.OnException(this,Ektron.OnException.ignoreException,ex,arguments);}}
function SmartForm_Repeater_addMinElements(containingElement)
{var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(!oFormElem)return;try
{var oElem;var oParentElem;var strAddMin;var nMinToAdd;var strID;var aryElems=oFormElem.getElementsByTagName("td");if(!aryElems)return;for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];strAddMin=oElem.getAttribute("ektdesignns_addmin");if(strAddMin!=null&&"string"==typeof strAddMin&&strAddMin.length>0)
{nMinToAdd=parseInt(strAddMin,10);oParentElem=$ektron(oElem).parent().get(0);strID=oParentElem.id+"";if(strID.length>0&&nMinToAdd>0)
{this.insertRows(strID,nMinToAdd);}}}}
catch(ex)
{Ektron.OnException(this,Ektron.OnException.ignoreException,ex,arguments);}}
function SmartForm_Repeater_numElements(oSection)
{var joSectionChildren=$ektron(oSection).children();var nChildren=joSectionChildren.length;var nElements=nChildren;for(var i=0;i<nChildren;i++)
{if(!this.isRow(joSectionChildren.get(i)))
{nElements--;}}
return nElements;}
function SmartForm_Repeater_getMax()
{var oElem=this.getTemplateElement();var vLimit=oElem.getAttribute("ektdesignns_maxoccurs");var nLimit=1;if("string"==typeof vLimit)
{if("unbounded"==vLimit)
{return"unbounded";}
else
{nLimit=parseInt(vLimit,10);}}
else if("number"==typeof vLimit)
{nLimit=vLimit;}
return nLimit;}
function SmartForm_Repeater_getMin()
{var oElem=this.getTemplateElement();var vLimit=oElem.getAttribute("ektdesignns_minoccurs");var strUse=oElem.getAttribute("ektdesignns_use");var nLimit=1;if("optional"==strUse)
{nLimit=0;}
if("string"==typeof vLimit)
{nLimit=parseInt(vLimit,10);}
else if("number"==typeof vLimit)
{nLimit=vLimit;}
return nLimit;}
function SmartForm_Repeater_atMax()
{var max=this.getMax();if("unbounded"==max)return false;var oSection=this.getRowSection(this.current);var numElements=this.numElements(oSection);return(numElements>=max);}
function SmartForm_Repeater_atMin()
{var min=this.getMin();var oSection=this.getRowSection(this.current);var numElements=this.numElements(oSection);return(numElements<=min);}
function SmartForm_Repeater_insertAbove_disabled()
{return this.atMax();}
function SmartForm_Repeater_insertAbove()
{if(!this.insertAbove_disabled())
{this.insert(this.prototype,this.current.sectionRowIndex);}
this.hideContextMenu();}
function SmartForm_Repeater_insertBelow_disabled()
{return this.atMax();}
function SmartForm_Repeater_insertBelow()
{if(!this.insertBelow_disabled())
{this.insert(this.prototype,this.current.sectionRowIndex+1);}
this.hideContextMenu();}
function SmartForm_Repeater_duplicate_disabled()
{return this.atMax();}
function SmartForm_Repeater_duplicate()
{if(!this.duplicate_disabled())
{Ektron.SmartForm.Repeater.highlight(this.current,false);this.insert(this.current,this.current.sectionRowIndex);}
this.hideContextMenu();}
function SmartForm_Repeater_remove_disabled()
{return this.atMin();}
function SmartForm_Repeater_remove()
{if(!this.remove_disabled())
{var oSection=this.getRowSection(this.current);if(this.isRow(this.current))
{var max=this.getMax();if(max!=="unbounded"&&1===this.numElements(oSection))
{var cur=this.current;this.insert($ektron(this.prototype).prev().get(0),this.current.sectionRowIndex+1);this.current=cur;}}
var eCur=$ektron(this.current);var oSibling=eCur.prev().get(0);if(!this.isRow(oSibling))
{oSibling=eCur.next().get(0);}
eCur.remove();this.current=null;if(this.isRow(oSibling))
{this.setFocus(oSibling);}}
this.hideContextMenu();}
function SmartForm_Repeater_moveUp_disabled()
{var oSibling=$ektron(this.current).prev().get(0);return(!this.isRow(oSibling));}
function SmartForm_Repeater_moveUp()
{if(!this.moveUp_disabled())
{var oRow=$ektron(this.current).prev().get(0);Ektron.SmartForm.unfixContentEditable(oRow);$ektron(this.current).prev().insertAfter(this.current);Ektron.SmartForm.removeCachedIFrames(oRow);Ektron.SmartForm.fixContentEditable(oRow);}
this.hideContextMenu();}
function SmartForm_Repeater_moveDown_disabled()
{var oSibling=$ektron(this.current).next().get(0);return(!this.isRow(oSibling));}
function SmartForm_Repeater_moveDown()
{if(!this.moveDown_disabled())
{var oRow=$ektron(this.current).next().get(0);Ektron.SmartForm.unfixContentEditable(oRow);$ektron(this.current).next().insertBefore(this.current);Ektron.SmartForm.removeCachedIFrames(oRow);Ektron.SmartForm.fixContentEditable(oRow);}
this.hideContextMenu();}
function SmartForm_Repeater_replace()
{var cur=this.current;this.insert(this.prototype,this.current.sectionRowIndex+1);this.current=cur;this.remove();}
function SmartForm_Repeater_insertRows(id,nCount)
{var oRow=document.getElementById(id);if(oRow)
{this.setCurrent(null,oRow);for(var i=0;i<nCount;i++)
{this.insertAbove();}
$ektron(oRow).remove();}}
Ektron.SmartForm.Repeater.highlight=function SmartForm_Repeater_highlight(oRow,bOn)
{var re=new RegExp((bOn?"_normal":"_hover"));var strReplace=(bOn?"_hover":"_normal");var oCell=null;for(var i=0;i<oRow.cells.length;i++)
{oCell=oRow.cells[i];oCell.className=oCell.className.replace(re,strReplace);}};function SmartForm_Repeater_showContextMenu(event,oElem)
{this.setCurrent(event,$ektron(oElem).parent().parent().get(0));Ektron.SmartForm.Repeater.highlight(this.current,true);if(!this.contextMenu)
{this.contextMenu=new Ektron.SmartForm.Repeater.ContextMenu(this.settings);var me=this;$ektron(document.body).click(function SmartForm_Repeater_body_click(event)
{event=(event?event:window.event);var oElem=event.srcElement;if(!oElem.menutype)
{me.hideContextMenu();}});}
this.contextMenu.show(event,oElem);}
function SmartForm_Repeater_hideContextMenu()
{if(this.contextMenu)this.contextMenu.hide();if(this.current)Ektron.SmartForm.Repeater.highlight(this.current,false);}
Ektron.SmartForm.Repeater.ContextMenu=function SmartForm_Repeater_ContextMenu(settings)
{this.settings=settings;this.localizeString=function(id,defaultString){return this.settings.localizedStrings[id]||defaultString;};this.isVisible=SmartForm_Repeater_ContextMenu_isVisible;this.update=SmartForm_Repeater_ContextMenu_update;this.show=SmartForm_Repeater_ContextMenu_show;this.hide=SmartForm_Repeater_ContextMenu_hide;this.createMenuElement=SmartForm_Repeater_ContextMenu_createMenuElement;this.contextMenuElement=this.createMenuElement();document.body.appendChild(this.contextMenuElement.parentNode);};function SmartForm_Repeater_ContextMenu_createMenuElement()
{var oMenuItems=[{action:"design_row_insertAbove",caption:this.localizeString("mnuInsAbv","Insert Above"),icon:"insabove"},{action:"design_row_insertBelow",caption:this.localizeString("mnuInsBel","Insert Below"),icon:"insbelow"},{action:"design_row_duplicate",caption:this.localizeString("mnuDupl","Duplicate"),icon:"duplicate"},{action:"design_row_moveUp",caption:this.localizeString("mnuMvUp","Move Up"),icon:"moveup"},{action:"design_row_moveDown",caption:this.localizeString("mnuMvDn","Move Down"),icon:"movedown"},{action:"design_row_remove",caption:this.localizeString("mnuRem","Remove"),icon:"remove"}];var oContainer=document.createElement("div");oContainer.contentEditable=false;oContainer.unselectable="on";oContainer.className="design_container";var oElem=document.createElement("div");oContainer.appendChild(oElem);oElem.className="design_contextmenu";oElem.style.display="none";oElem.style.visibility="hidden";var oTable=document.createElement("table");oElem.appendChild(oTable);oTable.cellSpacing=0;oTable.cellPadding=0;oTable.border=0;var oTBody=document.createElement("tbody");oTable.appendChild(oTBody);var oRow=null;var oCell=null;var oItem=null;var strBeginHTML='';var strEndHTML='</a>';for(var i=0;i<oMenuItems.length;i++)
{oItem=oMenuItems[i];oRow=oTBody.insertRow(oTBody.rows.length);oRow.setAttribute("ektdesignns_action",oItem.action);oCell=oRow.insertCell(oRow.cells.length);strBeginHTML='<a class="design_menuitem" href="#" onclick="if(!this.isDisabled){'+oItem.action+'()};return false;" menutype="menuitem"><img src="'+this.settings.skinPath+oItem.icon+'.gif" width="16" height="16" border="0"/>';oCell=oRow.insertCell(oRow.cells.length);oCell.innerHTML=strBeginHTML+oItem.caption+strEndHTML;}
return oContainer.firstChild;}
function SmartForm_Repeater_ContextMenu_isVisible()
{return(this.contextMenuElement.style.visibility!="hidden");}
function SmartForm_Repeater_ContextMenu_update()
{var strAction="";var bDisabled=false;var oRow=null;var oElem=null;var strSrc;var imgTags;var oTable=this.contextMenuElement.firstChild;var oTBody=oTable.tBodies[0];for(iRow=0;iRow<oTBody.rows.length;iRow++)
{oRow=oTBody.rows[iRow];strAction=oRow.getAttribute("ektdesignns_action");bDisabled=(window[strAction+'_disabled'])();oRow.disabled=bDisabled;if(bDisabled)
{$ektron(".design_menuitem",oRow).each(function()
{this.className="design_menuitem_disabled";$ektron("img",this).each(function()
{strSrc=this.src+"";this.src=strSrc.replace(/\.gif/,"_disabled.gif");});});}
else
{$ektron(".design_menuitem_disabled",oRow).each(function()
{this.className="design_menuitem";$ektron("img",this).each(function()
{strSrc=this.src+"";this.src=strSrc.replace(/_disabled\.gif/,".gif");});});}}}
function SmartForm_Repeater_ContextMenu_show(event,oElem)
{this.update();var offset=$ektron(oElem).offset();var x=offset.left+oElem.offsetWidth;var y=offset.top;Ektron.SmartForm.showWindowedControls(false);var oStyle=this.contextMenuElement.style;oStyle.left=x+"px";oStyle.top=y+"px";oStyle.display="block";oStyle.visibility="visible";event.cancelBubble=true;}
function SmartForm_Repeater_ContextMenu_hide()
{if(typeof this.contextMenuElement!="undefined"&&this.contextMenuElement!=null)
{oStyle=this.contextMenuElement.style;oStyle.display="none";oStyle.visibility="hidden";}
Ektron.SmartForm.showWindowedControls(true);}})();if(!Ektron.SmartForm.showWindowedControls)
{Ektron.SmartForm.showWindowedControls=function SmartForm_showWindowedControls(bShow)
{if(bShow)
{$ektron(".design_selectwrapper").each(function()
{var eThis=$ektron(this);eThis.after(eThis.contents()).remove();});}
else
{var oNewElem=document.createElement("span");oNewElem.contentEditable=false;oNewElem.className="design_selectwrapper";$ektron("select").each(function()
{var eThis=$ektron(this);if(0==eThis.parents(".design_selectwrapper").length)
{eThis.wrap(oNewElem);}});}
if(!bShow)
{if(typeof document.selection!="undefined")
{if("function"==typeof document.selection.empty)
{document.selection.empty();}}}};}
function design_row_onmouse(event,oSource)
{var oRow=$ektron(oSource).parent().parent().get(0);var contextMenu=null;var sf=Ektron.SmartForm.findByChildElement(oRow);if(sf)contextMenu=sf.repeater.contextMenu;if(!contextMenu||!contextMenu.isVisible())
{Ektron.SmartForm.Repeater.highlight(oRow,(event.type=="mouseover"));}}
function design_row_showContextMenu(event,oElem)
{var sf=Ektron.SmartForm.findByChildElement(oElem);if(sf)Ektron.SmartForm.Repeater.current=sf.repeater;if(sf)return sf.repeater.showContextMenu.apply(sf.repeater,arguments);}
function design_row_setCurrent(event,oRow)
{var sf=Ektron.SmartForm.findByChildElement(oRow);if(sf)Ektron.SmartForm.Repeater.current=sf.repeater;if(sf)return sf.repeater.setCurrent.apply(sf.repeater,arguments);}
function design_row_insertAbove()
{return Ektron.SmartForm.Repeater.current.insertAbove();}
function design_row_insertBelow()
{return Ektron.SmartForm.Repeater.current.insertBelow();}
function design_row_duplicate()
{return Ektron.SmartForm.Repeater.current.duplicate();}
function design_row_remove()
{return Ektron.SmartForm.Repeater.current.remove();}
function design_row_moveUp()
{return Ektron.SmartForm.Repeater.current.moveUp();}
function design_row_moveDown()
{return Ektron.SmartForm.Repeater.current.moveDown();}
function design_row_replace()
{return Ektron.SmartForm.Repeater.current.replace();}
function design_row_insertAbove_disabled()
{return Ektron.SmartForm.Repeater.current.insertAbove_disabled();}
function design_row_insertBelow_disabled()
{return Ektron.SmartForm.Repeater.current.insertBelow_disabled();}
function design_row_duplicate_disabled()
{return Ektron.SmartForm.Repeater.current.duplicate_disabled();}
function design_row_remove_disabled()
{return Ektron.SmartForm.Repeater.current.remove_disabled();}
function design_row_moveUp_disabled()
{return Ektron.SmartForm.Repeater.current.moveUp_disabled();}
function design_row_moveDown_disabled()
{return Ektron.SmartForm.Repeater.current.moveDown_disabled();}
if(!Ektron.SmartForm.setFormValues)(function()
{Ektron.SmartForm.setFormValues=function SmartForm_setFormValues(containingElement)
{var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(!oFormElem)return;var oElem;var aryElems=oFormElem.getElementsByTagName("input");for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];Ektron.SmartForm.setValue(oElem,Ektron.SmartForm.getValue(oElem));}
aryElems=oFormElem.getElementsByTagName("textarea");for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];Ektron.SmartForm.setValue(oElem,Ektron.SmartForm.getValue(oElem));}
aryElems=oFormElem.getElementsByTagName("option");for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];if(oElem.selected&&oElem.value!="")
{oElem.setAttribute("selected","selected");}
else
{oElem.removeAttribute("selected");}}};Ektron.SmartForm.getValue=function SmartForm_getValue(oElem)
{if(!oElem)return;var oContentElem=oElem;if("true"==oElem.getAttribute("contenteditable"))
{if(Ektron.SmartForm.isEditWithIFrame(oElem))
{oContentElem=oElem.firstChild.contentWindow.document.body;if(null==oContentElem)
{return;}}
else if(Ektron.SmartForm.isEditWithIFrameCache(oElem))
{oContentElem=oElem.firstChild.nextSibling;if(null==oContentElem)
{return;}}}
if(typeof oElem.value!="undefined")
{if("INPUT"==oElem.tagName&&("checkbox"==oElem.type||"radio"==oElem.type))
{var strValue=oElem.value+"";if(strValue.length>0&&strValue!="true"&&strValue!="on")
{if(oElem.checked)
{return strValue;}
else
{return"";}}
else
{if(oElem.checked)
{return true;}
else
{return false;}}}
else
{return oElem.value+"";}}
else if(typeof oElem.getAttribute!="undefined"&&oElem.getAttribute("datavalue")!=null)
{return oElem.getAttribute("datavalue");}
else if(typeof oElem.getAttribute!="undefined"&&oElem.getAttribute("value")!=null)
{return oElem.getAttribute("value");}
var strContent="";if("mixed"==oElem.getAttribute("ektdesignns_content")||"content-req"==oElem.getAttribute("ektdesignns_validation"))
{try
{strContent=Ektron.Xml.serializeXhtml(oContentElem.childNodes);}
catch(ex)
{Ektron.SmartForm.onexception(ex,[oContentElem.childNodes],Ektron.Xml.serializeXhtml);}}
if(strContent.length>0)
{strContent=strContent.replace(/^\n+/,"").replace(/\n+$/,"");if(/^(<p( jQuery\d+=\"?\d+\"?)?>)?(&nbsp;|&#160;|\xa0| )*(<br( type=\"_moz\")?( class=\"?khtml-block-placeholder\"?)?( \/)?>)?(<\/p>)?$/i.test(strContent))
{strContent="";}
return strContent;}
if(typeof oContentElem.innerText!="undefined")
{return oContentElem.innerText;}
else if(typeof oContentElem.textContent!="undefined")
{return oContentElem.textContent;}
else if(typeof oContentElem.innerHTML!="undefined")
{return $ektron.removeTags(oContentElem.innerHTML);}
else
{return;}};Ektron.SmartForm.setValue=function SmartForm_setValue(oElem,value)
{if(!oElem)return;var oContentElem=oElem;if("true"==oElem.getAttribute("contenteditable"))
{if(Ektron.SmartForm.isEditWithIFrame(oElem))
{oContentElem=oElem.firstChild.contentWindow.document.body;}
else if(Ektron.SmartForm.isEditWithIFrameCache(oElem))
{oContentElem=oElem.firstChild.nextSibling;}}
if(typeof oElem.value!="undefined")
{if("INPUT"==oElem.tagName&&("checkbox"==oElem.type||"radio"==oElem.type))
{if("true"==value||true==value||"on"==value)
{oElem.checked=true;oElem.setAttribute("checked","checked");}
else if("false"==value||false==value)
{oElem.checked=false;oElem.removeAttribute("checked");}
else
{if("string"==typeof value&&value.length>0)
{oElem.value=value;oElem.setAttribute("value",value);}
if(oElem.checked)
{oElem.setAttribute("checked","checked");}
else
{oElem.removeAttribute("checked");}}}
else
{if("TEXTAREA"==oElem.tagName)
{if(typeof oElem.innerText!="undefined")
{oElem.innerText=value;}
if(typeof oElem.textContent!="undefined")
{oElem.textContent=value;}}
else
{oElem.setAttribute("value",value);if(typeof oElem.getAttribute!="undefined"&&oElem.getAttribute("datavalue")!=null)
{oElem.datavalue=value;oElem.setAttribute("datavalue",value);}}
oElem.value=value;}}
else if(typeof oElem.getAttribute!="undefined"&&oElem.getAttribute("datavalue")!=null)
{oElem.datavalue=value;oElem.setAttribute("datavalue",value);}
else if(typeof oElem.getAttribute!="undefined"&&oElem.getAttribute("value")!=null)
{oElem.value=value;oElem.setAttribute("value",value);}
else if(typeof oContentElem.innerHTML!="undefined"&&"mixed"==oElem.getAttribute("ektdesignns_datatype"))
{oContentElem.innerHTML=value;}
else if(typeof oContentElem.innerText!="undefined")
{oContentElem.innerText=value;}
else if(typeof oContentElem.textContent!="undefined")
{oContentElem.textContent=value;}};Ektron.SmartForm.serializeSimpleElements=function SmartForm_serializeSimpleElements(containingElement)
{if(Ektron.SmartForm.cache_xmlDocument)return Ektron.SmartForm.cache_xmlDocument;var strXml="<root></root>";var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(oFormElem)
{var oSchema=Ektron.SmartForm.getContentElement("design_schema");var oSchemaToData=Ektron.SmartForm.getContentElement("design_schematodata_xslt");if(oSchema&&oSchema.innerText.length>0&&oSchemaToData&&oSchemaToData.innerText.length>0)
{var sViewPage="<ektdesign:viewPage"+s_rfnSerializeAttributes(oFormElem)+">"+s_rfnSerializeSimpleElements(oFormElem)+"</ektdesign:viewPage>";var strXSLT=oSchemaToData.innerText;strXSLT=strXSLT.replace(/<ektdesign:viewPage>[\s\S]+<\/ektdesign:viewPage>/,sViewPage);strXml=Ektron.SmartForm.ekXml.xslTransform(oSchema.innerText,strXSLT);}
else
{strXml="<root"+s_rfnSerializeAttributes(oFormElem)+">"+s_rfnSerializeSimpleElements(oFormElem)+"</root>";}}
Ektron.ContentDesigner.trace("SmartForm XML Document\n"+strXml);return strXml;};function s_rfnSerializeSimpleElements(oElem)
{if(!oElem)return"";if("design_prototype"==oElem.className)return"";var bIsRelevant=(oElem.getAttribute("ektdesignns_isrelevant")!="false");if(false==bIsRelevant)return"";var bProcessElement=true;var bind=oElem.getAttribute("ektdesignns_bind");var name=oElem.getAttribute("ektdesignns_name");var nodetype=oElem.getAttribute("ektdesignns_nodetype");if(!nodetype)nodetype="element";var bBoundElement=("string"==typeof bind&&bind.length>0&&"element"==nodetype);var bNamedElement=("string"==typeof name&&name.length>0&&"element"==nodetype);var bTextNode=("string"==typeof name&&name.length>0&&"text"==nodetype);if(bBoundElement)
{if(Ektron.SmartForm.isContainerElement(oElem,oElem.tagName))
{}
else
{switch(oElem.tagName)
{case"TEXTAREA":case"SELECT":return Ektron.Xml.serializeXhtml(oElem);default:var value=Ektron.SmartForm.serializeValue(oElem);if("undefined"==typeof value)
{bProcessElement=false;}
else
{return Ektron.Xml.serializeXhtml(oElem);}}}}
else if(bNamedElement)
{if("mixed"==oElem.getAttribute("ektdesignns_content"))
{value=Ektron.SmartForm.getValue(oElem);return serializeElement(name,value);}
else if(Ektron.SmartForm.isContainerElement(oElem,oElem.tagName))
{}
else
{var value=Ektron.SmartForm.serializeValue(oElem);if("undefined"==typeof value)
{bProcessElement=false;}
else
{return serializeElement(name,$ektron.htmlEncode(value));}}}
else if(bTextNode)
{var value=Ektron.SmartForm.serializeValue(oElem);if("undefined"==typeof value)
{bProcessElement=false;}
else
{return $ektron.htmlEncode(value);}}
var attrs="";var content="";if(bProcessElement&&ekHasChildren(oElem))
{var joChildren=$ektron(oElem).children();for(var iChild=0;iChild<joChildren.length;iChild++)
{content+=s_rfnSerializeSimpleElements(joChildren.get(iChild));}
if(bBoundElement)
{alert("Error: SerializeSimpleElements of a bound element is not implemented.");return"";}
else if(bNamedElement)
{for(var iChild=0;iChild<joChildren.length;iChild++)
{attrs+=s_rfnSerializeAttributes(joChildren.get(iChild));}
return serializeElement(name,content,attrs);}}
return content;}
function s_rfnSerializeAttributes(oElem)
{if(!oElem)return"";if("design_prototype"==oElem.className)return"";var name=oElem.getAttribute("ektdesignns_name");var nodetype=oElem.getAttribute("ektdesignns_nodetype");if(!nodetype)nodetype="element";var bNamed=("string"==typeof name&&name.length>0);if(bNamed&&"attribute"==nodetype)
{var value=Ektron.SmartForm.serializeValue(oElem);if("SPAN"==oElem.tagName&&"undefined"==typeof value)
{value="";}
if(typeof value!="undefined")
{return serializeAttribute(name,value);}}
var attrs="";if(!bNamed&&ekHasChildren(oElem))
{var joChildren=$ektron(oElem).children();for(var iChild=0;iChild<joChildren.length;iChild++)
{attrs+=s_rfnSerializeAttributes(joChildren.get(iChild));}}
return attrs;}
Ektron.SmartForm.serializeValue=function SmartForm_serializeValue(oElem)
{switch(oElem.tagName)
{case"INPUT":var inputType=oElem.type.toLowerCase();if("checkbox"==inputType)
{var strValue=oElem.value.toLowerCase();if("true"==strValue||"on"==strValue||""==strValue)
{return(oElem.checked?"true":"false");}}
else if("text"==inputType||"password"==inputType||"hidden"==inputType)
{return oElem.value;}
break;case"TEXTAREA":return oElem.value;case"SELECT":return oElem.value;case"SPAN":var value=oElem.getAttribute("datavalue");if(value!=null&&typeof value!="undefined")
{return value;}
else
{value=oElem.getAttribute("value");if(value!=null&&typeof value!="undefined")
{return value;}}
break;default:}
return;};Ektron.SmartForm.isContainerElement=function SmartForm_isContainerElement(oElem,tagName)
{if("FIELDSET"==tagName||"DIV"==tagName)
{return true;}
else if("TABLE"==tagName||"TR"==tagName)
{if(oElem)
{var attrValue;attrValue=oElem.getAttribute("ektdesignns_bind");if("string"==typeof attrValue&&attrValue.length>0)
{return true;}
attrValue=oElem.getAttribute("ektdesignns_name");if("string"==typeof attrValue&&attrValue.length>0)
{return true;}}}
return false;};function serializeElement(tagName,content,attributes)
{if("undefined"==typeof attributes)attributes="";var tag=tagName.toLowerCase();var bEmptyTag=("xsl:"==tag.substr(0,4)||(1==Ektron.Xml.htmlTagCount[tag]));if(bEmptyTag&&("undefined"==typeof content||("string"==typeof content&&0==content.length)||(null==content)))
{return"<"+tagName+attributes+" />\n";}
else
{return"<"+tagName+attributes+">"+content+"</"+tagName+">\n";}}
function serializeAttribute(name,value)
{return" "+name+"=\""+$ektron.htmlEncode(value)+"\"";}
if(!$ektron.htmlEncode)
{$ektron.htmlEncode=function(text){return(text+"").replace(Ektron.RegExp.Char.amp,"&amp;").replace(Ektron.RegExp.Char.lt,"&lt;").replace(Ektron.RegExp.Char.gt,"&gt;").replace(Ektron.RegExp.Char.quot,"&quot;");};}
if(!$ektron.removeTags)
{$ektron.removeTags=function(html){return(html+"").replace(Ektron.RegExp.tags,"");};}})();if(!Ektron.SmartForm.onsubmitForm)(function()
{Ektron.SmartForm.onsubmitForm=function SmartForm_onsubmitForm(form)
{var oElem=Ektron.SmartForm.validateHtmlForm(form);if(oElem&&oElem.title!=""){alert(oElem.title);Ektron.SmartForm.focusOn(oElem);return false;}
return true;};Ektron.SmartForm.prevalidateForm=function SmartForm_prevalidateForm(containingElement)
{if(Ektron.SmartForm.prevalidatingForm)return;var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(!oFormElem)return;Ektron.SmartForm.prevalidatingForm=true;Ektron.SmartForm.cache_xmlDocument=Ektron.SmartForm.serializeSimpleElements(containingElement);var oFirstInvalidElem=Ektron.SmartForm.prevalidateElement(oFormElem,null);Ektron.SmartForm.cache_xmlDocument="";Ektron.SmartForm.prevalidatingForm=false;Ektron.SmartForm.markValidity("dsg_prevalidate",oFirstInvalidElem);return oFirstInvalidElem;};Ektron.SmartForm.validateForm=function SmartForm_validateForm(strElemName)
{var oFormElem=Ektron.SmartForm.getContentElement(strElemName);Ektron.SmartForm.unfixContentEditable(oFormElem);Ektron.SmartForm.recalcForm(oFormElem);var oElem=Ektron.SmartForm.prevalidateForm(oFormElem);if(oElem)
{Ektron.SmartForm.focusOn(oElem);}
Ektron.SmartForm.markValidity("dsg_validate",oElem);Ektron.SmartForm.fixContentEditable(oFormElem);return(null==oElem);};Ektron.SmartForm.markValidity=function SmartForm_markValidity(strResultName,oInvalidElem)
{var oResultElem=document.getElementById(strResultName);if(oResultElem)
{if(oInvalidElem)
{oResultElem.title=oInvalidElem.title;oResultElem.setAttribute("ektdesignns_isvalid",false);}
else
{oResultElem.title="";oResultElem.setAttribute("ektdesignns_isvalid",true);}}};Ektron.SmartForm.validateHtmlForm=function SmartForm_validateHtmlForm(form)
{if(form&&form._form)form=form._form;var oForm;switch(typeof form)
{case"string":case"number":oForm=document.forms[form];break;case"object":oForm=form;break;default:oForm=document.forms[0];break;}
if(!oForm)return null;return Ektron.SmartForm.prevalidateElement(oForm,null);};Ektron.SmartForm.prevalidateElement=function SmartForm_prevalidateElement(oElem,oFirstInvalidElem)
{if(!oElem)return oFirstInvalidElem;if("undefined"==typeof oElem.getAttribute)return oFirstInvalidElem;if("design_prototype"==oElem.className)return oFirstInvalidElem;var relevant=oElem.getAttribute("ektdesignns_relevant");if(relevant)
{oElem.removeAttribute("ektdesignns_isrelevant");if(false==Ektron.SmartForm.evaluateXPathBoolean(relevant,oElem))
{oElem.setAttribute("ektdesignns_isrelevant","false");$ektron(oElem).hide();return oFirstInvalidElem;}
else
{$ektron(oElem).show();}}
if("object"==typeof oElem.currentStyle&&oElem.currentStyle!=null)
{if("none"==oElem.currentStyle.display)return oFirstInvalidElem;if("hidden"==oElem.currentStyle.visibility)return oFirstInvalidElem;}
var validation=oElem.getAttribute("ektdesignns_validation");if(validation&&validation!="none")
{oElem.removeAttribute("ektdesignns_isvalid");design_validate_result=true;if("function"==typeof oElem.onblur)
{oElem.onblur();}
else
{var sFn=oElem.getAttribute("onblur");if(sFn)
{try
{var fnOnBlur=new Function(sFn);fnOnBlur.call(oElem);}
catch(ex)
{sFn=sFn.replace(/([\(\,]\s*)this(\s*[\,\)])/,'$1oElem$2');var fn=new Function(sFn);eval(sFn);}}}
if(null==oFirstInvalidElem&&false==design_validate_result)
{oFirstInvalidElem=oElem;}}
if(typeof oElem.childNodes!="undefined")
{for(var i=0;i<oElem.childNodes.length;i++)
{if(1==oElem.nodeType)
{oFirstInvalidElem=Ektron.SmartForm.prevalidateElement(oElem.childNodes.item(i),oFirstInvalidElem);}}}
return oFirstInvalidElem;};function s_countSimpleElements(containingElement)
{var nCount=0;var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(oFormElem)
{var aryTagNames=["input","select","textarea"];var aryElems;var oElem;for(var iTagName=0;iTagName<aryTagNames.length;iTagName++)
{aryElems=oFormElem.getElementsByTagName(aryTagNames[iTagName]);for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];if(Ektron.SmartForm.isDDFieldElement(oElem))
{nCount++;}}}}
return nCount;}
function s_detectChange(containingElement)
{var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(!oFormElem)return;var aryTagNames=["input","select","textarea"];var aryElems;var oElem;for(var iTagName=0;iTagName<aryTagNames.length;iTagName++)
{aryElems=oFormElem.getElementsByTagName(aryTagNames[iTagName]);for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];if(Ektron.SmartForm.isDDFieldElement(oElem))
{try
{if("checkbox"==oElem.type)
{oElem.onclick=s_onChange;}
else
{oElem.onchange=s_onChange;}}
catch(ex)
{Ektron.OnException(Ektron.SmartForm,Ektron.OnException.ignoreException,ex,arguments);}}}}}
function s_onChange()
{var oInvalidElem=Ektron.SmartForm.prevalidateElement(this,null);var containingElement=Ektron.SmartForm.findContentElement(this);Ektron.SmartForm.recalcForm(containingElement);}
Ektron.SmartForm.precalcForm=function SmartForm_precalcForm(containingElement)
{var nSimpleElementCount=0;var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(!oFormElem)return;s_detectChange(oFormElem);nSimpleElementCount=s_countSimpleElements(oFormElem);Ektron.SmartForm.recalcForm(oFormElem);var sfInstance=Ektron.SmartForm.findByChildElement(oFormElem);if(sfInstance.watchdogTimer)
{clearInterval(sfInstance.watchdogTimer);sfInstance.watchdogTimer=null;}
sfInstance.watchdogTimer=setInterval(function SmartForm_watchdogChange(containingElement)
{var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(!oFormElem)return;var nCount=s_countSimpleElements(oFormElem);if(nSimpleElementCount!=nCount)
{if(nSimpleElementCount<nCount)
{s_detectChange(oFormElem);}
nSimpleElementCount=nCount;Ektron.SmartForm.recalcForm(oFormElem);}},2000);};Ektron.SmartForm.recalcForm=function SmartForm_recalcForm(containingElement)
{var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(!oFormElem)return;var aryElems=oFormElem.getElementsByTagName("input");var oElem;var exprCalc;for(var i=0;i<aryElems.length;i++)
{oElem=aryElems[i];exprCalc=oElem.getAttribute("ektdesignns_calculate");if("string"==typeof exprCalc)
{if("xpathr:"==exprCalc.substring(0,7))
{design_normalize_xpathr("string("+exprCalc.substring(7)+")",oElem);Ektron.SmartForm.prevalidateElement(oElem,null);}}}
var sfInstance=Ektron.SmartForm.findByChildElement(oFormElem);if(!sfInstance.designMode)
{$ektron("[ektdesignns_relevant]",oFormElem).each(function()
{Ektron.SmartForm.prevalidateElement(this,null);});}};Ektron.SmartForm.evaluateXPathBoolean=function SmartForm_evaluateXPathBoolean(expression,oElem)
{var oFormElem=Ektron.SmartForm.findContentElement(oElem);var value=Ektron.SmartForm.serializeSimpleElements(oFormElem);if(""==value)return;var sXPath=Ektron.SmartForm.getXPath(oElem,oFormElem);if(""==sXPath)return;expression=expression.replace(/^xpathr\:/,"");var strXSLT=Ektron.SmartForm.buildXpathrTemplate(sXPath,"<xsl:value-of select=\"boolean("+$ektron.htmlEncode(expression)+")\"/>\n");var result=("true"==Ektron.SmartForm.ekXml.xslTransform(value,strXSLT));Ektron.ContentDesigner.trace("evaluateXPathBoolean Elem='%s' XPath='%s' Expression='%s' Result=%s",oElem.id,sXPath,expression,result);return result;};Ektron.SmartForm.evaluate=function SmartForm_evaluate(expression,value)
{return(new Function("return "+expression)).call({text:value+""});};Ektron.SmartForm.normalize_complete=function SmartForm_normalize_complete(oElem,value)
{Ektron.SmartForm.setValue(oElem,value);};Ektron.SmartForm.validate_complete=function SmartForm_validate_complete(oElem,result,invalidmsg)
{design_validate_result=result;if(!oElem)return result;if(invalidmsg&&"string"==typeof oElem.title)
{var p=oElem.title.indexOf(invalidmsg);if(p>=0)
{if(p>0&&"\n"==oElem.title.charAt(p-1))
{p-=1;}
oElem.title=oElem.title.substring(0,p);}
p=oElem.title.length-1;if(p>=0&&"\n"==oElem.title.charAt(p))
{while(p>=0&&"\n"==oElem.title.charAt(p))
{p--;}
oElem.title=oElem.title.substring(0,p);}}
if(!result)
{if(invalidmsg&&("string"==typeof oElem.title))
{if(-1==oElem.title.indexOf(invalidmsg))
{if(oElem.title.length>0)
{oElem.title+=" \n";}
oElem.title+=invalidmsg;}}}
if("function"==typeof customValidationStyle)
{customValidationStyle(oElem,result);}
else
{s_validationStyle(oElem,result);}};function s_validationStyle(oElem,isValid)
{var parent=null;var elTypeName=oElem.tagName;var specialCaseBorder=(($ektron.browser.mozilla||$ektron.browser.safari)&&("INPUT"==elTypeName&&"checkbox"==oElem.type))||("SELECT"==elTypeName);if("object"==typeof oElem)
{parent=oElem.parentNode;if(("object"==typeof oElem.style)&&("object"==typeof parent))
{if(isValid)
{if(specialCaseBorder)
{if(("SPAN"==parent.tagName)&&("design_validation_failed"==parent.className))
{parent.className="design_validation_passed";}}
else
{$ektron(oElem).removeClass("design_validation_failed");}}
else
{var sf=Ektron.SmartForm.findByChildElement(oElem);if(sf&&(("undefined"==typeof sf.designMode)||(sf.designMode!=true)))
{if(specialCaseBorder)
{if((parent.tagName!="SPAN")||((parent.className!="design_validation_failed")&&(parent.className!="design_validation_passed")))
{var wrapper=document.createElement("span");wrapper=parent.insertBefore(wrapper,oElem);oElem=parent.removeChild(oElem);oElem=wrapper.appendChild(oElem);parent=wrapper;}
parent.className="design_validation_failed";}
else
{$ektron(oElem).addClass("design_validation_failed");}}}}}}
Ektron.SmartForm.focusOn=function SmartForm_focusOn(oElem)
{try
{oElem.scrollIntoView();}
catch(ex){}
try
{oElem.focus();}
catch(ex){}};})();if(!Ektron.SmartForm.buildXslt)(function()
{Ektron.SmartForm.buildXslt=function SmartForm_buildXslt(templates,method)
{if(!method)method="xml";var strXSLT=["<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">","<xsl:param name=\"currentDate\" select=\"'undefined'\"/>","<xsl:output method=\""+method+"\" version=\"1.0\" encoding=\"UTF-8\" indent=\"yes\" omit-xml-declaration=\"yes\"/>","<xsl:decimal-format NaN=\"\"/>",templates,"<xsl:template match=\"*|/\">","    <xsl:apply-templates select=\"@*|node()\"/>","</xsl:template>","<xsl:template match=\"text()|@*\"/>","</xsl:stylesheet>"].join("\n");return strXSLT;};function s_numberMatch(oElem,oCurrentElem,sXPath)
{var number=1;var bFound=false;if(!oElem||!oCurrentElem)return 1;$ektron("*",oElem).each(function()
{if(oCurrentElem==oElem)
{bFound=true;return false;}
if(sXPath==this.getAttribute("ektdesignns_bind"))number++;});return(bFound?number:1);}
Ektron.SmartForm.getXPath=function SmartForm_getXPath(oCurrentElem,containingElement)
{var sXPath="/";var oFormElem=Ektron.SmartForm.getContentElement(containingElement);if(oFormElem&&oCurrentElem)
{var bind=oCurrentElem.getAttribute("ektdesignns_bind");if("string"==typeof bind&&bind.length>0)
{sXPath=bind+"#"+s_numberMatch(oFormElem,oCurrentElem,bind);}
else
{sXPath=s_rfnGetXPath(oFormElem,oCurrentElem,"/root",{});}}
return sXPath;};function s_rfnGetXPath(oElem,oCurrentElem,sXPath,predicates)
{if(!oElem)return"";if("design_prototype"==oElem.className)return"";var bProcessElement=true;var name=oElem.getAttribute("ektdesignns_name");if("string"==typeof name&&name.length>0)
{if(Ektron.SmartForm.isContainerElement(oElem,oElem.tagName))
{bProcessElement=true;}
else
{var value=Ektron.SmartForm.serializeValue(oElem);bProcessElement=(typeof value!="undefined");}
if(bProcessElement)
{var nodetype=oElem.getAttribute("ektdesignns_nodetype");if(!nodetype)nodetype="element";switch(nodetype)
{case"element":sXPath+="/"+name;var nPredicate=predicates[sXPath];if("number"==typeof nPredicate)
{nPredicate++;}
else
{nPredicate=1;}
predicates[sXPath]=nPredicate;sXPath+="["+nPredicate+"]";break;case"attribute":sXPath+="/@"+name;break;case"mixed":break;case"text":break;default:}}
if(oCurrentElem==oElem)
{return sXPath;}}
if(bProcessElement&&ekHasChildren(oElem))
{var xpath="";var joChildren=$ektron(oElem).children();for(var iChild=0;iChild<joChildren.length;iChild++)
{xpath=s_rfnGetXPath(joChildren.get(iChild),oCurrentElem,sXPath,predicates);if(xpath.length>0)
{return xpath;}}}
return"";}
Ektron.SmartForm.buildXpathrTemplate=function SmartForm_buildXpathrTemplate(sXPath,sCode)
{var strXSLT='';var pNumber=sXPath.indexOf("#");if(-1==pNumber)
{strXSLT=["<xsl:template match=\""+sXPath+"\">","    "+sCode,"</xsl:template>"].join('\n');}
else
{sNumber=sXPath.substring(pNumber+1);sXPath=sXPath.substring(0,pNumber);strXSLT=["<xsl:template match=\""+sXPath+"\">","    <xsl:variable name=\"number\">","        <xsl:number count=\""+sXPath+"\" level=\"any\"","    </xsl:variable>","    <xsl:if test=\"$number="+sNumber+"\">","        "+sCode,"    </xsl:if>","</xsl:template>"].join('\n');}
strXSLT=Ektron.SmartForm.buildXslt(strXSLT);return strXSLT;};})();var design_validate_result=true;function design_div_focus(oElement)
{var bPrimeEmptyElement=false;if(!oElement.hasChildNodes())
{bPrimeEmptyElement=true;}
else if(1==oElement.childNodes.length&&3==oElement.firstChild.nodeType)
{var strText=oElement.firstChild.nodeValue;if(0==strText.length||/^\n+$/.test(strText))
{bPrimeEmptyElement=true;}}
if(bPrimeEmptyElement)
{if($ektron.browser.msie)
{oElement.innerHTML="<p>&#160;</p>";}
else if($ektron.browser.safari)
{oElement.innerHTML="<p><br class=\"khtml-block-placeholder\" /></p>";}}}
function design_div_blur(oElement)
{}
function design_toggleExpandCollapse(oElem)
{var sf=Ektron.SmartForm.findByChildElement(oElem);if(sf)return sf.toggleExpandCollapse(oElem);}
function design_normalize_xpathr(expression,oElem)
{var oFormElem=Ektron.SmartForm.findContentElement(oElem);if(Ektron.SmartForm.prevalidatingForm)return;var value=Ektron.SmartForm.serializeSimpleElements(oFormElem);if(""==value)return;var sXPath=Ektron.SmartForm.getXPath(oElem,oFormElem);if(""==sXPath)return;var strXSLT=Ektron.SmartForm.buildXpathrTemplate(sXPath,"<xsl:copy-of select=\""+$ektron.htmlEncode(expression)+"\"/>\n");value=Ektron.SmartForm.ekXml.xslTransform(value,strXSLT);if("NaN"==value)value="";Ektron.ContentDesigner.trace("normalize_xpathr Elem=%s XPath='%s' Expression='%s' Value='%s'",oElem.id,sXPath,expression,value);Ektron.SmartForm.normalize_complete(oElem,value);}
function design_validate_xpathr(expression,oElem,invalidmsg)
{var result=Ektron.SmartForm.evaluateXPathBoolean(expression,oElem);if(typeof result!="boolean")return;Ektron.SmartForm.validate_complete(oElem,result,invalidmsg);return result;}
function design_normalize_xpath(expression,oElem)
{if(Ektron.SmartForm.prevalidatingForm)return;var value=Ektron.SmartForm.getValue(oElem);if("undefined"==typeof value)return;var strXSLT=["<xsl:template match=\"/root\">","    <xsl:copy-of select=\""+$ektron.htmlEncode(expression)+"\"/>","</xsl:template>"].join('\n');strXSLT=Ektron.SmartForm.buildXslt(strXSLT);value="<root>"+value+"</root>";value=Ektron.SmartForm.ekXml.xslTransform(value,strXSLT);if("NaN"==value)value="";Ektron.SmartForm.normalize_complete(oElem,value);}
function design_validate_xpath(expression,oElem,invalidmsg)
{var value=Ektron.SmartForm.getValue(oElem);if("undefined"==typeof value)return;var strXSLT=["<xsl:template match=\"/root\">","    <xsl:value-of select=\"boolean("+$ektron.htmlEncode(expression)+")\"/>","</xsl:template>"].join('\n');strXSLT=Ektron.SmartForm.buildXslt(strXSLT,"text");value="<root>"+value+"</root>";var result=("true"==Ektron.SmartForm.ekXml.xslTransform(value,strXSLT));Ektron.SmartForm.validate_complete(oElem,result,invalidmsg);return result;}
function design_normalize_xslt(url,oElem)
{if(Ektron.SmartForm.prevalidatingForm)return;var value=Ektron.SmartForm.getValue(oElem);if("undefined"==typeof value)return;value="<root>"+value+"</root>";value=Ektron.SmartForm.ekXml.xslTransform(value,url);if("NaN"==value)value="";Ektron.SmartForm.normalize_complete(oElem,value);}
function design_validate_xslt(url,oElem,invalidmsg)
{var value=Ektron.SmartForm.getValue(oElem);if("undefined"==typeof value)return;value="<root>"+value+"</root>";var result=("true"==Ektron.SmartForm.ekXml.xslTransform(value,url));Ektron.SmartForm.validate_complete(oElem,result,invalidmsg);return result;}
function design_validate(re,oElem,value)
{if(!oElem)return;var data=value;if("undefined"==typeof value)
{data=Ektron.SmartForm.getValue(oElem);if("undefined"==typeof data)
{return;}}
var result=re.test(data);Ektron.SmartForm.validate_complete(oElem,result);return result;}
function design_normalize_re(re,oElem)
{if(typeof Ektron.SmartForm.prevalidatingForm=="undefined"||Ektron.SmartForm.prevalidatingForm!=true)
{var value=Ektron.SmartForm.getValue(oElem);if("undefined"==typeof value)return;if("undefined"!=typeof RegExp.lastIndex)
{RegExp.lastIndex=0;}
re.lastIndex=0;var ary=re.exec(value);value=(null==ary?"":ary[0]);Ektron.SmartForm.normalize_complete(oElem,value);}}
function design_validate_re(re,oElem,invalidmsg)
{var value=Ektron.SmartForm.getValue(oElem);if("undefined"==typeof value)return;if("undefined"!=typeof RegExp.lastIndex)
{RegExp.lastIndex=0;}
re.lastIndex=0;var result=re.test(value);Ektron.SmartForm.validate_complete(oElem,result,invalidmsg);return result;}
function design_normalize_js(expression,oElem)
{if(typeof Ektron.SmartForm.prevalidatingForm=="undefined"||Ektron.SmartForm.prevalidatingForm!=true)
{var value=Ektron.SmartForm.getValue(oElem);if("undefined"==typeof value)return;value=Ektron.SmartForm.evaluate(expression,value);Ektron.SmartForm.normalize_complete(oElem,value);}}
function design_validate_js(expression,oElem,invalidmsg)
{var value=Ektron.SmartForm.getValue(oElem);if("undefined"==typeof value)return;var result=Ektron.SmartForm.evaluate(expression,value);Ektron.SmartForm.validate_complete(oElem,result,invalidmsg);return result;}
function design_validate_select(minIndex,oElem,invalidmsg)
{if(!oElem)return;if("undefined"==typeof oElem.selectedIndex)
{return;}
var result=(oElem.selectedIndex>=minIndex);Ektron.SmartForm.validate_complete(oElem,result,invalidmsg);return result;}
function design_validate_choice(minSelected,maxSelected,oElem,invalidmsg)
{if(!oElem)return;if("undefined"==typeof oElem.getElementsByTagName)return;var num_checked=0;var oCurrElem;var bUseChecked;var aryElements=null;var validation=oElem.getAttribute("ektdesignns_validation");if("choice-req"==validation)
{aryElements=oElem.getElementsByTagName("input");bUseChecked=true;}
else if("select-req"==validation)
{aryElements=oElem.getElementsByTagName("option");bUseChecked=false;}
if(aryElements)
{for(var i=0;i<aryElements.length;i++)
{oCurrElem=aryElements[i];if(bUseChecked)
{if(oCurrElem.checked)
{num_checked++;}}
else
{if(oCurrElem.selected)
{num_checked++;}}}}
var result=(minSelected<=num_checked&&(maxSelected<=0||num_checked<=maxSelected));Ektron.SmartForm.validate_complete(oElem,result,invalidmsg);return result;}
function design_normalize_isbn(value)
{value=value+"";value=value.replace(/[\s\-]/g,"").toUpperCase();return value;}
function design_validate_isbn(value)
{var result=design_validate_isbn10(value)||design_validate_isbn13(value);return result;}
function design_validate_isbn10(value)
{var result=true;value=value+"";var re=new RegExp("^[0-9]{9}[0-9X]$");if(!re.test(value))return false;var check=0;var weight=10;for(var i=0;i<value.length;i++)
{var c=value.charCodeAt(i);if(88==c&&1==weight)
{check+=10;weight--;}
else if(48<=c&&c<=57)
{check+=(c-48)*weight--;}}
result=(0==weight&&0==(check%11));return result;}
function design_validate_isbn13(value)
{value=value+"";var re=new RegExp("^[0-9]{13}$");if(!re.test(value))return false;var check=0;var n=13;var weight=1;for(var i=0;i<value.length;i++)
{var c=value.charCodeAt(i);if(48<=c&&c<=57)
{check+=(c-48)*weight;weight=(1==weight?3:1);n--;}}
return(0==n&&0==(check%10));}
function design_normalize_issn(value)
{value=value+"";value=value.replace(/[\s\-]/g,"").toUpperCase();return value;}
function design_validate_issn(value)
{value=value+"";var re=new RegExp("^[0-9]{7}[0-9X]$");if(!re.test(value))return false;var check=0;var weight=8;for(var i=0;i<value.length;i++)
{var c=value.charCodeAt(i);if(88==c&&1==weight)
{check+=10;weight--;}
else if(48<=c&&c<=57)
{check+=(c-48)*weight--;}}
return(0==weight&&0==(check%11));}
function design_current_date()
{var oCurrentDate=new Date();var mm=(oCurrentDate.getMonth()+1);if(mm<=9)mm="0"+mm;var dd=oCurrentDate.getDate();if(dd<=9)dd="0"+dd;return(oCurrentDate.getFullYear()+"-"+mm+"-"+dd);}
function design_validate_future_date(date)
{date=date+"";if(10==date.length)
{return(date>=design_current_date());}
return false;}
if(!Ektron.DataListManager)(function()
{Ektron.DataListManager={init:function DataListManager_init(settings)
{settings=$ektron.extend({serverUrl:location.protocol+"//"+location.host,srcPath:"",langType:"",ekXml:null},settings);settings.langType=settings.langType+"";s_settings=settings;if(!Ektron.Xml)
{throw new ReferenceError("Ektron.DataListManager depends on Ektron.Xml. Please include ektron.xml.js.");}
this.replaceDataLists=DataListManager_replaceDataLists;this.getDataList=DataListManager_getDataList;}};var s_settings={};function DataListManager_replaceDataLists(containingElement)
{var aryDatalistCache=new Array();$ektron("select[ektdesignns_datasrc], div.ektdesignns_choices[ektdesignns_datasrc], div.ektdesignns_checklist[ektdesignns_datasrc], div.design_choices[ektdesignns_datasrc], div.design_checklist[ektdesignns_datasrc]",containingElement).each(function()
{var oElem=this;var datasrc=oElem.getAttribute("ektdesignns_datasrc");var datalist=oElem.getAttribute("ektdesignns_datalist");if("string"==typeof datalist&&datalist.length>0)
{if("undefined"==typeof aryDatalistCache[datalist])
{var strSelect=oElem.getAttribute("ektdesignns_dataselect");var strCaptionXPath=oElem.getAttribute("ektdesignns_captionxpath");var strValueXPath=oElem.getAttribute("ektdesignns_valuexpath");var strNamespaces=oElem.getAttribute("ektdesignns_datanamespaces");aryDatalistCache[datalist]=Ektron.DataListManager.getDataList(oElem.tagName,datasrc,strSelect,strCaptionXPath,strValueXPath,strNamespaces);}
if(aryDatalistCache[datalist].length>0)
{s_replaceDataList(oElem,aryDatalistCache[datalist]);}}});}
function s_replaceDataList(oElem,strDatalist)
{if("SELECT"==oElem.tagName)
{var nNumOrigItemsToKeep=0;var validation=oElem.getAttribute("ektdesignns_validation");if("select-req"==validation)
{nNumOrigItemsToKeep=1;}
var strOrigDataList="";for(var iOption=0;iOption<oElem.options.length;iOption++)
{var oOption=oElem.options[iOption];oOption.innerHTML=$ektron.htmlEncodeText(oOption.text);strOrigDataList+=Ektron.Xml.serializeXhtml(oOption);}
var strHtml=s_transformDataList(strOrigDataList,strDatalist,nNumOrigItemsToKeep);strHtml=strHtml.replace(/<select[^>]*>/,"").replace("</select>","");$ektron(oElem).html(strHtml);if(oElem.multiple&&oElem.size<2&&oElem.options.length>12)
{oElem.size=12;}}
else
{var oOrigListElem=$ektron(oElem).children("OL").get(0);var strOrigDataList=Ektron.Xml.serializeXhtml(oOrigListElem);var strHtml=s_transformChoiceDataList(strOrigDataList,strDatalist);strHtml=strHtml.replace(/<ol[^>]*>/,"").replace("</ol>","");oOrigListElem.innerHTML=strHtml;}};function DataListManager_getDataList(strDDFieldTagName,strSource,strSelect,strCaptionXPath,strValueXPath,strNamespaces,strLangType)
{var strPrefixes="";if("undefined"==typeof strNamespaces||null==strNamespaces)
{strNamespaces="";}
else
{strPrefixes=extractPrefixesFromNamespaces(strNamespaces);if(strPrefixes.length>0)
{strPrefixes=" exclude-result-prefixes=\""+strPrefixes+"\"";}}
var langType=(strLangType||s_settings.langType)+"";if(langType.length>0)
{langType="&LangType="+langType;}
strSource=strSource.replace("&LangType=-1",langType);var strXSLT=["<?xml version=\"1.0\"?>","<xsl:stylesheet version=\"1.0\" "+strPrefixes+" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" "+strNamespaces+">","<xsl:output method=\"xml\" version=\"1.0\" omit-xml-declaration=\"yes\" indent=\"yes\"/>","<xsl:param name=\"localeUrl\" select=\"'"+s_settings.serverUrl+s_settings.srcPath+"resourcexml.aspx?name=DataListSpec'\"/>","<xsl:variable name=\"localeXml\" select=\"document($localeUrl)/*\"/>","<xsl:template match=\"/\">","  <select>","  <xsl:for-each select=\""+strSelect+"\">","    <option>","      <xsl:if test=\""+strValueXPath+"\">","        <xsl:attribute name=\"value\">","          <xsl:value-of select=\""+strValueXPath+"\"/>","        </xsl:attribute>","      </xsl:if>","      <xsl:choose>","        <xsl:when test=\"@localeRef\">","          <xsl:value-of select=\"$localeXml/data[@name=current()/@localeRef]/value/text()\"/>","        </xsl:when>","        <xsl:otherwise>","          <xsl:value-of select=\""+strCaptionXPath+"\"/>","        </xsl:otherwise>","      </xsl:choose>","    </option>","  </xsl:for-each>","  </select>","</xsl:template>","</xsl:stylesheet>"].join('\n');var strHtml=s_settings.ekXml.xslTransform(strSource,strXSLT);strHtml=$ektron.trim(strHtml);if(strHtml.indexOf("<option")>=0||0==strHtml.length)
{return strHtml;}
else
{if(Ektron.Xml.onexception)Ektron.Xml.onexception(new Error("Function getDataList returned unexpected result.\n"+strHtml),arguments);return"";}}
function s_transformChoiceDataList(strOrigDataList,strNewDataList)
{var strXSLT="";strXSLT=["<?xml version='1.0'?>","<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:xslout=\"alias\">","<xsl:namespace-alias stylesheet-prefix=\"xslout\" result-prefix=\"xsl\"/>","<xsl:template match=\"ol\">","<xslout:variable name=\"nameID\" select=\"'{li/input/@name}'\"/>","<xslout:variable name=\"inputType\" select=\"'{li/input/@type}'\"/>","</xsl:template>","<xsl:template match=\"text()\"/>","</xsl:stylesheet>"].join('\n');var strVariables=s_settings.ekXml.xslTransform(strOrigDataList,strXSLT);strXSLT=["<?xml version='1.0'?>","<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:xslout=\"alias\">","<xsl:namespace-alias stylesheet-prefix=\"xslout\" result-prefix=\"xsl\"/>","<xsl:template match=\"/\">"," <xsl:apply-templates/>","</xsl:template>","<xsl:template match=\"ol/li/input[@checked]\">"," <xslout:if test=\"not(option[@value=xpathLiteralString{@value}gnirtSlaretiLhtapx])\">","     <xsl:copy-of select=\"..\"/>"," </xslout:if>","</xsl:template>","<xsl:template match=\"text()\"/>","</xsl:stylesheet>"].join('\n');var strOldSelectedSnip=s_settings.ekXml.xslTransform(strOrigDataList,strXSLT);strXSLT=["<?xml version='1.0'?>","<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:xslout=\"alias\">","<xsl:namespace-alias stylesheet-prefix=\"xslout\" result-prefix=\"xsl\"/>","<xsl:template match=\"/\">"," <xsl:for-each select=\"ol/li/input[1]/@*[starts-with(name(),'ektdesignns_')]\">","  <xslout:attribute name=\"{name()}\"><xsl:value-of select=\".\"/></xslout:attribute>"," </xsl:for-each>"," <xsl:apply-templates/>","</xsl:template>","<xsl:template match=\"ol/li/input[@checked]\">"," <xslout:if test=\"@value=xpathLiteralString{@value}gnirtSlaretiLhtapx\">","           <xslout:attribute name=\"checked\">checked</xslout:attribute>"," </xslout:if>","</xsl:template>","<xsl:template match=\"text()\"/>","</xsl:stylesheet>"].join('\n');var strNewSelectedSnip=s_settings.ekXml.xslTransform(strOrigDataList,strXSLT);var strOlTag=strOrigDataList.match(/<ol[^>]*>/)[0];strXSLT=["<?xml version='1.0'?>","<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" exclude-result-prefixes=\"ektdesign\" xmlns:ektdesign=\"urn:ektdesign\">","<xsl:output method=\"xml\" version=\"1.0\" indent=\"yes\" omit-xml-declaration=\"yes\"/>",strVariables,"<xsl:template match=\"/\">"," "+strOlTag+"","        <xsl:apply-templates/>","    </ol>","</xsl:template>","<xsl:template match=\"select\">",strOldSelectedSnip,"    <xsl:apply-templates select=\"node()\"/>","</xsl:template>","<xsl:template match=\"option\">","    <xsl:variable name=\"modelID\" select=\"generate-id()\"/>","    <xsl:variable name=\"displayOption\" select=\"text()\"/>","    <xsl:variable name=\"valueOption\" select=\"@value\"/>","     <li>","    <input type=\"{$inputType}\" id=\"{$modelID}\" title=\"{$displayOption}\" value=\"{$valueOption}\" name=\"{$nameID}\">",strNewSelectedSnip,"    </input>","    <label for=\"{$modelID}\"><xsl:value-of select=\"$displayOption\"/></label>","    </li>","</xsl:template>","<xsl:template match=\"*\">","   <xsl:copy>","       <xsl:copy-of select=\"@*\"/>","       <xsl:apply-templates select=\"node()\"/>","   </xsl:copy>","</xsl:template>","</xsl:stylesheet>"].join('\n');var strHtml=s_settings.ekXml.xslTransform(strNewDataList,strXSLT);return strHtml;}
function s_transformDataList(strOrigDataList,strNewDataList,nNumOrigItemsToKeep)
{strOrigDataList="<select>"+strOrigDataList+"</select>";var strOldPredicate="@selected";if("number"==typeof nNumOrigItemsToKeep)
{strOldPredicate+=" or position()&lt;="+nNumOrigItemsToKeep;}
var strXSLT="";strXSLT=["<?xml version='1.0'?>","<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:xslout=\"alias\">","<xsl:namespace-alias stylesheet-prefix=\"xslout\" result-prefix=\"xsl\"/>","<xsl:template match=\"/\">"," <xsl:apply-templates/>","</xsl:template>","<xsl:template match=\"option["+strOldPredicate+"]\">"," <xslout:if test=\"not(option[@value=xpathLiteralString{@value}gnirtSlaretiLhtapx])\">","     <xsl:copy-of select=\".\"/>"," </xslout:if>","</xsl:template>","<xsl:template match=\"text()\"/>","</xsl:stylesheet>"].join('\n');var strOldSelectedSnip=s_settings.ekXml.xslTransform(strOrigDataList,strXSLT);strXSLT=["<?xml version='1.0'?>","<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:xslout=\"alias\">","<xsl:namespace-alias stylesheet-prefix=\"xslout\" result-prefix=\"xsl\"/>","<xsl:template match=\"/\">"," <xsl:apply-templates/>","</xsl:template>","<xsl:template match=\"option[@selected]\">"," <xslout:if test=\"@value=xpathLiteralString{@value}gnirtSlaretiLhtapx\">","           <xslout:attribute name=\"selected\">selected</xslout:attribute>"," </xslout:if>","</xsl:template>","<xsl:template match=\"text()\"/>","</xsl:stylesheet>"].join('\n');var strNewSelectedSnip=s_settings.ekXml.xslTransform(strOrigDataList,strXSLT);strXSLT=["<?xml version='1.0'?>","<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" exclude-result-prefixes=\"ektdesign\" xmlns:ektdesign=\"urn:ektdesign\">","<xsl:output method=\"xml\" version=\"1.0\" indent=\"yes\" omit-xml-declaration=\"yes\"/>","<xsl:template match=\"select\">","   <select>","   <!-- copy selected values that are not in the new data list -->",strOldSelectedSnip,"   <!-- process option tags -->","   <xsl:apply-templates select=\"node()\"/>","   </select>","</xsl:template>","<xsl:template match=\"option\">","   <xsl:copy>","       <!-- copy attributes except 'selected' -->","       <xsl:copy-of select=\"@*[name() != 'selected']\"/>","       <!-- check if selected in the old data list -->",strNewSelectedSnip,"       <!-- copy the text -->","       <xsl:copy-of select=\"node()\"/>","       </xsl:copy>","</xsl:template>","<xsl:template match=\"*\"> ","   <xsl:copy>","       <xsl:copy-of select=\"@*\"/>","       <xsl:apply-templates select=\"node()\"/>","   </xsl:copy>","</xsl:template>","</xsl:stylesheet>"].join('\n');var strHtml=s_settings.ekXml.xslTransform(strNewDataList,strXSLT);strHtml=$ektron.trim(strHtml);if(strHtml.indexOf("<option")>=0||0==strHtml.length)
{return strHtml;}
else
{if(Ektron.Xml.onexception)Ektron.Xml.onexception(new Error("Function transformDataList returned unexpected result.\n"+strHtml),arguments);return"";}}
function extractPrefixesFromNamespaces(strNamespaces)
{var aryNSPrefix=new Array();var aryAllNS=strNamespaces.match(/xmlns:\w+=['"][^'"]*['"]/g);if(null==aryAllNS)return"";aryAllNS.sort();var prev="";for(var i=0;i<aryAllNS.length;i++)
{if(aryAllNS[i]!=prev)
{var aryNS=aryAllNS[i].match(/xmlns:(\w+)=['"]([^'"]*)['"]/);aryNSPrefix[aryNSPrefix.length]=aryNS[1];prev=aryAllNS[i];}}
return aryNSPrefix.join(" ");}})();

