/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
*/
var YAHOO=window.YAHOO||{};YAHOO.namespace=function(ns){if(!ns||!ns.length){return null;}var levels=ns.split(".");var nsobj=YAHOO;for(var i=(levels[0]=="YAHOO")?1:0;i<levels.length;++i){nsobj[levels[i]]=nsobj[levels[i]]||{};nsobj=nsobj[levels[i]];}return nsobj;};YAHOO.log=function(sMsg,sCategory,sSource){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(sMsg,sCategory,sSource);}else{return false;}};YAHOO.extend=function(subclass,superclass){var f=function(){};f.prototype=superclass.prototype;subclass.prototype=new f();subclass.prototype.constructor=subclass;subclass.superclass=superclass.prototype;if(superclass.prototype.constructor==Object.prototype.constructor){superclass.prototype.constructor=superclass;}};YAHOO.namespace("util");YAHOO.namespace("widget");YAHOO.namespace("example");
YAHOO.util.Dom=function(){var ua=navigator.userAgent.toLowerCase();var isOpera=(ua.indexOf('opera')>-1);var isSafari=(ua.indexOf('safari')>-1);var isIE=(window.ActiveXObject);var id_counter=0;var util=YAHOO.util;var property_cache={};var toCamel=function(property){var convert=function(prop){var test=/(-[a-z])/i.exec(prop);return prop.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());};while(property.indexOf('-')>-1){property=convert(property);}return property;};var toHyphen=function(property){if(property.indexOf('-')>-1){return property;}var converted='';for(var i=0,len=property.length;i<len;++i){if(property.charAt(i)==property.charAt(i).toUpperCase()){converted=converted+'-'+property.charAt(i).toLowerCase();}else{converted=converted+property.charAt(i);}}return converted;};var cacheConvertedProperties=function(property){property_cache[property]={camel:toCamel(property),hyphen:toHyphen(property)};};return{get:function(el){if(!el){return null;}if(typeof el!='string'&&!(el instanceof Array)){return el;}if(typeof el=='string'){return document.getElementById(el);}else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=util.Dom.get(el[i]);}return collection;}return null;},getStyle:function(el,property){var f=function(el){var value=null;var dv=document.defaultView;if(!property_cache[property]){cacheConvertedProperties(property);}var camel=property_cache[property]['camel'];var hyphen=property_cache[property]['hyphen'];if(property=='opacity'&&el.filters){value=1;try{value=el.filters.item('DXImageTransform.Microsoft.Alpha').opacity/100;}catch(e){try{value=el.filters.item('alpha').opacity/100;}catch(e){}}}else if(el.style[camel]){value=el.style[camel];}else if(isIE&&el.currentStyle&&el.currentStyle[camel]){value=el.currentStyle[camel];}else if(dv&&dv.getComputedStyle){var computed=dv.getComputedStyle(el,'');if(computed&&computed.getPropertyValue(hyphen)){value=computed.getPropertyValue(hyphen);}}return value;};return util.Dom.batch(el,f,util.Dom,true);},setStyle:function(el,property,val){if(!property_cache[property]){cacheConvertedProperties(property);}var camel=property_cache[property]['camel'];var f=function(el){switch(property){case 'opacity':if(isIE&&typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}else{el.style.opacity=val;el.style['-moz-opacity']=val;el.style['-khtml-opacity']=val;}break;default:el.style[camel]=val;}};util.Dom.batch(el,f,util.Dom,true);},getXY:function(el){var f=function(el){if(el.offsetParent===null||this.getStyle(el,'display')=='none'){return false;}var parentNode=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)&&parent.document!=document){doc=parent.document;if(!this.isAncestor(doc.documentElement,el)){return false;}}var scrollTop=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var scrollLeft=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return [box.left+scrollLeft,box.top+scrollTop];}else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;parentNode=parentNode.offsetParent;}}if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}if(el.parentNode){parentNode=el.parentNode;}else{parentNode=null;}while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML'){pos[0]-=parentNode.scrollLeft;/*pos[1]-=parentNode.scrollTop;*/if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}return pos;};return util.Dom.batch(el,f,util.Dom,true);},getX:function(el){return util.Dom.getXY(el)[0];},getY:function(el){return util.Dom.getXY(el)[1];},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}var pageXY=this.getXY(el);if(pageXY===false){return false;}var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}var newXY=this.getXY(el);if(!noRetry&&(newXY[0]!=pos[0]||newXY[1]!=pos[1])){this.setXY(el,pos,true);}};util.Dom.batch(el,f,util.Dom,true);},setX:function(el,x){util.Dom.setXY(el,[x,null]);},setY:function(el,y){util.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new YAHOO.util.Region.getRegion(el);return region;};return util.Dom.batch(el,f,util.Dom,true);},getClientWidth:function(){return util.Dom.getViewportWidth();},getClientHeight:function(){return util.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return util.Dom.hasClass(el,className)};return util.Dom.getElementsBy(method,tag,root);},hasClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');var f=function(el){return re.test(el['className']);};return util.Dom.batch(el,f,util.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}el['className']=[el['className'],className].join(' ');};util.Dom.batch(el,f,util.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};util.Dom.batch(el,f,util.Dom,true);},replaceClass:function(el,oldClassName,newClassName){var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return;}el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};util.Dom.batch(el,f,util.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=util.Dom.get(el);}else{el={};}if(!el.id){el.id=prefix+id_counter++;}return el.id;};return util.Dom.batch(el,f,util.Dom,true);},isAncestor:function(haystack,needle){haystack=util.Dom.get(haystack);if(!haystack||!needle){return false;}var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}else if(parent.tagName.toUpperCase()=='HTML'){return false;}parent=parent.parentNode;}return false;}};return util.Dom.batch(needle,f,util.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return util.Dom.batch(el,f,util.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';root=util.Dom.get(root)||document;var nodes=[];var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}return nodes;},batch:function(el,method,o,override){var id=el;el=util.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}return method.call(scope,el,o);}var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=id[i];}collection[collection.length]=method.call(scope,el[i],o);}return collection;},getDocumentHeight:function(){var scrollHeight=-1,windowHeight=-1,bodyHeight=-1;var marginTop=parseInt(util.Dom.getStyle(document.body,'marginTop'),10);var marginBottom=parseInt(util.Dom.getStyle(document.body,'marginBottom'),10);var mode=document.compatMode;if((mode||isIE)&&!isOpera){switch(mode){case 'CSS1Compat':scrollHeight=((window.innerHeight&&window.scrollMaxY)?window.innerHeight+window.scrollMaxY:-1);windowHeight=[document.documentElement.clientHeight,self.innerHeight||-1].sort(function(a,b){return(a-b);})[1];bodyHeight=document.body.offsetHeight+marginTop+marginBottom;break;default:scrollHeight=document.body.scrollHeight;bodyHeight=document.body.clientHeight;}}else{scrollHeight=document.documentElement.scrollHeight;windowHeight=self.innerHeight;bodyHeight=document.documentElement.clientHeight;}var h=[scrollHeight,windowHeight,bodyHeight].sort(function(a,b){return(a-b);});return h[2];},getDocumentWidth:function(){var docWidth=-1,bodyWidth=-1,winWidth=-1;var marginRight=parseInt(util.Dom.getStyle(document.body,'marginRight'),10);var marginLeft=parseInt(util.Dom.getStyle(document.body,'marginLeft'),10);var mode=document.compatMode;if(mode||isIE){switch(mode){case 'CSS1Compat':docWidth=document.documentElement.clientWidth;bodyWidth=document.body.offsetWidth+marginLeft+marginRight;winWidth=self.innerWidth||-1;break;default:bodyWidth=document.body.clientWidth;winWidth=document.body.scrollWidth;break;}}else{docWidth=document.documentElement.clientWidth;bodyWidth=document.body.offsetWidth+marginLeft+marginRight;winWidth=self.innerWidth;}var w=[docWidth,bodyWidth,winWidth].sort(function(a,b){return(a-b);});return w[2];},getViewportHeight:function(){var height=-1;var mode=document.compatMode;if((mode||isIE)&&!isOpera){switch(mode){case 'CSS1Compat':height=document.documentElement.clientHeight;break;default:height=document.body.clientHeight;}}else{height=self.innerHeight;}return height;},getViewportWidth:function(){var width=-1;var mode=document.compatMode;if(mode||isIE){switch(mode){case 'CSS1Compat':width=document.documentElement.clientWidth;break;default:width=document.body.clientWidth;}}else{width=self.innerWidth;}return width;}};}();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();
YAHOO.util.CustomEvent=function(type,oScope,silent){this.type=type;this.scope=oScope||window;this.silent=silent;this.subscribers=[];if(YAHOO.util.Event){YAHOO.util.Event.regCE(this);}if(!this.silent){}};YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,bOverride){this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,bOverride));},unsubscribe:function(fn,obj){var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}return found;},fire:function(){var len=this.subscribers.length;var args=[];for(var i=0;i<arguments.length;++i){args.push(arguments[i]);}if(!this.silent){}for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}var scope=(s.override)?s.obj:this.scope;s.fn.call(scope,this.type,args,s.obj);}}},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(i);}},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}delete this.subscribers[index];},toString:function(){return "CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,bOverride){this.fn=fn;this.obj=obj||null;this.override=(bOverride);};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){return(this.fn==fn&&this.obj==obj);};YAHOO.util.Subscriber.prototype.toString=function(){return "Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var delayedListeners=[];var unloadListeners=[];var customEvents=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;return{POLL_RETRYS:200,POLL_INTERVAL:50,EL:0,TYPE:1,FN:2,WFN:3,SCOPE:3,ADJ_SCOPE:4,isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),addDelayedListener:function(el,sType,fn,oScope,bOverride){delayedListeners[delayedListeners.length]=[el,sType,fn,oScope,bOverride];if(loadComplete){retryCount=this.POLL_RETRYS;this.startTimeout(0);}},startTimeout:function(interval){var i=(interval||interval===0)?interval:this.POLL_INTERVAL;var self=this;var callback=function(){self._tryPreloadAttach();};this.timeout=setTimeout(callback,i);},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override});retryCount=this.POLL_RETRYS;this.startTimeout(0);},addListener:function(el,sType,fn,oScope,bOverride){if(!fn||!fn.call){return false;}if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=(this.on(el[i],sType,fn,oScope,bOverride)&&ok);}return ok;}else if(typeof el=="string"){var oEl=this.getEl(el);if(loadComplete&&oEl){el=oEl;}else{this.addDelayedListener(el,sType,fn,oScope,bOverride);return true;}}if(!el){return false;}if("unload"==sType&&oScope!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,oScope,bOverride];return true;}var scope=(bOverride)?oScope:el;var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),oScope);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}legacyHandlers[legacyIndex].push(index);}else if(el.addEventListener){el.addEventListener(sType,wrappedFn,false);}else if(el.attachEvent){el.attachEvent("on"+sType,wrappedFn);}return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true;var le=legacyHandlers[legacyIndex];for(var i=0,len=le.length;i<len;++i){var index=le[i];if(index){var li=listeners[index];if(li&&li[this.WFN]){var scope=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}else{delete le[i];}}}return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(!el.addEventListener&&!el.attachEvent){return true;}else if(this.isSafari){if("click"==sType||"dblclick"==sType){return true;}}return false;},removeListener:function(el,sType,fn,index){if(!fn||!fn.call){return false;}if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}return ok;}if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){delete unloadListeners[i];return true;}}return false;}var cacheItem=null;if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}if(index>=0){cacheItem=listeners[index];}if(!el||!cacheItem){return false;}if(el.removeEventListener){el.removeEventListener(sType,cacheItem[this.WFN],false);}else if(el.detachEvent){el.detachEvent("on"+sType,cacheItem[this.WFN]);}delete listeners[index][this.WFN];delete listeners[index][this.FN];delete listeners[index];return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&node.nodeName&&"#TEXT"==node.nodeName.toUpperCase()){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;},getXY:function(ev){return [this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;},getCharCode:function(ev){return ev.charCode||((ev.type=="keypress")?ev.keyCode:0);},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}return id;},_isValidCollection:function(o){return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},regCE:function(ce){customEvents.push(ce);},_load:function(e){loadComplete=true;},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}var stillDelayed=[];for(var i=0,len=delayedListeners.length;i<len;++i){var d=delayedListeners[i];if(d){var el=this.getEl(d[this.EL]);if(el){this.on(el,d[this.TYPE],d[this.FN],d[this.SCOPE],d[this.ADJ_SCOPE]);delete delayedListeners[i];}else{stillDelayed.push(d);}}}delayedListeners=stillDelayed;var notAvail=[];for(i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){el=this.getEl(item.id);if(el){var scope=(item.override)?item.obj:el;item.fn.call(scope,item.obj);delete onAvailStack[i];}else{notAvail.push(item);}}}retryCount=(stillDelayed.length===0&&notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startTimeout();}this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn,l.index);}}if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var elListeners=[];if(listeners&&listeners.length>0){for(var i=0,len=listeners.length;i<len;++i){var l=listeners[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){elListeners.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.SCOPE],adjust:l[this.ADJ_SCOPE],index:i});}}}return(elListeners.length)?elListeners:null;},_unload:function(e,me){for(var i=0,len=unloadListeners.length;i<len;++i){var l=unloadListeners[i];if(l){var scope=(l[this.ADJ_SCOPE])?l[this.SCOPE]:window;l[this.FN].call(scope,this.getEvent(e),l[this.SCOPE]);}}if(listeners&&listeners.length>0){for(i=0,len=listeners.length;i<len;++i){l=listeners[i];if(l){this.removeListener(l[this.EL],l[this.TYPE],l[this.FN],i);}}this.clearCache();}for(i=0,len=customEvents.length;i<len;++i){customEvents[i].unsubscribeAll();delete customEvents[i];}for(i=0,len=legacyEvents.length;i<len;++i){delete legacyEvents[i][0];delete legacyEvents[i];}},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement;db=document.body;if(dd&&dd.scrollTop){return [dd.scrollTop,dd.scrollLeft];}else if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}}};}();YAHOO.util.Event.on=YAHOO.util.Event.addListener;if(document&&document.body){YAHOO.util.Event._load();}else{YAHOO.util.Event.on(window,"load",YAHOO.util.Event._load,YAHOO.util.Event,true);}YAHOO.util.Event.on(window,"unload",YAHOO.util.Event._unload,YAHOO.util.Event,true);YAHOO.util.Event._tryPreloadAttach();}
YAHOO.util.Anim=function(el,attributes,duration,method){if(el){this.init(el,attributes,duration,method);}};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return 'px';}return '';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i];}}else{end=start+attributes[attr]['by'];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;YAHOO.util.AnimMgr.registerElement(this);};this.stop=function(){YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();for(var attr in this.attributes){this.setRuntimeAttribute(attr);}isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=200;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index!=-1){queue.splice(index,1);}tweenCount-=1;if(tweenCount<=0){this.stop();}};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[i].isAnimated()){this.unRegister(tween,i);}}queue=[];thread=null;tweenCount=0;}else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null){tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}tween._onTween.fire();}else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}return [ tmp[0][0],tmp[0][1] ];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.parseColor=function(s){if(s.length==3){return s;}var c=this.patterns.hex.exec(s);if(c&&c.length==4){return [ parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}c=this.patterns.rgb.exec(s);if(c&&c.length==4){return [ parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}c=this.patterns.hex3.exec(s);if(c&&c.length==4){return [ parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(val=='transparent'){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&val=='transparent'){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='ffffff';}}}}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong: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;},elasticIn: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;},elasticOut: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;},elasticBoth: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;},backIn:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof 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;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut: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;}},bounceBoth:function(t,b,c,d){if(t<d/2)return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0] instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}control=tmp;}if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}else{Y.Dom.setXY(el,Y.Dom.getXY(el));}start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[ start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1] ];for(i=0,len=control.length;i<len;++i){control[i]=[ start[0]+control[i][0],start[1]+control[i][1] ];}}this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[ val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1] ];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[ el.scrollLeft,el.scrollTop ];}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_header:{},_has_http_headers:false,_default_post_header:true,_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:[],_timeOut:[],_polling_interval:50,_transaction_id:0,setProgId:function(id){this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b){this._default_post_header=b;},setPollingInterval:function(i){if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId){var obj,http;try{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}catch(e){for(var i=0;i<this._msxml_progid.length;++i){try{http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};break;}catch(e){}}}finally{return obj;}},getConnectionObject:function(){var o;var tId=this._transaction_id;try{o=this.createXhrObject(tId);if(o){this._transaction_id++;}}catch(e){}finally{return o;}},asyncRequest:function(method,uri,callback,postData){var o=this.getConnectionObject();if(!o){return null;}else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri);this.releaseObject(o);return;}if(method=='GET'){uri+="?"+this._sFormData;}else if(method=='POST'){postData=this._sFormData;}this._sFormData='';}o.conn.open(method,uri,true);if(this._isFormSubmit||(postData&&this._default_post_header)){this.initHeader('Content-Type','application/x-www-form-urlencoded');if(this._isFormSubmit){this._isFormSubmit=false;}}if(this._has_http_headers){this.setHeader(o);}this.handleReadyState(o,callback);postData?o.conn.send(postData):o.conn.send(null);return o;}},handleReadyState:function(o,callback){var timeOut=callback.timeout;var oConn=this;try{if(timeOut!==undefined){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true)},timeOut);}this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(oConn._poll[o.tId]);oConn._poll.splice(o.tId);if(timeOut){oConn._timeOut.splice(o.tId);}oConn.handleTransactionResponse(o,callback);}},this._polling_interval);}catch(e){window.clearInterval(oConn._poll[o.tId]);oConn._poll.splice(o.tId);if(timeOut){oConn._timeOut.splice(o.tId);}oConn.handleTransactionResponse(o,callback);}},handleTransactionResponse:function(o,callback,isAbort){if(!callback){this.releaseObject(o);return;}var httpStatus,responseObject;try{if(o.conn.status!==undefined&&o.conn.status!=0){httpStatus=o.conn.status;}else{httpStatus=13030;}}catch(e){httpStatus=13030;}if(httpStatus>=200&&httpStatus<300){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}else{callback.success.apply(callback.scope,[responseObject]);}}}else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,isAbort);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}else{callback.failure.apply(callback.scope,[responseObject]);}}break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}else{callback.failure.apply(callback.scope,[responseObject]);}}}}this.releaseObject(o);},createResponseObject:function(o,callbackArg){var obj={};var headerObj={};try{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}catch(e){}obj.tId=o.tId;obj.status=o.conn.status;obj.statusText=o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof callbackArg!==undefined){obj.argument=callbackArg;}return obj;},createExceptionObject:function(tId,callbackArg,isAbort){var COMM_CODE=0;var COMM_ERROR='communication failure';var ABORT_CODE=-1;var ABORT_ERROR='transaction aborted';var obj={};obj.tId=tId;if(isAbort){obj.status=ABORT_CODE;obj.statusText=ABORT_ERROR;}else{obj.status=COMM_CODE;obj.statusText=COMM_ERROR;}if(callbackArg){obj.argument=callbackArg;}return obj;},initHeader:function(label,value){if(this._http_header[label]===undefined){this._http_header[label]=value;}else{this._http_header[label]=value+","+this._http_header[label];}this._has_http_headers=true;},setHeader:function(o){for(var prop in this._http_header){if(this._http_header.propertyIsEnumerable){o.conn.setRequestHeader(prop,this._http_header[prop]);}}delete this._http_header;this._http_header={};this._has_http_headers=false;},setForm:function(formId,isUpload,secureUri){this._sFormData='';if(typeof formId=='string'){var oForm=(document.getElementById(formId)||document.forms[formId]);}else if(typeof formId=='object'){var oForm=formId;}else{return;}if(isUpload){(typeof secureUri=='string')?this.createFrame(secureUri):this.createFrame();this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oDisabled=oForm.elements[i].disabled;oElement=oForm.elements[i];oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName){switch(oElement.type){case 'select-one':case 'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].value||oElement.options[j].text)+'&';}}break;case 'radio':case 'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}break;case 'file':case undefined:case 'reset':case 'button':break;case 'submit':if(hasSubmit==false){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';hasSubmit=true;}break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';break;}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);},createFrame:function(secureUri){if(window.ActiveXObject){var io=document.createElement('<IFRAME name="ioFrame" id="ioFrame">');if(secureUri){io.src=secureUri;}}else{var io=document.createElement('IFRAME');io.id='ioFrame';io.name='ioFrame';}io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},uploadFile:function(id,callback,uri){this._formNode.action=uri;this._formNode.enctype='multipart/form-data';this._formNode.method='POST';this._formNode.target='ioFrame';this._formNode.submit();this._formNode=null;this._isFileUpload=false;this._isFormSubmit=false;var uploadCallback=function(){var oResponse={tId:id,responseText:document.getElementById("ioFrame").contentWindow.document.body.innerHTML,argument:callback.argument};if(callback.upload){if(!callback.scope){callback.upload(oResponse);}else{callback.upload.apply(callback.scope,[oResponse]);}}YAHOO.util.Event.removeListener("ioFrame","load",uploadCallback);window.ioFrame.location.replace('#');setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);};YAHOO.util.Event.addListener("ioFrame","load",uploadCallback);},abort:function(o,callback,isTimeout){if(this.isCallInProgress(o)){window.clearInterval(this._poll[o.tId]);this._poll.splice(o.tId);if(isTimeout){this._timeOut.splice(o.tId);}o.conn.abort();this.handleTransactionResponse(o,callback,true);return true;}else{return false;}},isCallInProgress:function(o){if(o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}else{return false;}},releaseObject:function(o){o.conn=null;o=null;}};

// odabrana najava i pripadajuća slikica
var najava_odabrana = null;
var slikica_odabrana = null;
var slikica = new Array();

// inicijalizacija
function init_page(){
	var imgs = document.getElementById('tblRaspored').getElementsByTagName('img');
	var len  = imgs.length;
	for (i=0; i<len; ++i){
		// sve slike osim toggle-a
		if (imgs[i].className != 'modeSwitch') slikica[imgs[i].id] = new Slikica(imgs[i]);
	}
	// setiranje query string-a i index-a url-a koji traži najavu (podrazumijeva se da je najava zadnji
	// parametar
	/*
	var query = location.search;
	var idx = query.indexOf('najava=');
	// parametar najava postoji i dohvaća se upravo ta najava
	if (idx > 0){
		// setiranje id tražene najave
		var najava_id = query.substring(query.indexOf('najava=') + 7);
		// potraga za TD elementom koji ima id upravo onaj upisan u parametru "najava"
		var najava_arr = YAHOO.util.Dom.getElementsBy(function(el){return (najava_id == el.getAttribute('id'))}, 'td', document.getElementById('tblRaspored'));
		// postoji li koji termin s najavom
		if (najava_arr.length > 0){
			// pozvati funkciju s pozicijom elementa slučajno odabranog TD elementa s najavom
			mi(najava_arr[0]);
		}
	}
	// parametar najava nije naveden i postavlja se jedna slućajno odabrana najava
	else{
		// dohvat svih TD elemenata s nazivima termina i koji imaju najave
		var najava_arr = YAHOO.util.Dom.getElementsBy(function(el){return (/tdNajava/.test(el.getAttribute('name')))}, 'td', document.getElementById('tblRaspored'));
		// postoji li koji termin s najavom
		if (najava_arr.length > 0){
			// izračunati slučajni index
			var rnd = Math.floor(Math.random() * najava_arr.length);
			// pozvati funkciju s pozicijom elementa slučajno odabranog TD elementa s najavom
			mi(najava_arr[rnd]);
		}
	}
	*/
}

// učitati sve slike 
YAHOO.util.Event.addListener(window, 'load', init_page);

// definicija objekta Slikice
function Slikica(el) {
	// private
	el = YAHOO.util.Dom.get(el);
	move = null;
	// metoda koja vraća el
	this.getEl = function() { return el; };
	// clone to extract sizes
	var clone = el.cloneNode(true); 
	// dimenzije slike koje se nalaze u style
	this.initial = {
			width: parseInt(clone.style.width),
			height: parseInt(clone.style.height),
			x: YAHOO.util.Dom.getX(el),
			y: YAHOO.util.Dom.getY(el)
	}
	// dimenzije na koje povećavamo sliku
	this.expanded = {
			width: clone.width,
			height: clone.height
	}
	YAHOO.util.Event.addListener(el, 'mouseover', this.zoomIn, this, true);
//	YAHOO.util.Event.addListener(el, 'click', this.moveImg, this, true);
	clone = null; // kill clone
}

Slikica.prototype = {
	initial: {},
	expanded: {},

	zoomIn: function() {
		// ako slika već animirana (vraća se) tada ne treba zoomIn
		if (this.move && this.move.isAnimated() == true) return;
		var el = this.getEl();
		var attributes = {
			width:  {to: this.expanded.width / 2},
			height: {to: this.expanded.height / 2},
			left:   {to: - (this.expanded.width / 6)},
			top:    {to: - (this.expanded.height / 8)}
		};
		var zoom = new YAHOO.util.Anim(el, attributes, 0.3, YAHOO.util.Easing.backOut);
		zoom.animate();
		// postaviti listener
		YAHOO.util.Event.addListener(el, 'mouseout', this.zoomOut, this, true);
		// slika ide ispred svega (zIndex se postavlja na DIV)
		el.parentNode.style.zIndex = 998;
	},

	zoomOut: function() {
		var el = this.getEl();
		var attributes = {
			width:  {to: this.initial.width},
			height: {to: this.initial.height},
			left:   {to: 0},
			top:    {to: 0}
		};
		var zoom = new YAHOO.util.Anim(el, attributes, 0.3, YAHOO.util.Easing.backOut);
		zoom.animate();
		// maknuti listener
		YAHOO.util.Event.removeListener(el, 'mouseout', this.zoomOut);
		// vratiti zIndex na 1 (postavlja se na DIV)
		el.parentNode.style.zIndex = 1;
	}
	/*
	moveImg: function(){
		// ako slika već animirana (vraća se) tada ne treba zoomIn
		if (this.move && this.move.isAnimated() == true) return;
		// ako postoji slikica za vratiti onda je treba vratiti :)
		if (slikica_odabrana) slikica_odabrana.backImg();
		// prethodno označeni TD stare najave treba resetirati
		makni_odabrano();
		// setirati element
		var el = this.getEl();
		// pozicija na koju treba pomaknuti slikicu
		var xd = YAHOO.util.Dom.getX('najavaContainer') + 3;
		var yd = YAHOO.util.Dom.getY('najavaContainer') + 3;
		var attributes = {
			points: {to: [xd, yd], control: [ [400, 800], [-100, 200] ]},
			width:  {to: this.expanded.width},
			height: {to: this.expanded.height}
		};
		this.move = new YAHOO.util.Motion(el, attributes, 1, YAHOO.util.Easing.easyBoth);
		this.move.animate();
		// postaviti listener-e
		YAHOO.util.Event.removeListener(el, 'mouseout', this.zoomOut);
		YAHOO.util.Event.removeListener(el, 'mouseover', this.zoomIn);
		YAHOO.util.Event.removeListener(el, 'click', this.moveImg);
		// vratiti zIndex na 1 (postavlja se na DIV)
		el.parentNode.style.zIndex = 1;
		// postaviti referencu na TD odabrane najave i slikicu koju treba vratiti
		slikica_odabrana = this;
		najava_odabrana = el.parentNode.parentNode.parentNode.getElementsByTagName('TD')[0];
		// dohvatiti id najave i dohvatiti najavu
		naj_id = el.parentNode.parentNode.parentNode.getElementsByTagName('TD')[0].id;
		var request = YAHOO.util.Connect.asyncRequest('GET', 'najava.xml?id=' + naj_id, oCallback);
	},
	
	
	backImg: function(){
		var el = this.getEl();
		var attributes = {
			points: {to: [this.initial.x, this.initial.y], control: [ [-100, 200] , [400, 400] ]},
			width:  {to: this.initial.width},
			height: {to: this.initial.height}
		};
		this.move = new YAHOO.util.Motion(el, attributes, 1, YAHOO.util.Easing.easyBoth);
		this.move.animate();
		// staviti event na mouseover i click
		YAHOO.util.Event.addListener(el, 'click', this.moveImg, this, true);
		YAHOO.util.Event.addListener(el, 'mouseover', this.zoomIn, this, true);
		// vratiti zIndex na 1 (postavlja se na DIV)
		el.parentNode.style.zIndex = 1;
		// promijeniti stil TR-a
		el.parentNode.parentNode.parentNode.getElementsByTagName('TD')[0].className  = 'link';
	}
	*/
}
/*
// pokretanje animacije na TD click (mi -> move image)
function mi(el){
	// dohvatiti parent node (koji je TR i onda u njima sve img koje nađe)
	sl = el.parentNode.getElementsByTagName('img');
	// ako postoji slikica za najavu
	if (sl[0] != null){
		// u svakom TR elementu postoje TD elementi, a samo u jednom TD postoji IMG tag
		sl_id = sl[0].id;
		// ako je već odabrana slikica tada se ne klika po linku
		if (slikica_odabrana && slikica_odabrana.getEl().id == sl_id) return;
		// je li ikada slikica pokrenuta, ako nije tada se može pokrenuti
		if (slikica[sl_id].move == null) slikica[sl_id].moveImg();
		// slika je već bila pokrenuta pa se još pita je li u ovom trenutku animirana
		else{
			if (slikica[sl_id].move.isAnimated() == false) slikica[sl_id].moveImg();
		}
	}
	// ne postoji slikica za najavu i potrebno je samo dovući najavu
	else{
		// ako postoji slikica za vratiti onda je treba vratiti :)
		if (slikica_odabrana) slikica_odabrana.backImg();
		// više ne postoji odabrana slikica
		slikica_odabrana = null;
		// prethodno označeni TD stare najave treba resetirati
		makni_odabrano();
		// postaviti koja je najava odabrana
		najava_odabrana = el;
		// dohvatiti najavu
		var request = YAHOO.util.Connect.asyncRequest('GET', 'najava.xml?id=' + el.id, oCallback);
	}
}
*/
/*
function successHandler(o){
	// pronaći sve elemente koje treba obojati
	var najava_arr = YAHOO.util.Dom.getElementsBy(function(el){return (najava_odabrana.id == el.getAttribute('id'))}, 'td', document.getElementById('tblRaspored'));
	// obojati odabrane retke
	for (i=0,termin=''; i<najava_arr.length; i++){
		najava_arr[i].className = 'chosen';
		if (i > 0) termin += ', ';
		termin += najava_arr[i].parentNode.getElementsByTagName('TH')[0].childNodes[0].data
	}
	var root = o.responseXML.documentElement;
  var najava_html = root.getElementsByTagName('NAJAVA')[0].firstChild.nodeValue;
	// datum i mreza koji se trebaju ubaciti u najavu
	datumMreza = document.getElementById('mrezaDatum').innerHTML + termin;
	// napraviti zamjenu u dohvaćenom html-u
	najava_html = najava_html.replace('x_datumMreza_x', datumMreza)
	// setiranje reference na najava_div
	var najava_div = document.getElementById('najavaContainer');
	// prikaz dohvaćene najave u div id=najavaContainer 
	najava_div.innerHTML = najava_html;
} 
 
function failureHandler(o){
	// setiranje reference na najava_div
	var najava_div = document.getElementById('najavaContainer');
	// prikaz dohvaćene najave u div id=najavaContainer 
	najava_div.innerHTML = "Greška prilikom učitavanja najave";
} 
 */
 /*
var oCallback = { 
	success: successHandler, 
	failure: failureHandler 
} 

// funkcija koja označene najave vraća na staro
function makni_odabrano(){
	if (najava_odabrana == null) return;
		// pronaći sve elemente kojima treba maknuti boju
	var najava_arr = YAHOO.util.Dom.getElementsBy(function(el){return (najava_odabrana.id == el.getAttribute('id'))}, 'td', document.getElementById('tblRaspored'));
	// maknuti boju prethodno označenih redaka
	for (i=0; i<najava_arr.length; i++) najava_arr[i].className = 'link';
}
*/