if(typeof YAHOO=="undefined"){var YAHOO={};} YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i-1){return true;}else{return YAHOO.lang.isObject(obj)&&obj.constructor==Array;}},isBoolean:function(obj){return typeof obj=='boolean';},isFunction:function(obj){return typeof obj=='function';},isNull:function(obj){return obj===null;},isNumber:function(obj){return typeof obj=='number'&&isFinite(obj);},isObject:function(obj){return obj&&(typeof obj=='object'||YAHOO.lang.isFunction(obj));},isString:function(obj){return typeof obj=='string';},isUndefined:function(obj){return typeof obj=='undefined';},hasOwnProperty:function(obj,prop){if(Object.prototype.hasOwnProperty){return obj.hasOwnProperty(prop);} return!YAHOO.lang.isUndefined(obj[prop])&&obj.constructor.prototype[prop]!==obj[prop];},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");} var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;} if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}},augment:function(r,s){if(!s||!r){throw new Error("YAHOO.lang.augment failed, please check that "+"all dependencies are included.");} var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/body|html/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;} if(propertyCache[property]){return propertyCache[property];} var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());} propertyCache[property]=converted;return converted;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';} var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];} return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}} return val/100;break;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};} if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}} break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';} el.style[property]=val;};} YAHOO.util.Dom={get:function(el){if(YAHOO.lang.isString(el)){return document.getElementById(el);} if(YAHOO.lang.isArray(el)){var c=[];for(var i=0,len=el.length;i=this.left&®ion.right<=this.right&®ion.top>=this.top&®ion.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.register("dom",YAHOO.util.Dom,{version:"2.2.2",build:"204"}); YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){} var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");} if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);} this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();} var found=false;for(var i=0,len=this.subscribers.length;i0){param=args[0];} ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);} if(false===ret){if(!this.silent){} return false;}}} return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i=0){cacheItem=listeners[index];} if(!el||!cacheItem){return false;} if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i0);} var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}} item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i0){for(var i=0,len=searchList.length;i0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);} j=j-1;} l=null;EU.clearCache();} for(i=0,len=legacyEvents.length;i');var el=document.getElementById("_yui_eu_dr");el.onreadystatechange=function(){if("complete"==this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};el=null;YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);}else if(EU.webkit){EU._drwatch=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._drwatch);EU._drwatch=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);} EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();} YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];} subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}else{return false;}},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);} this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i-1){return true;}else{return YAHOO.lang.isObject(obj)&&obj.constructor==Array;}},isBoolean:function(obj){return typeof obj=='boolean';},isFunction:function(obj){return typeof obj=='function';},isNull:function(obj){return obj===null;},isNumber:function(obj){return typeof obj=='number'&&isFinite(obj);},isObject:function(obj){return obj&&(typeof obj=='object'||YAHOO.lang.isFunction(obj));},isString:function(obj){return typeof obj=='string';},isUndefined:function(obj){return typeof obj=='undefined';},hasOwnProperty:function(obj,prop){if(Object.prototype.hasOwnProperty){return obj.hasOwnProperty(prop);} return!YAHOO.lang.isUndefined(obj[prop])&&obj.constructor.prototype[prop]!==obj[prop];},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");} var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;} if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}},augment:function(r,s){if(!s||!r){throw new Error("YAHOO.lang.augment failed, please check that "+"all dependencies are included.");} var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/body|html/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;} if(propertyCache[property]){return propertyCache[property];} var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());} propertyCache[property]=converted;return converted;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';} var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];} return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}} return val/100;break;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};} if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}} break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';} el.style[property]=val;};} YAHOO.util.Dom={get:function(el){if(YAHOO.lang.isString(el)){return document.getElementById(el);} if(YAHOO.lang.isArray(el)){var c=[];for(var i=0,len=el.length;i=this.left&®ion.right<=this.right&®ion.top>=this.top&®ion.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.register("dom",YAHOO.util.Dom,{version:"2.2.2",build:"204"}); YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){} var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");} if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);} this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();} var found=false;for(var i=0,len=this.subscribers.length;i0){param=args[0];} ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);} if(false===ret){if(!this.silent){} return false;}}} return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i=0){cacheItem=listeners[index];} if(!el||!cacheItem){return false;} if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i0);} var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}} item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i0){for(var i=0,len=searchList.length;i0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);} j=j-1;} l=null;EU.clearCache();} for(i=0,len=legacyEvents.length;i');var el=document.getElementById("_yui_eu_dr");el.onreadystatechange=function(){if("complete"==this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};el=null;YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);}else if(EU.webkit){EU._drwatch=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._drwatch);EU._drwatch=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);} EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();} YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];} subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}else{return false;}},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);} this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i=200&&httpStatus<300||httpStatus===1223){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?isAbort:false));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);responseObject=null;},createResponseObject:function(o,callbackArg) {var obj={};var headerObj={};try {var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i');if(typeof secureUri=='boolean'){io.src='javascript:false';} else if(typeof secureURI=='string'){io.src=secureUri;}} else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;} io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData) {var formElements=[];var postMessage=postData.split('&');for(var i=0;i0){for(var i=0;i0)?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;i0&&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;i0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i0){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.register("animation",YAHOO.util.Anim,{version:"2.2.2",build:"204"}); if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var Event=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;} oDD[sMethod].apply(oDD,args);}}},_onLoad:function(){this.init();Event.on(document,"mouseup",this.handleMouseUp,this,true);Event.on(document,"mousemove",this.handleMouseMove,this,true);Event.on(window,"unload",this._onUnload,this,true);Event.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,sGroup){if(!this.initialized){this.init();} if(!this.ids[sGroup]){this.ids[sGroup]={};} this.ids[sGroup][oDD.id]=oDD;},removeDDFromGroup:function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};} var obj=this.ids[sGroup];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}} delete this.handleIds[oDD.id];},regHandle:function(sDDId,sHandleId){if(!this.handleIds[sDDId]){this.handleIds[sDDId]={};} this.handleIds[sDDId][sHandleId]=sHandleId;},isDragDrop:function(id){return(this.getDDById(id))?true:false;},getRelated:function(p_oDD,bTargetsOnly){var oDDs=[];for(var i in p_oDD.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;} if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}} return oDDs;},isLegalTarget:function(oDD,oTargetDD){var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;ithis.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}} if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);} this.stopEvent(e);return true;},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;} var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;} if(!this.isOverTarget(pt,ddo,this.mode,curRegion)){outEvts.push(ddo);} oldOvers[i]=true;delete this.dragOvers[i];} for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;} for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;} if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode,curRegion)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);} this.dragOvers[oDD.id]=oDD;}}}}} this.interactionInfo={out:outEvts,enter:enterEvts,over:overEvts,drop:dropEvts,point:pt,draggedRegion:curRegion,sourceRegion:this.locationCache[dc.id],validDrop:isDrop};if(isDrop&&!dropEvts.length){this.interactionInfo.validDrop=false;dc.onInvalidDrop(e);} if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);dc.onDragOut(e,outEvts);} if(enterEvts.length){dc.onDragEnter(e,enterEvts);} if(overEvts.length){dc.b4DragOver(e,overEvts);dc.onDragOver(e,overEvts);} if(dropEvts.length){dc.b4DragDrop(e,dropEvts);dc.onDragDrop(e,dropEvts);}}else{var len=0;for(i=0,len=outEvts.length;i2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}} return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();} (function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=Dom.get(this.id);} return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){id=Dom.generateId(id);} this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;} var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];} this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);} this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);} Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;} if(this.isLocked()){return;} this.b4MouseDown(e);this.onMouseDown(e);this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(xthis.maxX){x=this.maxX;}} if(this.constrainY){if(ythis.maxY){y=this.maxY;}} x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);} this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);} delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}} for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}} this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}} for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}} this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=parseInt(iLeft,10);this.rightConstraint=parseInt(iRight,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);} this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=parseInt(iUp,10);this.bottomConstraint=parseInt(iDown,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);} this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();} if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);} if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}} return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");} this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot0&&y-stclientW&&toRight0&&x-slthis.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}} if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);} this.stopEvent(e);return true;},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;} var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;} if(!this.isOverTarget(pt,ddo,this.mode,curRegion)){outEvts.push(ddo);} oldOvers[i]=true;delete this.dragOvers[i];} for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;} for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;} if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode,curRegion)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);} this.dragOvers[oDD.id]=oDD;}}}}} this.interactionInfo={out:outEvts,enter:enterEvts,over:overEvts,drop:dropEvts,point:pt,draggedRegion:curRegion,sourceRegion:this.locationCache[dc.id],validDrop:isDrop};if(isDrop&&!dropEvts.length){this.interactionInfo.validDrop=false;dc.onInvalidDrop(e);} if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);dc.onDragOut(e,outEvts);} if(enterEvts.length){dc.onDragEnter(e,enterEvts);} if(overEvts.length){dc.b4DragOver(e,overEvts);dc.onDragOver(e,overEvts);} if(dropEvts.length){dc.b4DragDrop(e,dropEvts);dc.onDragDrop(e,dropEvts);}}else{var len=0;for(i=0,len=outEvts.length;i2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}} return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();} (function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=Dom.get(this.id);} return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){id=Dom.generateId(id);} this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;} var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];} this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);} this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);} Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;} if(this.isLocked()){return;} this.b4MouseDown(e);this.onMouseDown(e);this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(xthis.maxX){x=this.maxX;}} if(this.constrainY){if(ythis.maxY){y=this.maxY;}} x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);} this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);} delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}} for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}} this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}} for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}} this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=parseInt(iLeft,10);this.rightConstraint=parseInt(iRight,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);} this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=parseInt(iUp,10);this.bottomConstraint=parseInt(iDown,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);} this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();} if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);} if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}} return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");} this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot0&&y-stclientW&&toRight0&&x-slrightConstraint){x=rightConstraint;} if(ybottomConstraint){y=bottomConstraint;} this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);};YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);};YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);} this.iframe=null;YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;} clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){YAHOO.widget.Overlay.windowScrollEvent.fire();},1);}else{YAHOO.widget.Overlay.windowScrollEvent.fire();}};YAHOO.widget.Overlay.windowResizeHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.resizeEnd){window.resizeEnd=-1;} clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){YAHOO.widget.Overlay.windowResizeEvent.fire();},100);}else{YAHOO.widget.Overlay.windowResizeEvent.fire();}};YAHOO.widget.Overlay._initialized=null;if(YAHOO.widget.Overlay._initialized===null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;} YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);} this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){if(activeOverlay!=o){if(activeOverlay){activeOverlay.blur();} activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex,10)+2));} this.overlays.sort(this.compareZIndexDesc);o.focusEvent.fire();}}};this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,this.overlays.length-1);o.hideEvent.unsubscribe(o.blur);o.destroyEvent.unsubscribe(this._onOverlayDestroy,o);if(o.element){YAHOO.util.Event.removeListener(o.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);} o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent.unsubscribeAll();o.blurEvent.unsubscribeAll();o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){for(var o=0;o0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;ozIndex2){return-1;}else if(zIndex10) oThis.startAutoPlay(); else oThis.stopAutoPlay(); } }); this.cfg.addProperty("wrap",{ value:false, handler:function(type,args,carouselElem){ }, validator:oThis.cfg.checkBoolean }); this.cfg.addProperty("navMargin",{ value:0, handler:function(type,args,carouselElem){ oThis.calculateSize(); }, validator:oThis.cfg.checkNumber }); this.cfg.addProperty("revealAmount",{ value:0, handler:function(type,args,carouselElem){ oThis.reload(); }, validator:oThis.cfg.checkNumber }); this.cfg.addProperty("prevElementID",{ value:null, handler:function(type,args,carouselElem){ if(oThis._carouselPrev){ YAHOO.util.Event.removeListener(oThis._carouselPrev,"click",oThis._scrollPrev); } oThis._prevElementID=args[0]; if(oThis._prevElementID==null){ oThis._carouselPrev=YAHOO.util.Dom.getElementsByClassName(carouselPrevClass, "div",oThis.carouselElem)[0]; }else{ oThis._carouselPrev=YAHOO.util.Dom.get(oThis._prevElementID); } YAHOO.util.Event.addListener(oThis._carouselPrev,"click",oThis._scrollPrev,oThis); } }); this.cfg.addProperty("prevElement",{ value:null, handler:function(type,args,carouselElem){ if(oThis._carouselPrev){ YAHOO.util.Event.removeListener(oThis._carouselPrev,"click",oThis._scrollPrev); } oThis._prevElementID=args[0]; if(oThis._prevElementID==null){ oThis._carouselPrev=YAHOO.util.Dom.getElementsByClassName(carouselPrevClass, "div",oThis.carouselElem)[0]; }else{ oThis._carouselPrev=YAHOO.util.Dom.get(oThis._prevElementID); } YAHOO.util.Event.addListener(oThis._carouselPrev,"click",oThis._scrollPrev,oThis); } }); this.cfg.addProperty("nextElementID",{ value:null, handler:function(type,args,carouselElem){ if(oThis._carouselNext){ YAHOO.util.Event.removeListener(oThis._carouselNext,"click",oThis._scrollNext); } oThis._nextElementID=args[0]; if(oThis._nextElementID==null){ oThis._carouselNext=YAHOO.util.Dom.getElementsByClassName(carouselNextClass, "div",oThis.carouselElem); }else{ oThis._carouselNext=YAHOO.util.Dom.get(oThis._nextElementID); } if(oThis._carouselNext){ YAHOO.util.Event.addListener(oThis._carouselNext,"click",oThis._scrollNext,oThis); } } }); this.cfg.addProperty("nextElement",{ value:null, handler:function(type,args,carouselElem){ if(oThis._carouselNext){ YAHOO.util.Event.removeListener(oThis._carouselNext,"click",oThis._scrollNext); } oThis._nextElementID=args[0]; if(oThis._nextElementID==null){ oThis._carouselNext=YAHOO.util.Dom.getElementsByClassName(carouselNextClass, "div",oThis.carouselElem); }else{ oThis._carouselNext=YAHOO.util.Dom.get(oThis._nextElementID); } if(oThis._carouselNext){ YAHOO.util.Event.addListener(oThis._carouselNext,"click",oThis._scrollNext,oThis); } } }); this.cfg.addProperty("loadInitHandler",{ value:null, handler:function(type,args,carouselElem){ if(oThis._loadInitHandlerEvt){ oThis._loadInitHandlerEvt.unsubscribe(oThis._currLoadInitHandler,oThis); } oThis._currLoadInitHandler=args[0]; if(oThis._currLoadInitHandler){ if(!oThis._loadInitHandlerEvt){ oThis._loadInitHandlerEvt=new YAHOO.util.CustomEvent("onLoadInit",oThis); } oThis._loadInitHandlerEvt.subscribe(oThis._currLoadInitHandler,oThis); } } }); this.cfg.addProperty("loadNextHandler",{ value:null, handler:function(type,args,carouselElem){ if(oThis._loadNextHandlerEvt){ oThis._loadNextHandlerEvt.unsubscribe(oThis._currLoadNextHandler,oThis); } oThis._currLoadNextHandler=args[0]; if(oThis._currLoadNextHandler){ if(!oThis._loadNextHandlerEvt){ oThis._loadNextHandlerEvt=new YAHOO.util.CustomEvent("onLoadNext",oThis); } oThis._loadNextHandlerEvt.subscribe(oThis._currLoadNextHandler,oThis); } } }); this.cfg.addProperty("loadPrevHandler",{ value:null, handler:function(type,args,carouselElem){ if(oThis._loadPrevHandlerEvt){ oThis._loadPrevHandlerEvt.unsubscribe(oThis._currLoadPrevHandler,oThis); } oThis._currLoadPrevHandler=args[0]; if(oThis._currLoadPrevHandler){ if(!oThis._loadPrevHandlerEvt){ oThis._loadPrevHandlerEvt=new YAHOO.util.CustomEvent("onLoadPrev",oThis); } oThis._loadPrevHandlerEvt.subscribe(oThis._currLoadPrevHandler,oThis); } } }); this.cfg.addProperty("prevButtonStateHandler",{ value:null, handler:function(type,args,carouselElem){ if(oThis._currPrevButtonStateHandler){ oThis._prevButtonStateHandlerEvt.unsubscribe(oThis._currPrevButtonStateHandler,oThis); } oThis._currPrevButtonStateHandler=args[0]; if(oThis._currPrevButtonStateHandler){ if(!oThis._prevButtonStateHandlerEvt){ oThis._prevButtonStateHandlerEvt=new YAHOO.util.CustomEvent("onPrevButtonStateChange",oThis); } oThis._prevButtonStateHandlerEvt.subscribe(oThis._currPrevButtonStateHandler,oThis); } } }); this.cfg.addProperty("nextButtonStateHandler",{ value:null, handler:function(type,args,carouselElem){ if(oThis._currNextButtonStateHandler){ oThis._nextButtonStateHandlerEvt.unsubscribe(oThis._currNextButtonStateHandler,oThis); } oThis._currNextButtonStateHandler=args[0]; if(oThis._currNextButtonStateHandler){ if(!oThis._nextButtonStateHandlerEvt){ oThis._nextButtonStateHandlerEvt=new YAHOO.util.CustomEvent("onNextButtonStateChange",oThis); } oThis._nextButtonStateHandlerEvt.subscribe(oThis._currNextButtonStateHandler,oThis); } } }); if(carouselCfg){ this.cfg.applyConfig(carouselCfg); } this._origFirstVisible=this.cfg.getProperty("firstVisible"); this._currLoadInitHandler=this.cfg.getProperty("loadInitHandler"); this._currLoadNextHandler=this.cfg.getProperty("loadNextHandler"); this._currLoadPrevHandler=this.cfg.getProperty("loadPrevHandler"); this._currPrevButtonStateHandler=this.cfg.getProperty("prevButtonStateHandler"); this._currNextButtonStateHandler=this.cfg.getProperty("nextButtonStateHandler"); this._currAnimationCompleteHandler=this.cfg.getProperty("animationCompleteHandler"); this._nextElementID=this.cfg.getProperty("nextElementID"); if(!this._nextElementID) this._nextElementID=this.cfg.getProperty("nextElement"); this._prevElementID=this.cfg.getProperty("prevElementID"); if(!this._prevElementID) this._prevElementID=this.cfg.getProperty("prevElement"); this._autoPlayTimer=null; this._priorLastVisible=this._priorFirstVisible=this.cfg.getProperty("firstVisible"); this._lastPrebuiltIdx=0; this.carouselList=YAHOO.util.Dom.getElementsByClassName(carouselListClass, "ul",this.carouselElem)[0]; if(this._nextElementID==null){ this._carouselNext=YAHOO.util.Dom.getElementsByClassName(carouselNextClass, "div",this.carouselElem)[0]; }else{ this._carouselNext=YAHOO.util.Dom.get(this._nextElementID); } if(this._prevElementID==null){ this._carouselPrev=YAHOO.util.Dom.getElementsByClassName(carouselPrevClass, "div",this.carouselElem)[0]; }else{ this._carouselPrev=YAHOO.util.Dom.get(this._prevElementID); } this._clipReg=YAHOO.util.Dom.getElementsByClassName(carouselClipRegionClass, "div",this.carouselElem)[0]; if(this.isVertical()){ YAHOO.util.Dom.addClass(this.carouselList,"carousel-vertical"); } this._scrollNextAnim=new YAHOO.util.Motion(this.carouselList,this.scrollNextParams, this.cfg.getProperty("animationSpeed"),this.cfg.getProperty("animationMethod")); this._scrollPrevAnim=new YAHOO.util.Motion(this.carouselList,this.scrollPrevParams, this.cfg.getProperty("animationSpeed"),this.cfg.getProperty("animationMethod")); if(this._carouselNext){ YAHOO.util.Event.addListener(this._carouselNext,"click",this._scrollNext,this); } if(this._carouselPrev){ YAHOO.util.Event.addListener(this._carouselPrev,"click",this._scrollPrev,this); } var loadInitHandler=this.cfg.getProperty("loadInitHandler"); if(loadInitHandler){ this._loadInitHandlerEvt=new YAHOO.util.CustomEvent("onLoadInit",this); this._loadInitHandlerEvt.subscribe(loadInitHandler,this); } var loadNextHandler=this.cfg.getProperty("loadNextHandler"); if(loadNextHandler){ this._loadNextHandlerEvt=new YAHOO.util.CustomEvent("onLoadNext",this); this._loadNextHandlerEvt.subscribe(loadNextHandler,this); } var loadPrevHandler=this.cfg.getProperty("loadPrevHandler"); if(loadPrevHandler){ this._loadPrevHandlerEvt=new YAHOO.util.CustomEvent("onLoadPrev",this); this._loadPrevHandlerEvt.subscribe(loadPrevHandler,this); } var animationCompleteHandler=this.cfg.getProperty("animationCompleteHandler"); if(animationCompleteHandler){ this._animationCompleteEvt=new YAHOO.util.CustomEvent("onAnimationComplete",this); this._animationCompleteEvt.subscribe(animationCompleteHandler,this); } var prevButtonStateHandler=this.cfg.getProperty("prevButtonStateHandler"); if(prevButtonStateHandler){ this._prevButtonStateHandlerEvt=new YAHOO.util.CustomEvent("onPrevButtonStateChange", this); this._prevButtonStateHandlerEvt.subscribe(prevButtonStateHandler,this); } var nextButtonStateHandler=this.cfg.getProperty("nextButtonStateHandler"); if(nextButtonStateHandler){ this._nextButtonStateHandlerEvt=new YAHOO.util.CustomEvent("onNextButtonStateChange",this); this._nextButtonStateHandlerEvt.subscribe(nextButtonStateHandler,this); } var visibleExtent=this._calculateVisibleExtent(); YAHOO.util.Event.onAvailable(this._carouselElemID+"-item-"+ visibleExtent.start,this._calculateSize,this); if(this.cfg.getProperty("loadOnStart")) this._loadInitial(); }, clear:function(){ var loadInitHandler=this.cfg.getProperty("loadInitHandler"); if(loadInitHandler){ this._removeChildrenFromNode(this.carouselList); this._lastPrebuiltIdx=0; } this.stopAutoPlay(); this._priorLastVisible=this._priorFirstVisible=this._origFirstVisible; this.cfg.setProperty("firstVisible",this._origFirstVisible,true); this.moveTo(this._origFirstVisible); }, reload:function(numVisible){ if(this._isValidObj(numVisible)){ this.cfg.setProperty("numVisible",numVisible); } this.clear(); var visibleExtent=this._calculateVisibleExtent(); YAHOO.util.Event.onAvailable(this._carouselElemID+"-item-"+visibleExtent.start, this._calculateSize,this); this._loadInitial(); }, load:function(){ var visibleExtent=this._calculateVisibleExtent(); YAHOO.util.Event.onAvailable(this._carouselElemID+"-item-"+visibleExtent.start, this._calculateSize,this); this._loadInitial(); }, addItem:function(idx,innerHTMLOrElem,itemClass){ if(idx>this.cfg.getProperty("size")){ return null; } var liElem=this.getItem(idx); if(!this._isValidObj(liElem)){ liElem=this._createItem(idx,innerHTMLOrElem); this.carouselList.appendChild(liElem); }else if(this._isValidObj(liElem.placeholder)){ var newLiElem=this._createItem(idx,innerHTMLOrElem); this.carouselList.replaceChild(newLiElem,liElem); liElem=newLiElem; } if(this._isValidObj(itemClass)){ YAHOO.util.Dom.addClass(liElem,itemClass); } if(this.isVertical()) setTimeout(function(){liElem.style.display="block";},1); return liElem; }, insertBefore:function(refIdx,innerHTML){ if(refIdx>=this.cfg.getProperty("size")){ return null; } if(refIdx<1){ refIdx=1; } var insertionIdx=refIdx-1; if(insertionIdx>this._lastPrebuiltIdx){ this._prebuildItems(this._lastPrebuiltIdx,refIdx); } var liElem=this._insertBeforeItem(refIdx,innerHTML); this._enableDisableControls(); return liElem; }, insertAfter:function(refIdx,innerHTML){ if(refIdx>this.cfg.getProperty("size")){ refIdx=this.cfg.getProperty("size"); } var insertionIdx=refIdx+1; if(insertionIdx>this._lastPrebuiltIdx){ this._prebuildItems(this._lastPrebuiltIdx,insertionIdx+1); } var liElem=this._insertAfterItem(refIdx,innerHTML); if(insertionIdx>this.cfg.getProperty("size")){ this.cfg.setProperty("size",insertionIdx,true); } this._enableDisableControls(); return liElem; }, scrollNext:function(){ this._scrollNext(null,this); this._autoPlayTimer=null; if(this.cfg.getProperty("autoPlay")!==0){ this._autoPlayTimer=this.startAutoPlay(); } }, scrollPrev:function(){ this._scrollPrev(null,this); }, scrollTo:function(newStart){ this._position(newStart,true); }, moveTo:function(newStart){ this._position(newStart,false); }, startAutoPlay:function(interval){ if(this._isValidObj(interval)){ this.cfg.setProperty("autoPlay",interval,true); } if(this._autoPlayTimer!==null){ return this._autoPlayTimer; } var oThis=this; var autoScroll=function(){oThis.scrollNext();}; this._autoPlayTimer=setTimeout(autoScroll,this.cfg.getProperty("autoPlay")); return this._autoPlayTimer; }, stopAutoPlay:function(){ if(this._autoPlayTimer!==null){ clearTimeout(this._autoPlayTimer); this._autoPlayTimer=null; } }, isVertical:function(){ return(this.cfg.getProperty("orientation")!="horizontal"); }, isItemLoaded:function(idx){ var liElem=this.getItem(idx); if(this._isValidObj(liElem)&&!this._isValidObj(liElem.placeholder)){ return true; } return false; }, getItem:function(idx){ var elemName=this._carouselElemID+"-item-"+idx; var liElem=YAHOO.util.Dom.get(elemName); return liElem; }, show:function(){ YAHOO.util.Dom.setStyle(this.carouselElem,"display","block"); this.calculateSize(); }, hide:function(){ YAHOO.util.Dom.setStyle(this.carouselElem,"display","none"); }, calculateSize:function(){ var ulKids=this.carouselList.childNodes; var li=null; for(var i=0;ithis._lastPrebuiltIdx)?idx:this._lastPrebuiltIdx; }, _createItem:function(idx,innerHTMLOrElem){ if(idx<1)return; var liElem=document.createElement("li"); liElem.id=this._carouselElemID+"-item-"+idx; if(typeof(innerHTMLOrElem)==="string"){ liElem.innerHTML=innerHTMLOrElem; }else{ liElem.appendChild(innerHTMLOrElem); } return liElem; }, _insertAfterItem:function(refIdx,innerHTMLOrElem){ return this._insertBeforeItem(refIdx+1,innerHTMLOrElem); }, _insertBeforeItem:function(refIdx,innerHTMLOrElem){ var refItem=this.getItem(refIdx); var size=this.cfg.getProperty("size"); if(size!=this.UNBOUNDED_SIZE){ this.cfg.setProperty("size",size+1,true); } for(var i=this._lastPrebuiltIdx;i>=refIdx;i--){ var anItem=this.getItem(i); if(this._isValidObj(anItem)){ anItem.id=this._carouselElemID+"-item-"+(i+1); } } var liElem=this._createItem(refIdx,innerHTMLOrElem); var insertedItem=this.carouselList.insertBefore(liElem,refItem); this._lastPrebuiltIdx+=1; return liElem; }, insertAfterEnd:function(innerHTMLOrElem){ return this.insertAfter(this.cfg.getProperty("size"),innerHTMLOrElem); }, _position:function(newStart,showAnimation){ var currStart=this._priorFirstVisible; if(newStart>currStart){ var inc=newStart-currStart; this._scrollNextInc(inc,showAnimation); }else{ var dec=currStart-newStart; this._scrollPrevInc(dec,showAnimation); } }, _scrollPrev:function(e,carousel){ if(e!==null){ carousel.stopAutoPlay(); } if(carousel._scrollPrevAnim.isAnimated()){ return false; } carousel._scrollPrevInc(carousel.cfg.getProperty("scrollInc"), (carousel.cfg.getProperty("animationSpeed")!==0)); }, _scrollNext:function(e,carousel){ if(e!==null){ carousel.stopAutoPlay(); } if(carousel._scrollNextAnim.isAnimated()){ return false; } carousel._scrollNextInc(carousel.cfg.getProperty("scrollInc"), (carousel.cfg.getProperty("animationSpeed")!==0)); }, _handleAnimationComplete:function(type,args,argList){ var carousel=argList[0]; var direction=argList[1]; carousel._animationCompleteEvt.fire(direction); }, _areAllItemsLoaded:function(first,last){ var itemsLoaded=true; for(var i=first;i<=last;i++){ var liElem=this.getItem(i); if(!this._isValidObj(liElem)){ this._prebuildLiElem(i); itemsLoaded=false; }else if(this._isValidObj(liElem.placeholder)){ itemsLoaded=false; } } return itemsLoaded; }, _prebuildItems:function(first,last){ for(var i=first;i<=last;i++){ var liElem=this.getItem(i); if(!this._isValidObj(liElem)){ this._prebuildLiElem(i); } } }, _isExtraRevealed:function(){ return(this.cfg.getProperty("revealAmount")>0); }, _scrollNextInc:function(inc,showAnimation){ var numVisible=this.cfg.getProperty("numVisible"); var currStart=this._priorFirstVisible; var currEnd=this._priorLastVisible; var size=this.cfg.getProperty("size"); var scrollExtent=this._calculateAllowableScrollExtent(); if(this.cfg.getProperty("wrap")&&currEnd==scrollExtent.end){ this.scrollTo(scrollExtent.start); return; } var newStart=currStart+inc; var newEnd=newStart+numVisible-1; if(newEnd>scrollExtent.end){ newEnd=scrollExtent.end; newStart=newEnd-numVisible+1; } inc=newStart-currStart; this.cfg.setProperty("firstVisible",newStart,true); if(inc>0){ if(this._isValidObj(this.cfg.getProperty("loadNextHandler"))){ var visibleExtent=this._calculateVisibleExtent(newStart,newEnd); var cacheStart=(currEnd+1)scrollExtent.end){ newEnd=scrollExtent.end; newStart=newEnd-numVisible+1; } dec=currStart-newStart; this.cfg.setProperty("firstVisible",newStart,true); if(dec>0){ if(this._isValidObj(this.cfg.getProperty("loadPrevHandler"))){ var visibleExtent=this._calculateVisibleExtent(newStart,newEnd); var cacheEnd=(currStart-1)>visibleExtent.end?(currStart-1):visibleExtent.end; var alreadyCached=this._areAllItemsLoaded(visibleExtent.start,cacheEnd); this._loadPrevHandlerEvt.fire(visibleExtent.start,visibleExtent.end,alreadyCached); } if(showAnimation){ var prevParams={points:{by:[this.scrollAmountPerInc*dec,0]}}; if(this.isVertical()){ prevParams={points:{by:[0,this.scrollAmountPerInc*dec]}}; } this._scrollPrevAnim=new YAHOO.util.Motion(this.carouselList, prevParams, this.cfg.getProperty("animationSpeed"),this.cfg.getProperty("animationMethod")); if(this.cfg.getProperty("animationCompleteHandler")){ this._scrollPrevAnim.onComplete.subscribe(this._handleAnimationComplete,[this,"prev"]); } this._scrollPrevAnim.animate(); }else{ if(this.isVertical()){ var currY=YAHOO.util.Dom.getY(this.carouselList); YAHOO.util.Dom.setY(this.carouselList,currY+ this.scrollAmountPerInc*dec); }else{ var currX=YAHOO.util.Dom.getX(this.carouselList); YAHOO.util.Dom.setX(this.carouselList,currX+ this.scrollAmountPerInc*dec); } } } this._priorFirstVisible=newStart; this._priorLastVisible=newEnd; this._enableDisableControls(); return false; }, _enableDisableControls:function(){ var firstVisible=this.cfg.getProperty("firstVisible"); var lastVisible=this.getLastVisible(); var scrollExtent=this._calculateAllowableScrollExtent(); if(this._prevEnabled){ if(firstVisible===scrollExtent.start){ this._disablePrev(); } } if(this._prevEnabled===false){ if(firstVisible>scrollExtent.start){ this._enablePrev(); } } if(this._nextEnabled){ if(lastVisible===scrollExtent.end){ this._disableNext(); } } if(this._nextEnabled===false){ if(lastVisiblesize?size:end; var extent={start:start,end:end}; this._firstItemRevealed=-1; this._lastItemRevealed=-1; if(this._isExtraRevealed()){ if(start>1){ this._firstItemRevealed=start-1; extent.start=this._firstItemRevealed; } if(end