
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - gen_validatorv2.js - */
// http://www.nlsenlaw.org/portal_javascripts/gen_validatorv2.js?original=1
function Validator(frmname){this.formobj=document.forms[frmname];if(!this.formobj){alert("BUG: couldnot get Form object "+frmname);return}
if(this.formobj.onsubmit){this.formobj.old_onsubmit=this.formobj.onsubmit;this.formobj.onsubmit=null}
else{this.formobj.old_onsubmit=null}
this.formobj.onsubmit=form_submit_handler;this.addValidation=add_validation;this.setAddnlValidationFunction=set_addnl_vfunction;this.clearAllValidations=clear_all_validations}
function set_addnl_vfunction(functionname){this.formobj.addnlvalidation=functionname}
function clear_all_validations(){for(var itr=0;itr<this.formobj.elements.length;itr++){this.formobj.elements[itr].validationset=null}}
function form_submit_handler(){for(var itr=0;itr<this.elements.length;itr++){if(this.elements[itr].validationset&&!this.elements[itr].validationset.validate()){return false}}
if(this.addnlvalidation){str=" var ret = "+this.addnlvalidation+"()";eval(str);if(!ret) return ret}
return true}
function add_validation(itemname,descriptor,errstr){if(!this.formobj){alert("BUG: the form object is not set properly");return}
var itemobj=this.formobj[itemname];if(!itemobj){alert("BUG: Couldnot get the input object named: "+itemname);return}
if(!itemobj.validationset){itemobj.validationset=new ValidationSet(itemobj)}
itemobj.validationset.add(descriptor,errstr)}
function ValidationDesc(inputitem,desc,error){this.desc=desc;this.error=error;this.itemobj=inputitem;this.validate=vdesc_validate}
function vdesc_validate(){if(!V2validateData(this.desc,this.itemobj,this.error)){this.itemobj.focus();return false}
return true}
function ValidationSet(inputitem){this.vSet=new Array();this.add=add_validationdesc;this.validate=vset_validate;this.itemobj=inputitem}
function add_validationdesc(desc,error){this.vSet[this.vSet.length]=new ValidationDesc(this.itemobj,desc,error)}
function vset_validate(){for(var itr=0;itr<this.vSet.length;itr++){if(!this.vSet[itr].validate()){return false}}
return true}
function validateEmailv2(email){if(email.length<=0){return true}
var splitted=email.match("^(.+)@(.+)$");if(splitted==null) return false;if(splitted[1]!=null){var regexp_user=/^\"?[\w-_\.]*\"?$/;if(splitted[1].match(regexp_user)==null) return false}
if(splitted[2]!=null){var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;if(splitted[2].match(regexp_domain)==null){var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;if(splitted[2].match(regexp_ip)==null) return false}
return true}
return false}
function V2validateData(strValidateStr,objValue,strError){var epos=strValidateStr.search("=");var command="";var cmdvalue="";if(epos>=0){command=strValidateStr.substring(0,epos);cmdvalue=strValidateStr.substr(epos+1)}
else{command=strValidateStr}
switch(command){case "req":case "required":{if(eval(objValue.value.length)==0){if(!strError||strError.length==0){strError=objValue.name+" : Required Field"}
alert(strError);return false}
break}
case "maxlength":case "maxlen":{if(eval(objValue.value.length)>eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : "+cmdvalue+" characters maximum "}
alert(strError+"\n[Current length = "+objValue.value.length+" ]");return false}
break}
case "minlength":case "minlen":{if(eval(objValue.value.length)<eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : "+cmdvalue+" characters minimum  "}
alert(strError+"\n[Current length = "+objValue.value.length+" ]");return false}
break}
case "alnum":case "alphanumeric":{var charpos=objValue.value.search("[^A-Za-z0-9]");if(objValue.value.length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alpha-numeric characters allowed "}
alert(strError+"\n [Error character position "+eval(charpos+1)+"]");return false}
break}
case "num":case "numeric":{var charpos=objValue.value.search("[^0-9]");if(objValue.value.length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only digits allowed "}
alert(strError+"\n [Error character position "+eval(charpos+1)+"]");return false}
break}
case "alphabetic":case "alpha":{var charpos=objValue.value.search("[^A-Za-z]");if(objValue.value.length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphabetic characters allowed "}
alert(strError+"\n [Error character position "+eval(charpos+1)+"]");return false}
break}
case "alnumhyphen":{var charpos=objValue.value.search("[^A-Za-z0-9\-_]");if(objValue.value.length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": characters allowed are A-Z,a-z,0-9,- and _"}
alert(strError+"\n [Error character position "+eval(charpos+1)+"]");return false}
break}
case "email":{if(!validateEmailv2(objValue.value)){if(!strError||strError.length==0){strError=objValue.name+": Enter a valid Email address "}
alert(strError);return false}
break}
case "lt":case "lessthan":{if(isNaN(objValue.value)){alert(objValue.name+": Should be a number ");return false}
if(eval(objValue.value)>=eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : value should be less than "+cmdvalue}
alert(strError);return false}
break}
case "gt":case "greaterthan":{if(isNaN(objValue.value)){alert(objValue.name+": Should be a number ");return false}
if(eval(objValue.value)<=eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : value should be greater than "+cmdvalue}
alert(strError);return false}
break}
case "regexp":{if(objValue.value.length>0){if(!objValue.value.match(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+": Invalid characters found "}
alert(strError);return false}}
break}
case "dontselect":{if(objValue.selectedIndex==null){alert("BUG: dontselect command for non-select Item");return false}
if(objValue.selectedIndex==eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+": Please Select one option "}
alert(strError);return false}
break}}
return true}


/* - Menu_Folder/DropDownMenuX.js - */
// http://www.nlsenlaw.org/portal_javascripts/Menu_Folder/DropDownMenuX.js?original=1
function DropDownMenuX(id){this.type="horizontal";this.delay={"show":0,"hide":400}
this.position={"level1":{"top":0,"left":0},"levelX":{"top":0,"left":0}}
this.fixIeSelectBoxBug=true;this.zIndex={"visible":500,"hidden":-1};this.browser={"ie":Boolean(document.body.currentStyle),"ie5":(navigator.appVersion.indexOf("MSIE 5.5")!=-1||navigator.appVersion.indexOf("MSIE 5.0")!=-1),"ie6":(navigator.appVersion.indexOf("MSIE 6.0")!=-1)};if(!this.browser.ie){this.browser.ie5=false;this.browser.ie6=false}
this.init=function(){if(!document.getElementById(this.id)){return alert("DropDownMenuX.init() failed. Element '"+this.id+"' does not exist.")}
if(this.type!="horizontal"&&this.type!="vertical"){return alert("DropDownMenuX.init() failed. Unknown menu type: '"+this.type+"'")}
if(this.browser.ie&&this.browser.ie5){fixWrap()}
fixSections();parse(document.getElementById(this.id).childNodes,this.tree,this.id)}
function fixSections(){var arr=document.getElementById(self.id).getElementsByTagName("div");var sections=new Array();var widths=new Array();for(var i=0;i<arr.length;i++){if(arr[i].className=="section"){sections.push(arr[i])}}
for(var i=0;i<sections.length;i++){widths.push(getMaxWidth(sections[i].childNodes))}
for(var i=0;i<sections.length;i++){sections[i].style.width=(widths[i])+"px"}
if(self.browser.ie){for(var i=0;i<sections.length;i++){setMaxWidth(sections[i].childNodes,widths[i])}}}
function fixWrap(){var elements=document.getElementById(self.id).getElementsByTagName("a");for(var i=0;i<elements.length;i++){if (/item2/.test(elements[i].className)){elements[i].innerHTML='<div nowrap="nowrap">'+elements[i].innerHTML+'</div>'}}}
function getMaxWidth(nodes){var maxWidth=0;for(var i=0;i<nodes.length;i++){if(nodes[i].nodeType!=1||/section/.test(nodes[i].className)){continue}
if(nodes[i].offsetWidth>maxWidth){maxWidth=nodes[i].offsetWidth}}
return maxWidth}
function setMaxWidth(nodes,maxWidth){for(var i=0;i<nodes.length;i++){if(nodes[i].nodeType==1&&/item2/.test(nodes[i].className)&&nodes[i].currentStyle){if(self.browser.ie5){nodes[i].style.width=(maxWidth)+"px"} else{nodes[i].style.width=(maxWidth-parseInt(nodes[i].currentStyle.paddingLeft)-parseInt(nodes[i].currentStyle.paddingRight))+"px"}}}}
function parse(nodes,tree,id){for(var i=0;i<nodes.length;i++){if(1!=nodes[i].nodeType){continue}
switch(true){case/\bitem1\b/.test(nodes[i].className):nodes[i].id=id+"-"+tree.length;tree.push(new Array());nodes[i].onmouseover=itemOver;nodes[i].onmouseout=itemOut;break;case/\bitem2\b/.test(nodes[i].className):nodes[i].id=id+"-"+tree.length;tree.push(new Array());nodes[i].onmouseover=itemOver;nodes[i].onmouseout=itemOut;break;case/\bsection\b/.test(nodes[i].className):nodes[i].id=id+"-"+(tree.length-1)+"-section";nodes[i].onmouseover=sectionOver;nodes[i].onmouseout=sectionOut;var box1=document.getElementById(id+"-"+(tree.length-1));var box2=document.getElementById(nodes[i].id);var el=new Element(box1.id);if(1==el.level){if("horizontal"==self.type){box2.style.top=box1.offsetTop+box1.offsetHeight+self.position.level1.top+"px";if(self.browser.ie5){box2.style.left=self.position.level1.left+"px"} else{box2.style.left=box1.offsetLeft+self.position.level1.left+"px"}} else if("vertical"==self.type){box2.style.top=box1.offsetTop+self.position.level1.top+"px";if(self.browser.ie5){box2.style.left=box1.offsetWidth+self.position.level1.left+"px"} else{box2.style.left=box1.offsetLeft+box1.offsetWidth+self.position.level1.left+"px"}}} else{box2.style.top=box1.offsetTop+self.position.levelX.top+"px";box2.style.left=box1.offsetLeft+box1.offsetWidth+self.position.levelX.left+"px"}
self.sections.push(nodes[i].id);self.sectionsShowCnt.push(0);self.sectionsHideCnt.push(0);if(self.fixIeSelectBoxBug&&self.browser.ie6){nodes[i].innerHTML=nodes[i].innerHTML+'<iframe id="'+nodes[i].id+'-iframe" src="javascript:false;" scrolling="no" frameborder="0" style="position: absolute; top: 0px; left: 0px; display: none; filter:alpha(opacity=0);"></iframe>'}
break}
if(nodes[i].childNodes){if (/\bsection\b/.test(nodes[i].className)){parse(nodes[i].childNodes,tree[tree.length-1],id+"-"+(tree.length-1))} else{parse(nodes[i].childNodes,tree,id)}}}}
function itemOver(){self.itemShowCnt++;var id_section=this.id+"-section";if(self.visible.length){var el=new Element(self.visible.getLast());el=document.getElementById(el.getParent().id);if (/item\d-active/.test(el.className)){el.className=el.className.replace(/(item\d)-active/,"$1")}}
if(self.sections.contains(id_section)){clearTimers();self.sectionsHideCnt[self.sections.indexOf(id_section)]++;var cnt=self.sectionsShowCnt[self.sections.indexOf(id_section)];var timerId=setTimeout(function(a,b){return function(){self.showSection(a,b)}}(id_section,cnt),self.delay.show);self.timers.push(timerId)} else{if(self.visible.length){clearTimers();var timerId=setTimeout(function(a,b){return function(){self.showItem(a,b)}}(this.id,self.itemShowCnt),self.delay.show);self.timers.push(timerId)}}}
function itemOut(){self.itemShowCnt++;var id_section=this.id+"-section";if(self.sections.contains(id_section)){self.sectionsShowCnt[self.sections.indexOf(id_section)]++;if(self.visible.contains(id_section)){var cnt=self.sectionsHideCnt[self.sections.indexOf(id_section)];var timerId=setTimeout(function(a,b){return function(){self.hideSection(a,b)}}(id_section,cnt),self.delay.hide);self.timers.push(timerId)}}}
function sectionOver(){self.sectionsHideCnt[self.sections.indexOf(this.id)]++;var el=new Element(this.id);var parent=document.getElementById(el.getParent().id);if(!/item\d-active/.test(parent.className)){parent.className=parent.className.replace(/(item\d)/,"$1-active")}}
function sectionOut(){self.sectionsShowCnt[self.sections.indexOf(this.id)]++;var cnt=self.sectionsHideCnt[self.sections.indexOf(this.id)];var timerId=setTimeout(function(a,b){return function(){self.hideSection(a,b)}}(this.id,cnt),self.delay.hide);self.timers.push(timerId)}
this.showSection=function(id,cnt){if(typeof cnt!="undefined"){if(cnt!=this.sectionsShowCnt[this.sections.indexOf(id)]){return}}
this.sectionsShowCnt[this.sections.indexOf(id)]++;if(this.visible.length){if(id==this.visible.getLast()){return}
var el=new Element(id);var parents=el.getParentSections();for(var i=this.visible.length-1;i>=0;i--){if(parents.contains(this.visible[i])){break} else{this.hideSection(this.visible[i])}}}
var el=new Element(id);var parent=document.getElementById(el.getParent().id);if(!/item\d-active/.test(parent.className)){parent.className=parent.className.replace(/(item\d)/,"$1-active")}
if(document.all){document.getElementById(id).style.display="block"}
document.getElementById(id).style.visibility="visible";document.getElementById(id).style.zIndex=this.zIndex.visible;if(this.fixIeSelectBoxBug&&this.browser.ie6){var div=document.getElementById(id);var iframe=document.getElementById(id+"-iframe");iframe.style.width=div.offsetWidth+parseInt(div.currentStyle.borderLeftWidth)+parseInt(div.currentStyle.borderRightWidth);iframe.style.height=div.offsetHeight+parseInt(div.currentStyle.borderTopWidth)+parseInt(div.currentStyle.borderBottomWidth);iframe.style.top=-parseInt(div.currentStyle.borderTopWidth);iframe.style.left=-parseInt(div.currentStyle.borderLeftWidth);iframe.style.zIndex=div.style.zIndex-1;iframe.style.display="block"}
this.visible.push(id)}
this.showItem=function(id,cnt){if(typeof cnt!="undefined"){if(cnt!=this.itemShowCnt){return}}
this.itemShowCnt++;if(this.visible.length){var el=new Element(id+"-section");var parents=el.getParentSections();for(var i=this.visible.length-1;i>=0;i--){if(parents.contains(this.visible[i])){break} else{this.hideSection(this.visible[i])}}}}
this.hideSection=function(id,cnt){if(typeof cnt!="undefined"){if(cnt!=this.sectionsHideCnt[this.sections.indexOf(id)]){return}
if(id==this.visible.getLast()){for(var i=this.visible.length-1;i>=0;i--){this.hideSection(this.visible[i])}
return}}
var el=new Element(id);var parent=document.getElementById(el.getParent().id);if (/item\d-active/.test(parent.className)){parent.className=parent.className.replace(/(item\d)-active/,"$1")}
document.getElementById(id).style.zIndex=this.zIndex.hidden;document.getElementById(id).style.visibility="hidden";if(document.all){document.getElementById(id).style.display="none"}
if(this.fixIeSelectBoxBug&&this.browser.ie6){var iframe=document.getElementById(id+"-iframe");iframe.style.display="none"}
if(this.visible.contains(id)){if(id==this.visible.getLast()){this.visible.pop()} else{return}} else{return}
this.sectionsHideCnt[this.sections.indexOf(id)]++}
function Element(id){this.menu=self;this.id=id;this.getLevel=function(){var s=this.id.substr(this.menu.id.length);return s.substrCount("-")}
this.getParent=function(){var s=this.id.substr(this.menu.id.length);var a=s.split("-");a.pop();return new Element(this.menu.id+a.join("-"))}
this.hasParent=function(){var s=this.id.substr(this.menu.id.length);var a=s.split("-");return a.length>2}
this.hasChilds=function(){return Boolean(document.getElementById(this.id+"-section"))}
this.getParentSections=function(){var s=this.id.substr(this.menu.id.length);s=s.substr(0,s.length-"-section".length);var a=s.split("-");a.shift();a.pop();var s=this.menu.id;var parents=[];for(var i=0;i<a.length;i++){s+=("-"+a[i]);parents.push(s+"-section")}
return parents}
this.level=this.getLevel()}
function clearTimers(){for(var i=self.timers.length-1;i>=0;i--){clearTimeout(self.timers[i]);self.timers.pop()}}
var self=this;this.id=id;this.tree=[];this.sections=[];this.sectionsShowCnt=[];this.sectionsHideCnt=[];this.itemShowCnt=0;this.timers=[];this.visible=[]}
if(typeof Array.prototype.indexOf=="undefined"){Array.prototype.indexOf=function(item){for(var i=0;i<this.length;i++){if(this[i]===item){return i}}
return-1}}
if(typeof Array.prototype.contains=="undefined"){Array.prototype.contains=function(s){for(var i=0;i<this.length;i++){if(this[i]===s){return true}}
return false}}
if(typeof String.prototype.substrCount=="undefined"){String.prototype.substrCount=function(s){return this.split(s).length-1}}
if(typeof Array.prototype.getLast=="undefined"){Array.prototype.getLast=function(){return this[this.length-1]}}

/* XXX ERROR -- could not find 'ie5.js'*/

/* - fckeditor.js - */
// http://www.nlsenlaw.org/portal_javascripts/fckeditor.js?original=1
var FCKeditor=function(instanceName,width,height,toolbarSet,value){this.InstanceName=instanceName ;this.Width=width||'100%' ;this.Height=height||'200' ;this.ToolbarSet=toolbarSet||'Default' ;this.Value=value||'' ;this.BasePath='/fckeditor/' ;this.CheckBrowser=true ;this.DisplayErrors=true ;this.EnableSafari=false ;this.EnableOpera=false ;this.Config=new Object() ;this.OnError=null }
FCKeditor.prototype.Version='2.4.3' ;FCKeditor.prototype.VersionBuild='15657' ;FCKeditor.prototype.Create=function(){document.write(this.CreateHtml()) }
FCKeditor.prototype.CreateHtml=function(){if(!this.InstanceName||this.InstanceName.length==0){this._ThrowError(701,'You must specify an instance name.') ;return '' }
var sHtml='<div>' ;if(!this.CheckBrowser||this._IsCompatibleBrowser()){sHtml+='<input type="hidden" id="'+this.InstanceName+'" name="'+this.InstanceName+'" value="'+this._HTMLEncode(this.Value)+'" style="display:none" />' ;sHtml+=this._GetConfigHtml() ;sHtml+=this._GetIFrameHtml() }
else{var sWidth=this.Width.toString().indexOf('%')>0?this.Width:this.Width+'px' ;var sHeight=this.Height.toString().indexOf('%')>0?this.Height:this.Height+'px' ;sHtml+='<textarea name="'+this.InstanceName+'" rows="4" cols="40" style="width:'+sWidth+';height:'+sHeight+'">'+this._HTMLEncode(this.Value)+'<\/textarea>' }
sHtml+='</div>' ;return sHtml }
FCKeditor.prototype.ReplaceTextarea=function(){if(!this.CheckBrowser||this._IsCompatibleBrowser()){var oTextarea=document.getElementById(this.InstanceName) ;var colElementsByName=document.getElementsByName(this.InstanceName) ;var i=0;while(oTextarea||i==0){if(oTextarea&&oTextarea.tagName.toLowerCase()=='textarea')
break ;oTextarea=colElementsByName[i++] }
if(!oTextarea){alert('Error: The TEXTAREA with id or name set to "'+this.InstanceName+'" was not found') ;return }
oTextarea.style.display='none' ;this._InsertHtmlBefore(this._GetConfigHtml(),oTextarea) ;this._InsertHtmlBefore(this._GetIFrameHtml(),oTextarea) }}
FCKeditor.prototype._InsertHtmlBefore=function(html,element){if(element.insertAdjacentHTML)
element.insertAdjacentHTML('beforeBegin',html) ;else{var oRange=document.createRange() ;oRange.setStartBefore(element) ;var oFragment=oRange.createContextualFragment(html);element.parentNode.insertBefore(oFragment,element) }}
FCKeditor.prototype._GetConfigHtml=function(){var sConfig='' ;for(var o in this.Config){if(sConfig.length>0) sConfig+='&amp;' ;sConfig+=encodeURIComponent(o)+'='+encodeURIComponent(this.Config[o]) }
return '<input type="hidden" id="'+this.InstanceName+'___Config" value="'+sConfig+'" style="display:none" />' }
FCKeditor.prototype._GetIFrameHtml=function(){var sFile='fckeditor.html' ;try{if((/fcksource=true/i).test(window.top.location.search))
sFile='fckeditor.original.html' }
catch(e){}
var sLink=this.BasePath+'editor/'+sFile+'?InstanceName='+encodeURIComponent(this.InstanceName) ;if(this.ToolbarSet) sLink+='&amp;Toolbar='+this.ToolbarSet ;return '<iframe id="'+this.InstanceName+'___Frame" src="'+sLink+'" width="'+this.Width+'" height="'+this.Height+'" frameborder="0" scrolling="no"></iframe>' }
FCKeditor.prototype._IsCompatibleBrowser=function(){return FCKeditor_IsCompatibleBrowser(this.EnableSafari,this.EnableOpera) }
FCKeditor.prototype._ThrowError=function(errorNumber,errorDescription){this.ErrorNumber=errorNumber ;this.ErrorDescription=errorDescription ;if(this.DisplayErrors){document.write('<div style="COLOR: #ff0000">') ;document.write('[ FCKeditor Error '+this.ErrorNumber+': '+this.ErrorDescription+' ]') ;document.write('</div>') }
if(typeof(this.OnError)=='function')
this.OnError(this,errorNumber,errorDescription) }
FCKeditor.prototype._HTMLEncode=function(text){if(typeof(text)!="string")
text=text.toString() ;text=text.replace(/&/g,"&amp;").replace(/"/g, "&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;") ;return text }
function FCKeditor_IsCompatibleBrowser(enableSafari,enableOpera){var sAgent=navigator.userAgent.toLowerCase() ;if(sAgent.indexOf("msie")!=-1&&sAgent.indexOf("mac")==-1&&sAgent.indexOf("opera")==-1){var sBrowserVersion=navigator.appVersion.match(/MSIE (.\..)/)[1] ;return(sBrowserVersion>=5.5) }
if(navigator.product=="Gecko"&&navigator.productSub>=20030210&&!(typeof(opera)=='object'&&opera.postError))
return true ;if(enableOpera&&sAgent.indexOf('opera')==0&&parseInt(navigator.appVersion,10)>=9)
return true ;if(enableSafari&&sAgent.indexOf('safari')!=-1)
return(sAgent.match(/safari\/(\d+)/ )[1] >= 312 ) ;	// Build must be at least 312(1.3)
return false }

/* - fck_plone.js - */
// http://www.nlsenlaw.org/portal_javascripts/fck_plone.js?original=1
var FCKBaseHref={};makeLinksRelative=function(basehref,contents){var base=basehref.replace('http://www.nlsenlaw.org','');var href=base.replace(/\/[^\/]*$/,'/');var hrefparts=href.split('/');return contents.replace(/(<[^>]* (?:src|href)=")([^"]*)"/g,
function(str,tag,url,offset,contents){url=url.replace('http://www.nlsenlaw.org','');if(url.substring(0,1)=='#'){str=tag+url+'"'}
else{var urlparts=url.split('#');var anchor=urlparts[1]||'';url=urlparts[0];var urlparts=url.split('/');var common=0;while(common<urlparts.length&&common<hrefparts.length&&urlparts[common]==hrefparts[common])
common++;var last=urlparts[common];if(common+1==urlparts.length&&last=='emptypage'){urlparts[common]=''}
if(common>0){var path=new Array();var i=0;for(;i+common<hrefparts.length-1;i++){path[i]='..'};while(common<urlparts.length){path[i++]=urlparts[common++]};if(i==0){path[i++]='.'}
str=path.join('/');if(anchor){str=[str,anchor].join('#')}
str=tag+str+'"'}}
return str})};finalizePublication=function(editorInstance){var oField=editorInstance.LinkedField;var fieldName=oField.name;var baseHref=FCKBaseHref[fieldName];if(baseHref){relativeLinksHtml=makeLinksRelative(FCKBaseHref[fieldName],editorInstance.GetXHTML());oField.value=relativeLinksHtml}}
getParamValue=function(id){value=document.getElementById(id).value;if(value=='true') return true;if(value=='false') return false;return value}
FCKeditor_Plone_start_instance=function(fckContainer,inputname){var inputContainer=document.getElementById(inputname+'_'+'cleaninput');if(inputContainer){var fckParams=['path_user','base_path','fck_basehref','links_basehref','input_url','allow_server_browsing','browser_root','allow_file_upload','allow_image_upload','allow_flash_upload','fck_skin_path','lang','fck_default_r2l','force_paste_as_text','allow_latin_entities','spellchecker','keyboard_entermode','keyboard_shiftentermode','fck_toolbar','editor_width','editor_height'];var fckValues={};for(var i=0;i<fckParams.length;i++){var id=inputname+'_'+fckParams [i];fckValues [fckParams [i]]=getParamValue(id)}
var oFck=new FCKeditor(inputname);var pathUser=fckValues ['path_user']+'/';oFck.BasePath=fckValues ['base_path']+'/';oFck.Config['CustomConfigurationsPath']=fckValues ['input_url']+'/fckconfigPlone.js?field_name='+inputname;oFck.BaseHref=fckValues ['fck_basehref'];FCKBaseHref[inputname]=fckValues ['links_basehref'];oFck.Value=inputContainer.innerHTML;oFck.Config['LinkBrowser']=fckValues ['allow_server_browsing'];oFck.Config['LinkBrowserURL']=fckValues ['base_path']+'/fckbrowser/browser.html?field_name='+inputname+'&Connector='+fckValues ['input_url']+'/connectorPlone&ServerPath='+fckValues ['browser_root']+'&CurrentPath='+pathUser ;oFck.Config['LinkUpload']=fckValues ['allow_file_upload'] ;oFck.Config['LinkUploadURL']=fckValues ['input_url']+'/uploadPlone?field_name='+inputname+'&CurrentPath='+pathUser;oFck.Config['ImageBrowser']=fckValues ['allow_server_browsing'];oFck.Config['ImageBrowserURL']=fckValues ['base_path']+'/fckbrowser/browser.html?field_name='+inputname+'&Type=Image&Connector='+fckValues ['input_url']+'/connectorPlone&ServerPath='+fckValues ['browser_root']+'&CurrentPath='+pathUser ;oFck.Config['ImageUpload']=fckValues ['allow_image_upload'] ;oFck.Config['ImageUploadURL']=fckValues ['input_url']+'/uploadPlone?field_name='+inputname+'&CurrentPath='+pathUser;oFck.Config['FlashBrowser']=fckValues ['allow_server_browsing'];oFck.Config['FlashBrowserURL']=fckValues ['base_path']+'/fckbrowser/browser.html?field_name='+inputname+'&Type=Flash&Connector='+fckValues ['input_url']+'/connectorPlone&ServerPath='+fckValues ['browser_root']+'&CurrentPath='+pathUser ;oFck.Config['FlashUpload']=fckValues ['allow_flash_upload'] ;oFck.Config['FlashUploadURL']=fckValues ['input_url']+'/uploadPlone?field_name='+inputname+'&CurrentPath='+pathUser;oFck.Config['SkinPath']=fckValues ['base_path']+'/editor/'+fckValues ['fck_skin_path'];oFck.Config['AutoDetectLanguage']=false;oFck.Config['DefaultLanguage']=fckValues ['lang'];oFck.Config['ForcePasteAsPlainText']=fckValues ['force_paste_as_text'];oFck.Config['IncludeLatinEntities']=fckValues ['allow_latin_entities'];oFck.Config['SpellChecker']=fckValues ['spellchecker'];oFck.Config['EnterMode']=fckValues ['keyboard_entermode'];oFck.Config['ShiftEnterMode']=fckValues ['keyboard_shiftentermode'];oFck.ToolbarSet=fckValues ['fck_toolbar'];oFck.Width=fckValues ['editor_width'];oFck.Height=fckValues ['editor_height'];try{fckContainer.innerHTML=oFck.CreateHtml();document.getElementById(inputname+'_fckLoading').style.display='none'}
catch(e){document.getElementById(inputname+'_fckLoading').style.display='none';document.getElementById(inputname+'_fckError').style.display='block'}}}
Save_inline=function(fieldname,form,editorInstance){if(editorInstance.Commands.GetCommand('FitWindow').GetState()){kukit.log('Full screen mode must be disabled before saving inline');editorInstance.Commands.GetCommand('FitWindow').Execute()} ;saveField=document.getElementById(fieldname+'_fckSaveField');if(saveField){kukit.log('Fire the savekupu server event = save inline without submitting');saveField.style.visibility='visible';if(saveField.fireEvent){saveField.fireEvent('onChange')}
else{var evt=document.createEvent("HTMLEvents");evt.initEvent("change",true,true);saveField.dispatchEvent(evt)}
comp=(setTimeout("saveField.style.visibility='hidden'",2000));return false}
else{kukit.log('Try to submit the form in portal_factory');window.onbeforeunload=null;form.submit()}}


/* - fck_ploneInit.js - */
// http://www.nlsenlaw.org/portal_javascripts/fck_ploneInit.js?original=1
function getElementsByClassName(oElm,strTagName,strClassName){var arrElements=(strTagName=="*"&&oElm.all)?oElm.all:oElm.getElementsByTagName(strTagName);var arrReturnElements=new Array();strClassName=strClassName.replace(/\-/g,"\\-");var oRegExp=new RegExp("(^|\\s)"+strClassName+"(\\s|$)");var oElement;for(var i=0;i<arrElements.length;i++){oElement=arrElements[i];if(oRegExp.test(oElement.className)){arrReturnElements.push(oElement)}}
return(arrReturnElements)}
function FCKeditor_OnComplete(editorInstance){editorInstance.Events.AttachEvent('OnAfterLinkedFieldUpdate',finalizePublication) }
FCKeditor_Plone_Init=function(){var fckContainers=getElementsByClassName(document,'div','fckContainer');for(var i=0;i<fckContainers.length;i++){var fckContainer=fckContainers [i];var fckContainerId=fckContainer.getAttribute('id');var inputname=fckContainerId.replace("_fckContainer","");FCKeditor_Plone_start_instance(fckContainer,inputname)}}
registerPloneFunction(FCKeditor_Plone_Init);

/* - mark_special_links.js - */
// http://www.nlsenlaw.org/portal_javascripts/mark_special_links.js?original=1
function scanforlinks(){if(!W3CDOM){return false}
if((typeof external_links_in_content_only!='undefined')&&(external_links_in_content_only==false)){links=document.getElementsByTagName('a');for(i=0;i<links.length;i++){if((links[i].getAttribute('href'))&&(links[i].className.indexOf('link-plain')==-1)){var linkval=links[i].getAttribute('href');if(linkval.toLowerCase().indexOf(window.location.protocol+'//'+window.location.host)==0){} else if(linkval.indexOf('http:')!=0){} else{links[i].setAttribute('target','_blank')}}}}
contentarea=getContentArea();if(!contentarea)
return false;links=contentarea.getElementsByTagName('a');for(i=0;i<links.length;i++){if((links[i].getAttribute('href'))&&(links[i].className.indexOf('link-plain')==-1)){var linkval=links[i].getAttribute('href');if(linkval.toLowerCase().indexOf(window.location.protocol+'//'+window.location.host)==0){} else if(linkval.indexOf('http:')!=0){protocols=['mailto','ftp','news','irc','h323','sip','callto','https','feed','webcal'];for(p=0;p<protocols.length;p++){if(linkval.indexOf(protocols[p]+':')==0){wrapNode(links[i],'span','link-'+protocols[p]);break}}} else{if(links[i].getElementsByTagName('img').length==0){wrapNode(links[i],'span','link-external')}
if((typeof external_links_open_new_window!='undefined')&&(external_links_open_new_window==true)){links[i].setAttribute('target','_blank')}}}}};registerPloneFunction(scanforlinks);
