
/* 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 -
 */

/* - Menu.js - */
// http://www.nesoindia.org/portal_javascripts/Menu.js?original=1
subNav=function(){if(document.all&&document.getElementById){var navRoot=document.getElementById("sub-nav");if(navRoot!=null){for(i=0;i<navRoot.childNodes.length;i++){node=navRoot.childNodes[i];if(node.nodeName=="LI"){node.onmouseover=function(){this.className+=" over"}
node.onmouseout=function(){this.className=this.className.replace(" over","")}}}}}}
window.onload=subNav;

/* - IeHoverFix.js - */
// http://www.nesoindia.org/portal_javascripts/IeHoverFix.js?original=1
sfHover=function(){var el=document.getElementById("sub-nav");if(el!=null){(!/\bnav\b/.test(el.className)&&el.tagName=="UL")
setHover(el)}
var ieNavs=document.getElementsByTagName('ul');for(i=0;i<ieNavs.length;i++){var ul=ieNavs[i];if(/\bnav\b/.test(ul.className))
setHover(ul)}}
function setHover(nav){var ieULs=nav.getElementsByTagName('ul');if(navigator.appVersion.substr(22,3)!="5.0"){for(j=0;j<ieULs.length;j++){var ieMat=document.createElement('iframe');if(document.location.protocol=="https:")
ieMat.src="//0";else if(window.opera!="undefined")
ieMat.src="";else
ieMat.src="javascript:false";ieMat.scrolling="no";ieMat.frameBorder="0";ieMat.style.width=ieULs[j].offsetWidth+"px";ieMat.style.height=ieULs[j].offsetHeight+"px";ieMat.style.zIndex="-1";ieULs[j].insertBefore(ieMat,ieULs[j].childNodes[0]);ieULs[j].style.zIndex="101"}
var ieLIs=nav.getElementsByTagName('li');for(var i=0;i<ieLIs.length;i++) if(ieLIs[i]){ieLIs[i].onmouseover=function(){if(!/\bsfhover\b/.test(this.className))
this.className+=" sfhover"}
ieLIs[i].onmouseout=function(){if(!this.contains(event.toElement))
this.className=this.className.replace(' sfhover','')}}} else{var ieLIs=document.getElementById('nav').getElementsByTagName('li');for(var i=0;i<ieLIs.length;i++) if(ieLIs[i]){ieLIs[i].onmouseover=function(){this.className+=" sfhover";hideSelects()}
ieLIs[i].onmouseout=function(){this.className=this.className.replace(' sfhover','');showSelects()}}}}
function hideSelects(){var oSelects=document.getElementsByTagName("select");for(var i=0;i<oSelects.length;i++)
oSelects[i].className+=" hide"}
function showSelects(){var oSelects=document.getElementsByTagName("select");for(var i=0;i<oSelects.length;i++)
oSelects[i].className=oSelects[i].className.replace(" hide","")}
if (/MSIE 6/.test(navigator.userAgent)&&window.attachEvent) window.attachEvent('onload',sfHover);

/* - EventListener.js - */
// http://www.nesoindia.org/portal_javascripts/EventListener.js?original=1
var EventListener={listeners:[],bSafari:/safari/i.test(navigator.userAgent),addEvents:function(els,type,func,scope){for(var i=0;i<els.length;i++){this.addEvent(els[i],type,func,scope)}},addEvent:function(el,type,func,scope){var handler=this.delegate(func,scope||el);try{el.addEventListener(type,handler,false)} catch(e){el.attachEvent('on'+type,handler)}
var event={element:el,type:type,handler:handler};this.listeners.push(event);return event},removeEvents:function(events){for(var i=0;i<events.length;i++){this.removeEvent(events[i])}},removeEvent:function(event){try{event.element.removeEventListener(event.type,event.handler,false)} catch(e){event.element.detachEvent('on'+event.type,event.handler)}
for(var i=0;i<this.listeners.length;i++){if(this.listeners[i]==event){this.listeners.splice(i,1);break}}},getTarget:function(e,name){var target=e.target||e.srcElement;var reg=name?new RegExp('^'+name+'$','i'):null;while(target&&(target.nodeType!=1||(reg&&!reg.test(target.nodeName)))){target=target.parentNode}
return target},getEvents:function(el,type){var result=[];for(var item,i=0;(item=this.listeners[i++]);){if((!el||el==item.element)&&(!type||type==item.type)){result.push(item)}}
return result},cancelEvent:function(e){this.preventDefault(e);this.stopPropagation(e);return false},preventDefault:function(e){try{e.preventDefault()} catch(exception){e.returnValue=false}
if(this.bSafari){var target=this.getTarget(e,'a');if(target){target.onclick=function(){return false}}}},stopPropagation:function(e){try{e.stopPropagation()} catch(exception){e.cancelBubble=true}},delegate:function(func,scope){return function(){func.apply(scope,arguments)}}}

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

/* - Animator.js - */
// http://www.nesoindia.org/portal_javascripts/Animator.js?original=1
Animator=function(startValue,endValue,f,t,r){this.step=10;this.rate=10;this.power=2;this.type=this.NONE;this.min=startValue;this.max=endValue;this.isReversing=false;this.animateFunction=f;this.terminateFunction=t;this.reversalFunction=r;this.precalc=new Array(100);for(var i=0;i<=100;i++) this.precalc[i]=this.calculate(i)}
Animator.prototype.NONE=0;Animator.prototype.EASEIN=1;Animator.prototype.EASEOUT=2;Animator.prototype.EASEINOUT=3;Animator.prototype.method=function(method){var context=this;return function(){method.apply(context,arguments);if(this.blur&&this.tagName=="A") this.blur();return false}}
Animator.prototype.setStep=function(step){this.step=step}
Animator.prototype.setRate=function(rate){this.rate=rate}
Animator.prototype.setPower=function(power){this.power=power;for(var i=0;i<=100;i++) this.precalc[i]=this.calculate(i)}
Animator.prototype.setType=function(type){this.type=type;for(var i=0;i<=100;i++) this.precalc[i]=this.calculate(i)}
Animator.prototype.setAnimateFunction=function(f){this.animateFunction=f}
Animator.prototype.start=function(){if(this.interval) return;this.time=0;this.isReversing=false;this.interval=setInterval(this.method(this.animate),this.rate)}
Animator.prototype.reverse=function(){this.isReversing=(this.isReversing)?false:true}
Animator.prototype.stop=function(){if(this.interval) clearInterval(this.interval);this.interval=null}
Animator.prototype.pause=function(){if(this.interval) clearInterval(this.interval)}
Animator.prototype.resume=function(){this.interval=setInterval(this.method(this.animate),this.rate)}
Animator.prototype.isAnimating=function(){return Boolean(this.interval)}
Animator.prototype.animate=function(){if(this.time>=0&&this.time<=100){this.animateFunction(this.precalc[this.time]);this.time=(this.isReversing)?this.time-this.step:this.time+this.step} else{clearInterval(this.interval);this.interval=null;if(!this.isReversing&&this.terminateFunction) this.terminateFunction();if(this.isReversing&&this.reversalFunction) this.reversalFunction()}}
Animator.prototype.calculate=function(t){t=t/100;var factor;switch(this.type){case this.NONE:factor=this.easeNone(t);break;case this.EASEIN:factor=this.easeIn(t);break;case this.EASEOUT:factor=this.easeOut(t);break;case this.EASEINOUT:factor=this.easeInOut(t);break}
return parseInt(this.min+factor*(this.max-this.min))}
Animator.prototype.easeNone=function(t){return t}
Animator.prototype.easeIn=function(t){return Math.pow(t,this.power)}
Animator.prototype.easeOut=function(t){return 1-this.easeIn(1-t)}
Animator.prototype.easeInOut=function(t){if(t<0.5) return this.easeIn(t*2)/2;return 0.5+this.easeOut((t-0.5)*2)/2}


/* - Rotator.js - */
// http://www.nesoindia.org/portal_javascripts/Rotator.js?original=1
var strAnim=""
Rotator=function(scrollableElement,itemContainer,itemTagName,buttonContainer,visibleItems,scrollDistance,initialDelay){this.itemSize=scrollDistance;this.visibleItems=visibleItems;this.orientation=0;this.buttons=buttonContainer.getElementsByTagName("a");this.currentButton=1;this.buttons[this.currentButton].className="current";this.scrollable=scrollableElement;this.itemContainer=itemContainer
this.items=itemContainer.getElementsByTagName(itemTagName);this.totalItems=this.items.length;if(this.totalItems<=this.visibleItems) return;var rotator=this;var bottomClones=new Array(this.visibleItems);var topClones=new Array(this.visibleItems);for(var i=0;i<this.visibleItems;i++){bottomClones[i]=this.items[this.totalItems-1-i].cloneNode(true);topClones[i]=this.items[i].cloneNode(true)}
for(var i=0;i<this.visibleItems;i++){itemContainer.insertBefore(bottomClones[i],this.items[0]);itemContainer.appendChild(topClones[i])}
this.index=this.visibleItems;if(this.orientation) this.scrollable.scrollTop=this.index*this.itemSize;else this.scrollable.scrollLeft=this.index*this.itemSize;EventListener.addEvent(window.document,'mouseover',this.method(this.automatic));EventListener.addEvent(itemContainer,'mouseover', function(event){rotator.manual();cancelBubble(event)})
EventListener.addEvent(buttonContainer,'mouseover', function(event){rotator.manual();cancelBubble(event)})
EventListener.addEvent(this.buttons[0],"click",function(){this.blur();rotator.manual();rotator.back();return false})
for(var i=1;i<this.buttons.length-1;i++){EventListener.addEvent(this.buttons[i],"click",function(){this.blur();rotator.manual();rotator.goToItem(this.name);return false})}
EventListener.addEvent(this.buttons[this.buttons.length-1],"click", function(){this.blur();rotator.manual();rotator.forward();return false})
setTimeout(this.method(this.automatic),initialDelay)}
Rotator.prototype.method=function(method){var context=this;return function(){method.apply(context,arguments);if(this.blur&&this.tagName=="A") this.blur();return false}}
Rotator.prototype.setHorizontalMode=function(){this.orientation=0}
Rotator.prototype.setVerticalMode=function(){this.orientation=1}
Rotator.prototype.checkIndex=function(){if(this.index==0) this.index=this.totalItems;if(this.index==this.totalItems+this.visibleItems) this.index=this.visibleItems;if(this.orientation) this.scrollable.scrollTop=this.index*this.itemSize;else this.scrollable.scrollLeft=this.index*this.itemSize;this.animating=false;this.setCurrentTab()}
Rotator.prototype.setCurrentTab=function(){this.buttons[this.currentButton].className="";this.currentButton=this.index;this.buttons[this.currentButton].className="current"}
Rotator.prototype.forward=function(intStep){if(this.animating) return;if(isNaN(intStep)){intStep=1}
if(this.orientation) this.scrollForward=new Animator(this.scrollable.scrollTop,this.scrollable.scrollTop+(intStep*this.itemSize),this.method(this.animateForward),this.method(this.checkIndex));else this.scrollForward=new Animator(this.scrollable.scrollLeft,this.scrollable.scrollLeft+(intStep*this.itemSize),this.method(this.animateForward),this.method(this.checkIndex));this.scrollForward.setStep(3);this.scrollForward.setType(this.scrollForward.EASEINOUT);this.scrollForward.setRate(20);this.animating=this.scrollForward;this.index+=intStep;this.scrollForward.start()}
Rotator.prototype.animateForward=function(value){if(this.orientation) this.scrollable.scrollTop=value;else this.scrollable.scrollLeft=value}
Rotator.prototype.back=function(intStep){if(this.animating) return;if(isNaN(intStep)){intStep=-1}
if(this.orientation) this.scrollBack=new Animator((this.scrollable.offsetHeight-this.scrollable.scrollTop),(this.scrollable.offsetHeight-this.scrollable.scrollTop-intStep*this.itemSize),this.method(this.animateBack),this.method(this.checkIndex));else this.scrollBack=new Animator((this.scrollable.offsetWidth-this.scrollable.scrollLeft),(this.scrollable.offsetWidth-this.scrollable.scrollLeft-intStep*this.itemSize),this.method(this.animateBack),this.method(this.checkIndex));this.scrollBack.setStep(3);this.scrollBack.setType(this.scrollBack.EASEINOUT);this.scrollBack.setRate(20);this.animating=this.scrollBack;this.index+=intStep;this.scrollBack.start()}
Rotator.prototype.animateBack=function(value){if(this.orientation) this.scrollable.scrollTop=this.scrollable.offsetHeight-value;else this.scrollable.scrollLeft=this.scrollable.offsetWidth-value}
Rotator.prototype.automatic=function(){if(!this.auto){this.auto=setInterval(this.method(this.forward),4000,1)}}
Rotator.prototype.manual=function(){if(this.auto){clearInterval(this.auto);this.auto=null}}
Rotator.prototype.goToItem=function(itemIndex){var diff=itemIndex-this.index;if(diff<0){this.back(diff)}
if(diff>0){this.forward(diff)}
return false}
function cancelBubble(e){if(!e) var e=window.event;e.cancelBubble=true;if(e.stopPropagation) e.stopPropagation()}


/* - regplonefuncalias.js - */
// http://www.nesoindia.org/portal_javascripts/regplonefuncalias.js?original=1
registerPloneFunction=function(func){EventListener.addEvent(window,'load',func)}

