﻿
var eventShow=null;var eventHide=null;var eventHideAll=null;var visibles=null;var ie6=false,ie=false;if(window.navigator!=null&&window.navigator.appVersion!=null){ie=window.navigator.appVersion.indexOf("MSIE ")>=0;if(ie)
ie6=window.navigator.appVersion.indexOf("MSIE 6.0")>=0;}
function appenParam(url,name,val){if(url.indexOf("?")<0)
url+="?";else if(url.charAt[url.length-1]!='&')
url+="&";url+=name+"="+val;return url;}
function registerClick(ev,item){ev.cancelBubble=true;var anchor=item;if(anchor.tagName!="A")
anchor=item.childNodes(0);else
item=item.parentNode;if(anchor.tagName!="A")
return;var url=anchor.getAttribute("href");if(url==null)
return;if(url!=null&&url.length>0){var target=anchor.getAttribute("target");if(target!=null&&target.length>0)
window.open(url,target);else if(ev.shiftKey)
window.open(url);else
document.location=url;}
return false;}
function findParentAttrib(obj,name,value,stack){var c=0;while(obj!=null&&obj.getAttribute!=null&&obj.getAttribute(name)!=value&&c++<stack)
obj=obj.parentNode;if(obj!=null&&obj.getAttribute!=null&&obj.getAttribute(name)==value)
return obj;return null;}
function registerOver(ev,item,subMenuId,menuStyle,mouseOverClass,imageId,imageHoverId){if(eventHideAll!=null){window.clearTimeout(eventHideAll.thread);eventHideAll=null;}
if(!item.initialized){item.mouseOverClass=mouseOverClass;item.popDown=item.getAttribute("popdir")=="down";item.parentSubMenu=findParentAttrib(item.parentNode,"menutype","submenu",1);if(item.parentSubMenu!=null)
item.parentRootMenu=item.parentSubMenu.parentRootMenu;if(item.parentRootMenu==null)
item.parentRootMenu=findParentAttrib(item.parentNode,"menutype","menu",50);if(item.parentSubMenu!=null)
item.parentMenu=item.parentSubMenu;else
item.parentMenu=item.parentRootMenu;item.panel=findParentAttrib(item.parentMenu,"menutype","panel",1);if(item.panel==null)
item.panel=item.parentMenu;item.parentMenu.panel=item.panel;item.parentItem=item.parentMenu.parentNode;item.subMenu=document.getElementById(subMenuId);item.menuStyle=menuStyle;item.imageId=imageId;item.imageHoverId=imageHoverId;item.image=document.getElementById(item.id+"img");if(item.subMenu!=null){item.subPanel=findParentAttrib(item.subMenu,"menutype","panel",1);if(item.subPanel==null)
item.subPanel=item.subMenu;item.subMenuNoHide=item.subPanel.getAttribute("nohide")=="1";item.subMenu.panel=item.subPanel;item.subMenu.parentSubMenu=item.parentSubMenu;item.subMenu.parentMenu=item.parentMenu;item.subMenu.parentRootMenu=item.parentRootMenu;}else
item.subPanel=item.subMenu;if(item.subMenu!=null)
item.subMenu.firstItem=item.subMenu.getElementsByTagName("li")[0];if(item.parentSubMenu==null&&item.parentMenu.firstItem==null)
item.parentMenu.firstItem=item.parentMenu.getElementsByTagName("li")[0];item.initialized=true;if(ie6&&item.menuStyle=="pop")
item.style.width=item.offsetWidth+"px";var rootMenu=item.parentRootMenu;rootMenu.expandAnimation=rootMenu.getAttribute("expandAnimation");rootMenu.expandTime=rootMenu.getAttribute("expandTime");rootMenu.collapseAnimation=rootMenu.getAttribute("collapseAnimation");rootMenu.collapseTime=rootMenu.getAttribute("collapseTime");rootMenu.fps=rootMenu.getAttribute("fps");}
if(item.mouseOverClass!=null){if(item.orgClass==undefined)
item.orgClass=item.className;item.className=item.mouseOverClass;}
if(item.image&&item.imageHoverId)
item.image.src="/file.cpo?id="+item.imageHoverId;if(item.subVisible||item.subMenuNoHide)
return;ev.cancelBubble=true;clearShowEvent();if(item.subMenu!=null)
eventShow=new eventClass(item,item.subMenu,window.setTimeout(doShowSub,300));else
eventHide=new eventClass(item,null,window.setTimeout(doHideSub,300));}
function registerOut(item){if(item.orgClass!=undefined)
item.className=item.orgClass;if(item.image&&item.imageId)
item.image.src="/file.cpo?id="+item.imageId;if(eventHideAll==null)
eventHideAll=new eventClass(item,null,window.setTimeout(doHideAll,500));}
function clearHideEvent(){if(eventHide!=null){window.clearTimeout(eventHide.thread);eventHide=null;}}
function clearShowEvent(){if(eventShow!=null){window.clearTimeout(eventShow.thread);eventShow=null;}}
function eventClass(iitem,isub,ithread){this.item=iitem;this.sub=isub;this.thread=ithread;}
function doHideAll(){while(visibles!=null&&visibles.length>0)
hideSub(visibles.pop().subVisible);}
function getPosition(element){var result=new Object();result.x=0;result.y=0;result.w=element.offsetWidth;result.h=element.offsetHeight;while(element.offsetParent!=null&&element.offsetParent.style.position!="absolute"&&element.offsetParent.style.position!="relative"){result.x+=element.offsetLeft;result.y+=element.offsetTop;element=element.offsetParent;}
return result;}
function doShowSub(){var ievent=eventShow;clearShowEvent();if(ievent==null)
return;var item=ievent.item;var sub=ievent.sub;item.subVisible=sub;sub.parentItem=item;hideSubs(item);if(visibles==null)
visibles=new Array();visibles.push(item);if(item.menuStyle=="nest"){if(item.parentRootMenu.expandAnimation){var root=item.parentRootMenu;sub.style.visibility="hidden";sub.style.display="";if(!sub.animHeight)
sub.animHeight=sub.clientHeight;sub.style.display="none";new CpoAnimate(sub,root.expandTime,root.fps,0,sub.animHeight,"height",CpoAnimate.Effects[root.expandAnimation],function(){this.style.visibility="";this.style.display="";},function(){this.style.height="auto";});}
else
sub.style.display="block";return;}
sub.panel.style.position="absolute";sub.panel.style.display="block";sub.panel.style.visibility="hidden";var pos=getPosition(item);var xbord=0,ybord=0;if(item.parentSubMenu==null){var pos=getPosition(item);if(item.popDown){var parPos=getPosition(item.parentMenu);pos.y=parPos.y+item.parentMenu.offsetHeight;}else{var parPos=getPosition(item.parentMenu);pos.x=parPos.x+item.parentMenu.offsetWidth;if(ie)
pos.y-=((sub.firstItem.parentNode.offsetHeight-sub.firstItem.parentNode.clientHeight)/2.0);else
pos.y-=(sub.firstItem.parentNode.offsetHeight-sub.firstItem.parentNode.clientHeight);}
pos.x+=document.body.offsetLeft;pos.y+=document.body.offsetTop;}
else{var pos=getPosition(item);pos.x+=item.parentMenu.clientWidth-item.offsetLeft;pos.y+=item.offsetTop-(sub.firstItem.parentNode.offsetHeight-sub.firstItem.parentNode.clientHeight);}
var offset=parseInt(item.parentMenu.getAttribute("popoffsetx"));if(offset!=0&&!isNaN(offset))
pos.x+=offset;offset=parseInt(item.parentMenu.getAttribute("popoffsety"));if(offset!=0&&!isNaN(offset))
pos.y+=offset;sub.panel.style.left=(pos.x)+"px";sub.panel.style.top=(pos.y)+"px";if(item.parentRootMenu.expandAnimation){var root=item.parentRootMenu;if(!sub.panel.animHeight)
sub.panel.animHeight=sub.panel.clientHeight;sub.panel.style.height="0px";sub.panel.style.visibility="";new CpoAnimate(sub.panel,root.expandTime,root.fps,0,sub.panel.animHeight,"height",CpoAnimate.Effects[root.expandAnimation],function(){this.style.visibility="";},function(){this.style.height="auto";});}
else
sub.panel.style.visibility="";}
function hideSub(sub){if(sub.parentItem.parentRootMenu.collapseAnimation){var root=sub.parentItem.parentRootMenu;if(!sub.panel.animHeight)
sub.panel.animHeight=sub.panel.clientHeight;sub.panel.owner=sub;new CpoAnimate(sub.panel,root.collapseTime,root.fps,sub.panel.animHeight,0,"height",CpoAnimate.Effects[root.collapseAnimation],function(){this.style.visibility="";},function(){this.style.display="none";this.style.height="auto";this.owner.parentItem.subVisible=null;});}
else{sub.panel.style.display="none";sub.parentItem.subVisible=null;}}
function hideSubs(item){if(visibles==null||visibles.length==0)
return;if(item.subVisible==visibles[visibles.length-1])
return;while(visibles.length>0&&item.parentSubMenu!=visibles[visibles.length-1].subVisible){hideSub(visibles.pop().subVisible);}}
function doHideSub(){var ievent=eventHide;clearHideEvent();if(ievent==null)
return;hideSubs(ievent.item);}
function CpoAnimate(element,duration,fps,fromValue,endValue,propName,animFunc,onStartFunc,onEndFunc){if(element.cpoAnimate)
element.cpoAnimate.stop();this.element=element;element.cpoAnimate=this;this.fromValue=fromValue;this.endValue=endValue;this.propName=propName;if(!duration)
this.duration=200;else
this.duration=duration;if(!fps)
this.fps=60;else
this.fps=fps;this.interval=1000.0/this.fps;this.totalFrames=this.duration/this.interval;this.startTime=new Date().getTime();if(!animFunc)
this.animFunc=CpoAnimate.Effects["InQuad"];else
this.animFunc=animFunc;this.onStartFunc=onStartFunc;this.onEndFunc=onEndFunc;element.style.overflow="hidden";element.style[this.propName]=this.fromValue+"px";this.timer=window.setInterval(CpoCreateDelegate(this,this.animator),this.interval);};function CpoCreateDelegate(instance,method){return function(){return method.apply(instance,arguments);}};CpoAnimate.prototype={stop:function(){this.duration=-1000;},reset:function(){clearInterval(this.timer);this.element.cpoAnimate=null;this.element.style[this.propName]=this.endValue+"px";this.element.style.overflow="";if(this.onEndFunc)
this.onEndFunc.call(this.element);this.element=null;},animator:function(){var time=new Date().getTime();var ellapsedTime=time-this.startTime;if(ellapsedTime>=this.duration){this.reset();return;}
var frame=(time-this.startTime)/this.interval;var value=Math.abs(this.endValue-this.fromValue)/this.totalFrames*frame;value=this.animFunc(ellapsedTime,0,value,this.duration);if(this.endValue<this.fromValue)
value=this.fromValue-value;try{this.element.style[this.propName]=Math.ceil(value)+"px";}catch(ex){}
if(!this.didAnimate){this.didAnimate=true;if(this.onStartFunc)
this.onStartFunc.call(this.element);}}}
CpoAnimate.Effects=[];CpoAnimate.Effects["Linear"]=function(t,b,c,d){return c*t/d+b;};CpoAnimate.Effects["InQuad"]=function(t,b,c,d){return c*(t/=d)*t+b;};CpoAnimate.Effects["OutQuad"]=function(t,b,c,d){return-c*(t/=d)*(t-2)+b;};CpoAnimate.Effects["InOutQuad"]=function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;};CpoAnimate.Effects["InCubic"]=function(t,b,c,d){return c*(t/=d)*t*t+b;};CpoAnimate.Effects["OutCubic"]=function(t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;};CpoAnimate.Effects["InOutCubic"]=function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;};CpoAnimate.Effects["InQuart"]=function(t,b,c,d){return c*(t/=d)*t*t*t+b;};CpoAnimate.Effects["OutQuart"]=function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;};CpoAnimate.Effects["InOutQuart"]=function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;};CpoAnimate.Effects["InQuint"]=function(t,b,c,d){return c*(t/=d)*t*t*t*t+b;};CpoAnimate.Effects["OutQuint"]=function(t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;};CpoAnimate.Effects["InOutQuint"]=function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;};CpoAnimate.Effects["InSine"]=function(t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;};CpoAnimate.Effects["OutSine"]=function(t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;};CpoAnimate.Effects["InOutSine"]=function(t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;};CpoAnimate.Effects["InExpo"]=function(t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;};CpoAnimate.Effects["OutExpo"]=function(t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;};CpoAnimate.Effects["InOutExpo"]=function(t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;};CpoAnimate.Effects["InCirc"]=function(t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;};CpoAnimate.Effects["OutCirc"]=function(t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;};CpoAnimate.Effects["InOutCirc"]=function(t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;};CpoAnimate.Effects["InElastic"]=function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if((!a)||a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;};CpoAnimate.Effects["OutElastic"]=function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if((!a)||a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;};CpoAnimate.Effects["InOutElastic"]=function(t,b,c,d,a,p){if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if((!a)||a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;};CpoAnimate.Effects["InBack"]=function(t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;};CpoAnimate.Effects["OutBack"]=function(t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;};CpoAnimate.Effects["InOutBack"]=function(t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;};CpoAnimate.Effects["OutBounce"]=function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}};CpoAnimate.Effects["InBounce"]=function(t,b,c,d){return c-CpoAnimate.Effects["OutBounce"](d-t,0,c,d)+b;};CpoAnimate.Effects["InOutBounce"]=function(t,b,c,d){if(t<d/2)return CpoAnimate.Effects["InBounce"](t*2,0,c,d)*.5+b;return CpoAnimate.Effects["OutBounce"](t*2-d,0,c,d)*.5+c*.5+b;};