
var cssQuery=function(){var version="2.0.2";var $COMMA=/\s*,\s*/;var cssQuery=function($selector,$$from){try{var $match=[];var $useCache=arguments.callee.caching&&!$$from;var $base=($$from)?($$from.constructor==Array)?$$from:[$$from]:[document];var $$selectors=parseSelector($selector).split($COMMA),i;for(i=0;i<$$selectors.length;i++){$selector=_toStream($$selectors[i]);if(isMSIE&&$selector.slice(0,3).join("")==" *#"){$selector=$selector.slice(2);$$from=_msie_selectById([],$base,$selector[1]);}else $$from=$base;var j=0,$token,$filter,$arguments,$cacheSelector="";while(j<$selector.length){$token=$selector[j++];$filter=$selector[j++];$cacheSelector+=$token+$filter;$arguments="";if($selector[j]=="("){while($selector[j++]!=")"&&j<$selector.length){$arguments+=$selector[j];}
$arguments=$arguments.slice(0,-1);$cacheSelector+="("+$arguments+")";}
$$from=($useCache&&cache[$cacheSelector])?cache[$cacheSelector]:select($$from,$token,$filter,$arguments);if($useCache)cache[$cacheSelector]=$$from;}
$match=$match.concat($$from);}
delete cssQuery.error;return $match;}catch($error){cssQuery.error=$error;return[];}};cssQuery.toString=function(){return"function cssQuery() {\n  [version "+version+"]\n}";};var cache={};cssQuery.caching=false;cssQuery.clearCache=function($selector){if($selector){$selector=_toStream($selector).join("");delete cache[$selector];}else cache={};};var modules={};var loaded=false;cssQuery.addModule=function($name,$script){if(loaded)eval("$script="+String($script));modules[$name]=new $script();;};cssQuery.valueOf=function($code){return $code?eval($code):this;};var selectors={};var pseudoClasses={};var AttributeSelector={match:/\[([\w-]+(\|[\w-]+)?)\s*(\W?=)?\s*([^\]]*)\]/};var attributeSelectors=[];selectors[" "]=function($results,$from,$tagName,$namespace){var $element,i,j;for(i=0;i<$from.length;i++){var $subset=getElementsByTagName($from[i],$tagName,$namespace);for(j=0;($element=$subset[j]);j++){if(thisElement($element)&&compareNamespace($element,$namespace))
$results.push($element);}}};selectors["#"]=function($results,$from,$id){var $element,j;for(j=0;($element=$from[j]);j++)if($element.id==$id)$results.push($element);};selectors["."]=function($results,$from,$className){$className=new RegExp("(^|\\s)"+$className+"(\\s|$)");var $element,i;for(i=0;($element=$from[i]);i++)
if($className.test($element.className))$results.push($element);};selectors[":"]=function($results,$from,$pseudoClass,$arguments){var $test=pseudoClasses[$pseudoClass],$element,i;if($test)for(i=0;($element=$from[i]);i++)
if($test($element,$arguments))$results.push($element);};pseudoClasses["link"]=function($element){var $document=getDocument($element);if($document.links)for(var i=0;i<$document.links.length;i++){if($document.links[i]==$element)return true;}};pseudoClasses["visited"]=function($element){};var thisElement=function($element){return($element&&$element.nodeType==1&&$element.tagName!="!")?$element:null;};var previousElementSibling=function($element){while($element&&($element=$element.previousSibling)&&!thisElement($element))continue;return $element;};var nextElementSibling=function($element){while($element&&($element=$element.nextSibling)&&!thisElement($element))continue;return $element;};var firstElementChild=function($element){return thisElement($element.firstChild)||nextElementSibling($element.firstChild);};var lastElementChild=function($element){return thisElement($element.lastChild)||previousElementSibling($element.lastChild);};var childElements=function($element){var $childElements=[];$element=firstElementChild($element);while($element){$childElements.push($element);$element=nextElementSibling($element);}
return $childElements;};var isMSIE=true;var isXML=function($element){var $document=getDocument($element);return(typeof $document.mimeType=="unknown")?/\.xml$/i.test($document.URL):Boolean($document.mimeType=="XML Document");};var getDocument=function($element){return $element.ownerDocument||$element.document;};var getElementsByTagName=function($element,$tagName){return($tagName=="*"&&$element.all)?$element.all:$element.getElementsByTagName($tagName);};var compareTagName=function($element,$tagName,$namespace){if($tagName=="*")return thisElement($element);if(!compareNamespace($element,$namespace))return false;if(!isXML($element))$tagName=$tagName.toUpperCase();return $element.tagName==$tagName;};var compareNamespace=function($element,$namespace){return!$namespace||($namespace=="*")||($element.scopeName==$namespace);};var getTextContent=function($element){return $element.innerText;};function _msie_selectById($results,$from,id){var $match,i,j;for(i=0;i<$from.length;i++){if($match=$from[i].all.item(id)){if($match.id==id)$results.push($match);else if($match.length!=null){for(j=0;j<$match.length;j++){if($match[j].id==id)$results.push($match[j]);}}}}
return $results;};if(![].push)Array.prototype.push=function(){for(var i=0;i<arguments.length;i++){this[this.length]=arguments[i];}
return this.length;};var $NAMESPACE=/\|/;function select($$from,$token,$filter,$arguments){if($NAMESPACE.test($filter)){$filter=$filter.split($NAMESPACE);$arguments=$filter[0];$filter=$filter[1];}
var $results=[];if(selectors[$token]){selectors[$token]($results,$$from,$filter,$arguments);}
return $results;};var $STANDARD_SELECT=/^[^\s>+~]/;var $$STREAM=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function _toStream($selector){if($STANDARD_SELECT.test($selector))$selector=" "+$selector;return $selector.match($$STREAM)||[];};var $WHITESPACE=/\s*([\s>+~(),]|^|$)\s*/g;var $IMPLIED_ALL=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var parseSelector=function($selector){return $selector.replace($WHITESPACE,"$1").replace($IMPLIED_ALL,"$1*$2");};var Quote={toString:function(){return"'"},match:/^('[^']*')|("[^"]*")$/,test:function($string){return this.match.test($string);},add:function($string){return this.test($string)?$string:this+$string+this;},remove:function($string){return this.test($string)?$string.slice(1,-1):$string;}};var getText=function($text){return Quote.remove($text);};var $ESCAPE=/([\/()[\]?{}|*+-])/g;function regEscape($string){return $string.replace($ESCAPE,"\\$1");};loaded=true;return cssQuery;}();function RemoteDataProvider(sUrl){this.sUrl=sUrl;this.bAsync=true;this.iTimeout=0;}
RemoteDataProvider.prototype.x_GetHttpObj=function(){var oHttpObj=null;try{oHttpObj=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{oHttpObj=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){oHttpObj=null;}}
if(!oHttpObj&&typeof XMLHttpRequest!="undefined"){oHttpObj=new XMLHttpRequest();}
this.oHttpObj=oHttpObj;return oHttpObj;};RemoteDataProvider.prototype.x_onChange=function(oHttpObj,oTimer){if(oTimer.bTimeout){return;}
if(oHttpObj.readyState==4&&oHttpObj.status==200){if(oTimer.oTimer){clearTimeout(oTimer.oTimer);}
this.onSuccess(oHttpObj);this.onStop();}else if(oHttpObj.readyState==4&&oHttpObj.status!=200){if(oTimer.oTimer){clearTimeout(oTimer.oTimer);}
this.onError(oHttpObj);this.onStop();}};RemoteDataProvider.prototype.x_Init=function(oTimer){var oHttpObj=this.x_GetHttpObj();if(null==oHttpObj){return null;}
if(oHttpObj.readyState!==0){oHttpObj.abort();}
var oThis=this;if(this.bAsync){oHttpObj.onreadystatechange=function(){oThis.x_onChange(oHttpObj,oTimer);};}
this.iActiveRequests++;this.onStart();if(this.iTimeout>0){oTimer.bTimeout=false;oTimer.oTimer=setTimeout(function(){oTimer.bTimeout=true;oHttpObj.abort();oThis.onTimeout(oThis.iTimeout);},this.iTimeout);}
return oHttpObj;};RemoteDataProvider.prototype.Get=function(sRequest){var sUrl=this.sUrl+(sRequest?sRequest:"");var oTimer={};var oHttpObj=this.x_Init(oTimer);if(oHttpObj){oHttpObj.open("get",sUrl,this.bAsync);oHttpObj.send(null);if(!this.bAsync){this.x_onChange(oHttpObj,oTimer);}}};RemoteDataProvider.prototype.Post=function(sRequest){this.Request(null,sRequest);};RemoteDataProvider.prototype.Request=function(sGetRequest,sPostRequest){var sUrl=this.sUrl+(sGetRequest?sGetRequest:"");var oTimer={};var oHttpObj=this.x_Init(oTimer);if(oHttpObj){if(typeof sPostRequest!="string"||sPostRequest===""){sPostRequest="";}
oHttpObj.open("post",sUrl,this.bAsync);oHttpObj.setRequestHeader("Content-type","application/x-www-form-urlencoded");oHttpObj.setRequestHeader("Content-length",sPostRequest.length);oHttpObj.send(sPostRequest);if(!this.bAsync){this.x_onChange(oHttpObj,oTimer);}}};RemoteDataProvider.prototype.onSuccess=function(obj){alert(["succes:",obj.responseText]);};RemoteDataProvider.prototype.onStart=function(){};RemoteDataProvider.prototype.onStop=function(){};RemoteDataProvider.prototype.onError=function(obj){};RemoteDataProvider.prototype.onTimeout=function(iTime){};RemoteDataProvider.prototype.Abort=function(){this.oHttpObj.abort();}
xmlHttpCall=function(siteName,portletPath,actionName,args,callback,userArgs,oThis){var xhrArgs={'p$site':siteName,'p$rq':portletPath+":"+actionName};for(var arg in args){xhrArgs[arg]=args[arg];}
var query_string="";var hasValue=false;for(var arg in xhrArgs){var sep=(hasValue)?"&":"";query_string+=sep+encodeURIComponent(arg);if(xhrArgs[arg]!=null){query_string+="="+encodeURIComponent(xhrArgs[arg]);}
hasValue=true;}
var rdp=new RemoteDataProvider(window.location.href.replace(/\?.*/,''));rdp.bAsync=(callback!=null);if(rdp.bAsync){xmlHttpCall._addCall(rdp);}
rdp.iTimeout=10000;rdp.onSuccess=rdp.onError=function(obj){xmlHttpCall._removeCall(rdp);if(callback&&typeof(callback)=='function'){if(oThis!=null){callback.call(oThis,obj,userArgs);}else{callback(obj,userArgs);}}else{throw"xmlHttpCall: callback not defined or not a function";}};rdp.onTimeout=function(obj){xmlHttpCall._removeCall(rdp);var fakeHttpResponse={'iTimeout':obj,'responseText':null,'responseXML':null,'status':408,'statusText':'Request Timeout'};if(oThis!=null){if(callback&&typeof(callback)=='function'){if(oThis!=null){callback.call(oThis,fakeHttpResponse,userArgs);}else{callback(fakeHttpResponse,userArgs);}}else{throw"xmlHttpCall: callback not defined or not a function (timeout)";}}};rdp.Post(query_string);};xmlHttpCall._activeCalls=[];xmlHttpCall._addCall=function(xhrObj){xmlHttpCall._activeCalls.push(xhrObj);};xmlHttpCall._removeCall=function(xhrObj){for(var i=0;i<xmlHttpCall._activeCalls.length;i++){if(xmlHttpCall._activeCalls[i]===xhrObj){xmlHttpCall._activeCalls.splice(i,1);break;}}};xmlHttpCall.abortCalls=function(){for(var i=xmlHttpCall._activeCalls.length;i--;){try{xmlHttpCall._activeCalls[i].abort();}
catch(e){}}
xmlHttpCall._activeCalls=[];};function Base(){};Base.version="1.0.2";Base.prototype={extend:function(s,v){var e=Base.prototype.extend;if(arguments.length==2){var a=this[s];if((a instanceof Function)&&(v instanceof Function)&&a.valueOf()!=v.valueOf()&&/\bbase\b/.test(v)){var m=v;v=function(){var p=this.base;this.base=a;var r=m.apply(this,arguments);this.base=p;return r};v.valueOf=function(){return m};v.toString=function(){return String(m)}}return this[s]=v}else if(s){var p={toSource:null};var x=["toString","valueOf"];if(Base._)x[2]="constructor";for(var i=0;(n=x[i]);i++){if(s[n]!=p[n]){e.call(this,n,s[n])}}for(var n in s){if(!p[n]){e.call(this,n,s[n])}}}return this},base:function(){}};Base.extend=function(i,s){var e=Base.prototype.extend;if(!i)i={};Base._=1;var p=new this;e.call(p,i);var constructor=p.constructor;p.constructor=this;delete Base._;var k=function(){if(!Base._)constructor.apply(this,arguments);this.constructor=k};k.prototype=p;k.extend=this.extend;k.toString=function(){return String(constructor)};e.call(k,s);var o=constructor?k:p;if(o.init instanceof Function)o.init();return o};var utils={KeyCode_TAB:9,KeyCode_DELETE:46,KeyCode_BACKSPACE:8,KeyCode_LEFT_ARROW:37,KeyCode_RIGHT_ARROW:39,KeyCode_HOME:36,KeyCode_END:35,KeyCode_PAGE_UP:33,KeyCode_PAGE_DOWN:34,KeyCode_UP_ARROW:38,KeyCode_DOWN_ARROW:40,KeyCode_ESC:27,KeyCode_ENTER:13,KeyCode_SPACE:32,KeyCode_SHIFT_KEY:16,KeyCode_CTRL_KEY:17,KeyCode_ALT_KEY:18,KeyCode_LEFT_MS_WINDOWS_KEY:91,KeyCode_RIGHT_MS_WINDOWS_KEY:92,KeyCode_MS_MENU_KEY:93,bIsIe:false,isArray:function(oObj){return this.isObject(oObj)&&oObj.constructor==Array;},isObject:function(oObj){return(oObj&&typeof oObj=='object');},hasClass:function(oEl,className){var regexp=new RegExp("(^|\\s)"+className+"(\\s|$)");return regexp.test(oEl.className);},addClass:function(oEl,className){if(!this.hasClass(oEl,className)){if(oEl.className)oEl.className+=" "+className;else oEl.className=className;}},removeClass:function(oEl,className){var regexp=new RegExp("(^|\\s)"+className+"(\\s|$)");var b=regexp.test(oEl.className);oEl.className=oEl.className.replace(regexp,"$2");return b;},toggleClass:function(oEl,className){if(this.hasClass(oEl,className))this.removeClass(oEl,className);else this.addClass(oEl,className);},createCookie:function(name,value,days,path){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires='; expires='+date.toGMTString();}else expires='';document.cookie=name+'='+value+expires+'; path='+(path?path:"/");},readCookie:function(name){var nameEQ=name+'=';var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return"";},eraseCookie:function(sName,bOnlyInMyDomain){if(bOnlyInMyDomain){this.createCookie(sName,"",-1);}else{var x=sName+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=";document.cookie=x+"ncbi.nlm.nih.gov";document.cookie=x+"nlm.nih.gov";document.cookie=x+"nih.gov";}},addEvent_guid:1,addEvent:function(oEl,sType,fHandler){if(!fHandler.$$guid)fHandler.$$guid=this.addEvent_guid++;if(!oEl.events)oEl.events={};var handlers=oEl.events[sType];if(!handlers){handlers=oEl.events[sType]={};if(oEl["on"+sType]){handlers[0]=oEl["on"+sType];}}
handlers[fHandler.$$guid]=fHandler;oEl["on"+sType]=handleEvent;function handleEvent(e){var returnValue=true;e=e||fixEvent(window.event);var handlers=this.events[e.type];for(var i in handlers){this.$$handleEvent=handlers[i];if(this.$$handleEvent(e)===false){returnValue=false;}}
return returnValue;};function fixEvent(e){e.preventDefault=fixEvent.preventDefault;e.stopPropagation=fixEvent.stopPropagation;return e;};fixEvent.preventDefault=function(){this.returnValue=false;};fixEvent.stopPropagation=function(){this.cancelBubble=true;};try{}finally{element=null;}
return fHandler.$$guid;},removeEvent:function(oEl,sType,fHandler){if(oEl.events&&oEl.events[sType]){delete oEl.events[sType][fHandler.$$guid];return fHandler.$$guid;}
return null;},preventDefault:function(e){if(e.preventDefault)e.preventDefault();else window.event.returnValue=false;},getRelatedTarget:function(e){if(!e)var e=window.event;if(e.relatedTarget)return e.relatedTarget;else if(e.toElement)return e.toElement;},getTargetObj:function(e){var oTarget;e=e||window.event;if(e==null)return null;if(e.srcElement==null)oTarget=e.target;else oTarget=e.srcElement;while(oTarget&&oTarget.nodeType!=1)oTarget=oTarget.parentNode;return oTarget;},getPageDim:function(oEl){var dim={w:0,h:0};var test1,test2;var x;if(undefined==oEl){x=document.body;}else{x=oEl;}
var test1=parseInt(x.scrollHeight);var test2=parseInt(x.offsetHeight);if(test1>test2){dim.w=parseInt(x.scrollWidth);dim.h=test1;}else{dim.w=parseInt(x.offsetWidth);dim.h=test2;}
return dim;},getWindowDim:function(){var dim={w:0,h:0};if(self.innerHeight){dim.w=self.innerWidth;dim.h=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){dim.w=document.documentElement.clientWidth;dim.h=document.documentElement.clientHeight;}else if(document.body){dim.w=document.body.clientWidth;dim.h=document.body.clientHeight;}
dim.w=parseInt(dim.w);dim.h=parseInt(dim.h);return dim;},getXY:function(oEl,oParent){var dim={x:0,y:0,w:oEl.offsetWidth,h:oEl.offsetHeight};if(oEl.offsetParent){while(oEl&&oEl!=oParent){dim.x+=oEl.offsetLeft;dim.y+=oEl.offsetTop;oEl=oEl.offsetParent;}}else if(oEl.x){dim.x=oEl.x;dim.y=oEl.y;}
return dim;},getBorders:function(oEl){var res={t:0,b:0,l:0,r:0,isInner:false};res.t=this.getStyle(oEl,"borderTopWidth");if(typeof(res.t)=="string"&&res.t!=""){res.b=this.getStyle(oEl,"borderBottomWidth");res.l=this.getStyle(oEl,"borderLeftWidth");res.r=this.getStyle(oEl,"borderRightWidth");}else{res.t=this.getStyle(oEl,"border-top-width");res.b=this.getStyle(oEl,"border-bottom-width");res.l=this.getStyle(oEl,"border-left-width");res.r=this.getStyle(oEl,"border-right-width");}
if(oEl.currentStyle){res.isInner=true;}
res.b=parseInt(res.b);if(isNaN(res.b))res.b=0;res.t=parseInt(res.t);if(isNaN(res.t))res.t=0;res.l=parseInt(res.l);if(isNaN(res.l))res.l=0;res.r=parseInt(res.r);if(isNaN(res.r))res.r=0;return res;},getPaddings:function(oEl){var res={t:0,b:0,l:0,r:0};res.t=this.getStyle(oEl,"paddingTop");if(typeof(res.t)=="string"&&res.t!=""){res.b=this.getStyle(oEl,"paddingBottom");res.l=this.getStyle(oEl,"paddingLeft");res.r=this.getStyle(oEl,"paddingRight");}else{res.t=this.getStyle(oEl,"padding-top");res.b=this.getStyle(oEl,"padding-bottom");res.l=this.getStyle(oEl,"padding-left");res.r=this.getStyle(oEl,"padding-right");}
res.b=parseInt(res.b);if(isNaN(res.b))res.b=0;res.t=parseInt(res.t);if(isNaN(res.t))res.t=0;res.l=parseInt(res.l);if(isNaN(res.l))res.l=0;res.r=parseInt(res.r);if(isNaN(res.r))res.r=0;return res;},getMargins:function(oEl){var res={t:0,b:0,l:0,r:0};res.t=this.getStyle(oEl,"marginTop");if(typeof(res.t)=="string"&&res.t!=""){res.b=this.getStyle(oEl,"marginBottom");res.l=this.getStyle(oEl,"marginLeft");res.r=this.getStyle(oEl,"marginRight");}else{res.t=this.getStyle(oEl,"margin-top");res.b=this.getStyle(oEl,"margin-bottom");res.l=this.getStyle(oEl,"margin-left");res.r=this.getStyle(oEl,"margin-right");}
res.b=parseInt(res.b);if(isNaN(res.b))res.b=0;res.t=parseInt(res.t);if(isNaN(res.t))res.t=0;res.l=parseInt(res.l);if(isNaN(res.l))res.l=0;res.r=parseInt(res.r);if(isNaN(res.r))res.r=0;return res;},getScrolls:function(){var dim={x:0,y:0};if(self.pageYOffset){dim.x=self.pageXOffset;dim.y=self.pageYOffset;}else if(document.documentElement){dim.x=document.documentElement.scrollLeft;dim.y=document.documentElement.scrollTop;}else if(document.body){dim.x=document.body.scrollLeft;dim.y=document.body.scrollTop;}
dim.x=parseInt(dim.x);dim.y=parseInt(dim.y);return dim;},insertAfter:function(parent,node,referenceNode){parent.insertBefore(node,referenceNode.nextSibling);},moveAfter:function(item1,item2){var parent=item1.parentNode;parent.removeChild(item1);parent.insertBefore(item1,item2?item2.nextSibling:null);},moveBefore:function(item1,item2){var parent=item1.parentNode;parent.removeChild(item1);parent.insertBefore(item1,item2);},removeChildren:function(oObj){if(!oObj||typeof oObj!="object")return;while(oObj&&oObj.hasChildNodes()){oObj.removeChild(oObj.firstChild);}},removeAllChildren:function(oObj){this.removeChildren(oObj);},getParent:function(oEl){if(oEl){var result=oEl.parentNode;while(result&&result.nodeType!=1)result=result.nextSibling;if(result)return result;}
return null;},getFirstChild:function(oEl){if(oEl){var result=oEl.firstChild;while(result&&result.nodeType!=1)result=result.nextSibling;if(result)return result;}
return null;},getNextSibling:function(oEl,sTagName){if(oEl){var result=oEl.nextSibling;if(sTagName){var tn=sTagName.toUpperCase();while(result&&result.tagName!=tn)result=result.nextSibling;}else{while(result&&result.nodeType!=1)result=result.nextSibling;}
return result;}
return null;},getPreviousSibling:function(oEl,sTagName){if(oEl){var result=oEl.previousSibling;if(sTagName){var tn=sTagName.toUpperCase();while(result&&result.tagName!=tn)result=result.previousSibling;}else{while(result&&result.nodeType!=1)result=result.previousSibling;}
return result;}
return null;},nextItem:function(oEl,sNodeName){if(oEl==null)return null;var next=oEl.nextSibling;while(next!=null){if(next.nodeName==sNodeName)return next;next=next.nextSibling;}
return null;},previousItem:function(oEl,sNodeName){var previous=oEl.previousSibling;while(previous!=null){if(previous.nodeName==sNodeName)return previous;previous=previous.previousSibling;}
return null},containsNode:function(oEl,oContainer){if(oEl==null)
return false;if(oEl==oContainer)
return true;else
return this.containsNode(this.getParent(oEl));},getStyle:function(oEl,sStyleProp){if(oEl.currentStyle){return oEl.currentStyle[sStyleProp];}else if(document.defaultView&&document.defaultView.getComputedStyle){return document.defaultView.getComputedStyle(oEl,'').getPropertyValue(sStyleProp);}},getSelection:function(){var text="";if(window.getSelection){text+=window.getSelection();}else if(document.getSelection){text+=document.getSelection();}else if(document.selection){text+=document.selection.createRange().text;}
return text;},selectRange:function(oEl,iStart,iLength){if(!(oEl&&oEl.value))return;if(oEl.createTextRange){var oRange=oEl.createTextRange();oRange.moveStart("character",iStart);oRange.moveEnd("character",iLength-oEl.value.length);oRange.select();}else if(oEl.setSelectionRange){oEl.setSelectionRange(iStart,iLength);}
oEl.focus();},getTextContent:function(oEl){return oEl.textContent;},getPlural:function(iN,sSuffix){if(undefined==sSuffix){return(iN>1?"s":"");}else if("y"==sSuffix){return(iN>1?"ies":"y");}else{return(iN>1?sSuffix+"s":sSuffix);}},getPeriodToString:function(iDelta){var x="Error, cannot convert '"+iDelta+"'";var sDir;iDelta=parseInt(iDelta);if(iDelta<0){sDir=" before";iDelta=-iDelta;}else
sDir=" ago";var iS=parseInt(iDelta/1000);var iM,iH,iD;if(iS<60){x=iS+" second"+this.getPlural(iS);}else{iM=parseInt(iS/60);if(iM<60){x=iM+" minute"+this.getPlural(iM);}else{iH=parseInt(iM/60);if(iH<24){iM=iM-iH*60;x=iH+" hour"+this.getPlural(iH)+" and "+iM+" minute"+this.getPlural(iM);}else{iD=parseInt(iH/24);iH-=iD*24;x=iD+" day"+this.getPlural(iD)+" and "+iH+" hour"+this.getPlural(iH);}}}
return x+sDir;},isEmail:function(sAddress){var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return(filter.test(sAddress))},getParams:function(sStr,sDelim){var res={};if(undefined==sStr)return res;var a;if(sDelim){a=sStr.split(sDelim);}else{if(sStr.indexOf("&amp;")==-1){a=sStr.split("&");}else{a=sStr.split("&amp;");}}
for(var i=0;i<a.length;i++){var b=a[i].split("=");if(b[0]=="")continue;if(b[1]==""){res[b[0]]=true;}else{res[b[0]]=unescape(b[1]);}}
return res;},Dump:function(oObj,iDepth){if(iDepth==null)iDepth=1;var s='';if(typeof(oObj)=="object"){s+=typeof(oObj)+" {\n";for(var k in oObj){for(var i=0;i<iDepth;i++)s+="  ";s+=k+": "+this.Dump(oObj[k],iDepth+1);}
for(var i=0;i<iDepth-1;i++)s+="  ";s+="}\n"}else{s+=""+oObj+"\n";}
return s;},jsLoader:{load:function(aScripts){var oS=document.getElementsByTagName("script");for(var j=0;j<oS.length;j++){if(oS[j].src=="")continue;this.oLoaded.push(oS[j].src);}
var sHost=document.location.protocol+"/"+"/"+document.location.host;var sPath=document.location.pathname;sPath=sPath.substring(0,sPath.lastIndexOf("/"))+"/";var oHead=document.getElementsByTagName("head")[0];for(var i=0;i<aScripts.length;i++){var sNewSrc=this.sBase+aScripts[i];if(sNewSrc.indexOf(":/"+"/")==-1){if(sNewSrc.indexOf("/")==0){sNewSrc=sHost+sNewSrc;}else{sNewSrc=sHost+sPath+sNewSrc;}}
var oS=document.getElementsByTagName("script");var b=true;for(var j=0;j<this.oLoaded.length;j++){if(sNewSrc==this.oLoaded[j]){b=false;}}
if(b){document.write("<script src='"+sNewSrc+"' type='text/javascript'></script>");this.oLoaded.push(sNewSrc);}}},sBase:"",oLoaded:[]},insertInHtml:function(text,obj){if(document.all){obj.innerHTML+=text;}else{var range=document.createRange();range.setStartAfter(obj);var docFrag=range.createContextualFragment(text);obj.appendChild(docFrag);}},replaceInHtml:function(text,obj){if(document.all){obj.innerHTML=text;}else{while(obj.hasChildNodes())obj.removeChild(obj.firstChild);var range=document.createRange();range.setStartAfter(obj);var docFrag=range.createContextualFragment(text);obj.appendChild(docFrag);}},drawText:function(sText,sId,add){if(!sId)sId="debug";var obj=document.getElementById(sId);if(obj){if(add)
obj.innerHTML="<br/>"+sText;else
obj.innerHTML+=sText;}},createNewId:function(){var newid=null;while(!newid||document.getElementById(newid)){newid="XID"+Math.round(Math.random()*65536).toString(16);}
return newid;}};String.prototype.trimSpaces=function(trimMode){var targetString=this;var iPos=0;if(!trimMode)trimMode=0;if(trimMode==0||trimMode==1){if(targetString.charAt(iPos)==" "){while(targetString.charAt(iPos)==" ")iPos++;targetString=targetString.substr(iPos);}}
iPos=targetString.length-1;if(trimMode==0||trimMode==2){if(targetString.charAt(iPos)==" "){while(targetString.charAt(iPos)==" ")iPos--;targetString=targetString.substr(0,iPos+1);}}
return targetString;}
function $(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element=='string')
element=document.getElementById(element);if(arguments.length==1)
return element;elements.push(element);}
return elements;}
function $C(attrValue,attrName,node,tag){if("*"==attrValue){return $AN(attrName,node,tag);}
var oElements=new Array();if(!node)node=document;if(!tag)tag='*';if(!attrName)attrName='class';var els=node.getElementsByTagName(tag);var elsLen=els.length;var pattern=new RegExp("(^|\\s)"+attrValue+"(\\s|$)");var j=0;for(i=0;i<elsLen;i++){if(attrName=="class"&&pattern.test(els[i].className)){oElements[j++]=els[i];}else if(pattern.test(els[i].getAttribute(attrName))){oElements[j++]=els[i];}}
return oElements;}
function $AN(attrName,node,tag){var oElements=new Array();if(node==null)node=document;if(tag==null)tag='*';var els=node.getElementsByTagName(tag);for(i=0;i<els.length;i++){if(els[i].getAttribute(attrName)>""){oElements[oElements.length]=els[i];}}
return oElements;}
function $N(name,node){var oElements=[];if(node==null)node=document;var els=node.getElementsByName(name);for(i=0;i<els.length;i++){oElements[oElements.length]=els[i];}
return oElements;}
debug=function(){};debug.prototype={constructor:function(){},enable:function(){},disable:function(){}};function Notifier(){this.oQuee={};}
Notifier.prototype.setListener=function(oListener,sMessage,fFunction,oNotifier){function x_setListener(oListener,sMessage,fFunction,oNotifier){for(var j in oThis.oQuee[sMessage]){if(oThis.oQuee[sMessage][j]===oListener){return false;}}
if(!oThis.oQuee[sMessage]){oThis.oQuee[sMessage]=[];}
j=oThis.oQuee[sMessage].length;oThis.oQuee[sMessage][j++]=({obj:oListener,fun:fFunction,ntf:oNotifier});return true;}
var oThis=this;if(utils.isArray(oListener)){for(var i in oListener){x_setListener(oListener[i],sMessage,fFunction,oNotifier);}}else{return x_setListener(oListener,sMessage,fFunction,oNotifier);}};Notifier.prototype.Notify=function(oNotifier,sMessage,oComment,oListener){var sAnyMessage="*";for(var i in this.oQuee[sAnyMessage]){if(null==oListener||this.oQuee[sAnyMessage][i].obj==oListener){if(this.oQuee[sAnyMessage][i].ntf==null||this.oQuee[sAnyMessage][i].ntf===oNotifier){if("function"==typeof this.oQuee[sAnyMessage][i].fun){var fun=this.oQuee[sAnyMessage][i].fun;fun(this.oQuee[sAnyMessage][i].obj,oComment,sMessage,oNotifier);}}}}
for(i in this.oQuee[sMessage]){if(null==oListener||this.oQuee[sMessage][i].obj==oListener){if(this.oQuee[sMessage][i].ntf==null||this.oQuee[sMessage][i].ntf===oNotifier){if("function"==typeof this.oQuee[sMessage][i].fun){if(this.oQuee[sMessage][i].fun(this.oQuee[sMessage][i].obj,oComment,sMessage,oNotifier)){return;}}}}}};Notifier.getInstance=function(){if(!Notifier.instance){Notifier.instance=new Notifier();}
return Notifier.instance;};Dispatcher=Base.extend({constructor:function(oRules,oHierarchy){this.init();},init:function(){this.oNotifier=new Notifier();this.submitOK=true;this.submitter=false;this.submitRequested=false;this.submitChecking=false;this._rules={};},initDataExchange:function(oRules){var oThis=this;var activenames=ActiveNames;var i,j;var rulehash={};activenames=ActiveNames;this.submitOK=true;this.submitRequested=false;this.submitter=null;this.oRules=oRules;for(i=0;i<oRules.length;i++){var name=oRules[i].ename;rulehash[name]=(rulehash[name]||[]);rulehash[name][rulehash[name].length]=oRules[i];}
var links=document.links;for(i=0;i<links.length;i++){initializeControl(links[i]);}
for(name in ActiveNames){var ctrl;var elems=document.getElementsByName(name);for(i=0;i<elems.length;i++){initializeControl(elems[i]);}}
for(var fname in this.dataExchangeFunctions){this.setListener(this,fname,this.dataExchangeFunctions[fname],null);}
function initializeControl(domCtrl){var thisName=domCtrl.name;var j,oRule;if(!(thisName&&typeof activenames[thisName]!=='undefined')){return;}
try{var sActionEvent=oThis.actionEventName(domCtrl);if(sActionEvent>""){if(rulehash[thisName]){oThis.addRule(oThis,sActionEvent,thisName,oThis.doDataExchange,rulehash[thisName]);}
if(activenames[thisName]){oThis.addRule(oThis,sActionEvent,thisName,oThis.doSubmitAttribute,null);}
oThis.listenForEvents(domCtrl,sActionEvent);}}finally{}};},addRule:function(oThis,sEvent,sName,fFunc,oArg){var rules=this._rules;var ename=sName+"$"+sEvent;var i;if(typeof(rules[ename])!='undefined'){for(i=0;i<rules[ename].length;i++){if(rules[ename][i].func==fFunc){return;}}}else{rules[ename]=[];}
rules[ename][rules[ename].length]={'thisptr':oThis,'func':fFunc,'arg':oArg};},getRulesFor:function(sName,sEvent){return this._rules[sName+"$"+sEvent];},listenForEvents:function(domCtrl,sEventName){domCtrl._i_=(domCtrl._i_||[]);if(!domCtrl._i_[sEventName]){domCtrl._i_[sEventName]=1;utils.addEvent(domCtrl,sEventName,this.handleAction);}},doDataExchange:function(eEvent,domTarget,oArg){var d=Dispatcher.getInstance();var rules=oArg;if(!rules){return;}
for(var k=0;k<rules.length;k++){d.notify(domTarget,rules[k].m,rules[k]);}},doSubmitAttribute:function(eEvent,domTarget,oArg){eEvent.preventDefault();eEvent.stopPropagation();console&&console.info("Submitting request because submit attribute set");var realname=domTarget.getAttributeNode("realname");realname=realname?realname.value:null;if(domTarget.name||realname){this.setSubmitSource(realname||domTarget.name);}
if(domTarget.name=="p$ExL"){el=document.getElementsByName('p$el');if((typeof(el)!='undefined')&&(el.length>0)){el[0].value=domTarget.getAttribute("href");}}
Dispatcher.getInstance().requestSubmit();},handleAction:function(e){var d=Dispatcher.getInstance();var t=this;var i;if(t.tagName&&t.tagName.toLowerCase()=='a'){e.preventDefault();e.stopPropagation();}
var realname=this.getAttributeNode("realname");realname=realname?realname.value:null;if(this.name||realname){d.setSubmitSource(realname||this.name);}
d.submitCheckBegin();try{console&&console.info("Executing rule "+t.name+"."+e.type);var rules=d.getRulesFor(t.name,e.type);for(i=0;rules&&(i<rules.length);i++){var rule=rules[i];try{rule.func.call(rule.thisptr,e,t,rule.arg);}catch(err){console&&console.error("Dispatcher.handleAction: rule failed: "+t.name+"$"+e.type+": "+err);}}}catch(err){console&&console.error("Error: handleAction: "+err);}finally{d.submitCheckEnd();}},actionEventName:function(t){var ttype=(t.getAttribute("type")||'').toLowerCase();switch(t.tagName.toLowerCase()){case'select':case'textarea':return'change';case'form':return'';case'input':if(ttype=='text'){return'change';}else if(ttype=='hidden'){return'';}}
return'click';},initHierarchy:function(oTree){if(!oTree||!oTree.name){return;}
var sname=oTree.shortname||oTree.name.substring(1+oTree.name.lastIndexOf("."));try{var c=Portal.Component.create(oTree.type,oTree.name,sname,this.oNotifier);c.realname=oTree.realname;}catch(e){console&&console.group&&console.group("Exception creating portlet "+oTree.name);console&&console.info("Message: "+e.toString());if(typeof(e)!='string'){console&&console.group&&console.group("Details");console&&console.dir&&console.dir(e);console&&console.groupEnd&&console.groupEnd();}
console&&console.group&&console.group("Trace")
console&&console.trace&&console.trace();console&&console.groupEnd&&console.groupEnd();console&&console.groupEnd&&console.groupEnd();}
if(oTree.children){for(var i=0;i<oTree.children.length;i++){this.initHierarchy(oTree.children[i]);}}},submit:function(){if(this.submitCheck()){if(xmlHttpCall&&xmlHttpCall.abortCalls){xmlHttpCall.abortCalls();}
document.forms[0]._submit();}},submitCheck:function(){var oThis=this;var thisForm=document.forms[0];this.submitOK=true;this.vetoWhy=null;this.notify(this,"portal$beforesubmit",{form:thisForm},null);return this.submitOK;},veto:function(whydata){this.submitOK=false;this.vetoWhy=whydata;},isVetoed:function(){return!this.submitOK;},setSubmitSource:function(sourceName){var el=document.getElementsByName('p$a');if((typeof(el)!='undefined')&&(el.length>0)){if(typeof(sourceName)=='undefined'){console&&console.warn("Warning: Can't identify submitter: using p$a=''");}else{el[0].value=sourceName;}}},getSrcDst:function(oRule,oNotifierObj){function x_FindObj(name,sid){var oResult=[];var oControls=$N(name);for(var i=0;i<oControls.length;i++){if("*"==sid||oControls[i].getAttribute("sid")==sid){oResult[oResult.length]=oControls[i];}}
return oResult;}
var oThis=this;var name=oRule.sname;var sid=oRule.ssid;if("#"==name){name=oRule.ename;}
if("#"==sid){sid=oRule.esid;sid=oNotifierObj.getAttribute("sid");}
var oSrc=x_FindObj(name,sid);name=oRule.dname;sid=oRule.dsid;if("#"==name){name=oRule.ename;}
if("#"==sid){sid=oRule.esid;sid=oNotifierObj.getAttribute("sid");}
var oDst=x_FindObj(name,sid);return{src:oSrc,dst:oDst};},setListener:function(oListener,sMessage,fFunction,oNotifier){return this.oNotifier.setListener(oListener,sMessage,fFunction,oNotifier);},notify:function(oNotifier,sMessage,oComment,oListener){return this.oNotifier.Notify(oNotifier,sMessage,oComment,oListener);},dataExchangeFunctions:{CopyValue:function(oListener,oRule,sMessage,oNotifierObj){var dispatcher=oListener;var oSrcDst=dispatcher.getSrcDst(oRule,oNotifierObj);for(var j=0;j<oSrcDst.dst.length;j++){for(var i=0;i<oSrcDst.src.length;i++){oSrcDst.dst[j].value=oSrcDst.src[i].value;}}},AddValue:function(oListener,oRule,sMessage,oNotifierObj){var dispatcher=oListener;var oSrcDst=dispatcher.getSrcDst(oRule,oNotifierObj);for(var j=0;j<oSrcDst.dst.length;j++){for(var i=0;i<oSrcDst.src.length;i++){oSrcDst.dst[j].value+=(oSrcDst.dst[j].value>""?", ":"")+oSrcDst.src[i].value;}}},SetValue:function(oListener,oRule,sMessage,oNotifierObj){var dispatcher=oListener;var oSrcDst=dispatcher.getSrcDst(oRule,oNotifierObj);for(var j=0;j<oSrcDst.dst.length;j++){var dst=oSrcDst.dst[j];if(Dispatcher.isCheckable(dst)){dst.checked=oRule.p[0];}else{dst.value=oRule.p[0];}}},ItemToList:function(oListener,oRule,sMessage,oNotifierObj){var dispatcher=oListener;var oSrcDst=dispatcher.getSrcDst(oRule,oNotifierObj);for(var j=0;j<oSrcDst.dst.length;j++){var dst=oSrcDst.dst[j];var dstval=dst.value.replace(/^\s+/,"").replace(/\s+$/,"");var dstItems=dstval.split(/\s*,\s*/).filter(function(s){return s!=="";});for(var i=0;i<oSrcDst.src.length;i++){var src=oSrcDst.src[i];var sc=Dispatcher.isCheckable(src);var checked=(sc?src.checked:(src.value!==""));var position=dstItems.indexOf(src.value);if(checked&&position<0){dstItems[dstItems.length]=src.value;}
if(!checked&&position>=0){dstItems.splice(position,1);}}
dst.value=dstItems.join(", ");}},PropertyToValue:function(oListener,oRule,sMessage,oNotifierObj){var dispatcher=oListener;var oSrcDst=dispatcher.getSrcDst(oRule,oNotifierObj);for(var j=0;j<oSrcDst.dst.length;j++){for(var i=0;i<oSrcDst.src.length;i++){oSrcDst.dst[j].value=oSrcDst.src[i].getAttribute(oRule.p[0]);}}},PropertyToList:function(oListener,oRule,sMessage,oNotifierObj){var dispatcher=oListener;var oSrcDst=dispatcher.getSrcDst(oRule,oNotifierObj);for(var j=0;j<oSrcDst.dst.length;j++){var dst=oSrcDst.dst[j];var o={};var values=[];var propname=oRule.p[0];for(var i=0;i<oSrcDst.src.length;i++){var src=oSrcDst.src[i];var prop=src.getAttribute(propname);if(!prop){continue;}
var sc=Dispatcher.isCheckable(src);if(sc?src.checked:(prop&&prop!=="")){if(!o[prop]){values[values.length]=prop;}
o[prop]=1;}}
dst.value=values.join(", ");}}},requestSubmit:function(src){console&&console.info("Request submitted");this.submitter=src;this.submitRequested=true;},submitCheckBegin:function(){if(this.submitChecking){throw"ERRINTERNAL: recursive submit check";}
this.submitChecking=true;this.submitter=null;this.submitRequested=false;},submitCheckEnd:function(){if(this.submitRequested){this.submit();}
this.submitChecking=false;this.submitter=null;this.submitRequested=false;}},{_instance:null,getInstance:function(){return Dispatcher._instance||(Dispatcher._instance=new Dispatcher());},onload:function(){var sc="Create components";var si="Initialize components";var d=Dispatcher.getInstance();d.initHierarchy(objHierarchy);d.initDataExchange(ObjectLinks);d.setListener(d,'portal$vetosubmit',function(dst,data,message,src){d.veto(data);},null);var theForm=document.forms[0];if(theForm&&!theForm._submit){theForm._submit=theForm.submit;theForm.submit=function(){Dispatcher.getInstance().requestSubmit();};}},isCheckbox:function(node){var t=node.getAttribute("type");return t&&(t.toLowerCase()=="checkbox");},isRadio:function(node){var t=node.getAttribute("type");return t&&(t.toLowerCase()=="radio");},isCheckable:function(node){return this.isRadio(node)||this.isCheckbox(node);}});document.addEventListener("DOMContentLoaded",Dispatcher.onload);Portal=Base.extend({constructor:function(){this.init();},init:function(){}},{_instance:null,getInstance:function(){return Portal._instance||(Portal._instance=new Portal());},requestSubmit:function(){Dispatcher.getInstance().requestSubmit();},$send:function(sMessage,oData,oDst){var d=Dispatcher.getInstance();d.submitCheckBegin();d.notify(null,sMessage,oData,oDst);d.submitCheckEnd();}});Portal.Component=Base.extend({constructor:function(path,name,notifier){this.init(path,name,notifier);},init:function(path,name,notifier){this.name=name;this.path=path;this.notifier=notifier;if(this.listen){var msg;var isEvent=new RegExp(/^([^<]+)<([^>]+)>/);var m;var d=Dispatcher.getInstance();for(msg in this.listen){m=isEvent.exec(msg);if(m){this.addEvent(m[1],m[2],this.listen[msg],false);}else{this._listen(msg,this.listen[msg],null);}}}
if(this.send){for(msg in this.send){if(this.send[msg]==null){this.send[msg]=this.makeSender(this,msg);}}}},makeSender:function(sender,msg){return function(obj){return sender._send(msg,obj,null);};},getValue:function(attr){var prop=null;var ix;if(typeof attr==="object"){prop=attr.prop;attr=attr.attr;}
else if((ix=attr.indexOf(":"))>=0){prop=attr.substring(ix+1);attr=attr.substring(0,ix);}
var inp=this.getInputs(attr);if(!inp){return null;}
if(inp.length==1){inp=inp[0];return(prop&&prop.toLowerCase()!=="value")?inp.getAttribute(prop):htmlutils.getValue(inp);}
else if(inp.length>0&&(!prop||prop.toLowerCase()==="value")&&(inp[0].type||"").toLowerCase()==="radio"){return htmlutils.getValue(inp);}
var result=[];for(var i=0;i<inp.length;i++){if(prop&&prop.toLowerCase()!=="value"){if(typeof(inp[i][prop])!='undefined'){result[result.length]=inp[i][prop];}else{result[result.length]=inp[i].getAttribute(prop);}}else{result[result.length]=htmlutils.getValue(inp[i]);}}
return result;},getList:function(attr){var ix;var prop=null;if((ix=attr.indexOf(":"))>=0){prop=attr.substring(ix+1);attr=attr.substring(0,ix);}
if(prop){throw"UNIMPLEMENTED: Component.getList: Getting list by property";}
var inp=this.getInputs(attr);if(!inp){return null;}
if(inp.length==1){inp=inp[0];return htmlutils.getList(inp);}
var result=[];for(var i=0;i<inp.length;i++){result[result.length]=htmlutils.getList(inp[i]);}
return result;},setValue:function(attr,value){var prop=null;var ix;if((ix=attr.indexOf(":"))>=0){prop=attr.substring(ix+1);attr=attr.substring(0,ix);}
var inp=this.getInputs(attr);if(inp.length==1){inp=inp[0];if(prop){if(typeof(inp[prop])!='undefined'){inp[prop]=value;}else{inp.setAttribute(prop,value);}}else{inp.value=value;}}else{throw"UNIMPLEMENTED: Cannot (yet) set vector values from scalar";}},getInputs:function(name){var inp=document.getElementsByName(this.path+"."+name);if(!inp||inp.length===0){inp=null;}
return inp;},getInput:function(name){var inp=this.getInputs(name);return((inp&&inp.length>0)?inp[0]:null);},focusInitialInput:function(name,overrideEnterWatch){var inp=this.getInput(name);if(inp){Portal.initialElement.focusElement(inp,overrideEnterWatch);}},has:function(attrname){var inp=document.getElementsByName(this.path+"."+attrname);return(inp&&(inp.length>0));},addEvent:function(inputName,eventName,f,flag){var inputs;var oThis=this;if(typeof(inputName)=='string'){inputs=this.getInputs(inputName);}else if(utils.isArray(inputName)){inputs=inputName;}else{inputs=[inputName];}
if(!inputs){console&&console.warn("Can't find: "+inputName);return;}
var d=Dispatcher.getInstance();for(i=0;i<inputs.length;i++){d.addRule(oThis,eventName,inputs[i].name,f,null);d.listenForEvents(inputs[i],eventName);}
return;},removeEvent:function(inputName,eventName,f,flag){var inputs=this.getInputs(inputName);for(var i=0;inputs&&(i<inputs.length);i++){utils.removeEvent(inputs[i],eventName,f,flag);}},iListen:0,iNextListen:function(){return"L$"+this.iListen++;},_listen:function(sMessage,fFunction,sSource){var oThis=this;var fName=this.iNextListen()+"$"+sMessage;this[fName]=fFunction;var d=Dispatcher.getInstance();d.setListener(oThis,sMessage,function(dst,data,message,src){oThis[fName](message,data,src);},sSource);},_send:function(sMessage,oData,oDst){var d=Dispatcher.getInstance();d.notify(this,sMessage,oData,oDst);},getMetaData:function(){var result={};result.listensFor=[];if(this.listen){for(var msg in this.listen){result.listensFor[result.listensFor.length]=msg;}}
result.sends=[];if(this.send){for(msg in this.send){result.sends[result.sends.length]=msg;}}
result.attributes=[];for(var attr in this.getAttributes()){result.attributes[result.attributes.length]=attr;}
return result;}},{$i:{},$$i:{},create:function(type,path,cname,notifier){var p=Portal.Component.$i;var pelem=path.split(".");for(var i=0;i<pelem.length-1;i++){p=p[pelem[i]];}
var sname=path.substring(1+path.lastIndexOf("."));if(typeof(Portal[type])=='undefined'){throw("No such portlet type: "+type);}
if(typeof(Portal[type][sname])=='undefined'){p[sname]=new Portal[type](path,cname,notifier);}else{try{p[sname]=new Portal[type][sname](path,cname,notifier);}catch(e){console&&console.error("Creating Portlet."+type+"."+sname+": "+e.message);throw e;}}
var l;if(!(l=Portal.Component.$$i[sname])){l=Portal.Component.$$i[sname]=[];}
l[l.length]=p[cname];if(p[cname].beforesubmit){var d=Dispatcher.getInstance();var oThis=this;d.setListener(oThis,"portal$beforesubmit",function(dst,data,message,src){var whydata=p[cname].beforesubmit();if(typeof(whydata)=='boolean'){return whydata;}else if(typeof(whydata)=='object'){d.notify(this,'portal$vetosubmit',whydata,null);return true;}
throw cname+".beforesubmit: returned "+typeof(whydata);},null);}
return p[cname];},get:function(path){return eval("Portal.Component.$i."+path);},getByShortName:function(name){return eval("Portal.Component.$$i."+name);},classExists:function(name){return(typeof(Portal.Component[name])!="undefined");},instanceExists:function(path){try{eval("Portal.Component.$i"+path);return true;}catch(e){}
return false;}});Portal.Layout=Portal.Component.extend({constructor:function(path,name,notifier){this.base(path,name,notifier);}});Portal.Cluster=Portal.Component.extend({constructor:function(path,name,notifier){this.base(path,name,notifier);}});Portal.Portlet=Portal.Component.extend({getAttributes:function(){var t=document.getElementsByTagName("input");var result={};var pathlen=this.path.length;for(var i=0;i<t.length;i++){var it=t[i];var itn=it.getAttribute("name");if(!itn){continue;}
var prefixlen=itn.lastIndexOf(".");var samePrefix=(itn.substring(0,this.path.length)==this.path);if((prefixlen==pathlen)&&samePrefix){result[itn.substring(1+prefixlen)]=it.value;}}
return result;}});$PI=function(path){return Portal.Component.get(path);};$PN=function(name){var c=Portal.Component.getByShortName(name);if(typeof(c)=="undefined"){return null;}
return(c.length==1)?c[0]:c;};htmlutils={accessors:{select:{getValue:function(node){return this.getList(node).join(", ");},getList:function(node){var opts=node.options;var r=[];for(var i=0;i<opts.length;i++){if(opts[i].selected){r[r.length]=opts[i].value;}}
return r;}},button:{getValue:function(node){var attrNode=node.getAttributeNode('value');return(attrNode!==null)?attrNode.nodeValue:null;}},input_radio:{getValue:function(nodes){for(var i=0;i<nodes.length;i++){if(nodes[i].checked)return nodes[i].value;}
return null;}}},getValue:function(elem){var em=elem.length>1?elem[0]:elem;var tagName=em.tagName.toLowerCase();if(tagName==="input"){tagName+="_"+em.type;}
var v=this.accessors[tagName];return v&&v.getValue?v.getValue(elem):elem.value;},getList:function(elem){var v=this.accessors[elem.tagName.toLowerCase()];return v&&v.getList?v.getList(elem):(elem.value?[elem.value]:[]);}};utils.addEvent(window,"load",function(){Portal.getInstance();},false);(function(){Portal.initialElement={count:0,key13Pressed:false,hasListenTimePassed:false,listenTime:175,_focusQueue:null,focus:function(elem,ignoreEnter){if(document.all){elem.blur();}
if(elem&&(!Portal.initialElement.key13Pressed||ignoreEnter)){if(Portal.initialElement.hasListenTimePassed||ignoreEnter){if(elem.createTextRange){var text=elem.createTextRange();text.moveStart('character',elem.value.length);text.collapse();text.select();}
else if(elem.setSelectionRange){elem.focus();var len=elem.value.length;elem.setSelectionRange(len,len);}
else{elem.focus();elem.value=elem.value;}}
else{Portal.initialElement._focusQueue=elem;}}},timerEnd:function(){Portal.initialElement.hasListenTimePassed=true;var elem=Portal.initialElement._focusQueue;if(elem!==null)Portal.initialElement.focus(elem);elem=null;}}
function watchKeyPress(evt){evt=evt||window.event;var keyCode=evt.keyCode||evt.which;if(keyCode==13){Portal.initialElement.key13Pressed=true;Portal.initialElement.count++;}}
if(document.addEventListener){document.addEventListener('keypress',watchKeyPress,false);document.addEventListener('keydown',watchKeyPress,false);}else if(document.attachEvent){document.attachEvent('onkeypress',watchKeyPress);document.attachEvent('onkeydown',watchKeyPress);}
window.setTimeout(Portal.initialElement.timerEnd,Portal.initialElement.listenTime);})();