/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

if(typeof YAHOO=="undefined"){var YAHOO={};}
YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.init=function(){this.namespace("util","widget","example");if(typeof YAHOO_config!="undefined"){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
if(unique){ls.push(l);}}}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]};}
var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m);}
if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[],getVersion:function(name){return YAHOO.env.modules[name]||null;}};YAHOO.lang={isArray:function(obj){if(obj.constructor&&obj.constructor.toString().indexOf('Array')>-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 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){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){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;i=i+1){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}}};YAHOO.init();YAHOO.util.Lang=YAHOO.lang;YAHOO.augment=YAHOO.lang.augment;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.2.0",build:"127"});
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-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};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}
if(propertyCache[property]){return propertyCache[property];}
while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;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;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(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}
YAHOO.util.Dom={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]=Y.Dom.get(el[i]);}
return collection;}
return null;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||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')
{if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}
if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}
return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},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';}
if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.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 Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}
el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.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);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}
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);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}
if(!el.id){el.id=prefix+id_counter++;}
return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.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||parent.tagName.toUpperCase()=='HTML'){return false;}
parent=parent.parentNode;}
return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';var nodes=[];if(root){root=Y.Dom.get(root);if(!root){return nodes;}}else{root=document;}
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=Y.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=el[i];}
collection[collection.length]=method.call(scope,el[i],o);}
return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}
return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}
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.register("dom",YAHOO.util.Dom,{version:"2.2.0",build:"127"});
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var lastError=null;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,isSafari:(/KHTML/gi).test(navigator.userAgent),webkit:function(){var v=navigator.userAgent.match(/AppleWebKit\/([^ ]*)/);if(v&&v[1]){return v[1];}
return null;}(),isIE:(!this.webkit&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){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,obj,override)&&ok;}
return ok;}else if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
if(!el){return false;}
if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}
var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}
var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};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||el!=legacyEvents[legacyIndex][0]){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(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,scope,ret;lh=legacyHandlers[legacyIndex];for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){scope=li[this.ADJ_SCOPE];ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
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(this.webkit&&("click"==sType||"dblclick"==sType)){var v=parseInt(this.webkit,10);if(!isNaN(v)&&v<418){return true;}}
return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
return ok;}
if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
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){unloadListeners.splice(i,1);return true;}}
return false;}
var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
if(index>=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;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){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(ex){this.lastError=ex;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.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(){},_load:function(e){loadComplete=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}
this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
var notAvail=[];for(var i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){var el=this.getEl(item.id);if(el){if(!item.checkReady||loadComplete||el.nextSibling||(document&&document.body)){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
item.fn.call(scope,item.obj);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
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);}}
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 results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType=="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
for(var j=0;j<searchLists.length;++j){var searchList=searchLists[j];if(searchList&&searchList.length>0){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}
return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}
unloadListeners=null;if(listeners&&listeners.length>0){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<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}
legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_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||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}
EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
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(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;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;if(!len&&this.silent){return true;}
var args=[],ret=true,i;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
var argslength=args.length;if(!this.silent){}
for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}
var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){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<len;++i){this._delete(len-1-i);}
return i;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=obj||null;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};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<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
return false;}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
if(!keyData.alt){keyData.alt=false;}
if(!keyData.ctrl){keyData.ctrl=false;}
if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.register("event",YAHOO.util.Event,{version:"2.2.0",build:"127"});
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

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(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}
YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};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=1000;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[0].isAnimated()){this.unRegister(queue[0],0);}}
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.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;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(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}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;}
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.register("animation",YAHOO.util.Anim,{version:"2.2.0",build:"127"});
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded',_use_default_xhr_header:true,_default_xhr_header:'XMLHttpRequest',_has_default_headers:true,_default_headers:{},_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._use_default_post_header=b;},setDefaultXhrHeader:function(b)
{this._use_default_xhr_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,postData);this.releaseObject(o);return;}
if(method.toUpperCase()=='GET'){if(this._sFormData.length!=0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
else{uri+="?"+this._sFormData;}}
else if(method.toUpperCase()=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
o.conn.open(method,uri,true);if(this._use_default_xhr_header){if(!this._default_headers['X-Requested-With']){this.initHeader('X-Requested-With',this._default_xhr_header,true);}}
if(this._isFormSubmit||(postData&&this._use_default_post_header)){this.initHeader('Content-Type',this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}
if(this._has_default_headers||this._has_http_headers){this.setHeader(o);}
this.handleReadyState(o,callback);o.conn.send(postData||null);return o;}},handleReadyState:function(o,callback)
{var oConn=this;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){delete oConn._timeOut[o.tId];}
oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},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?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<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,isDefault)
{var headerObj=(isDefault)?this._default_headers:this._http_headers;if(headerObj[label]===undefined){headerObj[label]=value;}
else{headerObj[label]=value+","+headerObj[label];}
if(isDefault){this._has_default_headers=true;}
else{this._has_http_headers=true;}},setHeader:function(o)
{if(this._has_default_headers){for(var prop in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,prop)){o.conn.setRequestHeader(prop,this._default_headers[prop]);}}}
if(this._has_http_headers){for(var prop in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,prop)){o.conn.setRequestHeader(prop,this._http_headers[prop]);}}
delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers
this._default_headers={};this._has_default_headers=false;},setForm:function(formId,isUpload,secureUri)
{this.resetFormState();var oForm;if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}
else if(typeof formId=='object'){oForm=formId;}
else{return;}
if(isUpload){this.createFrame(secureUri?secureUri:null);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++){oElement=oForm.elements[i];oDisabled=oForm.elements[i].disabled;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){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text)+'&';}
else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?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);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;if(window.ActiveXObject){var io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');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;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}
return formElements;},uploadFile:function(id,callback,uri,postData){var frameId='yuiIO'+id;var uploadEncoding='multipart/form-data';var io=document.getElementById(frameId);this._formNode.action=uri;this._formNode.method='POST';this._formNode.target=frameId;if(this._formNode.encoding){this._formNode.encoding=uploadEncoding;}
else{this._formNode.enctype=uploadEncoding;}
if(postData){var oElements=this.appendPostData(postData);}
this._formNode.submit();if(oElements&&oElements.length>0){for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
this.resetFormState();var uploadCallback=function()
{var obj={};obj.tId=id;obj.argument=callback.argument;try
{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
catch(e){}
if(callback&&callback.upload){if(!callback.scope){callback.upload(obj);}
else{callback.upload.apply(callback.scope,[obj]);}}
if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",uploadCallback);}
else if(window.detachEvent){io.detachEvent('onload',uploadCallback);}
else{io.removeEventListener('load',uploadCallback,false);}
setTimeout(function(){document.body.removeChild(io);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}
else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout)
{if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){delete this._timeOut[o.tId];}
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;}};
YAHOO.register("connection", YAHOO.widget.Module, {version: "2.2.0", build: "127"});
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

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,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;i<len;++i){if(targets[i].id==oTargetDD.id){return true;}}
return false;},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop);},isHandle:function(sDDId,sHandleId){return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}
return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}
this.dragThreshMet=true;},handleMouseUp:function(e){if(!this.dragCurrent){return;}
clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}
this.stopDrag(e);this.stopEvent(e);},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}
if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}
this.dragCurrent.onMouseUp(e);}
this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}
if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}
if(!this.dragThreshMet){var diffX=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var diffY=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(diffX>this.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 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)){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)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);}
this.dragOvers[oDD.id]=oDD;}}}}}
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;i<len;++i){dc.b4DragOut(e,outEvts[i].id);dc.onDragOut(e,outEvts[i].id);}
for(i=0,len=enterEvts.length;i<len;++i){dc.onDragEnter(e,enterEvts[i].id);}
for(i=0,len=overEvts.length;i<len;++i){dc.b4DragOver(e,overEvts[i].id);dc.onDragOver(e,overEvts[i].id);}
for(i=0,len=dropEvts.length;i<len;++i){dc.b4DragDrop(e,dropEvts[i].id);dc.onDragDrop(e,dropEvts[i].id);}}
if(isDrop&&!dropEvts.length){dc.onInvalidDrop(e);}},getBestMatch:function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver){winner=dd;break;}else{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea())){winner=dd;}}}}
return winner;},refreshCache:function(groups){var g=groups||this.ids;for(var sGroup in g){if("string"!=typeof sGroup){continue;}
for(var i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var parent=el.offsetParent;if(parent){return true;}}}catch(e){}
return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}
var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}
if(!pos){return null;}
x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
if(!loc){return false;}
oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}
oTarget.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}
this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el){oWrapper=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}
return oWrapper;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{}
return{top:t,left:l};},getStyle:function(el,styleProp){return YAHOO.util.Dom.getStyle(el,styleProp);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(moveEl,targetEl){var aCoord=YAHOO.util.Dom.getXY(targetEl);YAHOO.util.Dom.setXY(moveEl,aCoord);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}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,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)));},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<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}
return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;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<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=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&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
if(x>this.maxX){x=this.maxX;}}
if(this.constrainY){if(y<this.minY){y=this.minY;}
if(y>this.maxY){y=this.maxY;}}
x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}
var div=this.getDragEl();if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
this.setDragElPos(iPageX,iPageY);YAHOO.util.Dom.setStyle(dragEl,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();var bt=parseInt(DOM.getStyle(dragEl,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(dragEl,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(dragEl,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}
if(isNaN(br)){br=0;}
if(isNaN(bb)){bb=0;}
if(isNaN(bl)){bl=0;}
var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){this.setStartPosition();var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.2.0",build:"127"});
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}};this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}
return true;}else{return false;}};this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
return true;}}else{return false;}}};this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
var foundDuplicate=false;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var queueItemKey=queueItem[0];var queueItemValue=queueItem[1];if(queueItemKey.toLowerCase()==key){eventQueue[i]=null;eventQueue.push([key,(typeof value!='undefined'?value:queueItemValue)]);foundDuplicate=true;break;}}}
if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}
if(property.supercedes){for(var s=0;s<property.supercedes.length;s++){var supercedesCheck=property.supercedes[s];for(var q=0;q<eventQueue.length;q++){var queueItemCheck=eventQueue[q];if(queueItemCheck){var queueItemCheckKey=queueItemCheck[0];var queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey.toLowerCase()==supercedesCheck.toLowerCase()){eventQueue.push([queueItemCheckKey,queueItemCheckValue]);eventQueue[q]=null;break;}}}}}
return true;}else{return false;}};this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}};this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}};this.refresh=function(){for(var prop in config){this.refireEvent(prop);}};this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
this.queueInProgress=false;eventQueue=[];};this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
return true;}else{return false;}};this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
return output;};};YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
return false;};YAHOO.widget.DateMath={DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",ONE_DAY_MS:1000*60*60*24,add:function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}}
d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;}
return d;},subtract:function(date,field,amount){return this.add(date,field,(amount*-1));},before:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()<ms){return true;}else{return false;}},after:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()>ms){return true;}else{return false;}},between:function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}},getJan1:function(calendarYear){return new Date(calendarYear,0,1);},getDayOffset:function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;},getWeekNumber:function(date,calendarYear){date=this.clearTime(date);var nearestThurs=new Date(date.getTime()+(4*this.ONE_DAY_MS)-((date.getDay())*this.ONE_DAY_MS));var jan1=new Date(nearestThurs.getFullYear(),0,1);var dayOfYear=((nearestThurs.getTime()-jan1.getTime())/this.ONE_DAY_MS)-1;var weekNum=Math.ceil((dayOfYear)/7);return weekNum;},isYearOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;}
return overlaps;},isMonthOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;}
return overlaps;},findMonthStart:function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;},findMonthEnd:function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;},clearTime:function(date){date.setHours(12,0,0,0);return date;}};YAHOO.widget.Calendar=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.widget.Calendar.IMG_ROOT=null;YAHOO.widget.Calendar.DATE="D";YAHOO.widget.Calendar.MONTH_DAY="MD";YAHOO.widget.Calendar.WEEKDAY="WD";YAHOO.widget.Calendar.RANGE="R";YAHOO.widget.Calendar.MONTH="M";YAHOO.widget.Calendar.DISPLAY_DAYS=42;YAHOO.widget.Calendar.STOP_RENDER="S";YAHOO.widget.Calendar.prototype={Config:null,parent:null,index:-1,cells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,_selectedDates:null,domEventMap:null};YAHOO.widget.Calendar.prototype.init=function(id,containerId,config){this.initEvents();this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);this.id=id;this.oDomContainer=document.getElementById(containerId);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.initStyles();YAHOO.util.Dom.addClass(this.oDomContainer,this.Style.CSS_CONTAINER);YAHOO.util.Dom.addClass(this.oDomContainer,this.Style.CSS_SINGLE);this.cellDates=[];this.cells=[];this.renderStack=[];this._renderStack=[];this.setupConfig();if(config){this.cfg.applyConfig(config,true);}
this.cfg.fireQueue();};YAHOO.widget.Calendar.prototype.configIframe=function(type,args,obj){var useIframe=args[0];if(YAHOO.util.Dom.inDocument(this.oDomContainer)){if(useIframe){var pos=YAHOO.util.Dom.getStyle(this.oDomContainer,"position");if(this.browser=="ie"&&(pos=="absolute"||pos=="relative")){if(!YAHOO.util.Dom.inDocument(this.iframe)){this.iframe=document.createElement("iframe");this.iframe.src="javascript:false;";YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");this.oDomContainer.insertBefore(this.iframe,this.oDomContainer.firstChild);}}}else{if(this.iframe){if(this.iframe.parentNode){this.iframe.parentNode.removeChild(this.iframe);}
this.iframe=null;}}}};YAHOO.widget.Calendar.prototype.configTitle=function(type,args,obj){var title=args[0];var close=this.cfg.getProperty("close");var titleDiv;if(title&&title!==""){titleDiv=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||document.createElement("div");titleDiv.className=YAHOO.widget.CalendarGroup.CSS_2UPTITLE;titleDiv.innerHTML=title;this.oDomContainer.insertBefore(titleDiv,this.oDomContainer.firstChild);YAHOO.util.Dom.addClass(this.oDomContainer,"withtitle");}else{titleDiv=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||null;if(titleDiv){YAHOO.util.Event.purgeElement(titleDiv);this.oDomContainer.removeChild(titleDiv);}
if(!close){YAHOO.util.Dom.removeClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.configClose=function(type,args,obj){var close=args[0];var title=this.cfg.getProperty("title");var DEPR_CLOSE_PATH="us/my/bn/x_d.gif";var linkClose;if(close===true){linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||document.createElement("a");linkClose.href="javascript:void(null);";linkClose.className="link-close";YAHOO.util.Event.addListener(linkClose,"click",this.hide,this,true);if(YAHOO.widget.Calendar.IMG_ROOT!==null){var imgClose=document.createElement("img");imgClose.src=YAHOO.widget.Calendar.IMG_ROOT+DEPR_CLOSE_PATH;imgClose.className=YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;linkClose.appendChild(imgClose);}else{linkClose.innerHTML='<span class="'+YAHOO.widget.CalendarGroup.CSS_2UPCLOSE+' '+this.Style.CSS_CLOSE+'"></span>';}
this.oDomContainer.appendChild(linkClose);YAHOO.util.Dom.addClass(this.oDomContainer,"withtitle");}else{linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||null;if(linkClose){YAHOO.util.Event.purgeElement(linkClose);this.oDomContainer.removeChild(linkClose);}
if(!title||title===""){YAHOO.util.Dom.removeClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.initEvents=function(){this.beforeSelectEvent=new YAHOO.util.CustomEvent("beforeSelect");this.selectEvent=new YAHOO.util.CustomEvent("select");this.beforeDeselectEvent=new YAHOO.util.CustomEvent("beforeDeselect");this.deselectEvent=new YAHOO.util.CustomEvent("deselect");this.changePageEvent=new YAHOO.util.CustomEvent("changePage");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.resetEvent=new YAHOO.util.CustomEvent("reset");this.clearEvent=new YAHOO.util.CustomEvent("clear");this.beforeSelectEvent.subscribe(this.onBeforeSelect,this,true);this.selectEvent.subscribe(this.onSelect,this,true);this.beforeDeselectEvent.subscribe(this.onBeforeDeselect,this,true);this.deselectEvent.subscribe(this.onDeselect,this,true);this.changePageEvent.subscribe(this.onChangePage,this,true);this.renderEvent.subscribe(this.onRender,this,true);this.resetEvent.subscribe(this.onReset,this,true);this.clearEvent.subscribe(this.onClear,this,true);};YAHOO.widget.Calendar.prototype.doSelectCell=function(e,cal){var target=YAHOO.util.Event.getTarget(e);var cell,index,d,date;while(target.tagName.toLowerCase()!="td"&&!YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
cell=target;if(YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_SELECTABLE)){index=cell.id.split("cell")[1];d=cal.cellDates[index];date=new Date(d[0],d[1]-1,d[2]);var link;if(cal.Options.MULTI_SELECT){link=cell.getElementsByTagName("a")[0];if(link){link.blur();}
var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{link=cell.getElementsByTagName("a")[0];if(link){link.blur();}
cal.selectCell(index);}}};YAHOO.widget.Calendar.prototype.doCellMouseOver=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}
while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
if(YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){YAHOO.util.Dom.addClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.doCellMouseOut=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}
while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
if(YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){YAHOO.util.Dom.removeClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.setupConfig=function(){this.cfg.addProperty("pagedate",{value:new Date(),handler:this.configPageDate});this.cfg.addProperty("selected",{value:[],handler:this.configSelected});this.cfg.addProperty("title",{value:"",handler:this.configTitle});this.cfg.addProperty("close",{value:false,handler:this.configClose});this.cfg.addProperty("iframe",{value:true,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty("mindate",{value:null,handler:this.configMinDate});this.cfg.addProperty("maxdate",{value:null,handler:this.configMaxDate});this.cfg.addProperty("MULTI_SELECT",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("START_WEEKDAY",{value:0,handler:this.configOptions,validator:this.cfg.checkNumber});this.cfg.addProperty("SHOW_WEEKDAYS",{value:true,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_HEADER",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_FOOTER",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("HIDE_BLANK_WEEKS",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("NAV_ARROW_LEFT",{value:null,handler:this.configOptions});this.cfg.addProperty("NAV_ARROW_RIGHT",{value:null,handler:this.configOptions});this.cfg.addProperty("MONTHS_SHORT",{value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],handler:this.configLocale});this.cfg.addProperty("MONTHS_LONG",{value:["January","February","March","April","May","June","July","August","September","October","November","December"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_1CHAR",{value:["S","M","T","W","T","F","S"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_SHORT",{value:["Su","Mo","Tu","We","Th","Fr","Sa"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_MEDIUM",{value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_LONG",{value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],handler:this.configLocale});var refreshLocale=function(){this.cfg.refireEvent("LOCALE_MONTHS");this.cfg.refireEvent("LOCALE_WEEKDAYS");};this.cfg.subscribeToConfigEvent("START_WEEKDAY",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("MONTHS_SHORT",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("MONTHS_LONG",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_1CHAR",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_SHORT",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_MEDIUM",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_LONG",refreshLocale,this,true);this.cfg.addProperty("LOCALE_MONTHS",{value:"long",handler:this.configLocaleValues});this.cfg.addProperty("LOCALE_WEEKDAYS",{value:"short",handler:this.configLocaleValues});this.cfg.addProperty("DATE_DELIMITER",{value:",",handler:this.configLocale});this.cfg.addProperty("DATE_FIELD_DELIMITER",{value:"/",handler:this.configLocale});this.cfg.addProperty("DATE_RANGE_DELIMITER",{value:"-",handler:this.configLocale});this.cfg.addProperty("MY_MONTH_POSITION",{value:1,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MY_YEAR_POSITION",{value:2,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_MONTH_POSITION",{value:1,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_DAY_POSITION",{value:2,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_MONTH_POSITION",{value:1,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_DAY_POSITION",{value:2,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_YEAR_POSITION",{value:3,handler:this.configLocale,validator:this.cfg.checkNumber});};YAHOO.widget.Calendar.prototype.configPageDate=function(type,args,obj){this.cfg.setProperty("pagedate",this._parsePageDate(args[0]),true);};YAHOO.widget.Calendar.prototype.configMinDate=function(type,args,obj){var val=args[0];if(typeof val=='string'){val=this._parseDate(val);this.cfg.setProperty("mindate",new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configMaxDate=function(type,args,obj){var val=args[0];if(typeof val=='string'){val=this._parseDate(val);this.cfg.setProperty("maxdate",new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configSelected=function(type,args,obj){var selected=args[0];if(selected){if(typeof selected=='string'){this.cfg.setProperty("selected",this._parseDates(selected),true);}}
if(!this._selectedDates){this._selectedDates=this.cfg.getProperty("selected");}};YAHOO.widget.Calendar.prototype.configOptions=function(type,args,obj){type=type.toUpperCase();var val=args[0];this.Options[type]=val;};YAHOO.widget.Calendar.prototype.configLocale=function(type,args,obj){type=type.toUpperCase();var val=args[0];this.Locale[type]=val;this.cfg.refireEvent("LOCALE_MONTHS");this.cfg.refireEvent("LOCALE_WEEKDAYS");};YAHOO.widget.Calendar.prototype.configLocaleValues=function(type,args,obj){type=type.toUpperCase();var val=args[0];switch(type){case"LOCALE_MONTHS":switch(val){case"short":this.Locale.LOCALE_MONTHS=this.cfg.getProperty("MONTHS_SHORT").concat();break;case"long":this.Locale.LOCALE_MONTHS=this.cfg.getProperty("MONTHS_LONG").concat();break;}
break;case"LOCALE_WEEKDAYS":switch(val){case"1char":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_1CHAR").concat();break;case"short":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_SHORT").concat();break;case"medium":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_MEDIUM").concat();break;case"long":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_LONG").concat();break;}
var START_WEEKDAY=this.cfg.getProperty("START_WEEKDAY");if(START_WEEKDAY>0){for(var w=0;w<START_WEEKDAY;++w){this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());}}
break;}};YAHOO.widget.Calendar.prototype.initStyles=function(){this.Style={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTED:"selected",CSS_CELL_SELECTABLE:"selectable",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_BODY:"calbody",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_SINGLE:"single",CSS_CONTAINER:"yui-calcontainer",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_CLOSE:"calclose",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};};YAHOO.widget.Calendar.prototype.buildMonthLabel=function(){var text=this.Locale.LOCALE_MONTHS[this.cfg.getProperty("pagedate").getMonth()]+" "+this.cfg.getProperty("pagedate").getFullYear();return text;};YAHOO.widget.Calendar.prototype.buildDayLabel=function(workingDate){var day=workingDate.getDate();return day;};YAHOO.widget.Calendar.prototype.renderHeader=function(html){var colSpan=7;var DEPR_NAV_LEFT="us/tr/callt.gif";var DEPR_NAV_RIGHT="us/tr/calrt.gif";if(this.cfg.getProperty("SHOW_WEEK_HEADER")){colSpan+=1;}
if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){colSpan+=1;}
html[html.length]="<thead>";html[html.length]="<tr>";html[html.length]='<th colspan="'+colSpan+'" class="'+this.Style.CSS_HEADER_TEXT+'">';html[html.length]='<div class="'+this.Style.CSS_HEADER+'">';var renderLeft,renderRight=false;if(this.parent){if(this.index===0){renderLeft=true;}
if(this.index==(this.parent.cfg.getProperty("pages")-1)){renderRight=true;}}else{renderLeft=true;renderRight=true;}
var cal=this.parent||this;if(renderLeft){var leftArrow=this.cfg.getProperty("NAV_ARROW_LEFT");if(leftArrow===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){leftArrow=YAHOO.widget.Calendar.IMG_ROOT+DEPR_NAV_LEFT;}
var leftStyle=(leftArrow===null)?"":' style="background-image:url('+leftArrow+')"';html[html.length]='<a class="'+this.Style.CSS_NAV_LEFT+'"'+leftStyle+' >&#160;</a>';}
html[html.length]=this.buildMonthLabel();if(renderRight){var rightArrow=this.cfg.getProperty("NAV_ARROW_RIGHT");if(rightArrow===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){rightArrow=YAHOO.widget.Calendar.IMG_ROOT+DEPR_NAV_RIGHT;}
var rightStyle=(rightArrow===null)?"":' style="background-image:url('+rightArrow+')"';html[html.length]='<a class="'+this.Style.CSS_NAV_RIGHT+'"'+rightStyle+' >&#160;</a>';}
html[html.length]='</div>';html[html.length]='</th>';html[html.length]='</tr>';if(this.cfg.getProperty("SHOW_WEEKDAYS")){html=this.buildWeekdays(html);}
html[html.length]='</thead>';return html;};YAHOO.widget.Calendar.prototype.buildWeekdays=function(html){html[html.length]='<tr class="'+this.Style.CSS_WEEKDAY_ROW+'">';if(this.cfg.getProperty("SHOW_WEEK_HEADER")){html[html.length]='<th>&#160;</th>';}
for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i){html[html.length]='<th class="calweekdaycell">'+this.Locale.LOCALE_WEEKDAYS[i]+'</th>';}
if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){html[html.length]='<th>&#160;</th>';}
html[html.length]='</tr>';return html;};YAHOO.widget.Calendar.prototype.renderBody=function(workingDate,html){var startDay=this.cfg.getProperty("START_WEEKDAY");this.preMonthDays=workingDate.getDay();if(startDay>0){this.preMonthDays-=startDay;}
if(this.preMonthDays<0){this.preMonthDays+=7;}
this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var useDate,weekNum,weekClass;useDate=this.cfg.getProperty("pagedate");html[html.length]='<tbody class="m'+(useDate.getMonth()+1)+' '+this.Style.CSS_BODY+'">';var i=0;var tempDiv=document.createElement("div");var cell=document.createElement("td");tempDiv.appendChild(cell);var jan1=new Date(useDate.getFullYear(),0,1);var cal=this.parent||this;for(var r=0;r<6;r++){weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useDate.getFullYear(),startDay);weekClass="w"+weekNum;if(r!==0&&this.isDateOOM(workingDate)&&this.cfg.getProperty("HIDE_BLANK_WEEKS")===true){break;}else{html[html.length]='<tr class="'+weekClass+'">';if(this.cfg.getProperty("SHOW_WEEK_HEADER")){html=this.renderRowHeader(weekNum,html);}
for(var d=0;d<7;d++){var cellRenderers=[];this.clearElement(cell);YAHOO.util.Dom.addClass(cell,"calcell");cell.id=this.id+"_cell"+i;cell.innerHTML=i;var renderer=null;if(workingDate.getFullYear()==this.today.getFullYear()&&workingDate.getMonth()==this.today.getMonth()&&workingDate.getDate()==this.today.getDate()){cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;}
this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];if(this.isDateOOM(workingDate)){cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;}else{YAHOO.util.Dom.addClass(cell,"wd"+workingDate.getDay());YAHOO.util.Dom.addClass(cell,"d"+workingDate.getDate());for(var s=0;s<this.renderStack.length;++s){var rArray=this.renderStack[s];var type=rArray[0];var month;var day;var year;switch(type){case YAHOO.widget.Calendar.DATE:month=rArray[1][1];day=rArray[1][2];year=rArray[1][0];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day&&workingDate.getFullYear()==year){renderer=rArray[2];this.renderStack.splice(s,1);}
break;case YAHOO.widget.Calendar.MONTH_DAY:month=rArray[1][0];day=rArray[1][1];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day){renderer=rArray[2];this.renderStack.splice(s,1);}
break;case YAHOO.widget.Calendar.RANGE:var date1=rArray[1][0];var date2=rArray[1][1];var d1month=date1[1];var d1day=date1[2];var d1year=date1[0];var d1=new Date(d1year,d1month-1,d1day);var d2month=date2[1];var d2day=date2[2];var d2year=date2[0];var d2=new Date(d2year,d2month-1,d2day);if(workingDate.getTime()>=d1.getTime()&&workingDate.getTime()<=d2.getTime()){renderer=rArray[2];if(workingDate.getTime()==d2.getTime()){this.renderStack.splice(s,1);}}
break;case YAHOO.widget.Calendar.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];}
break;case YAHOO.widget.Calendar.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];}
break;}
if(renderer){cellRenderers[cellRenderers.length]=renderer;}}}
if(this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()])>-1){cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected;}
var mindate=this.cfg.getProperty("mindate");var maxdate=this.cfg.getProperty("maxdate");if(mindate){mindate=YAHOO.widget.DateMath.clearTime(mindate);}
if(maxdate){maxdate=YAHOO.widget.DateMath.clearTime(maxdate);}
if((mindate&&(workingDate.getTime()<mindate.getTime()))||(maxdate&&(workingDate.getTime()>maxdate.getTime()))){cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=cal.styleCellDefault;cellRenderers[cellRenderers.length]=cal.renderCellDefault;}
for(var x=0;x<cellRenderers.length;++x){var ren=cellRenderers[x];if(ren.call((this.parent||this),workingDate,cell)==YAHOO.widget.Calendar.STOP_RENDER){break;}}
workingDate.setTime(workingDate.getTime()+YAHOO.widget.DateMath.ONE_DAY_MS);if(i>=0&&i<=6){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TOP);}
if((i%7)===0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_LEFT);}
if(((i+1)%7)===0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RIGHT);}
var postDays=this.postMonthDays;if(postDays>=7&&this.cfg.getProperty("HIDE_BLANK_WEEKS")){var blankWeeks=Math.floor(postDays/7);for(var p=0;p<blankWeeks;++p){postDays-=7;}}
if(i>=((this.preMonthDays+postDays+this.monthDays)-7)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_BOTTOM);}
html[html.length]=tempDiv.innerHTML;i++;}
if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){html=this.renderRowFooter(weekNum,html);}
html[html.length]='</tr>';}}
html[html.length]='</tbody>';return html;};YAHOO.widget.Calendar.prototype.renderFooter=function(html){return html;};YAHOO.widget.Calendar.prototype.render=function(){this.beforeRenderEvent.fire();var workingDate=YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty("pagedate"));this.resetRenderers();this.cellDates.length=0;YAHOO.util.Event.purgeElement(this.oDomContainer,true);var html=[];html[html.length]='<table cellSpacing="0" class="'+this.Style.CSS_CALENDAR+' y'+workingDate.getFullYear()+'" id="'+this.id+'">';html=this.renderHeader(html);html=this.renderBody(workingDate,html);html=this.renderFooter(html);html[html.length]='</table>';this.oDomContainer.innerHTML=html.join("\n");this.applyListeners();this.cells=this.oDomContainer.getElementsByTagName("td");this.cfg.refireEvent("title");this.cfg.refireEvent("close");this.cfg.refireEvent("iframe");this.renderEvent.fire();};YAHOO.widget.Calendar.prototype.applyListeners=function(){var root=this.oDomContainer;var cal=this.parent||this;var linkLeft,linkRight;linkLeft=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT,"a",root);linkRight=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT,"a",root);if(linkLeft){this.linkLeft=linkLeft[0];YAHOO.util.Event.addListener(this.linkLeft,"mousedown",cal.previousMonth,cal,true);}
if(linkRight){this.linkRight=linkRight[0];YAHOO.util.Event.addListener(this.linkRight,"mousedown",cal.nextMonth,cal,true);}
if(this.domEventMap){var el,elements;for(var cls in this.domEventMap){if(YAHOO.lang.hasOwnProperty(this.domEventMap,cls)){var items=this.domEventMap[cls];if(!(items instanceof Array)){items=[items];}
for(var i=0;i<items.length;i++){var item=items[i];elements=YAHOO.util.Dom.getElementsByClassName(cls,item.tag,this.oDomContainer);for(var c=0;c<elements.length;c++){el=elements[c];YAHOO.util.Event.addListener(el,item.event,item.handler,item.scope,item.correct);}}}}}
YAHOO.util.Event.addListener(this.oDomContainer,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseout",this.doCellMouseOut,this);};YAHOO.widget.Calendar.prototype.getDateByCellId=function(id){var date=this.getDateFieldsByCellId(id);return new Date(date[0],date[1]-1,date[2]);};YAHOO.widget.Calendar.prototype.getDateFieldsByCellId=function(id){id=id.toLowerCase().split("_cell")[1];id=parseInt(id,10);return this.cellDates[id];};YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderRowHeader=function(weekNum,html){html[html.length]='<th class="calrowhead">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderRowFooter=function(weekNum,html){html[html.length]='<th class="calrowfoot">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML='<a href="javascript:void(null);" >'+this.buildDayLabel(workingDate)+"</a>";};YAHOO.widget.Calendar.prototype.styleCellDefault=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTABLE);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight1=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight2=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight3=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight4=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar.prototype.renderCellStyleToday=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar.prototype.renderCellStyleSelected=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar.prototype.renderCellNotThisMonth=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderBodyCellRestricted=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL);YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RESTRICTED);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.addMonths=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractMonths=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.addYears=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractYears=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar.prototype.reset=function(){this.cfg.resetProperty("selected");this.cfg.resetProperty("pagedate");this.resetEvent.fire();};YAHOO.widget.Calendar.prototype.clear=function(){this.cfg.setProperty("selected",[]);this.cfg.setProperty("pagedate",new Date(this.today.getTime()));this.clearEvent.fire();};YAHOO.widget.Calendar.prototype.select=function(date){this.beforeSelectEvent.fire();var selected=this.cfg.getProperty("selected");var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];if(this._indexOfSelectedFieldArray(toSelect)==-1){selected[selected.length]=toSelect;}}
if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
this.selectEvent.fire(aToBeSelected);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.selectCell=function(cellIndex){this.beforeSelectEvent.fire();var selected=this.cfg.getProperty("selected");var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();selected[selected.length]=selectDate;if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
this.renderCellStyleSelected(dCellDate,cell);this.selectEvent.fire([selectDate]);this.doCellMouseOut.call(cell,null,this);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselect=function(date){this.beforeDeselectEvent.fire();var selected=this.cfg.getProperty("selected");var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];var index=this._indexOfSelectedFieldArray(toSelect);if(index!=-1){selected.splice(index,1);}}
if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
this.deselectEvent.fire(aToBeSelected);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectCell=function(i){this.beforeDeselectEvent.fire();var selected=this.cfg.getProperty("selected");var cell=this.cells[i];var cellDate=this.cellDates[i];var cellDateIndex=this._indexOfSelectedFieldArray(cellDate);var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();if(cellDateIndex>-1){if(this.cfg.getProperty("pagedate").getMonth()==dCellDate.getMonth()&&this.cfg.getProperty("pagedate").getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);}
selected.splice(cellDateIndex,1);}
if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
this.deselectEvent.fire(selectDate);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectAll=function(){this.beforeDeselectEvent.fire();var selected=this.cfg.getProperty("selected");var count=selected.length;var sel=selected.concat();if(this.parent){this.parent.cfg.setProperty("selected",[]);}else{this.cfg.setProperty("selected",[]);}
if(count>0){this.deselectEvent.fire(sel);}
return this.getSelectedDates();};YAHOO.widget.Calendar.prototype._toFieldArray=function(date){var returnDate=[];if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(typeof date=='string'){returnDate=this._parseDates(date);}else if(date instanceof Array){for(var i=0;i<date.length;++i){var d=date[i];returnDate[returnDate.length]=[d.getFullYear(),d.getMonth()+1,d.getDate()];}}
return returnDate;};YAHOO.widget.Calendar.prototype._toDate=function(dateFieldArray){if(dateFieldArray instanceof Date){return dateFieldArray;}else{return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);}};YAHOO.widget.Calendar.prototype._fieldArraysAreEqual=function(array1,array2){var match=false;if(array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]){match=true;}
return match;};YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray=function(find){var selected=-1;var seldates=this.cfg.getProperty("selected");for(var s=0;s<seldates.length;++s){var sArray=seldates[s];if(find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]){selected=s;break;}}
return selected;};YAHOO.widget.Calendar.prototype.isDateOOM=function(date){var isOOM=false;if(date.getMonth()!=this.cfg.getProperty("pagedate").getMonth()){isOOM=true;}
return isOOM;};YAHOO.widget.Calendar.prototype._parsePageDate=function(date){var parsedDate;if(date){if(date instanceof Date){parsedDate=YAHOO.widget.DateMath.findMonthStart(date);}else{var month,year,aMonthYear;aMonthYear=date.split(this.cfg.getProperty("DATE_FIELD_DELIMITER"));month=parseInt(aMonthYear[this.cfg.getProperty("MY_MONTH_POSITION")-1],10)-1;year=parseInt(aMonthYear[this.cfg.getProperty("MY_YEAR_POSITION")-1],10);parsedDate=new Date(year,month,1);}}else{parsedDate=new Date(this.today.getFullYear(),this.today.getMonth(),1);}
return parsedDate;};YAHOO.widget.Calendar.prototype.onBeforeSelect=function(){if(this.cfg.getProperty("MULTI_SELECT")===false){if(this.parent){this.parent.callChildFunction("clearAllBodyCellStyles",this.Style.CSS_CELL_SELECTED);this.parent.deselectAll();}else{this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll();}}};YAHOO.widget.Calendar.prototype.onSelect=function(selected){};YAHOO.widget.Calendar.prototype.onBeforeDeselect=function(){};YAHOO.widget.Calendar.prototype.onDeselect=function(deselected){};YAHOO.widget.Calendar.prototype.onChangePage=function(){this.render();};YAHOO.widget.Calendar.prototype.onRender=function(){};YAHOO.widget.Calendar.prototype.onReset=function(){this.render();};YAHOO.widget.Calendar.prototype.onClear=function(){this.render();};YAHOO.widget.Calendar.prototype.validate=function(){return true;};YAHOO.widget.Calendar.prototype._parseDate=function(sDate){var aDate=sDate.split(this.Locale.DATE_FIELD_DELIMITER);var rArray;if(aDate.length==2){rArray=[aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar.MONTH_DAY;}else{rArray=[aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar.DATE;}
for(var i=0;i<rArray.length;i++){rArray[i]=parseInt(rArray[i],10);}
return rArray;};YAHOO.widget.Calendar.prototype._parseDates=function(sDates){var aReturn=[];var aDates=sDates.split(this.Locale.DATE_DELIMITER);for(var d=0;d<aDates.length;++d){var sDate=aDates[d];if(sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var aRange=sDate.split(this.Locale.DATE_RANGE_DELIMITER);var dateStart=this._parseDate(aRange[0]);var dateEnd=this._parseDate(aRange[1]);var fullRange=this._parseRange(dateStart,dateEnd);aReturn=aReturn.concat(fullRange);}else{var aDate=this._parseDate(sDate);aReturn.push(aDate);}}
return aReturn;};YAHOO.widget.Calendar.prototype._parseRange=function(startDate,endDate){var dStart=new Date(startDate[0],startDate[1]-1,startDate[2]);var dCurrent=YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);var dEnd=new Date(endDate[0],endDate[1]-1,endDate[2]);var results=[];results.push(startDate);while(dCurrent.getTime()<=dEnd.getTime()){results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);dCurrent=YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);}
return results;};YAHOO.widget.Calendar.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar.prototype.clearElement=function(cell){cell.innerHTML="&#160;";cell.className="";};YAHOO.widget.Calendar.prototype.addRenderer=function(sDates,fnRender){var aDates=this._parseDates(sDates);for(var i=0;i<aDates.length;++i){var aDate=aDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);};YAHOO.widget.Calendar.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){YAHOO.util.Dom.removeClass(this.cells[c],style);}};YAHOO.widget.Calendar.prototype.setMonth=function(month){var current=this.cfg.getProperty("pagedate");current.setMonth(parseInt(month,10));this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.setYear=function(year){var current=this.cfg.getProperty("pagedate");current.setFullYear(parseInt(year,10));this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty("selected");for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.Calendar.prototype.hide=function(){this.oDomContainer.style.display="none";};YAHOO.widget.Calendar.prototype.show=function(){this.oDomContainer.style.display="block";};YAHOO.widget.Calendar.prototype.browser=function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}();YAHOO.widget.Calendar.prototype.toString=function(){return"Calendar "+this.id;};YAHOO.widget.Calendar_Core=YAHOO.widget.Calendar;YAHOO.widget.Cal_Core=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(id,containerId,config){if(arguments.length>0){this.init(id,containerId,config);}};YAHOO.widget.CalendarGroup.prototype.init=function(id,containerId,config){this.initEvents();this.initStyles();this.pages=[];this.id=id;this.containerId=containerId;this.oDomContainer=document.getElementById(containerId);YAHOO.util.Dom.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_CONTAINER);YAHOO.util.Dom.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_MULTI_UP);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.setupConfig();if(config){this.cfg.applyConfig(config,true);}
this.cfg.fireQueue();if(this.browser=="opera"){var fixWidth=function(){var startW=this.oDomContainer.offsetWidth;var w=0;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];w+=cal.oDomContainer.offsetWidth;}
if(w>0){this.oDomContainer.style.width=w+"px";}};this.renderEvent.subscribe(fixWidth,this,true);}};YAHOO.widget.CalendarGroup.prototype.setupConfig=function(){this.cfg.addProperty("pages",{value:2,validator:this.cfg.checkNumber,handler:this.configPages});this.cfg.addProperty("pagedate",{value:new Date(),handler:this.configPageDate});this.cfg.addProperty("selected",{value:[],handler:this.delegateConfig});this.cfg.addProperty("title",{value:"",handler:this.configTitle});this.cfg.addProperty("close",{value:false,handler:this.configClose});this.cfg.addProperty("iframe",{value:true,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("mindate",{value:null,handler:this.delegateConfig});this.cfg.addProperty("maxdate",{value:null,handler:this.delegateConfig});this.cfg.addProperty("MULTI_SELECT",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("START_WEEKDAY",{value:0,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("SHOW_WEEKDAYS",{value:true,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_HEADER",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_FOOTER",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("HIDE_BLANK_WEEKS",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("NAV_ARROW_LEFT",{value:null,handler:this.delegateConfig});this.cfg.addProperty("NAV_ARROW_RIGHT",{value:null,handler:this.delegateConfig});this.cfg.addProperty("MONTHS_SHORT",{value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],handler:this.delegateConfig});this.cfg.addProperty("MONTHS_LONG",{value:["January","February","March","April","May","June","July","August","September","October","November","December"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_1CHAR",{value:["S","M","T","W","T","F","S"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_SHORT",{value:["Su","Mo","Tu","We","Th","Fr","Sa"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_MEDIUM",{value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_LONG",{value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],handler:this.delegateConfig});this.cfg.addProperty("LOCALE_MONTHS",{value:"long",handler:this.delegateConfig});this.cfg.addProperty("LOCALE_WEEKDAYS",{value:"short",handler:this.delegateConfig});this.cfg.addProperty("DATE_DELIMITER",{value:",",handler:this.delegateConfig});this.cfg.addProperty("DATE_FIELD_DELIMITER",{value:"/",handler:this.delegateConfig});this.cfg.addProperty("DATE_RANGE_DELIMITER",{value:"-",handler:this.delegateConfig});this.cfg.addProperty("MY_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MY_YEAR_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_DAY_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_DAY_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_YEAR_POSITION",{value:3,handler:this.delegateConfig,validator:this.cfg.checkNumber});};YAHOO.widget.CalendarGroup.prototype.initEvents=function(){var me=this;var sub=function(fn,obj,bOverride){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+"Event"].subscribe(fn,obj,bOverride);}};var unsub=function(fn,obj){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+"Event"].unsubscribe(fn,obj);}};this.beforeSelectEvent=new YAHOO.util.CustomEvent("beforeSelect");this.beforeSelectEvent.subscribe=sub;this.beforeSelectEvent.unsubscribe=unsub;this.selectEvent=new YAHOO.util.CustomEvent("select");this.selectEvent.subscribe=sub;this.selectEvent.unsubscribe=unsub;this.beforeDeselectEvent=new YAHOO.util.CustomEvent("beforeDeselect");this.beforeDeselectEvent.subscribe=sub;this.beforeDeselectEvent.unsubscribe=unsub;this.deselectEvent=new YAHOO.util.CustomEvent("deselect");this.deselectEvent.subscribe=sub;this.deselectEvent.unsubscribe=unsub;this.changePageEvent=new YAHOO.util.CustomEvent("changePage");this.changePageEvent.subscribe=sub;this.changePageEvent.unsubscribe=unsub;this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.beforeRenderEvent.subscribe=sub;this.beforeRenderEvent.unsubscribe=unsub;this.renderEvent=new YAHOO.util.CustomEvent("render");this.renderEvent.subscribe=sub;this.renderEvent.unsubscribe=unsub;this.resetEvent=new YAHOO.util.CustomEvent("reset");this.resetEvent.subscribe=sub;this.resetEvent.unsubscribe=unsub;this.clearEvent=new YAHOO.util.CustomEvent("clear");this.clearEvent.subscribe=sub;this.clearEvent.unsubscribe=unsub;};YAHOO.widget.CalendarGroup.prototype.configPages=function(type,args,obj){var pageCount=args[0];for(var p=0;p<pageCount;++p){var calId=this.id+"_"+p;var calContainerId=this.containerId+"_"+p;var childConfig=this.cfg.getConfig();childConfig.close=false;childConfig.title=false;var cal=this.constructChild(calId,calContainerId,childConfig);var caldate=cal.cfg.getProperty("pagedate");this._setMonthOnDate(caldate,caldate.getMonth()+p);cal.cfg.setProperty("pagedate",caldate);YAHOO.util.Dom.removeClass(cal.oDomContainer,this.Style.CSS_SINGLE);YAHOO.util.Dom.addClass(cal.oDomContainer,"groupcal");if(p===0){YAHOO.util.Dom.addClass(cal.oDomContainer,"first");}
if(p==(pageCount-1)){YAHOO.util.Dom.addClass(cal.oDomContainer,"last");}
cal.parent=this;cal.index=p;this.pages[this.pages.length]=cal;}};YAHOO.widget.CalendarGroup.prototype.configPageDate=function(type,args,obj){var val=args[0];var firstPageDate;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];if(p===0){firstPageDate=cal._parsePageDate(val);cal.cfg.setProperty("pagedate",firstPageDate);}else{var pageDate=new Date(firstPageDate);this._setMonthOnDate(pageDate,pageDate.getMonth()+p);cal.cfg.setProperty("pagedate",pageDate);}}};YAHOO.widget.CalendarGroup.prototype.delegateConfig=function(type,args,obj){var val=args[0];var cal;for(var p=0;p<this.pages.length;p++){cal=this.pages[p];cal.cfg.setProperty(type,val);}};YAHOO.widget.CalendarGroup.prototype.setChildFunction=function(fnName,fn){var pageCount=this.cfg.getProperty("pages");for(var p=0;p<pageCount;++p){this.pages[p][fnName]=fn;}};YAHOO.widget.CalendarGroup.prototype.callChildFunction=function(fnName,args){var pageCount=this.cfg.getProperty("pages");for(var p=0;p<pageCount;++p){var page=this.pages[p];if(page[fnName]){var fn=page[fnName];fn.call(page,args);}}};YAHOO.widget.CalendarGroup.prototype.constructChild=function(id,containerId,config){var container=document.getElementById(containerId);if(!container){container=document.createElement("div");container.id=containerId;this.oDomContainer.appendChild(container);}
return new YAHOO.widget.Calendar(id,containerId,config);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){month=parseInt(month,10);var currYear;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty("pagedate");if(p===0){currYear=pageDate.getFullYear();}else{pageDate.setYear(currYear);}
this._setMonthOnDate(pageDate,month+p);cal.cfg.setProperty("pagedate",pageDate);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){year=parseInt(year,10);for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty("pageDate");if((pageDate.getMonth()+1)==1&&p>0){year+=1;}
cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){this.renderHeader();for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.render();}
this.renderFooter();};YAHOO.widget.CalendarGroup.prototype.select=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.select(date);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.selectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.selectCell(cellIndex);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselect=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselect(date);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselectAll=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectAll();}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectCell(cellIndex);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.reset=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.reset();}};YAHOO.widget.CalendarGroup.prototype.clear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.clear();}};YAHOO.widget.CalendarGroup.prototype.nextMonth=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextMonth();}};YAHOO.widget.CalendarGroup.prototype.previousMonth=function(){for(var p=this.pages.length-1;p>=0;--p){var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextYear();}};YAHOO.widget.CalendarGroup.prototype.previousYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.previousYear();}};YAHOO.widget.CalendarGroup.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty("selected");for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.CalendarGroup.prototype.addRenderer=function(sDates,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addRenderer(sDates,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addMonthRenderer=function(month,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addMonthRenderer(month,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer=function(weekday,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addWeekdayRenderer(weekday,fnRender);}};YAHOO.widget.CalendarGroup.prototype.renderHeader=function(){};YAHOO.widget.CalendarGroup.prototype.renderFooter=function(){};YAHOO.widget.CalendarGroup.prototype.addMonths=function(count){this.callChildFunction("addMonths",count);};YAHOO.widget.CalendarGroup.prototype.subtractMonths=function(count){this.callChildFunction("subtractMonths",count);};YAHOO.widget.CalendarGroup.prototype.addYears=function(count){this.callChildFunction("addYears",count);};YAHOO.widget.CalendarGroup.prototype.subtractYears=function(count){this.callChildFunction("subtractYears",count);};YAHOO.widget.CalendarGroup.prototype._setMonthOnDate=function(date,iMonth){if(this.browser=="safari"&&(iMonth<0||iMonth>11)){var DM=YAHOO.widget.DateMath;var newDate=DM.add(date,DM.MONTH,iMonth-date.getMonth());date.setTime(newDate.getTime());}else{date.setMonth(iMonth);}};YAHOO.widget.CalendarGroup.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.CalendarGroup.CSS_MULTI_UP="multi";YAHOO.widget.CalendarGroup.CSS_2UPTITLE="title";YAHOO.widget.CalendarGroup.CSS_2UPCLOSE="close-icon";YAHOO.augment(YAHOO.widget.CalendarGroup,YAHOO.widget.Calendar,"buildDayLabel","buildMonthLabel","renderOutOfBoundsDate","renderRowHeader","renderRowFooter","renderCellDefault","styleCellDefault","renderCellStyleHighlight1","renderCellStyleHighlight2","renderCellStyleHighlight3","renderCellStyleHighlight4","renderCellStyleToday","renderCellStyleSelected","renderCellNotThisMonth","renderBodyCellRestricted","initStyles","configTitle","configClose","hide","show","browser");YAHOO.widget.CalendarGroup.prototype.toString=function(){return"CalendarGroup "+this.id;};YAHOO.widget.CalGrp=YAHOO.widget.CalendarGroup;YAHOO.widget.Calendar2up=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.extend(YAHOO.widget.Calendar2up,YAHOO.widget.CalendarGroup);YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up;YAHOO.register("calendar",YAHOO.widget.Calendar,{version:"2.2.0",build:"127"});
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}};this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}
return true;}else{return false;}};this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
return true;}}else{return false;}}};this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
var foundDuplicate=false;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var queueItemKey=queueItem[0];var queueItemValue=queueItem[1];if(queueItemKey.toLowerCase()==key){eventQueue[i]=null;eventQueue.push([key,(typeof value!='undefined'?value:queueItemValue)]);foundDuplicate=true;break;}}}
if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}
if(property.supercedes){for(var s=0;s<property.supercedes.length;s++){var supercedesCheck=property.supercedes[s];for(var q=0;q<eventQueue.length;q++){var queueItemCheck=eventQueue[q];if(queueItemCheck){var queueItemCheckKey=queueItemCheck[0];var queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey.toLowerCase()==supercedesCheck.toLowerCase()){eventQueue.push([queueItemCheckKey,queueItemCheckValue]);eventQueue[q]=null;break;}}}}}
return true;}else{return false;}};this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}};this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}};this.refresh=function(){for(var prop in config){this.refireEvent(prop);}};this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
this.queueInProgress=false;eventQueue=[];};this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
return true;}else{return false;}};this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
return output;};};YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}else{}};YAHOO.widget.Module.IMG_ROOT=null;YAHOO.widget.Module.IMG_ROOT_SSL=null;YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.textResizeEvent=new YAHOO.util.CustomEvent("textResize");YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}
if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("div");el.id=elId;}}
this.element=el;if(el.id){this.id=el.id;}
var childNodes=this.element.childNodes;if(childNodes){for(var i=0;i<childNodes.length;i++){var child=childNodes[i];switch(child.className){case YAHOO.widget.Module.CSS_HEADER:this.header=child;break;case YAHOO.widget.Module.CSS_BODY:this.body=child;break;case YAHOO.widget.Module.CSS_FOOTER:this.footer=child;break;}}}
this.initDefaultConfig();YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;}
resizeMonitor.id="_yuiResizeMonitor";resizeMonitor.style.visibility="hidden";document.body.appendChild(resizeMonitor);resizeMonitor.style.width="10em";resizeMonitor.style.height="10em";resizeMonitor.style.position="absolute";var nLeft=-1*resizeMonitor.offsetWidth;var nTop=-1*resizeMonitor.offsetHeight;resizeMonitor.style.top=nTop+"px";resizeMonitor.style.left=nLeft+"px";resizeMonitor.style.borderStyle="none";resizeMonitor.style.borderWidth="0";YAHOO.util.Dom.setStyle(resizeMonitor,"opacity","0");resizeMonitor.style.visibility="visible";if(!bIE){var doc=resizeMonitor.contentWindow.document;doc.open();doc.close();}}
var fireTextResize=function(){YAHOO.widget.Module.textResizeEvent.fire();};if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!YAHOO.widget.Module.textResizeInitialized){if(!YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",fireTextResize)){YAHOO.util.Event.addListener(this.resizeMonitor,"resize",fireTextResize);}
YAHOO.widget.Module.textResizeInitialized=true;}}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){if(!this.header){this.header=document.createElement("div");this.header.className=YAHOO.widget.Module.CSS_HEADER;}
if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}
this.changeHeaderEvent.fire(headerContent);this.changeContentEvent.fire();},appendToHeader:function(element){if(!this.header){this.header=document.createElement("div");this.header.className=YAHOO.widget.Module.CSS_HEADER;}
this.header.appendChild(element);this.changeHeaderEvent.fire(element);this.changeContentEvent.fire();},setBody:function(bodyContent){if(!this.body){this.body=document.createElement("div");this.body.className=YAHOO.widget.Module.CSS_BODY;}
if(typeof bodyContent=="string")
{this.body.innerHTML=bodyContent;}else{this.body.innerHTML="";this.body.appendChild(bodyContent);}
this.changeBodyEvent.fire(bodyContent);this.changeContentEvent.fire();},appendToBody:function(element){if(!this.body){this.body=document.createElement("div");this.body.className=YAHOO.widget.Module.CSS_BODY;}
this.body.appendChild(element);this.changeBodyEvent.fire(element);this.changeContentEvent.fire();},setFooter:function(footerContent){if(!this.footer){this.footer=document.createElement("div");this.footer.className=YAHOO.widget.Module.CSS_FOOTER;}
if(typeof footerContent=="string"){this.footer.innerHTML=footerContent;}else{this.footer.innerHTML="";this.footer.appendChild(footerContent);}
this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){if(!this.footer){this.footer=document.createElement("div");this.footer.className=YAHOO.widget.Module.CSS_FOOTER;}
this.footer.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
var me=this;var appendTo=function(element){if(typeof element=="string"){element=document.getElementById(element);}
if(element){element.appendChild(me.element);me.appendEvent.fire();}};if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
if(this.header&&!YAHOO.util.Dom.inDocument(this.header)){var firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}
if(this.body&&!YAHOO.util.Dom.inDocument(this.body)){if(this.footer&&YAHOO.util.Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}
if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
this.renderEvent.fire();return true;},destroy:function(){var parent;if(this.element){YAHOO.util.Event.purgeElement(this.element,true);parent=this.element.parentNode;}
if(parent){parent.removeChild(this.element);}
this.element=null;this.header=null;this.body=null;this.footer=null;for(var e in this){if(e instanceof YAHOO.util.CustomEvent){e.unsubscribeAll();}}
YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize,this);this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;";YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="yui-overlay";YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
this.initEvent.fire(YAHOO.widget.Overlay);};YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);};YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});};YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);};YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");};YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");};YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");if(currentVis=="inherit"){var e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=YAHOO.util.Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}
e=e.parentNode;}
if(currentVis=="inherit"){currentVis="visible";}}
var effect=this.cfg.getProperty("effect");var effectInstances=[];if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
var isMacGecko=(this.platform=="mac"&&this.browser=="gecko");if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();for(var j=0;j<effectInstances.length;j++){var ei=effectInstances[j];if(j===0&&!YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();for(var k=0;k<effectInstances.length;k++){var h=effectInstances[k];if(k===0&&!YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
h.animateOut();}}else if(currentVis===""){YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}};YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}};YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}};YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
if(this.iframe){if(zIndex<=0){zIndex=1;}
YAHOO.util.Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);};YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.showIframe=function(){if(this.iframe){this.iframe.style.display="block";}};YAHOO.widget.Overlay.prototype.hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}};YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showIframe,this)){this.showEvent.subscribe(this.showIframe,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}
var x=this.cfg.getProperty("x");var y=this.cfg.getProperty("y");if(!x||!y){this.syncPosition();x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");}
if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=YAHOO.widget.Overlay.IFRAME_SRC;}
var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){this.showIframe();}else{this.hideIframe();}}
var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}
YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=this.element.clientWidth;var height=this.element.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}
this.showEvent.unsubscribe(this.showIframe,this);this.hideEvent.unsubscribe(this.hideIframe,this);}};YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}};YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}};YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}
if(!contextAlign){contextAlign=contextArgs[2];}
if(element&&context){var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}};switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}};YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var offsetHeight=this.element.offsetHeight;var offsetWidth=this.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){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){this.blurAll();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);}};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.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();};overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();};var focusOnDomEvent=function(e,obj){overlay.focus();};var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}
this.overlays.push(overlay);return true;}else if(overlay instanceof Array){var regcount=0;for(var i=0;i<overlay.length;i++){if(this.register(overlay[i])){regcount++;}}
if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var p=0;p<this.overlays.length;p++){if(this.overlays[p].id==overlay){return this.overlays[p];}}}
return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}
if(!keyData){}
if(!handler){}
if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
if(!keyData.alt){keyData.alt=false;}
if(!keyData.ctrl){keyData.ctrl=false;}
if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Tooltip,YAHOO.widget.Overlay);YAHOO.widget.Tooltip.CSS_TOOLTIP="yui-tt";YAHOO.widget.Tooltip.prototype.init=function(el,userConfig){if(document.readyState&&document.readyState!="complete"){var deferredInit=function(){this.init(el,userConfig);};YAHOO.util.Event.addListener(window,"load",deferredInit,this,true);}else{YAHOO.widget.Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Tooltip);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.render(this.cfg.getProperty("container"));this.initEvent.fire(YAHOO.widget.Tooltip);}};YAHOO.widget.Tooltip.prototype.initDefaultConfig=function(){YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty("preventoverlap",{value:true,validator:this.cfg.checkBoolean,supercedes:["x","y","xy"]});this.cfg.addProperty("showdelay",{value:200,handler:this.configShowDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("autodismissdelay",{value:5000,handler:this.configAutoDismissDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("hidedelay",{value:250,handler:this.configHideDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("text",{handler:this.configText,suppressEvent:true});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});};YAHOO.widget.Tooltip.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);}};YAHOO.widget.Tooltip.prototype.configContainer=function(type,args,obj){var container=args[0];if(typeof container=='string'){this.cfg.setProperty("container",document.getElementById(container),true);}};YAHOO.widget.Tooltip.prototype.configContext=function(type,args,obj){var context=args[0];if(context){if(!(context instanceof Array)){if(typeof context=="string"){this.cfg.setProperty("context",[document.getElementById(context)],true);}else{this.cfg.setProperty("context",[context],true);}
context=this.cfg.getProperty("context");}
if(this._context){for(var c=0;c<this._context.length;++c){var el=this._context[c];YAHOO.util.Event.removeListener(el,"mouseover",this.onContextMouseOver);YAHOO.util.Event.removeListener(el,"mousemove",this.onContextMouseMove);YAHOO.util.Event.removeListener(el,"mouseout",this.onContextMouseOut);}}
this._context=context;for(var d=0;d<this._context.length;++d){var el2=this._context[d];YAHOO.util.Event.addListener(el2,"mouseover",this.onContextMouseOver,this);YAHOO.util.Event.addListener(el2,"mousemove",this.onContextMouseMove,this);YAHOO.util.Event.addListener(el2,"mouseout",this.onContextMouseOut,this);}}};YAHOO.widget.Tooltip.prototype.onContextMouseMove=function(e,obj){obj.pageX=YAHOO.util.Event.getPageX(e);obj.pageY=YAHOO.util.Event.getPageY(e);};YAHOO.widget.Tooltip.prototype.onContextMouseOver=function(e,obj){if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
var context=this;YAHOO.util.Event.addListener(context,"mousemove",obj.onContextMouseMove,obj);if(context.title){obj._tempTitle=context.title;context.title="";}
obj.showProcId=obj.doShow(e,context);};YAHOO.widget.Tooltip.prototype.onContextMouseOut=function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}
if(obj.showProcId){clearTimeout(obj.showProcId);obj.showProcId=null;}
if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));};YAHOO.widget.Tooltip.prototype.doShow=function(e,context){var yOffset=25;if(this.browser=="opera"&&context.tagName=="A"){yOffset+=12;}
var me=this;return setTimeout(function(){if(me._tempTitle){me.setBody(me._tempTitle);}else{me.cfg.refireEvent("text");}
me.moveTo(me.pageX,me.pageY+yOffset);if(me.cfg.getProperty("preventoverlap")){me.preventOverlap(me.pageX,me.pageY);}
YAHOO.util.Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));};YAHOO.widget.Tooltip.prototype.doHide=function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));};YAHOO.widget.Tooltip.prototype.preventOverlap=function(pageX,pageY){var height=this.element.offsetHeight;var elementRegion=YAHOO.util.Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;var mousePoint=new YAHOO.util.Point(pageX,pageY);if(elementRegion.contains(mousePoint)){this.cfg.setProperty("y",(pageY-height-5));}};YAHOO.widget.Tooltip.prototype.toString=function(){return"Tooltip "+this.id;};YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Panel,YAHOO.widget.Overlay);YAHOO.widget.Panel.CSS_PANEL="yui-panel";YAHOO.widget.Panel.CSS_PANEL_CONTAINER="yui-panel-container";YAHOO.widget.Panel.prototype.init=function(el,userConfig){YAHOO.widget.Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Panel);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.beforeRenderEvent.subscribe(function(){var draggable=this.cfg.getProperty("draggable");if(draggable){if(!this.header){this.setHeader("&#160;");}}},this,true);var me=this;var doBlur=function(){this.blur();};this.showMaskEvent.subscribe(function(){var checkFocusable=function(el){if((el.tagName=="A"||el.tagName=="BUTTON"||el.tagName=="SELECT"||el.tagName=="INPUT"||el.tagName=="TEXTAREA")&&el.type!="hidden"){if(!YAHOO.util.Dom.isAncestor(me.element,el)){YAHOO.util.Event.addListener(el,"focus",doBlur,el,true);return true;}}else{return false;}};this.focusableElements=YAHOO.util.Dom.getElementsBy(checkFocusable);},this,true);this.hideMaskEvent.subscribe(function(){for(var i=0;i<this.focusableElements.length;i++){var el2=this.focusableElements[i];YAHOO.util.Event.removeListener(el2,"focus",doBlur);}},this,true);this.beforeShowEvent.subscribe(function(){this.cfg.refireEvent("underlay");},this,true);this.initEvent.fire(YAHOO.widget.Panel);};YAHOO.widget.Panel.prototype.initEvents=function(){YAHOO.widget.Panel.superclass.initEvents.call(this);this.showMaskEvent=new YAHOO.util.CustomEvent("showMask");this.hideMaskEvent=new YAHOO.util.CustomEvent("hideMask");this.dragEvent=new YAHOO.util.CustomEvent("drag");};YAHOO.widget.Panel.prototype.initDefaultConfig=function(){YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty("close",{value:true,handler:this.configClose,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("draggable",{value:true,handler:this.configDraggable,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("underlay",{value:"shadow",handler:this.configUnderlay,supercedes:["visible"]});this.cfg.addProperty("modal",{value:false,handler:this.configModal,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("keylisteners",{handler:this.configKeyListeners,suppressEvent:true,supercedes:["visible"]});};YAHOO.widget.Panel.prototype.configClose=function(type,args,obj){var val=args[0];var doHide=function(e,obj){obj.hide();};if(val){if(!this.close){this.close=document.createElement("span");YAHOO.util.Dom.addClass(this.close,"container-close");this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);YAHOO.util.Event.addListener(this.close,"click",doHide,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}};YAHOO.widget.Panel.prototype.configDraggable=function(type,args,obj){var val=args[0];if(val){if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","move");this.registerDragDrop();}}else{if(this.dd){this.dd.unreg();}
if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","auto");}}};YAHOO.widget.Panel.prototype.configUnderlay=function(type,args,obj){var val=args[0];switch(val.toLowerCase()){case"shadow":YAHOO.util.Dom.removeClass(this.element,"matte");YAHOO.util.Dom.addClass(this.element,"shadow");if(!this.underlay){this.underlay=document.createElement("div");this.underlay.className="underlay";this.underlay.innerHTML="&#160;";this.element.appendChild(this.underlay);}
this.sizeUnderlay();break;case"matte":YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.addClass(this.element,"matte");break;default:YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.removeClass(this.element,"matte");break;}};YAHOO.widget.Panel.prototype.configModal=function(type,args,obj){var modal=args[0];if(modal){this.buildMask();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.showMask,this)){this.beforeShowEvent.subscribe(this.showMask,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMask,this)){this.hideEvent.subscribe(this.hideMask,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.sizeMask,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.destroyEvent,this.removeMask,this)){this.destroyEvent.subscribe(this.removeMask,this,true);}
this.cfg.refireEvent("zIndex");}else{this.beforeShowEvent.unsubscribe(this.showMask,this);this.hideEvent.unsubscribe(this.hideMask,this);YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this.destroyEvent.unsubscribe(this.removeMask,this);}};YAHOO.widget.Panel.prototype.removeMask=function(){if(this.mask){if(this.mask.parentNode){this.mask.parentNode.removeChild(this.mask);}
this.mask=null;}};YAHOO.widget.Panel.prototype.configKeyListeners=function(type,args,obj){var listeners=args[0];if(listeners){if(listeners instanceof Array){for(var i=0;i<listeners.length;i++){var listener=listeners[i];if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listener.disable,listener)){this.hideEvent.subscribe(listener.disable,listener,true);this.destroyEvent.subscribe(listener.disable,listener,true);}}}else{if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listeners.enable,listeners)){this.showEvent.subscribe(listeners.enable,listeners,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}};YAHOO.widget.Panel.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");};YAHOO.widget.Panel.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");};YAHOO.widget.Panel.prototype.configzIndex=function(type,args,obj){YAHOO.widget.Panel.superclass.configzIndex.call(this,type,args,obj);var maskZ=0;var currentZ=YAHOO.util.Dom.getStyle(this.element,"zIndex");if(this.mask){if(!currentZ||isNaN(currentZ)){currentZ=0;}
if(currentZ===0){this.cfg.setProperty("zIndex",1);}else{maskZ=currentZ-1;YAHOO.util.Dom.setStyle(this.mask,"zIndex",maskZ);}}};YAHOO.widget.Panel.prototype.buildWrapper=function(){var elementParent=this.element.parentNode;var originalElement=this.element;var wrapper=document.createElement("div");wrapper.className=YAHOO.widget.Panel.CSS_PANEL_CONTAINER;wrapper.id=originalElement.id+"_c";if(elementParent){elementParent.insertBefore(wrapper,originalElement);}
wrapper.appendChild(originalElement);this.element=wrapper;this.innerElement=originalElement;YAHOO.util.Dom.setStyle(this.innerElement,"visibility","inherit");};YAHOO.widget.Panel.prototype.sizeUnderlay=function(){if(this.underlay&&this.browser!="gecko"&&this.browser!="safari"){this.underlay.style.width=this.innerElement.offsetWidth+"px";this.underlay.style.height=this.innerElement.offsetHeight+"px";}};YAHOO.widget.Panel.prototype.onDomResize=function(e,obj){YAHOO.widget.Panel.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.sizeUnderlay();},0);};YAHOO.widget.Panel.prototype.registerDragDrop=function(){if(this.header){this.dd=new YAHOO.util.DD(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}
var me=this;this.dd.startDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.addClass(me.element,"drag");}
if(me.cfg.getProperty("constraintoviewport")){var offsetHeight=me.element.offsetHeight;var offsetWidth=me.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;this.minX=leftConstraint;this.maxX=rightConstraint;this.constrainX=true;this.minY=topConstraint;this.maxY=bottomConstraint;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}
me.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&this.browser=="gecko"){this.showMacGeckoScrollbars();}
me.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.removeClass(me.element,"drag");}
me.dragEvent.fire("endDrag",arguments);};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}};YAHOO.widget.Panel.prototype.buildMask=function(){if(!this.mask){this.mask=document.createElement("div");this.mask.id=this.id+"_mask";this.mask.className="mask";this.mask.innerHTML="&#160;";var maskClick=function(e,obj){YAHOO.util.Event.stopEvent(e);};var firstChild=document.body.firstChild;if(firstChild){document.body.insertBefore(this.mask,document.body.firstChild);}else{document.body.appendChild(this.mask);}}};YAHOO.widget.Panel.prototype.hideMask=function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();YAHOO.util.Dom.removeClass(document.body,"masked");}};YAHOO.widget.Panel.prototype.showMask=function(){if(this.cfg.getProperty("modal")&&this.mask){YAHOO.util.Dom.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}};YAHOO.widget.Panel.prototype.sizeMask=function(){if(this.mask){this.mask.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.mask.style.width=YAHOO.util.Dom.getDocumentWidth()+"px";}};YAHOO.widget.Panel.prototype.render=function(appendToNode){return YAHOO.widget.Panel.superclass.render.call(this,appendToNode,this.innerElement);};YAHOO.widget.Panel.prototype.toString=function(){return"Panel "+this.id;};YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Dialog,YAHOO.widget.Panel);YAHOO.widget.Dialog.CSS_DIALOG="yui-dialog";YAHOO.widget.Dialog.prototype.initDefaultConfig=function(){YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty("postmethod",{value:"async",handler:this.configPostMethod,validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty("buttons",{value:"none",handler:this.configButtons});};YAHOO.widget.Dialog.prototype.initEvents=function(){YAHOO.widget.Dialog.superclass.initEvents.call(this);this.beforeSubmitEvent=new YAHOO.util.CustomEvent("beforeSubmit");this.submitEvent=new YAHOO.util.CustomEvent("submit");this.manualSubmitEvent=new YAHOO.util.CustomEvent("manualSubmit");this.asyncSubmitEvent=new YAHOO.util.CustomEvent("asyncSubmit");this.formSubmitEvent=new YAHOO.util.CustomEvent("formSubmit");this.cancelEvent=new YAHOO.util.CustomEvent("cancel");};YAHOO.widget.Dialog.prototype.init=function(el,userConfig){YAHOO.widget.Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Dialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.beforeRenderEvent.subscribe(function(){var buttonCfg=this.cfg.getProperty("buttons");if(buttonCfg&&buttonCfg!="none"){if(!this.footer){this.setFooter("");}}},this,true);this.initEvent.fire(YAHOO.widget.Dialog);};YAHOO.widget.Dialog.prototype.doSubmit=function(){var pm=this.cfg.getProperty("postmethod");switch(pm){case"async":var method=this.form.getAttribute("method")||'POST';method=method.toUpperCase();YAHOO.util.Connect.setForm(this.form);var cObj=YAHOO.util.Connect.asyncRequest(method,this.form.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":this.form.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}};YAHOO.widget.Dialog.prototype.registerForm=function(){var form=this.element.getElementsByTagName("form")[0];if(!form){var formHTML="<form name=\"frm_"+this.id+"\" action=\"\"></form>";this.body.innerHTML+=formHTML;form=this.element.getElementsByTagName("form")[0];}
this.firstFormElement=function(){for(var f=0;f<form.elements.length;f++){var el=form.elements[f];if(el.focus&&!el.disabled){if(el.type&&el.type!="hidden"){return el;}}}
return null;}();this.lastFormElement=function(){for(var f=form.elements.length-1;f>=0;f--){var el=form.elements[f];if(el.focus&&!el.disabled){if(el.type&&el.type!="hidden"){return el;}}}
return null;}();this.form=form;if(this.cfg.getProperty("modal")&&this.form){var me=this;var firstElement=this.firstFormElement||this.firstButton;if(firstElement){this.preventBackTab=new YAHOO.util.KeyListener(firstElement,{shift:true,keys:9},{fn:me.focusLast,scope:me,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}
var lastElement=this.lastButton||this.lastFormElement;if(lastElement){this.preventTabOut=new YAHOO.util.KeyListener(lastElement,{shift:false,keys:9},{fn:me.focusFirst,scope:me,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}};YAHOO.widget.Dialog.prototype.configClose=function(type,args,obj){var val=args[0];var doCancel=function(e,obj){obj.cancel();};if(val){if(!this.close){this.close=document.createElement("div");YAHOO.util.Dom.addClass(this.close,"container-close");this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);YAHOO.util.Event.addListener(this.close,"click",doCancel,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}};YAHOO.widget.Dialog.prototype.configButtons=function(type,args,obj){var buttons=args[0];if(buttons!="none"){this.buttonSpan=null;this.buttonSpan=document.createElement("span");this.buttonSpan.className="button-group";for(var b=0;b<buttons.length;b++){var button=buttons[b];var htmlButton=document.createElement("button");htmlButton.setAttribute("type","button");if(button.isDefault){htmlButton.className="default";this.defaultHtmlButton=htmlButton;}
htmlButton.appendChild(document.createTextNode(button.text));YAHOO.util.Event.addListener(htmlButton,"click",button.handler,this,true);this.buttonSpan.appendChild(htmlButton);button.htmlButton=htmlButton;if(b===0){this.firstButton=button.htmlButton;}
if(b==(buttons.length-1)){this.lastButton=button.htmlButton;}}
this.setFooter(this.buttonSpan);this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");}else{if(this.buttonSpan){if(this.buttonSpan.parentNode){this.buttonSpan.parentNode.removeChild(this.buttonSpan);}
this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}};YAHOO.widget.Dialog.prototype.focusFirst=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}
if(this.firstFormElement){this.firstFormElement.focus();}else{this.focusDefaultButton();}};YAHOO.widget.Dialog.prototype.focusLast=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}
var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){this.focusLastButton();}else{if(this.lastFormElement){this.lastFormElement.focus();}}};YAHOO.widget.Dialog.prototype.focusDefaultButton=function(){if(this.defaultHtmlButton){this.defaultHtmlButton.focus();}};YAHOO.widget.Dialog.prototype.blurButtons=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.blur();}}};YAHOO.widget.Dialog.prototype.focusFirstButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.focus();}}};YAHOO.widget.Dialog.prototype.focusLastButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[buttons.length-1].htmlButton;if(html){html.focus();}}};YAHOO.widget.Dialog.prototype.configPostMethod=function(type,args,obj){var postmethod=args[0];this.registerForm();YAHOO.util.Event.addListener(this.form,"submit",function(e){YAHOO.util.Event.stopEvent(e);this.submit();this.form.blur();},this,true);};YAHOO.widget.Dialog.prototype.validate=function(){return true;};YAHOO.widget.Dialog.prototype.submit=function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}};YAHOO.widget.Dialog.prototype.cancel=function(){this.cancelEvent.fire();this.hide();};YAHOO.widget.Dialog.prototype.getData=function(){var oForm=this.form;if(oForm){var aElements=oForm.elements,nTotalElements=aElements.length,oData={},sName,oElement;for(var i=0;i<nTotalElements;i++){sName=aElements[i].name,oElement=aElements[sName];if(oElement){if(oElement.tagName){var sType=oElement.type,sTagName=oElement.tagName.toUpperCase();switch(sTagName){case"INPUT":if(sType=="checkbox"){oData[sName]=oElement.checked;}
else if(sType!="radio"){oData[sName]=oElement.value;}
break;case"TEXTAREA":oData[sName]=oElement.value;break;case"SELECT":var aOptions=oElement.options,nOptions=aOptions.length,aValues=[],oOption,sValue;for(var n=0;n<nOptions;n++){oOption=aOptions[n];if(oOption.selected){sValue=oOption.value;if(!sValue||sValue===""){sValue=oOption.text;}
aValues[aValues.length]=sValue;}}
oData[sName]=aValues;break;}}
else{var nElements=oElement.length,sType=oElement[0].type,sTagName=oElement[0].tagName.toUpperCase();switch(sType){case"radio":var oRadio;for(var n=0;n<nElements;n++){oRadio=oElement[n];if(oRadio.checked){oData[sName]=oRadio.value;break;}}
break;case"checkbox":var aValues=[],oCheckbox;for(var n=0;n<nElements;n++){oCheckbox=oElement[n];if(oCheckbox.checked){aValues[aValues.length]=oCheckbox.value;}}
oData[sName]=aValues;break;}}}}}
return oData;};YAHOO.widget.Dialog.prototype.toString=function(){return"Dialog "+this.id;};YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.SimpleDialog,YAHOO.widget.Dialog);YAHOO.widget.SimpleDialog.ICON_BLOCK="blckicon";YAHOO.widget.SimpleDialog.ICON_ALARM="alrticon";YAHOO.widget.SimpleDialog.ICON_HELP="hlpicon";YAHOO.widget.SimpleDialog.ICON_INFO="infoicon";YAHOO.widget.SimpleDialog.ICON_WARN="warnicon";YAHOO.widget.SimpleDialog.ICON_TIP="tipicon";YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.widget.SimpleDialog.prototype.initDefaultConfig=function(){YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty("icon",{value:"none",handler:this.configIcon,suppressEvent:true});this.cfg.addProperty("text",{value:"",handler:this.configText,suppressEvent:true,supercedes:["icon"]});};YAHOO.widget.SimpleDialog.prototype.init=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.SimpleDialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(YAHOO.widget.SimpleDialog);};YAHOO.widget.SimpleDialog.prototype.registerForm=function(){YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+this.id+"\" value=\"\"/>";};YAHOO.widget.SimpleDialog.prototype.configIcon=function(type,args,obj){var icon=args[0];if(icon&&icon!="none"){var iconHTML="";if(icon.indexOf(".")==-1){iconHTML="<span class=\"yui-icon "+icon+"\" >&#160;</span>";}else{iconHTML="<img src=\""+this.imageRoot+icon+"\" class=\"yui-icon\" />";}
this.body.innerHTML=iconHTML+this.body.innerHTML;}};YAHOO.widget.SimpleDialog.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}};YAHOO.widget.SimpleDialog.prototype.toString=function(){return"SimpleDialog "+this.id;};YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};YAHOO.widget.ContainerEffect.prototype.init=function(){this.beforeAnimateInEvent=new YAHOO.util.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent=new YAHOO.util.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent=new YAHOO.util.CustomEvent("animateInComplete");this.animateOutCompleteEvent=new YAHOO.util.CustomEvent("animateOutComplete");this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);};YAHOO.widget.ContainerEffect.prototype.animateIn=function(){this.beforeAnimateInEvent.fire();this.animIn.animate();};YAHOO.widget.ContainerEffect.prototype.animateOut=function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.toString=function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
return output;};YAHOO.widget.ContainerEffect.FADE=function(overlay,dur){var fade=new YAHOO.widget.ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
if(obj.overlay.underlay){obj.initialUnderlayOpacity=YAHOO.util.Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
if(obj.overlay.underlay){YAHOO.util.Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};YAHOO.widget.ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||YAHOO.util.Dom.getX(overlay.element);var y=overlay.cfg.getProperty("y")||YAHOO.util.Dom.getY(overlay.element);var clientWidth=YAHOO.util.Dom.getClientWidth();var offsetWidth=overlay.element.offsetWidth;var slide=new YAHOO.widget.ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=(-25-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";};slide.handleTweenAnimateIn=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var currentX=pos[0];var currentY=pos[1];if(YAHOO.util.Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");}
obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=YAHOO.util.Dom.getViewportWidth();var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var yso=pos[1];var currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var xto=pos[0];var yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};YAHOO.register("container",YAHOO.widget.Module,{version:"2.2.0",build:"127"});
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

YAHOO.widget.Slider=function(sElementId,sGroup,oThumb,sType){if(sElementId){this.init(sElementId,sGroup,true);this.initSlider(sType);this.initThumb(oThumb);}};YAHOO.widget.Slider.getHorizSlider=function(sBGElId,sHandleElId,iLeft,iRight,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,0,0,iTickSize),"horiz");};YAHOO.widget.Slider.getVertSlider=function(sBGElId,sHandleElId,iUp,iDown,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,0,0,iUp,iDown,iTickSize),"vert");};YAHOO.widget.Slider.getSliderRegion=function(sBGElId,sHandleElId,iLeft,iRight,iUp,iDown,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,iUp,iDown,iTickSize),"region");};YAHOO.widget.Slider.ANIM_AVAIL=true;YAHOO.extend(YAHOO.widget.Slider,YAHOO.util.DragDrop,{initSlider:function(sType){this.type=sType;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=YAHOO.widget.Slider.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;},initThumb:function(t){var self=this;this.thumb=t;t.cacheBetweenDrags=true;t.onChange=function(){self.handleThumbChange();};if(t._isHoriz&&t.xTicks&&t.xTicks.length){this.tickPause=Math.round(360/t.xTicks.length);}else if(t.yTicks&&t.yTicks.length){this.tickPause=Math.round(360/t.yTicks.length);}
t.onMouseDown=function(){return self.focus();};t.onMouseUp=function(){self.thumbMouseUp();};t.onDrag=function(){self.fireEvents(true);};t.onAvailable=function(){return self.setStartSliderState();};},onAvailable:function(){var Event=YAHOO.util.Event;Event.on(this.id,"keydown",this.handleKeyDown,this,true);Event.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(e){if(this.enableKeys){var Event=YAHOO.util.Event;var kc=Event.getCharCode(e);switch(kc){case 0x25:case 0x26:case 0x27:case 0x28:case 0x24:case 0x23:Event.preventDefault(e);break;default:}}},handleKeyDown:function(e){if(this.enableKeys){var Event=YAHOO.util.Event;var kc=Event.getCharCode(e),t=this.thumb;var h=this.getXValue(),v=this.getYValue();var horiz=false;var changeValue=true;switch(kc){case 0x25:h-=this.keyIncrement;break;case 0x26:v-=this.keyIncrement;break;case 0x27:h+=this.keyIncrement;break;case 0x28:v+=this.keyIncrement;break;case 0x24:h=t.leftConstraint;v=t.topConstraint;break;case 0x23:h=t.rightConstraint;v=t.bottomConstraint;break;default:changeValue=false;}
if(changeValue){if(t._isRegion){this.setRegionValue(h,v,true);}else{var newVal=(t._isHoriz)?h:v;this.setValue(newVal,true);}
Event.stopEvent(e);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=YAHOO.util.Dom.getXY(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this.setRegionValue.apply(this,this.deferredSetRegionValue,true);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true,true);}}else{if(this.deferredSetValue){this.setValue.apply(this,this.deferredSetValue,true);this.deferredSetValue=null;}else{this.setValue(0,true,true);}}},setThumbCenterPoint:function(){var el=this.thumb.getEl();if(el){this.thumbCenterPoint={x:parseInt(el.offsetWidth/2,10),y:parseInt(el.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){var el=this.getEl();if(el.focus){try{el.focus();}catch(e){}}
this.verifyOffset();if(this.isLocked()){return false;}else{this.onSlideStart();return true;}},onChange:function(firstOffset,secondOffset){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},handleThumbChange:function(){var t=this.thumb;if(t._isRegion){t.onChange(t.getXValue(),t.getYValue());this.fireEvent("change",{x:t.getXValue(),y:t.getYValue()});}else{t.onChange(t.getValue());this.fireEvent("change",t.getValue());}},setValue:function(newOffset,skipAnim,force){if(!this.thumb.available){this.deferredSetValue=arguments;return false;}
if(this.isLocked()&&!force){return false;}
if(isNaN(newOffset)){return false;}
var t=this.thumb;var newX,newY;this.verifyOffset(true);if(t._isRegion){return false;}else if(t._isHoriz){this.onSlideStart();newX=t.initPageX+newOffset+this.thumbCenterPoint.x;this.moveThumb(newX,t.initPageY,skipAnim);}else{this.onSlideStart();newY=t.initPageY+newOffset+this.thumbCenterPoint.y;this.moveThumb(t.initPageX,newY,skipAnim);}
return true;},setRegionValue:function(newOffset,newOffset2,skipAnim,force){if(!this.thumb.available){this.deferredSetRegionValue=arguments;return false;}
if(this.isLocked()&&!force){return false;}
if(isNaN(newOffset)){return false;}
var t=this.thumb;if(t._isRegion){this.onSlideStart();var newX=t.initPageX+newOffset+this.thumbCenterPoint.x;var newY=t.initPageY+newOffset2+this.thumbCenterPoint.y;this.moveThumb(newX,newY,skipAnim);return true;}
return false;},verifyOffset:function(checkPos){var newPos=YAHOO.util.Dom.getXY(this.getEl());if(newPos[0]!=this.baselinePos[0]||newPos[1]!=this.baselinePos[1]){this.thumb.resetConstraints();this.baselinePos=newPos;return false;}
return true;},moveThumb:function(x,y,skipAnim){var t=this.thumb;var self=this;if(!t.available){return;}
t.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);var _p=t.getTargetCoord(x,y);var p=[_p.x,_p.y];this.fireEvent("slideStart");if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&t._graduated&&!skipAnim){this.lock();this.curCoord=YAHOO.util.Dom.getXY(this.thumb.getEl());setTimeout(function(){self.moveOneTick(p);},this.tickPause);}else if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&!skipAnim){this.lock();var oAnim=new YAHOO.util.Motion(t.id,{points:{to:p}},this.animationDuration,YAHOO.util.Easing.easeOut);oAnim.onComplete.subscribe(function(){self.endMove();});oAnim.animate();}else{t.setDragElPos(x,y);this.endMove();}},moveOneTick:function(finalCoord){var t=this.thumb,tmp;var nextCoord=null;if(t._isRegion){nextCoord=this._getNextX(this.curCoord,finalCoord);var tmpX=(nextCoord)?nextCoord[0]:this.curCoord[0];nextCoord=this._getNextY([tmpX,this.curCoord[1]],finalCoord);}else if(t._isHoriz){nextCoord=this._getNextX(this.curCoord,finalCoord);}else{nextCoord=this._getNextY(this.curCoord,finalCoord);}
if(nextCoord){this.curCoord=nextCoord;this.thumb.alignElWithMouse(t.getEl(),nextCoord[0],nextCoord[1]);if(!(nextCoord[0]==finalCoord[0]&&nextCoord[1]==finalCoord[1])){var self=this;setTimeout(function(){self.moveOneTick(finalCoord);},this.tickPause);}else{this.endMove();}}else{this.endMove();}},_getNextX:function(curCoord,finalCoord){var t=this.thumb;var thresh;var tmp=[];var nextCoord=null;if(curCoord[0]>finalCoord[0]){thresh=t.tickSize-this.thumbCenterPoint.x;tmp=t.getTargetCoord(curCoord[0]-thresh,curCoord[1]);nextCoord=[tmp.x,tmp.y];}else if(curCoord[0]<finalCoord[0]){thresh=t.tickSize+this.thumbCenterPoint.x;tmp=t.getTargetCoord(curCoord[0]+thresh,curCoord[1]);nextCoord=[tmp.x,tmp.y];}else{}
return nextCoord;},_getNextY:function(curCoord,finalCoord){var t=this.thumb;var thresh;var tmp=[];var nextCoord=null;if(curCoord[1]>finalCoord[1]){thresh=t.tickSize-this.thumbCenterPoint.y;tmp=t.getTargetCoord(curCoord[0],curCoord[1]-thresh);nextCoord=[tmp.x,tmp.y];}else if(curCoord[1]<finalCoord[1]){thresh=t.tickSize+this.thumbCenterPoint.y;tmp=t.getTargetCoord(curCoord[0],curCoord[1]+thresh);nextCoord=[tmp.x,tmp.y];}else{}
return nextCoord;},b4MouseDown:function(e){this.thumb.autoOffset();this.thumb.resetConstraints();},onMouseDown:function(e){if(!this.isLocked()&&this.backgroundEnabled){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.focus();this.moveThumb(x,y);}},onDrag:function(e){if(!this.isLocked()){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.moveThumb(x,y,true);}},endMove:function(){this.unlock();this.moveComplete=true;this.fireEvents();},fireEvents:function(thumbEvent){var t=this.thumb;if(!thumbEvent){t.cachePosition();}
if(!this.isLocked()){if(t._isRegion){var newX=t.getXValue();var newY=t.getYValue();if(newX!=this.previousX||newY!=this.previousY){this.onChange(newX,newY);this.fireEvent("change",{x:newX,y:newY});}
this.previousX=newX;this.previousY=newY;}else{var newVal=t.getValue();if(newVal!=this.previousVal){this.onChange(newVal);this.fireEvent("change",newVal);}
this.previousVal=newVal;}
if(this.moveComplete){this.onSlideEnd();this.fireEvent("slideEnd");this.moveComplete=false;}}},toString:function(){return("Slider ("+this.type+") "+this.id);}});YAHOO.augment(YAHOO.widget.Slider,YAHOO.util.EventProvider);YAHOO.widget.SliderThumb=function(id,sGroup,iLeft,iRight,iUp,iDown,iTickSize){if(id){YAHOO.widget.SliderThumb.superclass.constructor.call(this,id,sGroup);this.parentElId=sGroup;}
this.isTarget=false;this.tickSize=iTickSize;this.maintainOffset=true;this.initSlider(iLeft,iRight,iUp,iDown,iTickSize);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD,{startOffset:null,_isHoriz:false,_prevVal:0,_graduated:false,getOffsetFromParent0:function(parentPos){var myPos=YAHOO.util.Dom.getXY(this.getEl());var ppos=parentPos||YAHOO.util.Dom.getXY(this.parentElId);return[(myPos[0]-ppos[0]),(myPos[1]-ppos[1])];},getOffsetFromParent:function(parentPos){var el=this.getEl();if(!this.deltaOffset){var myPos=YAHOO.util.Dom.getXY(el);var ppos=parentPos||YAHOO.util.Dom.getXY(this.parentElId);var newOffset=[(myPos[0]-ppos[0]),(myPos[1]-ppos[1])];var l=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var t=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);var deltaX=l-newOffset[0];var deltaY=t-newOffset[1];if(isNaN(deltaX)||isNaN(deltaY)){}else{this.deltaOffset=[deltaX,deltaY];}}else{var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);newOffset=[newLeft+this.deltaOffset[0],newTop+this.deltaOffset[1]];}
return newOffset;},initSlider:function(iLeft,iRight,iUp,iDown,iTickSize){this.initLeft=iLeft;this.initRight=iRight;this.initUp=iUp;this.initDown=iDown;this.setXConstraint(iLeft,iRight,iTickSize);this.setYConstraint(iUp,iDown,iTickSize);if(iTickSize&&iTickSize>1){this._graduated=true;}
this._isHoriz=(iLeft||iRight);this._isVert=(iUp||iDown);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this.tickSize=0;this._graduated=false;},getValue:function(){if(!this.available){return 0;}
var val=(this._isHoriz)?this.getXValue():this.getYValue();return val;},getXValue:function(){if(!this.available){return 0;}
var newOffset=this.getOffsetFromParent();return(newOffset[0]-this.startOffset[0]);},getYValue:function(){if(!this.available){return 0;}
var newOffset=this.getOffsetFromParent();return(newOffset[1]-this.startOffset[1]);},toString:function(){return"SliderThumb "+this.id;},onChange:function(x,y){}});if("undefined"==typeof YAHOO.util.Anim){YAHOO.widget.Slider.ANIM_AVAIL=false;}
YAHOO.register("slider",YAHOO.widget.Slider,{version:"2.2.0",build:"127"});
AbstractAjaxMessageHandler.prototype=new Object();
AbstractAjaxMessageHandler.constructor=AbstractAjaxMessageHandler;
AbstractAjaxMessageHandler.superclass=Object.prototype;
function AbstractAjaxMessageHandler(){
}
AbstractAjaxMessageHandler.prototype.processUpdate=function(_1){
};
AbstractAjaxMessageHandler.prototype.processJsonUpdate=function(_2){
};
var LoginRedirect=new function(){
this.context_path=null;
this.setContextPath=function(_3){
this.context_path=_3;
};
this.processUpdate=function(_4){
var _5=(this.context_path)?this.context_path+"/":"/";
window.location.href=_5;
};
};
var PreviewPodDashboardRedirect=new function(){
this.url_path=null;
this.setUrlPath=function(_6){
this.url_path=_6;
};
this.processUpdate=function(_7){
var _8=_7.firstChild;
if(_8&&_8.tagName=="acctInfo"){
if(_8.getAttribute("name")){
var _9=_8.getAttribute("name");
}
}
var _a=(this.url_path)?this.url_path:"/dashboard/loadDashboard.do";
_a=LoginRedirect.context_path+_a;
var _b=document.createElement("form");
_b.method="post";
_b.action=_a;
document.body.appendChild(_b);
var _c=function(_d,_e){
var _f=document.createElement("input");
_f.type="hidden";
_b.appendChild(_f);
_f.name=_d;
_f.value=_e;
};
if(_9){
_c("acct_not_in_preview","true");
_c("preview_pod_acct_name",_9);
}
_b.submit();
};
};
var PreviewPodAcctLandingRedirect=new function(){
this.url_path=null;
this.setUrlPath=function(_10){
this.url_path=_10;
};
this.processUpdate=function(_11){
var _12=_11.firstChild;
if(_12&&_12.tagName=="acctInfo"){
if(_12.getAttribute("name")){
var _13=_12.getAttribute("name");
}
}
var url=(this.url_path)?this.url_path:"/account/accountLanding.do";
url=LoginRedirect.context_path+url;
var _15=document.createElement("form");
_15.method="post";
_15.action=url;
document.body.appendChild(_15);
var _16=function(_17,_18){
var _19=document.createElement("input");
_19.type="hidden";
_15.appendChild(_19);
_19.name=_17;
_19.value=_18;
};
if(_13){
_16("acct_not_in_preview","true");
_16("preview_pod_acct_name",_13);
}
_15.submit();
};
};
var PreviewPodLoginRedirect=new function(){
this.url_path=null;
this.setUrlPath=function(_1a){
this.url_path=_1a;
};
this.processUpdate=function(_1b){
var url=(this.url_path)?this.url_path:"/signin/loadSignin.do";
url=LoginRedirect.context_path+url+"?acct_not_in_preview=true";
window.location.href=url;
};
};
var AjaxErrors=new function(){
this._errors=[];
this._errorCallbacks=[];
this.addError=function(_1d,_1e){
if(_1d&&_1e){
this._errors[_1d]=_1e;
}
};
this.clearAndHideErrors=function(){
for(var i in this._errors){
var _20=this._errors[i];
if(_20){
var _21=$(_20);
if(_21&&_21.style){
_21.style.display="none";
_21.innerHTML="";
}
}
var _22=$(i);
if(_22){
_22.className="";
}
}
};
this.setCallback=function(_23,_24,_25,_26){
if(_23&&_24){
this._errorCallbacks[_23]={callback:_24,args:_25,scope:_26};
}
};
this.processUpdate=function(_27){
var _28=_27.firstChild;
if(_28&&_28.tagName=="errors"){
this.clearAndHideErrors();
var _29=_28.childNodes;
for(var i=0;i<_29.length;i++){
var _2b=_29[i];
var _2c=_2b.getAttribute("field_id");
var _2d=ajaxEngine.getContentAsString(_2b);
var _2e=this._errors[_2c];
var _2f=document.getElementById(_2e);
if(_2f){
_2f.style.display="block";
_2f.className="fieldError";
_2f.innerHTML=_2d;
}
var _30=document.getElementsByName(_2c);
if(_30.length>0){
for(var j=0;j<_30.length;j++){
if(_30[j].id==_2c){
_30[j].className="error";
}
}
}
}
var _32=_28.getAttribute("ajax_event");
var _33=this._errorCallbacks[_32];
if(_33){
var _34=_33.callback;
var _35=_33.scope;
if(_35){
_34.apply(_35,_33.args);
}else{
_34.apply(window,_33.args);
}
}
}
};
};
AjaxPageErrorHandler.prototype=new AbstractAjaxMessageHandler();
function AjaxPageErrorHandler(){
this._GLOBAL_PAGE_MESSAGE_DIALOG="global_page_message_dialog";
this.ERROR_DIALOG_CONTAINER="error_dialog_container";
this.ERROR_DIALOG_CONTENT="error_dialog_content";
this.NOTIFICATION_DIALOG_CONTAINER="notification_dialog_container";
this.NOTIFICATION_DIALOG_CONTENT="notification_dialog_content";
this.PAGE_ERRORS_CONTAINER="page_errors_container";
this.PAGE_ERROR_MESSAGES="page_error_messages";
this.PAGE_NOTIFICATION_CONTAINER="page_notification_container";
this.PAGE_NOTIFICATION_MESSAGES="page_notificaction_messages";
}
AjaxPageErrorHandler.prototype.processUpdate=function(_36){
var _37=false;
var _38=_36.firstChild;
if(_38&&_38.tagName=="page-messages"){
var _39=_38.getElementsByTagName("errors")[0];
if(_39&&_39.childNodes.length>0){
var _3a=_39.getAttribute("displayType");
_39=_39.childNodes;
error_content=[];
var _3b=_39.length;
for(var i=0;i<_3b;i++){
error_content.push(ajaxEngine.getContentAsString(_39[i]));
}
if(_3a=="inline"){
var _3d=$(this.PAGE_ERRORS_CONTAINER);
var _3e=$(this.PAGE_ERROR_MESSAGES);
if(_3d&&_3e){
_3e.innerHTML=error_content.join("");
_3d.style.display="block";
}
}else{
if(_3a=="dialog"){
_37=true;
this.populatePageMessageDialog(error_content.join(""),true);
}
}
}
var _3f=_38.getElementsByTagName("notifications")[0];
if(_3f&&_3f.childNodes.length>0){
var _3a=_3f.getAttribute("displayType");
_3f=_3f.childNodes;
notification_content=[];
var _3b=_3f.length;
for(var i=0;i<_3b;i++){
notification_content.push(ajaxEngine.getContentAsString(_3f[i]));
}
if(_3a=="inline"){
var _3d=$(this.PAGE_NOTIFICATION_CONTAINER);
var _3e=$(this.PAGE_NOTIFICATION_MESSAGES);
if(_3d&&_3e){
_3e.innerHTML=notification_content.join("");
_3d.style.display="block";
}
}else{
if(_3a=="dialog"){
_37=true;
this.populatePageMessageDialog(notification_content.join(""),false);
}
}
}
if(_37){
dialog.createDialog(null,this._GLOBAL_PAGE_MESSAGE_DIALOG,true,null,null);
}
}
};
AjaxPageErrorHandler.prototype.populatePageMessageDialog=function(_40,_41){
if(_41){
var _42=$(this.ERROR_DIALOG_CONTAINER);
var _43=$(this.ERROR_DIALOG_CONTENT);
if(_42&&_43){
_43.innerHTML=_40;
_42.style.display="block";
}
}else{
var _42=$(this.NOTIFICATION_DIALOG_CONTAINER);
var _43=$(this.NOTIFICATION_DIALOG_CONTENT);
if(_42&&_43){
_43.innerHTML=_40;
_42.style.display="block";
}
}
};
AjaxPageErrorHandler.prototype.showPageErrorDialog=function(){
dialog.createDialog(null,this._GLOBAL_PAGE_MESSAGE_DIALOG,true,null,null);
};
AjaxRequest.prototype=new Object();
AjaxRequest.constructor=AjaxRequest;
AjaxRequest.superclass=Object.prototype;
function AjaxRequest(_44,_45){
if(_44){
this.initialize(_44,_45);
}
}
AjaxRequest.prototype.initialize=function(_46,_47,_48){
this._ajax_headers=[];
this._ajax_parameters=[];
this._ajax_form_ids=[];
this._ajax_regions=[];
this._ajax_buttons=[];
this._cursor="default";
this._setAjaxUrl(_46);
if(_47){
this.addAjaxParameter("ajax_event",_47);
this.ajax_event=_47;
}
if(_48){
this.addAjaxParameter("ajax_errors_bundle",_48);
}
};
AjaxRequest.prototype.setCursor=function(_49){
this._cursor=_49;
};
AjaxRequest.prototype.getCursor=function(){
return this._cursor;
};
AjaxRequest.prototype.getAjaxURL=function(){
return this._ajax_url;
};
AjaxRequest.prototype.addAjaxHeader=function(_4a,_4b){
this._ajax_headers[this._ajax_headers.length]={name:_4a,value:_4b};
};
AjaxRequest.prototype.getAjaxHeaders=function(){
return this._ajax_headers;
};
AjaxRequest.prototype.addAjaxParameter=function(_4c,_4d){
this._ajax_parameters[this._ajax_parameters.length]={name:_4c,value:_4d};
};
AjaxRequest.prototype.getAjaxParameters=function(){
return this._ajax_parameters;
};
AjaxRequest.prototype.addAjaxFormId=function(id){
this._ajax_form_ids[this._ajax_form_ids.length]=id;
};
AjaxRequest.prototype.getAjaxFormIds=function(){
return this._ajax_form_ids;
};
AjaxRequest.prototype.addAjaxRegion=function(_4f,_50){
this._ajax_regions[this._ajax_regions.length]={id:_4f,process_type:_50};
};
AjaxRequest.prototype.setAjaxRegions=function(_51){
this._ajax_regions=[];
var _52=_51.split(",");
for(var i=0;i<_52.length;i++){
this.addAjaxRegion(_52[i],"AREA");
}
};
AjaxRequest.prototype.getAjaxRegions=function(){
return this._ajax_regions;
};
AjaxRequest.prototype.addAjaxButtons=function(_54){
this._ajax_buttons[this._ajax_buttons.length]={id:_54};
};
AjaxRequest.prototype.setAjaxButton=function(_55){
if(_55){
var _56=_55.split(",");
for(var i=0;i<_56.length;i++){
this.addAjaxButtons(_56[i]);
}
}
};
AjaxRequest.prototype.getAjaxButtons=function(){
return this._ajax_buttons;
};
AjaxRequest.prototype.getQueryString=function(){
var _58=this.getAjaxFormIds();
for(var i=0;i<_58.length;i++){
var _5a=_58[i];
this._setFormAsParameters(_5a);
}
var _5b=[];
var _5c=this.getAjaxParameters();
for(var i=0;i<_5c.length;i++){
var _5d=_5c[i];
_5b.push(_5d.name+"="+encodeURIComponent(_5d.value));
if(i!=(_5c.length-1)){
_5b.push("&");
}
}
return _5b.join("");
};
AjaxRequest.prototype._setAjaxUrl=function(_5e){
if(_5e){
this._ajax_url=_5e;
var _5f=_5e;
var _60=_5f.indexOf("?");
if(_60!=-1){
this._ajax_url=_5e.substring(0,_60);
var _61=_5e.substring(_60+1);
var _62=_61.split("&");
for(var i=0;i<_62.length;i++){
var _64=_62[i].split("=");
var _65=_64[0];
var _66=_64[1];
this.addAjaxParameter(_65,_66);
}
}
}else{
alert("ajax_url is undefined.");
}
};
AjaxRequest.prototype._setFormAsParameters=function(_67){
var _68=document.getElementById(_67);
if(_68){
for(var i=0;i<_68.elements.length;i++){
var _6a=_68.elements[i];
var _6b=_6a.name;
var _6c=_6a.value;
switch(_6a.type.toLowerCase()){
case "select-multiple":
for(var j=0;j<_6a.options.length;j++){
var _6e=_6a.options[j];
if(_6e.selected){
this.addAjaxParameter(_6b,_6e.value);
}
}
break;
case "radio":
if(_6a.checked){
this.addAjaxParameter(_6b,_6c);
}
break;
case "checkbox":
if(_6a.checked){
this.addAjaxParameter(_6b,_6c);
}
break;
default:
this.addAjaxParameter(_6b,_6c);
break;
}
}
}
};
var ajaxEngine=new function(){
this._message_handlers=[];
this._polling_actions=[];
this._cached_requests=[];
this._ajax_error_bundle=null;
this._performance_mode=false;
this._performance_token=null;
this._errorDialog=null;
this.ErrorDialogTitle="{Ajax Errors}";
this.ErrorDialogDescription="{An error occurred while communicating to the server.}";
this.ErrorDetailsLabel="{Details}";
this.ErrorDialogCancel="{Cancel}";
this.initErrorDialog=function(){
if(document.getElementById("__ajax_system_error__")==null){
var div=document.createElement("div");
document.body.appendChild(div);
div.style.display="none";
div.style.width="500px";
div.id="__ajax_system_error__";
div.className="popup";
var _70=new Array();
_70.push("<div class=\"popWhtBdr\"><div class=\"box\"><div class=\"popTop clearfloat sectBG\">");
_70.push("<div class=\"popClose\"></div><div class=\"popHdr\" id=\"__ajax_err_dlg_title\">");
_70.push(this.ErrorDialogTitle);
_70.push("</div></div><div class=\"content clearfloat\">");
_70.push(this.ErrorDialogDescription);
_70.push("<p/><div class=\"boxContent shaded\" id=\"__ajax_err_details\" style=\"display:none\">");
_70.push(this.ErrorDetailsLabel);
_70.push(": <br/><div id=\"__ajax_err_msgs\"></div></div><p /></div>");
_70.push("<div class=\"popAction sectBG\"><form>");
_70.push("<input type=\"button\" id=\"__ajax_err_btn_cancelDialog\" class=\"cnclPrv\" onclick=\"dialog.hide();\" value=\"");
_70.push(this.ErrorDialogCancel);
_70.push("\"/></form></div></div></div></div>");
div.innerHTML=_70.join("");
}
};
this.setPerformanceMode=function(_71){
this._performance_mode=_71;
};
this.setPerformanceToken=function(_72){
this._performance_token=_72;
};
this.setAjaxErrorsBundle=function(_73){
if(_73){
this._ajax_error_bundle=_73;
}
};
this.registerMessageHandler=function(id,_75){
if(id&&_75){
this._message_handlers[id]=_75;
}
};
this.getMessageHandler=function(id){
if(id){
return this._message_handlers[id];
}
};
this.registerPollingAction=function(id,_78,_79,_7a){
if(id&&_78&&_79&&_7a){
this._polling_actions[id]={action:_78,bind_obj:_79,frequency:(_7a*1000),interval_id:null,__type:"polling"};
}
};
this.startPollingActions=function(){
this.stopPollingActions();
for(var i in this._polling_actions){
this.startPollingActionById(i);
}
};
this.startPollingActionById=function(id){
this.stopPollingActionById(id);
var _7d=this._polling_actions[id];
if(this._typeOfPollingAction(_7d)){
if(_7d.frequency>0){
_7d.interval_id=setInterval(this.bind(_7d.action,_7d.bind_obj),_7d.frequency);
}
}
};
this.stopPollingActions=function(){
for(var i in this._polling_actions){
this.stopPollingActionById(i);
}
};
this.stopPollingActionById=function(id){
var _80=this._polling_actions[id];
if(this._typeOfPollingAction(_80)&&_80.interval_id){
clearInterval(_80.interval_id);
_80.interval_id=null;
}
};
this.createAjaxRequest=function(_81,_82){
return new AjaxRequest(_81,_82);
};
this._setRequestTimeStamp=function(_83){
if(_83){
return _83+="&trnd="+Math.floor(Math.random()*1000000000);
}
};
this.sendAjaxRequest=function(_84,_85){
if(_84){
var _86=_84.getAjaxHeaders();
document.body.style.cursor=_84.getCursor();
for(var i=0;i<_86.length;i++){
var _88=_86[i];
YAHOO.util.Connect.initHeader(_88.name,_88.value);
}
if(this._ajax_error_bundle){
_84.addAjaxParameter("ajax_error_bundle",this._ajax_error_bundle);
}
if(isInScope(window.CRUMB_NAME)&&isInScope(window.CRUMB_VALUE)){
_84.addAjaxParameter(window.CRUMB_NAME,window.CRUMB_VALUE);
}
if(this._performance_mode&&(this._performance_token!=null)){
_84.addAjaxParameter("performanceToken",this._performance_token);
}
var _89=_84.getAjaxURL();
if(navigator.userAgent.toLowerCase().indexOf("opera")>-1){
var _8a=_89.lastIndexOf("/");
if(_8a>-1){
_89=_89.substring(_8a+1);
}
}
var _8b=_84.getQueryString();
var _8c=_89+_8b;
var _8d=this._cached_requests[_8c];
if(!_8d){
_84.hasNoCallback=_85;
_84.ajax_data=_8b;
this._cached_requests[_8c]=_84;
this._internalSendAjaxRequest(_85,_89,_8c,_84.getAjaxRegions(),_84.getAjaxButtons(),_8b);
}
}
};
this._internalSendAjaxRequest=function(_8e,_8f,_90,_91,_92,_93){
if(_8f&&_90&&_91&&_92&&_93){
this._toggleAjaxButtons(_92,true);
var _94=true;
var _95=[_91,_92,_90];
_93=this._setRequestTimeStamp(_93);
if(_8e){
var _96={success:this._handleEmptyAjaxResponse,failure:this._handleEmptyAjaxResponse,scope:this};
YAHOO.util.Connect.asyncRequest("POST",_8f,_96,_93);
}else{
var _96={success:this._handleAjaxResponse,failure:this._handleAjaxResponse,scope:this,argument:_95};
YAHOO.util.Connect.asyncRequest("POST",_8f,_96,_93);
}
var _97=document.getElementById("page_errors_container");
var _98=document.getElementById("page_error_messages");
if(_97&&_98){
}
if(_91){
this._setAjaxProcressTypes(_91);
}
}
};
this._handleEmptyAjaxResponse=function(){
};
this._handleAjaxResponse=function(_99){
document.body.style.cursor="default";
if(_99.status=="NS_ERROR_NOT_AVAILABLE"||_99.status==0){
return;
}
if(_99.status!=200){
this._onFailure(_99.status,_99.tId);
}else{
var _9a=_99.responseXML;
if(_9a){
this._cached_requests[_99.argument[2]]=null;
var _9b=_9a.getElementsByTagName("ajax-response");
if(_9b.length==1){
var _9c=_9b[0].getAttribute("ajax-event");
var _9d=_9b[0].getAttribute("ajax-token");
var _9e=null;
if(this._performance_mode){
_9e=new JSTimer();
_9e.startTimer();
}
try{
this._onSuccess(_9b[0].childNodes,_99.argument[0],_99.argument[1]);
if(this._performance_mode){
_9e.stopTimer();
var _9f=_9e._duration;
_9e=null;
var _a0=new AjaxRequest("ajaxStatLog.do",_9c);
_a0.addAjaxParameter("methodName",_9c);
_a0.addAjaxParameter("duration",_9f);
_a0.addAjaxParameter("ajaxToken",_9d);
this.sendAjaxRequest(_a0,true);
}
var _a1=_9b[0].getAttribute("beacon-url");
if(_a1!=null){
var _a2=new Image();
_a2.src=_a1;
}
}
catch(ex){
this.initErrorDialog();
this._enableAjaxRegion(_99.argument[0]);
this._toggleAjaxButtons(_99.argument[1],false);
var _a3=document.getElementById("__ajax_err_msgs");
if(_a3){
_a3.innerHTML=ex;
dialog.createDialog(null,"__ajax_system_error__",true);
}else{
alert(this.ErrorDialogDescription);
}
}
}else{
this.initErrorDialog();
this._enableAjaxRegion(_99.argument[0]);
this._toggleAjaxButtons(_99.argument[1],false);
var _a3=document.getElementById("__ajax_err_msgs");
if(_a3){
_a3.innerHTML="Malformed Ajax Response Passed.";
dialog.createDialog(null,"__ajax_system_error__",true);
}else{
alert("Malformed Ajax Response Passed.");
}
}
}else{
var _a4=this._cached_requests[_99.argument[2]];
if(_a4){
this._internalSendAjaxRequest(_a4.hasNoCallback,_99.argument[2],_a4.getAjaxURL(),null,_a4.getAjaxButtons(),_a4.ajax_data);
}
}
}
if(dialog._active){
dialog.clearAssociatedDrags();
}
};
this._onSuccess=function(_a5,_a6,_a7){
if(_a5&&_a6){
for(var i=0;i<_a5.length;i++){
var _a9=_a5[i];
if(_a9.nodeType!=1){
continue;
}
var id=_a9.getAttribute("id");
var _ab=_a9.getAttribute("type");
if(_ab&&id){
if(_ab=="xml"){
this._processAjaxMessageUpdate(this.getMessageHandler(id),_a9);
}else{
if(_ab=="html"){
this._processAjaxRegionUpdate(document.getElementById(id),_a9);
}else{
if(_ab=="json"){
this._processJsonUpdate(this.getMessageHandler(id),_a9);
}else{
alert("unsupported type: "+_ab);
}
}
}
}
}
this._enableAjaxRegion(_a6);
this._toggleAjaxButtons(_a7,false);
}
};
this._onFailure=function(_ac,_ad){
this._enableAjaxRegion(_ad);
this.initErrorDialog();
var _ae=document.getElementById("__ajax_err_msgs");
if(_ae){
_ae.innerHTML="Error Code: "+_ac;
dialog.createDialog(null,"__ajax_system_error__",true);
}else{
alert("There was an error processing your request.\n Error Code: "+_ac);
}
};
this._typeOfPollingAction=function(_af){
return (_af&&_af.__type=="polling");
};
this._processAjaxMessageUpdate=function(_b0,_b1){
if(_b0&&_b0.processUpdate&&_b1){
this._removeWhitespaceNodes(_b1);
_b0.processUpdate(_b1);
}
};
this._processJsonUpdate=function(_b2,_b3){
if(_b2&&_b2.processJsonUpdate&&_b3){
var _b4=ajaxEngine.getContentAsString(_b3);
var _b5=null;
if(_b4){
_b5=eval("("+_b4+")");
}
_b2.processJsonUpdate(_b5);
}
};
this._processAjaxRegionUpdate=function(_b6,_b7){
if(_b6&&_b7){
var _b8=this.getContentAsString(_b7);
_b6.innerHTML=_b8;
var _b9=_b7.getAttribute("autoHide");
if(_b9&&"true"==_b9){
if(null==_b8||_b8.trim().length<=0){
_b6.style.display="none";
}else{
_b6.style.display="block";
}
}
}
};
this._disableAjaxRegion=function(_ba,_bb,arr){
var _bd=document.createElement("div");
document.body.appendChild(_bd);
_bd.id=_ba.id+"_disable_div";
_bd.className="disable-cover";
this._clone(_ba,_bd);
if(arr){
arr.push(_bd);
}
if(dialog._active&&_bb!=null){
for(var i=0;i<_bb.length;i++){
if(_bb[i].id==_ba.id){
_bd.setAttribute("region",_ba.id);
return _bd.id;
}
}
}
return null;
};
this._enableAjaxRegion=function(_bf){
if(_bf&&_bf.coverRef){
for(var i=0;i<_bf.coverRef.length;i++){
var _c1=_bf.coverRef[i];
if(_c1){
document.body.removeChild(_c1);
}
}
}
};
this._toggleAjaxButtons=function(_c2,_c3){
if(_c2){
var _c4=_c2.length;
for(var i=0;i<_c4;i++){
var _c6=$(_c2[i].id);
if(_c6){
_c6.disabled=_c3;
}
}
}
};
this._setAjaxProcressTypes=function(_c7){
var _c8=new Array();
if(_c7){
var _c9=new Array();
_c7.coverRef=_c9;
for(var i=0;i<_c7.length;i++){
var _cb=document.getElementById(_c7[i].id);
if(_cb){
switch(_c7[i].process_type){
case "INLINE":
_cb.innerHTML="<img src=\""+getImgUrl("images/indicator.gif")+"\" width=\"16\" height=\"16\">";
break;
case "AREA":
var _cc=null;
if(dialog._active){
_cc=dialog._dialog_container.getElementsByTagName("div");
}
var _cd=this._disableAjaxRegion(_cb,_cc,_c9);
if(_cd!=null){
_c8.push(_cd);
}
break;
case "NONE":
_cb.innerHTML="&nbsp;";
break;
}
}
}
}
if(dialog._active){
dialog.setAssociatedDrags(_c8);
}
};
this.getContentAsString=function(_ce){
return _ce.xml!=undefined?this._getContentAsStringIE(_ce):this._getContentAsStringMozilla(_ce);
};
this._getContentAsStringIE=function(_cf){
var _d0=[];
for(var i=0;i<_cf.childNodes.length;i++){
_d0.push(_cf.childNodes[i].xml);
}
return this._removeCDATATagFromString(_d0.join(""));
};
this._getContentAsStringMozilla=function(_d2){
var _d3=new XMLSerializer();
var _d4=[];
for(var i=0;i<_d2.childNodes.length;i++){
_d4.push(_d3.serializeToString(_d2.childNodes[i]));
}
return this._removeCDATATagFromString(_d4.join(""));
};
this._removeCDATATagFromString=function(_d6){
var _d7=_d6.indexOf("<![CDATA[");
var end=_d6.indexOf("]]>");
if(_d7!=-1&&end!=-1){
_d7+=9;
return _d6.substring(_d7,end);
}
return _d6;
};
this._removeWhitespaceNodes=function(_d9){
if(_d9){
for(var i=0;i<_d9.childNodes.length;i++){
var _db=_d9.childNodes[i];
if(_db.nodeType==3&&!/\S/.test(_db.nodeValue)){
_db.parentNode.removeChild(_db);
i--;
}else{
this._removeWhitespaceNodes(_db);
}
}
}
};
this.bind=function(_dc,_dd){
if(_dc&&_dd){
return function(){
_dc.apply(_dd,arguments);
};
}
};
this._cumlativeOffset=function(_de){
var top=0,left=0;
do{
top+=_de.offsetTop||0;
left+=_de.offsetLeft||0;
_de=_de.offsetParent;
}while(_de);
return [top,left];
};
this._clone=function(_e0,_e1){
if(_e0&&_e1){
_e1.style.position="absolute";
var _e2=this._cumlativeOffset(_e0);
_e1.style.top=_e2[0]+"px";
_e1.style.left=_e2[1]+"px";
_e1.style.width=_e0.offsetWidth+"px";
_e1.style.height=_e0.offsetHeight+"px";
_e1.style.zIndex=100;
}
};
};
ajaxEngine.registerMessageHandler("ajax_errors",AjaxErrors);
ajaxEngine.registerMessageHandler("ajax_page_errors",new AjaxPageErrorHandler);
ajaxEngine.registerMessageHandler("login_redirect",LoginRedirect);
ajaxEngine.registerMessageHandler("previewpod_dashboard_redirect",PreviewPodDashboardRedirect);
ajaxEngine.registerMessageHandler("previewpod_acct_landing_redirect",PreviewPodAcctLandingRedirect);
ajaxEngine.registerMessageHandler("previewpod_login_redirect",PreviewPodLoginRedirect);

function open_win(_1,_2,_3,_4,_5,_6){
var w=(_3)?_3:625;
var h=(_4)?_4:600;
var tb=(_5)?_5:0;
var mb=(_6)?_6:0;
window.open(_1,_2,"toolbar="+tb+",location=0,directories=0,status=0,menubar="+mb+",scrollbars=1,resizable=1,width="+w+",height="+h);
}
var Element=new function(){
this.tags=new Array("applet","iframe","select");
this.hide=function(_b){
var _c=this._getElement(_b);
if(_c){
_c.style.display="none";
}
};
this.show=function(_d){
var _e=this._getElement(_d);
if(_e){
_e.style.display="";
}
};
this.toggle=function(_f){
var _10=this._getElement(_f);
if(_10){
if(_10.style.display=="none"){
_10.style.display="";
}else{
_10.style.display="none";
}
}
};
this._getElement=function(_11){
return $(_11);
};
this.getStyleProp=function(obj,_13){
var _14=obj.style[_13];
if(!_14){
if(document.defaultView&&typeof (document.defaultView.getComputedStyle)=="function"){
_14=document.defaultView.getComputedStyle(obj,"").getPropertyValue(_13);
}else{
if(obj.currentStyle){
_14=obj.currentStyle[_13];
}else{
_14=obj.style[_13];
}
}
}
return _14;
};
this.getElementsByClass=function(_15,_16,tag){
var _18=new Array();
if(_16==null){
_16=document;
}
if(tag==null){
tag="*";
}
var els=_16.getElementsByTagName(tag);
var _1a=els.length;
var _1b=new RegExp("(^|\\s)"+_15+"(\\s|$)");
for(i=0,j=0;i<_1a;i++){
if(_1b.test(els[i].className)){
_18[j]=els[i];
j++;
}
}
return _18;
};
this.classContains=function(o,_1d){
return (typeof (o.className)!="undefined"?o.className.indexOf(_1d)+1:false);
};
this.addClass=function(o,_1f){
if(!o){
return false;
}
if(this.classContains(o,_1f)){
return false;
}
o.className=(o.className?o.className+" ":"")+_1f;
};
this.removeClass=function(o,_21){
if(!o){
return false;
}
if(!this.classContains(o,_21)){
return false;
}
o.className=o.className.replace(new RegExp("( "+_21+")|("+_21+")","g"),"");
};
};
var MessageUtil=new function(){
this.replaceParams=function(_22,_23){
if(_22==null||_23==null||!(_23 instanceof Array)){
return null;
}
for(var i=0;i<_23.length;i++){
var _25="{"+i+"}";
var _26=_23[i];
if(_26!=null){
_22=_22.replace(_25,_26);
}
}
return _22;
};
};
function ToogleModuleControl(_27,_28,_29,_2a){
this.onChangeCallback=null;
this.onChangeScope=window;
this.prefs=[];
this.prefs["show_text"]=_29;
this.prefs["hide_text"]=_2a;
this.control=document.getElementById(_27);
this.content=document.getElementById(_28);
if(this.control&&this.content){
this.control.style.cursor="pointer";
YAHOO.util.Event.addListener(this.control,"click",this._toggleModule,this);
this._initText(this.control,this.content);
}
}
ToogleModuleControl.prototype._toggleModule=function(e,_2c){
_2c=(_2c)?_2c:this;
var _2d=(_2c)?_2c.control:this.control;
var _2e=(_2c)?_2c.content:this.content;
var _2f=true;
if(_2e.style.display=="none"){
_2e.style.display="block";
_2d.innerHTML="["+_2c.prefs["hide_text"]+"]";
}else{
_2f=false;
_2e.style.display="none";
_2d.innerHTML="["+_2c.prefs["show_text"]+"]";
}
if(_2c.onChangeCallback!=null){
_2c.onChangeCallback.call(_2c.onChangeScope,_2f);
}
};
ToogleModuleControl.prototype.setOnChangeListener=function(_30,_31){
this.onChangeCallback=_30;
this.onChangeScope=_31==null?window:_31;
};
ToogleModuleControl.prototype._initText=function(_32,_33){
if(_32&&_33){
if(_33.style.display=="none"){
_32.innerHTML="["+this.prefs["show_text"]+"]";
}else{
_32.innerHTML="["+this.prefs["hide_text"]+"]";
}
}
};
function AjaxTableTabLoader(){
this._isLocal=false;
this.ajax_regions=arguments;
this.perfs=[];
this.perfs["tableTab"]="tableTab";
this.perfs["tab"]="tab";
this.perfs["1stTabOn"]="onLt";
this.perfs["1stTabOff"]="offLt";
this.perfs["tabOn"]="onRt";
this.perfs["tabOff"]="offRt";
this.smartLoad=false;
this._tabs=[];
this._default_tab_id=0;
this._ajaxParams=[];
this.tabAjaxEvent=new YAHOO.util.CustomEvent("tabAjaxEvent",this);
}
AjaxTableTabLoader.prototype.addAjaxParam=function(_34,_35){
if(_34&&_35&&_34.length>0&&_35.length>0){
this._ajaxParams[_34]=_35;
}
};
AjaxTableTabLoader.prototype.resetSmartLoad=function(){
for(var i in this._tabs){
var _37=this._tabs[i];
if(_37.tab){
_37.loaded=false;
if(_37.tab.getAttribute("selectedTab")=="true"){
_37.loaded=true;
}
}
}
};
AjaxTableTabLoader.prototype.isLocal=function(_38){
this._isLocal=_38;
};
AjaxTableTabLoader.prototype.addTableTab=function(_39,_3a,_3b,_3c,_3d,_3e,_3f){
var tab=document.getElementById(_39);
if(tab){
var _41=document.getElementById(_3c);
var _42=document.getElementById(_3d);
var _43=document.getElementById(_3e);
this._tabs[_39]={tab:tab,url:_3a,event:_3b,top_actions:_41,bottom_actions:_42,pagination:_43,loaded:false};
YAHOO.util.Event.addListener(tab,"click",this._loadContent,this);
if(_3f){
this._default_tab_id=_39;
}
}
};
AjaxTableTabLoader.prototype.subscribe2AjaxEvent=function(_44){
if(_44.setAjaxEvent){
this.tabAjaxEvent.subscribe(this._handleTabEvent,_44);
}
};
AjaxTableTabLoader.prototype._fireTabEvent=function(tab){
if(tab){
var id=tab.id;
tab=this._tabs[id];
this.tabAjaxEvent.fire(tab.event);
}
};
AjaxTableTabLoader.prototype._handleTabEvent=function(_47,_48,obj){
var _4a=_48[0];
if(obj.setAjaxEvent){
obj.setAjaxEvent(_4a);
}
};
AjaxTableTabLoader.prototype.init=function(_4b,_4c){
this._loadContent(null,null,_4b,_4c);
};
AjaxTableTabLoader.prototype._loadContent=function(e,_4e,_4f,_50){
var _51=this;
var _52=null;
var _53=null;
var _54=null;
var _55=null;
var _56=null;
var _57=null;
var _58=true;
var _59=null;
if(e&&_4e){
_51=_4e;
_59=_51.ajax_regions;
_52=YAHOO.util.Event.getTarget(e);
if(_52.getAttribute("selectedTab")=="true"){
return;
}
_loader_tab_obj=_51._tabs[_52.id];
if(_51.smartLoad){
if(_loader_tab_obj.loaded){
_58=false;
}
_loader_tab_obj.loaded=true;
}
_53=_loader_tab_obj.url;
_54=_loader_tab_obj.event;
_55=_loader_tab_obj.top_actions;
_56=_loader_tab_obj.bottom_actions;
_57=_loader_tab_obj.pagination;
}else{
var _5a=_51._tabs[_51._default_tab_id];
if(_51.smartLoad){
_5a.loaded=true;
}
_52=_5a.tab;
_53=_5a.url;
if(_4f!=null){
_54=_4f;
}else{
_54=_5a.event;
}
if(_50!=null){
_59=_50;
}
_55=_5a.top_actions;
_56=_5a.bottom_actions;
_57=_5a.pagination;
}
_51._fireTabEvent(_52);
var _5b=0;
for(var i in _51._tabs){
var _5d=_51._tabs[i];
if(_5d.tab){
var tab=_5d.tab;
if(tab.id==_52.id){
tab.setAttribute("selectedTab","true");
}else{
tab.setAttribute("selectedTab","false");
}
var _5f=_5d.top_actions;
var _60=_5d.bottom_actions;
var _61=_5d.pagination;
var url=_5d.url;
if(_51._isLocal&&$(url)){
$(url).style.display="none";
}
if(_5f){
_5f.style.display="none";
}
if(_60){
_60.style.display="none";
}
if(_61){
_61.style.display="none";
}
var _63=[];
_63.push(_51.perfs["tableTab"]+" ");
if(_5b==0){
var _64=(tab.id==_52.id)?(_51.perfs["1stTabOn"]+" "+_51.perfs["tab"]):_51.perfs["1stTabOff"];
_63.push(_64);
}else{
var _65=(tab.id==_52.id)?(_51.perfs["tabOn"]+" "+_51.perfs["tab"]):_51.perfs["tabOff"];
_63.push(_65);
}
tab.className=_63.join("");
_5b++;
}
}
if(_55){
_55.style.display="block";
}
if(_56){
_56.style.display="block";
}
if(_57){
_57.style.display="block";
}
if(_58&&_53&&_54){
var _66=ajaxEngine.createAjaxRequest(_53,_54);
if(_59!=null){
for(var i=0;i<_59.length;i++){
_66.addAjaxRegion(_59[i],"AREA");
}
}
for(var i in this._ajaxParams){
_66.addAjaxParameter(i,this._ajaxParams[i]);
}
_66.addAjaxParameter("onload","true");
_66.addAjaxParameter("tabGeneratedEvent","true");
ajaxEngine.sendAjaxRequest(_66);
}
if(_51._isLocal&&$(_53)){
$(_53).style.display="block";
}
};
function parseAffectedElements(_67,_68){
var _69=_67.split(",");
for(var i=0;i<_69.length;i++){
_68.addAjaxRegion(_69[i],"AREA");
}
}
function invokeAjaxRequest(url,_6c,_6d,_6e,_6f){
var _70=new AjaxRequest(url,_6c);
if(_6d){
parseAffectedElements(_6d,_70);
}
if(_6e){
_70.addAjaxFormId(_6e);
}
addParamsToRequest(_6f,_70);
ajaxEngine.sendAjaxRequest(_70);
}
function addParamsToRequest(_71,_72){
var _73=parseParams(_71);
if(_73&&_73.length>0){
for(var i=0;i<_73.length;i++){
var _75=_73[i].split("=");
if(_75.length>1){
_72.addAjaxParameter(_75[0],_75[1]);
}
}
}
}
function parseParams(_76){
var _77=new Array();
if(_76&&_76!=""){
var _78=_76.split(",");
var val=null;
for(var i=0;i<_78.length;i++){
if(_78[i].indexOf("=")!=-1){
if(val!=null){
_77.push(val);
val=null;
}
val=_78[i];
continue;
}
val=val+","+_78[i];
}
if(val!=null){
_77.push(val);
}
}
return _77;
}
function invokeFilterRequest(url,_7c,_7d,_7e,_7f){
var _80=new AjaxRequest(url,_7c);
parseAffectedElements(_7e,_80);
_80.addAjaxParameter("function","filter");
_80.addAjaxFormId(_7d);
if(_7f){
_80.setAjaxButton(_7f);
}
ajaxEngine.sendAjaxRequest(_80);
}
function invokeFilterRequestOnLoad(url,_82,_83,_84){
var _85=new AjaxRequest(url,_82);
parseAffectedElements(_84,_85);
_85.addAjaxParameter("function","filter");
_85.addAjaxParameter("onload","true");
_85.addAjaxFormId(_83);
ajaxEngine.sendAjaxRequest(_85);
}
function invokeSortRequest(url,_87,_88,_89){
var _8a=new AjaxRequest(url,_87);
parseAffectedElements(_89,_8a);
_8a.addAjaxParameter("function","sort");
_8a.addAjaxFormId(_88);
ajaxEngine.sendAjaxRequest(_8a);
}
function invokeCancelRequest(url,_8c,_8d,_8e){
var _8f=new AjaxRequest(url,_8c);
parseAffectedElements(_8e,_8f);
_8f.addAjaxParameter("function","cancelled");
_8f.addAjaxFormId(_8d);
ajaxEngine.sendAjaxRequest(_8f);
}
function showPopup(){
var _90=$(arguments[0]);
var _91=$(arguments[1]);
var _92=arguments[2]||false;
var _93=arguments[3]||false;
var _94=arguments[4]||false;
var _95=arguments[5]||false;
var _96=arguments[6]||false;
var _97=arguments[7];
var _98=arguments[8];
var _99=arguments[9];
if(calendar!=null){
calendar.hide();
}else{
var _9a=(_96)?selectWithInput:selecteWithoutInput;
var _9b=new Calendar(_92,null,_9a,closeHandler);
_9b.weekNumbers=_93;
_9b.showsTime=_94;
_9b.time24=_95;
calendar=_9b;
_9b.setDateFormat(_97);
_9b.setTtDateFormat(_97);
_9b.setRange(_98,_99);
_9b.create();
}
if(_96){
calendar.parseDate(_91.value);
}else{
calendar.parseDate(_91.innerHTML);
}
calendar.sel=_91;
calendar.showAtElement(_90,"Br");
return false;
}
function selectWithInput(cal,_9d){
cal.sel.value=_9d;
}
function selecteWithoutInput(cal,_9f){
cal.sel.innerHTML=_9f;
var _a0=cal.sel.id.slice(5,cal.sel.id.length);
var _a1=$(_a0);
_a1.value=_9f;
}
function closeHandler(cal){
cal.hide();
cal.destroy();
cal=null;
}
function hideShowCovered(_a3,_a4){
if((_a3&&_a3.style.display!="none")||(_a3&&_a3.style.visibility!="hidden")){
var pos=getAbsolutePos(_a3);
var EX1=pos.x;
var EX2=_a3.offsetWidth+EX1;
var EY1=pos.y;
var EY2=_a3.offsetHeight+EY1;
for(var k=Element.tags.length-1;k>0;k--){
var _ab=_a3.getElementsByTagName(Element.tags[k]);
var _ac=new Array();
for(var _i=0;_i<_ab.length;_i++){
_ac[_i]=_ab[_i];
}
var ar=document.getElementsByTagName(Element.tags[k]);
var cc=null;
for(var i=ar.length;i>0;){
cc=ar[--i];
if(_ac.indexOf(cc)!=-1){
continue;
}
pos=getAbsolutePos(cc);
var CX1=pos.x;
var CX2=cc.offsetWidth+CX1;
var CY1=pos.y;
var CY2=cc.offsetHeight+CY1;
if(!((CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1))){
if(!_a4){
if(cc.__owner==null){
continue;
}
var _b5=cc.__owner.indexOf(_a3);
if(_b5!=-1){
cc.__owner[_b5]=undefined;
cc.__owner.pack();
if(cc.__owner.length==0){
if(!cc.__msh_save_visibility){
cc.__msh_save_visibility=Element.getStyleProp(cc,"visibility");
}
cc.style.visibility=cc.__msh_save_visibility;
cc.__owner=null;
cc.__msh_save_visibility=null;
}
}
}else{
if(cc.__owner!=null){
cc.__owner[cc.__owner.length]=_a3;
continue;
}
if(!cc.__msh_save_visibility){
cc.__msh_save_visibility=Element.getStyleProp(cc,"visibility");
cc.__owner=[_a3];
}
cc.style.visibility="hidden";
}
}
}
}
}
}
function $(){
var _b6=new Array();
for(var i=0;i<arguments.length;i++){
var _b8=arguments[i];
if(typeof _b8=="string"){
_b8=document.getElementById(_b8);
}
if(arguments.length==1){
return _b8;
}
_b6.push(_b8);
}
return _b6;
}
function getAbsolutePos(el){
var r={x:el.offsetLeft,y:el.offsetTop};
if(el.offsetParent){
var tmp=getAbsolutePos(el.offsetParent);
r.x+=tmp.x;
r.y+=tmp.y;
}
return r;
}
function formatNumber(_bc,inD,_be,sep){
_bc+="";
var _c0=_bc.indexOf(inD);
var _c1="";
if(_c0!=-1){
_c1=_be+_bc.substring(_c0+1,_bc.length);
_bc=_bc.substring(0,_c0);
}
var rgx=/(\d+)(\d{3})/;
while(rgx.test(_bc)){
_bc=_bc.replace(rgx,"$1"+sep+"$2");
}
return _bc+_c1;
}
function alertRedirect(url,_c4,_c5,_c6,_c7,_c8,_c9,_ca,tab,_cc){
if(_c4){
var _cd=document.createElement("form");
_cd.method="post";
_cd.action=url;
document.body.appendChild(_cd);
var _ce=function(_cf,_d0){
var _d1=document.createElement("input");
_d1.type="hidden";
_cd.appendChild(_d1);
_d1.name=_cf;
_d1.value=_d0;
};
if(_c5){
_ce("acctId",_c5);
}
if(_c6){
_ce("adGrpId",_c6);
_ce("objLevel",2);
}
if(_c7){
_ce("campaignId",_c7);
_ce("objLevel",1);
}
if(_c8){
_ce("termId",_c8);
}
if(_c9){
_ce("creativeId",_c9);
}
if(_ca){
_ce("status",_ca);
}
if(tab){
_ce("selectedTab",tab);
}
if(_cc){
_ce("alertLastUpdate",_cc);
}
_cd.submit();
}else{
alert(ALERT_REDIRECT_NO_ACCESS_FOR_LINK);
}
}
function submitAlert(){
if(arguments.length>0){
var _d2=document.createElement("form");
_d2.method="post";
_d2.action=arguments[0];
document.body.appendChild(_d2);
var _d3=function(_d4,_d5){
var _d6=document.createElement("input");
_d6.type="hidden";
_d2.appendChild(_d6);
_d6.name=_d4;
_d6.value=_d5;
};
for(i=1;i<arguments.length;i=i+2){
if(arguments[i]&&arguments[i+1]){
_d3(arguments[i],arguments[i+1]);
}
}
_d2.submit();
}
}
function toggleStatusNotification(_d7,_d8){
var div=document.getElementById(_d8);
if(_d7&&_d7.options&&div){
var _da=_d7.options[_d7.selectedIndex].value;
if(_da=="1"){
div.style.display="none";
}else{
if(_da=="2"){
div.style.display="block";
}
}
}
}
function fixCurrencyDecimalPlace(_db){
if(!isNaN(_db.value)&&_db.value.trim()!=""){
_db.value=new Number(_db.value).toFixed(MarketLocaleInfo.decimalPlaces);
}
}
function roundToWholeCurrency(_dc){
if(!isNaN(_dc.value)){
_dc.value=new Number(Math.round(_dc.value)).toFixed(2);
}
}
var SessionRefresh=new function(){
this.initialize=function(_dd,_de,_df){
this.TIMEOUT=_dd-_de;
this.TIMEOUT_ID="timeoutid";
this.timeLeft=this.TIMEOUT;
this.auto_refresh=_df||false;
this.activeFlag=false;
YAHOO.util.Event.addListener(window,"load",this._assignActiveFlagEvent,this);
ajaxEngine.registerPollingAction(this.TIMEOUT_ID,this._handleSessionRefresh,this,1);
this._startTimeoutTimer();
};
this._setActiveFlag=function(e,_e1){
_e1.activeFlag=true;
};
this._assignActiveFlagEvent=function(e,_e3){
YAHOO.util.Event.addListener(document,"click",_e3._setActiveFlag,_e3);
};
this._startTimeoutTimer=function(){
this._stopTimeoutTimer();
ajaxEngine.startPollingActionById(this.TIMEOUT_ID);
this.timeLeft=this.TIMEOUT;
};
this._stopTimeoutTimer=function(){
ajaxEngine.stopPollingActionById(this.TIMEOUT_ID);
};
this._handleSessionRefresh=function(){
this.timeLeft--;
if(this.timeLeft==0&&!this.activeFlag){
if(this.auto_refresh){
this._refreshSession();
}else{
this._stopTimeoutTimer();
var _e4=document.createElement("form");
document.body.appendChild(_e4);
_e4.method="post";
_e4.action="invalidateSession.do";
_e4.submit();
}
}else{
if(this.timeLeft==0&&this.activeFlag){
this._refreshSession();
}
}
};
this._refreshSession=function(){
var _e5=new AjaxRequest("refreshSession.do","refreshSession");
ajaxEngine.sendAjaxRequest(_e5);
this._stopTimeoutTimer();
this._startTimeoutTimer();
this.activeFlag=false;
};
};
function JSTimer(){
this._timer_running=false;
this._timer_id="";
this._initial=new Date();
this._result="";
this._duration=0;
}
JSTimer.prototype.startTimer=function(){
this._initial=new Date();
this._duration=0;
this._start_time=this._initial.getTime();
this.stopTimer();
};
JSTimer.prototype.stopTimer=function(){
var _e6=new Date();
var _e7=_e6.getTime();
this._duration=_e7-this._start_time;
};
function isInScope(_e8){
return Boolean(typeof _e8!="undefined"&&_e8);
}
var TextInsert=new function(){
this.textareaInsert=function(_e9,_ea){
if(_e9&&_ea){
if(_e9.setSelectionRange){
var _eb=_e9.selectionStart;
var _ec=_e9.selectionEnd;
_e9.value=_e9.value.substring(0,_eb)+_ea+_e9.value.substring(_ec);
}else{
if(document.selection){
var _ed=document.selection.createRange();
if(_ed.parentElement()==_e9){
var _ee=_ed.text=="";
_ed.text=_ea;
if(!_ee){
_ed.moveStart("character",-_ea.length);
_ed.select();
}
}else{
var _ef=_e9.caretPos;
if(_ef){
_e9.focus();
_ef.text=_ea;
_ef.select();
}else{
_e9.value=_e9.value+_ea;
}
}
}else{
_e9.value=_e9.value+_ea;
}
}
}
};
this.storeTextareaCaret=function(_f0){
if(_f0){
if(_f0.createTextRange){
_f0.caretPos=document.selection.createRange().duplicate();
}
}
};
this.textfieldInsert=function(_f1,_f2){
if(_f1,_f2){
this._replaceSelection(_f1,_f2);
}
};
this._setSelectionRange=function(_f3,_f4,_f5){
if(_f3.setSelectionRange){
_f3.setSelectionRange(_f4,_f5);
}else{
if(_f3.createTextRange){
var _f6=_f3.createTextRange();
_f6.collapse(true);
_f6.moveEnd("character",_f5);
_f6.moveStart("character",_f4);
_f6.select();
}
}
};
this._setCaretToPos=function(_f7,pos){
this._setSelectionRange(_f7,pos,pos);
};
this._replaceSelection=function(_f9,_fa){
if(_f9&&_fa){
if(_f9.setSelectionRange){
var _fb=_f9.selectionStart;
var _fc=_f9.selectionEnd;
_f9.value=_f9.value.substring(0,_fb)+_fa+_f9.value.substring(_fc);
if(_fb!=_fc){
this._setSelectionRange(_f9,_fb,(_fb+_fa.length));
}else{
this._setCaretToPos(_f9,(_fb+_fa.length));
}
}else{
if(document.selection){
var _fd=document.selection.createRange();
if(_fd.parentElement()==_f9){
var _fe=_fd.text=="";
_fd.text=_fa;
if(!_fe){
_fd.moveStart("character",-_fa.length);
_fd.select();
}
}else{
var _ff=_f9.caretPos;
if(_ff){
_f9.focus();
_ff.text=_fa;
_ff.select();
}else{
_f9.value=_f9.value+_fa;
}
}
}
}
}
};
};
function handleFormSubmit(frm,_101){
var _102=$(frm);
if(_102){
if(_102.getAttribute("isAlreadyClicked")!="yes"){
_102.setAttribute("isAlreadyClicked","yes");
if(_101){
var _103=_101.split(",");
var _104=_103.length;
for(var i=0;i<_104;i++){
var _106=$(_103[i]);
if(_106){
_106.disabled=true;
if(_106.type&&_106.type.toLowerCase()!="select"){
_106.className="disabledButton";
}
}
}
}
_102.submit();
}
}
}
function ingoreEnterEvent(e){
var _108=YAHOO.util.Event.getCharCode(e);
if(_108){
if(_108==13){
var _109=YAHOO.util.Event.getTarget(e);
if(_109&&_109.type){
if(_109.type.toLowerCase()!="textarea"){
YAHOO.util.Event.stopEvent(e);
return false;
}
}
}
}
return true;
}
function getImgUrl(path){
if(window.IMG_URL_PREFIX){
return IMG_URL_PREFIX+path;
}
return path;
}
function fixIE6ImgFlicker(){
var m=document.uniqueID&&document.compatMode&&!window.XMLHttpRequest&&document.execCommand;
try{
if(!!m){
m("BackgroundImageCache",false,true);
}
}
catch(oh){
}
}
function showProcessDialog(_10c){
if(!$("processDialog")){
var _10d=document.createElement("div");
_10d.id="processDialog";
_10d.className="popup";
_10d.style.display="";
_10d.style.width="500px";
var _10e=document.createElement("div");
_10e.className="popWhtBdr";
_10d.appendChild(_10e);
var _10f=document.createElement("div");
_10f.className="box";
_10e.appendChild(_10f);
var _110=document.createElement("div");
_110.className="content clearfloat retrieveInfo";
_110.style.paddingBottom="90px";
_110.innerHTML=_10c;
_10f.appendChild(_110);
document.body.appendChild(_10d);
}
dialog.createDialog(null,"processDialog",true);
}
function hideProcessDialog(){
var _111=$("processDialog");
if(_111){
_111.style.display="none;";
}
}
var agt=navigator.userAgent.toLowerCase();
var appVer=navigator.appVersion.toLowerCase();
var is_minor=parseFloat(appVer);
var is_major=parseInt(is_minor);
var is_opera=(agt.indexOf("opera")!=-1);
var is_opera2=(agt.indexOf("opera 2")!=-1||agt.indexOf("opera/2")!=-1);
var is_opera3=(agt.indexOf("opera 3")!=-1||agt.indexOf("opera/3")!=-1);
var is_opera4=(agt.indexOf("opera 4")!=-1||agt.indexOf("opera/4")!=-1);
var is_opera5=(agt.indexOf("opera 5")!=-1||agt.indexOf("opera/5")!=-1);
var is_opera6=(agt.indexOf("opera 6")!=-1||agt.indexOf("opera/6")!=-1);
var is_opera7=(agt.indexOf("opera 7")!=-1||agt.indexOf("opera/7")!=-1);
var is_opera8=(agt.indexOf("opera 8")!=-1||agt.indexOf("opera/8")!=-1);
var is_opera9=(agt.indexOf("opera 9")!=-1||agt.indexOf("opera/9")!=-1);
var is_opera5up=(is_opera&&!is_opera2&&!is_opera3&&!is_opera4);
var is_opera6up=(is_opera&&!is_opera2&&!is_opera3&&!is_opera4&&!is_opera5);
var is_opera7up=(is_opera&&!is_opera2&&!is_opera3&&!is_opera4&&!is_opera5&&!is_opera6);
var is_opera8up=(is_opera&&!is_opera2&&!is_opera3&&!is_opera4&&!is_opera5&&!is_opera6&&!is_opera7);
var is_opera9up=(is_opera&&!is_opera2&&!is_opera3&&!is_opera4&&!is_opera5&&!is_opera6&&!is_opera7&&!is_opera8);
var is_mac=(agt.indexOf("mac")!=-1);
var iePos=appVer.indexOf("msie");
if(iePos!=-1){
if(is_mac){
var iePos=agt.indexOf("msie");
is_minor=parseFloat(agt.substring(iePos+5,agt.indexOf(";",iePos)));
}else{
is_minor=parseFloat(appVer.substring(iePos+5,appVer.indexOf(";",iePos)));
}
is_major=parseInt(is_minor);
}
var is_konq=false;
var kqPos=agt.indexOf("konqueror");
if(kqPos!=-1){
is_konq=true;
is_minor=parseFloat(agt.substring(kqPos+10,agt.indexOf(";",kqPos)));
is_major=parseInt(is_minor);
}
var is_getElementById=(document.getElementById)?"true":"false";
var is_getElementsByTagName=(document.getElementsByTagName)?"true":"false";
var is_documentElement=(document.documentElement)?"true":"false";
var is_safari=((agt.indexOf("safari")!=-1)&&(agt.indexOf("mac")!=-1))?true:false;
var is_khtml=(is_safari||is_konq);
var is_nav=((agt.indexOf("mozilla")!=-1)&&(agt.indexOf("spoofer")==-1)&&(agt.indexOf("compatible")==-1)&&(agt.indexOf("opera")==-1)&&(agt.indexOf("webtv")==-1)&&(agt.indexOf("hotjava")==-1)&&(agt.indexOf("navigator")!=-1));
var is_gecko=((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;
var is_gver=0;
if(is_gecko){
is_gver=navigator.productSub;
}
var is_fb=((agt.indexOf("mozilla/5")!=-1)&&(agt.indexOf("spoofer")==-1)&&(agt.indexOf("compatible")==-1)&&(agt.indexOf("opera")==-1)&&(agt.indexOf("webtv")==-1)&&(agt.indexOf("hotjava")==-1)&&(is_gecko)&&(navigator.vendor=="Firebird"));
var is_fx=((agt.indexOf("mozilla/5")!=-1)&&(agt.indexOf("spoofer")==-1)&&(agt.indexOf("compatible")==-1)&&(agt.indexOf("opera")==-1)&&(agt.indexOf("webtv")==-1)&&(agt.indexOf("hotjava")==-1)&&(is_gecko)&&((navigator.vendor=="Firefox")||(agt.indexOf("firefox")!=-1)));
var is_moz=((agt.indexOf("mozilla/5")!=-1)&&(agt.indexOf("spoofer")==-1)&&(agt.indexOf("compatible")==-1)&&(agt.indexOf("opera")==-1)&&(agt.indexOf("webtv")==-1)&&(agt.indexOf("hotjava")==-1)&&(is_gecko)&&(!is_fb)&&(!is_fx)&&((navigator.vendor=="")||(navigator.vendor=="Mozilla")||(navigator.vendor=="Debian")));
if((is_moz)||(is_fb)||(is_fx)){
var is_moz_ver=(navigator.vendorSub)?navigator.vendorSub:0;
if(is_fx&&!is_moz_ver){
is_moz_ver=agt.indexOf("firefox/");
is_moz_ver=agt.substring(is_moz_ver+8);
is_moz_ver=parseFloat(is_moz_ver);
}
if(!(is_moz_ver)){
is_moz_ver=agt.indexOf("rv:");
is_moz_ver=agt.substring(is_moz_ver+3);
is_paren=is_moz_ver.indexOf(")");
is_moz_ver=is_moz_ver.substring(0,is_paren);
}
is_minor=is_moz_ver;
is_major=parseInt(is_moz_ver);
}
var is_fb_ver=is_moz_ver;
var is_fx_ver=is_moz_ver;
var is_ie=((iePos!=-1)&&(!is_opera)&&(!is_khtml));
var is_ie3=(is_ie&&(is_major<4));
var is_ie4=(is_ie&&is_major==4);
var is_ie4up=(is_ie&&is_minor>=4);
var is_ie5=(is_ie&&is_major==5);
var is_ie5up=(is_ie&&is_minor>=5);
var is_ie5_5=(is_ie&&(agt.indexOf("msie 5.5")!=-1));
var is_ie5_5up=(is_ie&&is_minor>=5.5);
var is_ie6=(is_ie&&is_major==6);
var is_ie6up=(is_ie&&is_minor>=6);
var is_ie7=(is_ie&&is_major==7);
var is_ie7up=(is_ie&&is_minor>=7);
var isGradeABrowser=((!is_nav)||is_opera9up||is_safari||((!is_nav)&&is_fx&&(is_fx_ver>=1.5))||is_ie6up);
function disableApplication(_112,_113){
YAHOO.namespace("ysm.detect");
if(!isGradeABrowser){
YAHOO.ysm.detect.panel2=new YAHOO.widget.Panel("panel2",{width:"300px",visible:false,draggable:false,close:false,fixedcenter:true,modal:true});
YAHOO.ysm.detect.panel2.setHeader(_112);
YAHOO.ysm.detect.panel2.setBody(_113);
YAHOO.ysm.detect.panel2.render(document.body);
YAHOO.ysm.detect.panel2.show();
return true;
}
return false;
}

var SearchUtils=new function(){
this.InvalidIntNumber="{Please enter a valid integer.}";
this.InvalidFloatNumber="{Please enter a valid number.}";
this.InvalidIntRange="{Please enter a valid integer range.}";
this.InvalidFloatRange="{Please enter a valid number range.}";
};
function defaultSearch(_1,_2,_3,_4,_5,_6,_7,_8){
if(_6&&document.getElementById(_6)){
var _9=_5.split();
var _a=document.getElementById(_6).value;
var _b=ajaxEngine.createAjaxRequest(_2,_3);
if(_4){
_b.addAjaxRegion(_4,"AREA");
}
for(var i=0;i<_9.length;i++){
_b.addAjaxParameter(_9[i]+"_Input",_a);
_b.addAjaxParameter(_9[i]+"_Select","CONTAINS");
_b.addAjaxParameter(_9[i]+"_DbProperty",_9[i]);
}
_b.addAjaxParameter("advancedSearch","true");
if(_7&&_8){
_b.addAjaxParameter(_7,"true");
_b.addAjaxParameter(_8,"true");
}else{
_b.addAjaxParameter("userSearch","true");
_b.addAjaxParameter("simpleSearch","true");
}
ajaxEngine.sendAjaxRequest(_b);
clearAdvSearchDiv(_1);
}
}
function refreshFilterDiv(_d,_e,_f,_10,_11){
var _12=document.getElementById(_f);
if(_11.getSearchType()=="simple"){
if(_12){
_12.style.visibility="visible";
}
}else{
if(_11.getSearchType()=="advanced"){
var _13=document.getElementById(_10);
if(_13){
_13.innerHTML=_11.getFilterStr();
}
var _14=document.getElementById(_d);
if(_14){
_14.style.display="none";
}
var _15=document.getElementById(_e);
if(_15){
_15.style.display="block";
}
if(_12){
_12.style.visibility="visible";
}
}else{
if(_11.getSearchType()=="default"){
var _13=document.getElementById(_10);
if(_13){
_13.innerHTML="";
}
var _14=document.getElementById(_d);
if(_14){
_14.style.display="block";
}
var _15=document.getElementById(_e);
if(_15){
_15.style.display="none";
}
if(_12){
_12.style.visibility="hidden";
}
}
}
}
}
function popAdvSearch(_16,ds,url,_19,_1a,_1b,_1c,_1d,_1e,_1f,_20){
if(_16&&ds){
if(ds.getFilterContent()){
if(document.getElementById(_16)==null){
generateAdvSearchDialog(_16,url,_19,_1a,_1b,_1c,_1d,_1e,_1f,_20);
}
var _21=document.getElementById(_16);
if(!_21.getAttribute("loaded")){
_21.innerHTML=ds.getFilterContent();
if(ds.getDefaultFilterFields()){
var _22=ds.getDefaultFilterFields().split(",");
for(var i=0;i<_22.length;i++){
AjaxErrors.addError(_22[i],_22[i]+"_errDiv");
AjaxErrors.setCallback(_19,dialog.createDialog,[null,_16+"_dialog",true],dialog);
}
}
_21.setAttribute("loaded","true");
}
dialog.createDialog(null,_16+"_dialog",true);
}
}
}
function generateAdvSearchDialog(_24,url,_26,_27,_28,_29,_2a,_2b,_2c,_2d){
if(_29==null){
_29="Cancel";
}
if(_2a==null){
_2a="Submit";
}
var _2e=document.createElement("div");
_2e.className="popup";
_2e.id=_24+"_dialog";
_2e.style.width="480px";
_2e.style.display="none";
var _2f=new Array();
_2f.push("<div class='popWhtBdr'><div class='box'>");
_2f.push("<div class='popTop clearfloat sectBG'><div class='popClose'></div>");
_2f.push("<div class='popHdr' id='sText_advSearch'>");
if(_28){
_2f.push(_28);
}else{
_2f.push("&nbsp;");
}
_2f.push("</div></div>");
_2f.push("<form name='"+_24+"_form' id='"+_24+"_form' >");
if(_2b){
_2f.push("<input type='hidden' name='ajax_error_bundle' value='"+_2b+"' />");
}
_2f.push("<div class='content  clearfloat' id='"+_24+"'></div>");
_2f.push("<div class='popAction sectBG'>");
var txt=_24==null?"null":"\""+_24.replace("_div","_text")+"\"";
_2f.push("<input value='"+_29+"' class='cnclPrv' type='button'  id='btn_advSearchPopCancel' onclick='dialog.hide();' />&nbsp;&nbsp;");
_2f.push("<input value='"+_2a+"' class='button' type='button'  id='btn_advSearchPopSubmit' name='btn_advSearchPopSubmit' onclick='submitSearch(this.form,\"");
_2f.push(url+"\",\""+_26+"\","+txt+"");
if(_2c&&_2d){
_2f.push(",\""+_2c+"\"");
_2f.push(",\""+_2d+"\"");
}else{
_2f.push(","+null);
_2f.push(","+null);
}
if(_27){
_2f.push(",\""+_27+"\"");
}
_2f.push(");' />");
_2f.push("</div></form></div></div>");
_2e.innerHTML=_2f.join("");
document.body.appendChild(_2e);
}
function clearAdvSearchDiv(_31){
if(_31){
var frm=document.getElementById(_31+"_form");
AjaxErrors.clearAndHideErrors();
if(frm&&frm.reset){
frm.reset();
for(var i=0;i<frm.elements.length;i++){
if(frm.elements[i].className=="error"){
frm.elements[i].className="";
}
}
}
if(frm&&frm.elements){
for(var i=0;i<frm.elements.length;i++){
if(frm.elements[i].getAttribute("hiddenref")!=null){
var _34=document.getElementById(frm.elements[i].getAttribute("hiddenref"));
if(_34!=null){
InputFormatter._format(frm.elements[i]);
}
}
}
}
}
}
function clearSearch(url,_36,_37,_38,_39,_3a,_3b){
dialog.hide();
clearAdvSearchDiv(_39);
if(_38&&document.getElementById(_38)){
document.getElementById(_38).value="";
}
var _3c=ajaxEngine.createAjaxRequest(url,_36);
if(_37){
_3c.addAjaxRegion(_37,"AREA");
}
_3c.addAjaxParameter("function","cancelled");
if(_3a&&_3b){
_3c.addAjaxParameter(_3a,"false");
_3c.addAjaxParameter(_3b,"false");
}else{
_3c.addAjaxParameter("userSearch","false");
_3c.addAjaxParameter("simpleSearch","false");
}
ajaxEngine.sendAjaxRequest(_3c);
}
function submitSearch(frm,url,_3f,_40,_41,_42,_43){
if(checkErrors(frm)){
return false;
}
dialog.hide();
AjaxErrors.clearAndHideErrors();
for(var i=0;i<frm.elements.length;i++){
if(frm.elements[i].className=="error"){
frm.elements[i].className="";
}
}
var _45=ajaxEngine.createAjaxRequest(url,_3f);
if(_43){
_45.addAjaxRegion(_43,"AREA");
}
_45.addAjaxFormId(frm.id);
_45.addAjaxParameter("advancedSearch","true");
if(_41!=null&&_42!=null){
_45.addAjaxParameter(_41,"true");
_45.addAjaxParameter(_42,"false");
}else{
_45.addAjaxParameter("userSearch","true");
_45.addAjaxParameter("simpleSearch","false");
}
if(_40){
var _46=document.getElementById(_40);
if(_46){
_46.value="";
}
}
ajaxEngine.sendAjaxRequest(_45);
}
function checkErrors(frm){
for(var i=0;i<frm.elements.length;i++){
var _49=document.getElementById(frm.elements[i].name+"_errDiv");
if(_49!=null&&_49.style.display=="block"){
return true;
}
}
return false;
}
function adjustPrecision(_4a,_4b){
if(_4a==null){
return;
}
var f=_4a;
var t=document.getElementById(f.id.indexOf("from_")!=-1?f.id.replace("from_","to_"):f.id.replace("to_","from_"));
if("1"==_4a.getAttribute("formattertype")){
var pre=_4a.getAttribute("precision");
InputFormatter._format(f);
if(!InputFormatter.isValidNumberEntry(f.value,pre==null?2:pre)){
return;
}
if(!InputFormatter.isValidNumberEntry(t.value,pre==null?2:pre)){
InputFormatter._format(t);
return;
}
}else{
if("2"==_4a.getAttribute("formattertype")){
InputFormatter._format(f);
if(!InputFormatter.isValidCurrencyEntry(f.value)){
return;
}
if(!InputFormatter.isValidCurrencyEntry(t.value)){
InputFormatter._format(t);
return;
}
}else{
return;
}
}
var _4f=null;
if(_4a.getAttribute("hiddenref")==null){
_4f=_4a;
}else{
_4f=document.getElementById(_4a.getAttribute("hiddenref"));
}
if(_4f==null){
return;
}
var _50=_4f.name+"_errDiv";
var _51=document.getElementById(_50);
if(_51){
var frm=document.getElementById(_4f.name+"_frm_rawData");
var to=document.getElementById(_4f.name+"_end_rawData");
if(frm&&to){
var _54=frm.value.trim();
var _55=to.value.trim();
if((_54!=""&&isNaN(_54))||(_55!=""&&isNaN(_55))){
_51.style.display="block";
_51.className="fieldError";
if(_4b>0){
_51.innerHTML=SearchUtils.InvalidFloatNumber;
}else{
_51.innerHTML=SearchUtils.InvalidIntNumber;
}
return 0;
}else{
if(_54!=""&&_55!=""&&(!isNaN(_54))&&(!isNaN(_55))){
if(parseFloat(_54)>parseFloat(_55)){
_51.style.display="block";
_51.className="fieldError";
if(_4b>0){
_51.innerHTML=SearchUtils.InvalidFloatRange;
}else{
_51.innerHTML=SearchUtils.InvalidIntRange;
}
return 0;
}
}
}
}
_51.style.display="none";
}
}

Object.prototype.clone=function(_1){
var _2=new this.constructor();
if(_1){
for(var k in this){
if(this[k] instanceof Function){
continue;
}
if(this[k].isCloneable()){
_2[k]=this[k].clone();
continue;
}else{
return null;
}
}
}else{
for(var k in this){
if(this[k] instanceof Function){
continue;
}
_2[k]=this[k];
}
}
return _2;
};
Object.prototype.isCloneable=function(){
return true;
};
Object.prototype.compareTo=function(_4){
return this.hashCode()==_4.hashCode()?0:(this.hashCode()>_4.hashCode()?1:-1);
};
Object.prototype.toArray=function(){
throw new MethodNotSupportedException("Object does not support this method.");
};
Object.prototype.toPropertyList=function(_5,_6){
var _7="<dict>";
_6=_6?_6:new Function("return false;");
for(var k in this){
if((this[k] instanceof Function)||(_6(k))){
continue;
}
if(_5){
if(this[k].isSerializable){
_7+="<key>"+k+"</key>"+this[k].serialize(_6);
}
}else{
if(k.isConvertable("propertyList")){
_7+="<key>"+k+"</key>"+this[k].toPropertyList(false,_6);
}
}
}
_7+="</dict>";
return _7;
};
Object.prototype.toXMLString=function(){
throw new MethodNotSupportedException("Object does not support this method.");
};
Object.prototype.isConvertable=function(_9){
switch(_9){
case "propertyList":
return true;
default:
return false;
}
};
Object.prototype.hashCode=function(){
var _a=this.toString();
var _b=0;
var _c=0;
for(var i=0;i<_a.length;i++){
_c=31*_c+_a.charCodeAt(_b++);
}
return _c;
};
Object.prototype.equivalent=function(_e){
return ((_e.constructor===this.constructor)?((this.hashCode()==_e.hashCode())?true:false):false);
};
Object.prototype.equals=function(_f){
return _f===this?true:false;
};
Object.prototype.setValueForKey=function(_10,_11){
};
Object.prototype.valueForKey=function(_12){
};
Object.prototype.className="Object";
Object.prototype.oid="";
Object.prototype.isSerializable=true;
Object.prototype.serialize=function(_13){
return this.toPropertyList(true,_13);
};
Object.deserialize=function(_14){
_14.normalize();
var _15;
for(var i=0;i<_14.childNodes.length;i++){
if((_14.childNodes[i].nodeName.toUpperCase()=="KEY")&&(_14.childNodes[i].firstChild.nodeValue=="className")){
_15=eval("new "+_14.childNodes[i+1].firstChild.nodeValue+"();");
break;
}
}
for(var i=0;i<_14.childNodes.length;i++){
if(_14.childNodes[i].nodeName.toUpperCase()=="KEY"){
if(_14.childNodes[i].firstChild.nodeValue=="className"){
i++;
continue;
}
switch(_14.childNodes[i+1].nodeName){
case "array":
_15[_14.childNodes[i].firstChild.nodeValue]=Array.deserialize(_14.childNodes[i+1]);
break;
case "string":
_15[_14.childNodes[i].firstChild.nodeValue]=String.deserialize(_14.childNodes[i+1]);
break;
case "real":
_15[_14.childNodes[i].firstChild.nodeValue]=Number.deserialize(_14.childNodes[i+1]);
break;
case "integer":
_15[_14.childNodes[i].firstChild.nodeValue]=Number.deserialize(_14.childNodes[i+1]);
break;
case "date":
_15[_14.childNodes[i].firstChild.nodeValue]=Date.deserialize(_14.childNodes[i+1]);
break;
case ("true"||"false"):
_15[_14.childNodes[i].firstChild.nodeValue]=Boolean.deserialize(_14.childNodes[i+1]);
break;
case "dict":
_15[_14.childNodes[i].firstChild.nodeValue]=Object.deserialize(_14.childNodes[i+1]);
break;
default:
}
i++;
}
}
return _15;
};
Array.prototype.className="Array";
Array.prototype.count=function(){
var _17=0;
for(var i=0;i<this.length;i++){
if(this[i]!=undefined){
_17++;
}
}
return _17;
};
Array.prototype.isEmpty=function(){
for(var i=0;i<this.length;i++){
if((this[i]!=undefined)&&(this[i]!=null)){
return false;
}
}
return true;
};
Array.prototype.isSparse=function(){
return this.count()==this.length?false:true;
};
Array.prototype.pack=function(){
for(var i=this.length-1;i>-1;i--){
if(this[i]==undefined){
this.splice(i,1);
}
}
};
Array.prototype.clone=function(_1b){
var _1c=new Array(this.length);
if(_1b){
for(var i=0;i<this.length;i++){
_1c[i]=this[i].isClonable?this[i].clone:null;
}
return _1c;
}else{
for(var i=0;i<this.length;i++){
_1c[i]=this[i];
}
return _1c;
}
};
Array.prototype.isClonable=function(){
return true;
};
Array.prototype.indexOf=function(_1e,_1f){
var to=this.length;
var _21=0;
if(_1f!=(undefined&&null)){
_21+=_1f>0?_1f:0;
to+=((_1f<0)&&(to+_1f>0))?_1f:0;
}
for(;_21<to;_21++){
if(this[_21]===_1e){
return _21;
}
}
return -1;
};
String.prototype.className="String";
String.prototype.trim=function(){
return this.replace(/^\s+|\s+$/g,"");
};
String.prototype.toBoolean=function(){
if((this=="false")||(this=="no")||(this=="0")||(this=="")){
return new Boolean(false);
}
return new Boolean(true);
};
function Collection(){
this.dataStructure=new Array();
this.cursor=-1;
}
Collection.prototype.add=function(_22){
this.dataStructure.push(_22);
};
Collection.prototype.addAll=function(_23){
for(var i=0;i<_23.length;i++){
this.add(_23[i]);
}
};
Collection.prototype.clear=function(){
this.dataStructure.length=0;
};
Collection.prototype.contains=function(_25){
try{
return Boolean(this.indexOf(_25)+1);
}
catch(e){
}
return false;
};
Collection.prototype.containsAll=function(_26){
for(var i=0;i<_26.length;i++){
if(!this.contains(_26[i])){
return false;
}
}
return true;
};
Collection.prototype.indexOf=function(_28){
return this.dataStructure.indexOf(_28);
};
Collection.prototype.isEmpty=function(){
return this.dataStructure.count>0?false:true;
};
Collection.prototype.remove=function(_29){
var _2a=new Iterator(this);
while(_2a.hasNext()){
if(_2a.next().equals(_29)){
return void _2a.remove();
}
}
throw new NoSuchElementException("Object does not exist in Map");
};
Collection.prototype.removeAll=function(_2b){
for(var i=0;i<_2b.length;i++){
this.remove(_2b[i]);
}
};
Collection.prototype.retainAll=function(_2d){
this.clear();
this.addAll(_2d);
};
Collection.prototype.size=function(){
return this.dataStructure.length;
};
Collection.prototype.toString=function(){
var k="";
for(var i=0;i<this.dataStructure.length;i++){
k+=this.dataStructure[i].toString()+", ";
}
return k;
};
Collection.prototype.className="Collection";
Collection.prototype.toArray=function(){
var _30=new Array();
var _31=new Iterator(this);
while(_31.hasNext()){
_30.push(_31.next());
}
return _30;
};
function Iterator(_32){
if(!(_32 instanceof Collection||_32 instanceof Map||_32 instanceof Set||_32 instanceof SortedMap||_32 instanceof SortedSet)){
throw new illegalArgumentException("Source object must be a Collections Framework object.");
}
this.cursor=-1;
this.collection=_32;
this.removed=false;
}
Iterator.prototype.next=function(){
if(!this.hasNext){
throw new NoSuchElementException("There are no additional elements in the iterator.");
}
this.removed=false;
return this.collection.dataStructure[++this.cursor];
};
Iterator.prototype.value=function(){
if(this.removed){
throw new IllegalStateException("Element has been removed");
}
return dataStructure[this.cursor];
};
Iterator.prototype.hasNext=function(){
return (this.cursor+1)>=this.collection.dataStructure.length?false:true;
};
Iterator.prototype.remove=function(){
if(this.removed){
throw new IllegalStateException("Remove operation has already been called.");
}
if(this.cursor<0){
throw new IllegalStateException("The iterator is not initialized. Call next() to begin traversal.");
}
this.collection.dataStructure.splice(this.cursor,1);
this.cursor--;
this.removed=true;
};
Iterator.prototype.reset=function(){
this.cursor=-1;
this.removed=false;
};
Iterator.prototype.className="Iterator";
Iterator.prototype.clone=function(_33){
throw new MethodNotSupportedException("Comparators do not support cloning");
};
Iterator.prototype.isClonable=function(){
return false;
};
Iterator.prototype.toArray=function(){
throw new MethodNotSupportedException("Object does not support this method.");
};
Iterator.prototype.toPropertyList=function(){
throw new MethodNotSupportedException("Object does not support this method.");
};
Iterator.prototype.toXMLString=function(){
throw new MethodNotSupportedException("Object does not support this method.");
};
Iterator.prototype.isConvertable=function(_34){
switch(_34){
default:
return false;
}
};
Iterator.prototype.isSerializable=false;
Iterator.prototype.serialize=function(){
throw new MethodNotSupportedException("Comparator does not support this method");
};
Iterator.deserialize=function(){
throw new MethodNotSupportedException("Comparator does not support this method");
};
function Map(){
this.cursor=-1;
this.dataStructure=new Array();
}
Map.prototype.clear=function(){
this.dataStructure.length=0;
};
Map.prototype.containsKey=function(key){
try{
return Boolean(this.indexOfKey(key)+1);
}
catch(e){
return false;
}
};
Map.prototype.containsValue=function(_36){
var _37=new Iterator(this);
while(_37.hasNext()){
if(_37.next().getValue.equals(_36)){
return true;
}
}
return false;
};
Map.prototype.copy=function(){
var _38=new Iterator(this);
var col=new this.prototype.constructor();
while(_38.hasNext()){
col.add(_38.next());
}
return col;
};
Map.prototype.disjoint=function(_3a){
var _3b=new Iterator(_3a);
while(_3b.hasNext()){
if(this.containsKey(_3b.next().getKey())){
return false;
}
}
return true;
};
Map.prototype.entrySet=function(){
return (new Set().dataStructure=this.dataStructure);
};
Map.prototype.keySet=function(){
var _3c=new Set();
var _3d=new Iterator(this);
while(_3d.hasNext()){
_3c.add(_3d.next().getKey());
}
return _3c;
};
Map.prototype.frequency=function(_3e){
var _3f=new Iterator(this);
var _40=0;
while(_3f.hasNext()){
if(_3f.next().getValue().equals(_3e)){
_40++;
}
}
return _40;
};
Map.prototype.get=function(key){
return this.dataStructure[this.indexOfKey(key)].value;
};
Map.prototype.indexOfKey=function(key){
for(var i=0;i<this.dataStructure.length;i++){
if(this.dataStructure[i].key==key){
this.cursor=i;
return i;
}
}
this.cursor=i;
throw new IllegalArgumentException("Key does not exist in Map");
};
Map.prototype.put=function(key,_45){
if((!key instanceof String)&&(!key instanceof Number)){
throw new IllegalArgumentException("Key must be a String or Number");
}
try{
return void this.dataStructure[this.indexOfKey(key)].setValue(_45);
}
catch(e){
}
this.dataStructure[this.dataStructure.length]=new MapEntry(key,_45);
};
Map.prototype.putAll=function(map){
if(!(map instanceof Map)){
throw new IllegalArgumentException("Function argument must be an instance of Map");
}
var _47=new Iterator(map);
while(_47.hasNext()){
this.put(_47.next().getKey(),_47.value().getValue());
}
};
Map.prototype.remove=function(key){
if((typeof key!="String")&&(typeof key!="Number")){
throw new IllegalArgumentException("Key must be a String or Number");
}
var _49=new Iterator(this);
while(_49.hasNext()){
if(_49.next().getKey().equals(key)){
return void _49.remove();
}
}
throw new NoSuchElementException("Key does not exist in Map");
};
Map.prototype.size=function(){
return this.dataStructure.length;
};
Map.prototype.toString=function(){
var k="";
for(var i=0;i<this.dataStructure.length;i++){
k+=this.dataStructure[i].toString()+", ";
}
return k;
};
Map.prototype.values=function(){
var _4c=new Iterator(this);
var _4d=new Collection();
while(_4c.hasNext()){
_4d.add(_4c.next().getValue());
}
return _4d;
};
Map.prototype.className="Map";
Map.prototype.isClonable=function(){
return false;
};
Map.prototype.toArray=function(){
throw new MethodNotSupportedException("Object does not support this method.");
};
function MapEntry(_4e,_4f){
this.key=_4e;
this.value=_4f;
}
MapEntry.prototype.equals=function(_50){
return _50 instanceof MapEntry?(this.hashCode==_50.hashCode):false;
};
MapEntry.prototype.getKey=function(){
return this.key;
};
MapEntry.prototype.getValue=function(){
return this.value;
};
MapEntry.prototype.setValue=function(_51){
this.value=_51;
};
MapEntry.prototype.toString=function(){
return new String(this.key+": "+this.value);
};
MapEntry.prototype.serialize=function(){
};
MapEntry.prototype.deserialize=function(){
};
MapEntry.prototype.className="MapEntry";
MapEntry.prototype.toArray=function(){
throw new MethodNotSupportedException("Object does not support this method.");
};
DecimalFormatter.prototype=new Object();
DecimalFormatter.prototype.constructor=DecimalFormatter;
DecimalFormatter.prototype.className="DecimalFormatter";
function DecimalFormatter(_52,_53,_54){
this.formatter=NumberFormat.getInstance(_53,_54,_52);
}
DecimalFormatter.prototype.formatCurrency=function(num,_56,_57){
if(!num||isNaN(num)){
num="0";
}
this.formatter.setNegativeFormat(this.formatter.PARENTHESIS);
this.formatter.setCurrency(_57==true);
this.formatter.setNumber(num);
if(_56!=null&&(!isNaN(_56))){
var _58=this.formatter.places;
}
this.formatter.setPlaces(_56==null?2:_56,false);
var _59=this.formatter.toFormatted();
if(_56!=null&&(!isNaN(_56))){
this.formatter.setPlaces(_58,true);
}
this.formatter.setCurrency(false);
this.formatter.setNegativeFormat(this.formatter.LEFT_DASH);
return _59;
};
DecimalFormatter.prototype.formatNumber=function(num,_5b){
if(isNaN(num)){
num="0";
}
this.formatter.setNumber(num);
if(_5b!=null&&(!isNaN(_5b))){
var _5c=this.formatter.places;
}
this.formatter.setPlaces(_5b==null?2:_5b,false);
var _5d=this.formatter.toFormatted();
if(_5b!=null&&(!isNaN(_5b))){
this.formatter.setPlaces(_5c,true);
}
return _5d;
};
DecimalFormatter.prototype.formatPercentage=function(num){
if(isNaN(num)){
num="0";
}
num=Math.round(num);
if(num>100){
num=100;
}
if(num<0){
num=0;
}
num+="%";
return num;
};
DecimalFormatter.prototype._alertError=function(_5f,e){
if(e.description==null){
alert(_5f+" Exception: "+e.message);
}else{
alert(_5f+" Exception: "+e.description);
}
};
DecimalFormatter.prototype.parse=function(num,_62){
if(num==null){
return null;
}
var _63=this.formatter.hasSeparators;
var _64=this.formatter.decimalValue;
var _65=this.formatter.separatorValue;
var _66=this.formatter.inputDecimalValue;
this.formatter.setInputDecimal(_64);
this.formatter.setSeparators(false,",",".");
this.formatter.setNumber(num);
if(_62!=null&&(!isNaN(_62))){
var _67=this.formatter.places;
}
this.formatter.setPlaces(_62==null?2:_62,false);
var _68=this.formatter.toFormatted();
if(_62!=null&&(!isNaN(_62))){
this.formatter.setPlaces(_67,true);
}
this.formatter.setInputDecimal(_66);
this.formatter.setSeparators(_63,_65,_64);
return new Number(_68);
};
function NumberFormat(num,_6a){
this.VERSION="Number Format v1.5.4";
this.COMMA=",";
this.PERIOD=".";
this.DASH="-";
this.LEFT_PAREN="(";
this.RIGHT_PAREN=")";
this.LEFT_OUTSIDE=0;
this.LEFT_INSIDE=1;
this.RIGHT_INSIDE=2;
this.RIGHT_OUTSIDE=3;
this.LEFT_DASH=0;
this.RIGHT_DASH=1;
this.PARENTHESIS=2;
this.NO_ROUNDING=-1;
this.num;
this.numOriginal;
this.hasSeparators=false;
this.separatorValue;
this.inputDecimalValue;
this.decimalValue;
this.negativeFormat;
this.negativeRed;
this.hasCurrency;
this.currencyPosition;
this.currencyValue;
this.places;
this.roundToPlaces;
this.truncate;
this.setNumber=setNumberNF;
this.toUnformatted=toUnformattedNF;
this.setInputDecimal=setInputDecimalNF;
this.setSeparators=setSeparatorsNF;
this.setCommas=setCommasNF;
this.setNegativeFormat=setNegativeFormatNF;
this.setNegativeRed=setNegativeRedNF;
this.setCurrency=setCurrencyNF;
this.setCurrencyPrefix=setCurrencyPrefixNF;
this.setCurrencyValue=setCurrencyValueNF;
this.setCurrencyPosition=setCurrencyPositionNF;
this.setPlaces=setPlacesNF;
this.toFormatted=toFormattedNF;
this.toPercentage=toPercentageNF;
this.getOriginal=getOriginalNF;
this.moveDecimalRight=moveDecimalRightNF;
this.moveDecimalLeft=moveDecimalLeftNF;
this.getRounded=getRoundedNF;
this.preserveZeros=preserveZerosNF;
this.justNumber=justNumberNF;
this.expandExponential=expandExponentialNF;
this.getZeros=getZerosNF;
this.moveDecimalAsString=moveDecimalAsStringNF;
this.moveDecimal=moveDecimalNF;
this.addSeparators=addSeparatorsNF;
if(_6a==null){
this.setNumber(num,this.PERIOD);
}else{
this.setNumber(num,_6a);
}
this.setCommas(true);
this.setNegativeFormat(this.LEFT_DASH);
this.setNegativeRed(false);
this.setCurrency(false);
this.setCurrencyPrefix("$");
this.setPlaces(2);
}
function setInputDecimalNF(val){
this.inputDecimalValue=val;
}
function setNumberNF(num,_6d){
if(_6d!=null){
this.setInputDecimal(_6d);
}
this.numOriginal=num;
this.num=this.justNumber(num);
}
function toUnformattedNF(){
return (this.num);
}
function getOriginalNF(){
return (this.numOriginal);
}
function setNegativeFormatNF(_6e){
this.negativeFormat=_6e;
}
function setNegativeRedNF(_6f){
this.negativeRed=_6f;
}
function setSeparatorsNF(isC,_71,_72){
this.hasSeparators=isC;
if(_71==null){
_71=this.COMMA;
}
if(_72==null){
_72=this.PERIOD;
}
if(_71==_72){
this.decimalValue=(_72==this.PERIOD)?this.COMMA:this.PERIOD;
}else{
this.decimalValue=_72;
}
this.separatorValue=_71;
}
function setCommasNF(isC){
this.setSeparators(isC,this.COMMA,this.PERIOD);
}
function setCurrencyNF(isC){
this.hasCurrency=isC;
}
function setCurrencyValueNF(val){
this.currencyValue=val;
}
function setCurrencyPrefixNF(cp){
this.setCurrencyValue(cp);
this.setCurrencyPosition(this.LEFT_OUTSIDE);
}
function setCurrencyPositionNF(cp){
this.currencyPosition=cp;
}
function setPlacesNF(p,tr){
this.roundToPlaces=!(p==this.NO_ROUNDING);
this.truncate=(tr!=null&&tr);
this.places=(p<0)?0:p;
}
function addSeparatorsNF(_7a,inD,_7c,sep){
_7a+="";
var _7e=_7a.indexOf(inD);
var _7f="";
if(_7e!=-1){
_7f=_7c+_7a.substring(_7e+1,_7a.length);
_7a=_7a.substring(0,_7e);
}
var rgx=/(\d+)(\d{3})/;
while(rgx.test(_7a)){
_7a=_7a.replace(rgx,"$1"+sep+"$2");
}
return _7a+_7f;
}
function toFormattedNF(){
var pos;
var _82=this.num;
var _83;
var _84=new Array(2);
if(this.roundToPlaces){
_82=this.getRounded(_82);
_83=this.preserveZeros(Math.abs(_82));
}else{
_83=this.expandExponential(Math.abs(_82));
}
if(this.hasSeparators){
_83=this.addSeparators(_83,this.PERIOD,this.decimalValue,this.separatorValue);
}else{
_83=_83.replace(new RegExp("\\"+this.PERIOD),this.decimalValue);
}
var c0="";
var n0="";
var c1="";
var n1="";
var n2="";
var c2="";
var n3="";
var c3="";
var _8d=(this.negativeFormat==this.PARENTHESIS)?this.LEFT_PAREN:this.DASH;
var _8e=(this.negativeFormat==this.PARENTHESIS)?this.RIGHT_PAREN:this.DASH;
if(this.currencyPosition==this.LEFT_OUTSIDE){
if(_82<0){
if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){
n1=_8d;
}
if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){
n2=_8e;
}
}
if(this.hasCurrency){
c0=this.currencyValue;
}
}else{
if(this.currencyPosition==this.LEFT_INSIDE){
if(_82<0){
if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){
n0=_8d;
}
if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){
n3=_8e;
}
}
if(this.hasCurrency){
c1=this.currencyValue;
}
}else{
if(this.currencyPosition==this.RIGHT_INSIDE){
if(_82<0){
if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){
n0=_8d;
}
if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){
n3=_8e;
}
}
if(this.hasCurrency){
c2=this.currencyValue;
}
}else{
if(this.currencyPosition==this.RIGHT_OUTSIDE){
if(_82<0){
if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){
n1=_8d;
}
if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){
n2=_8e;
}
}
if(this.hasCurrency){
c3=this.currencyValue;
}
}
}
}
}
_83=c0+n0+c1+n1+_83+n2+c2+n3+c3;
if(this.negativeRed&&_82<0){
_83="<font color=\"red\">"+_83+"</font>";
}
return (_83);
}
function toPercentageNF(){
nNum=this.num*100;
nNum=this.getRounded(nNum);
return nNum+"%";
}
function getZerosNF(_8f){
var _90="";
var i;
for(i=0;i<_8f;i++){
_90+="0";
}
return _90;
}
function expandExponentialNF(_92){
if(isNaN(_92)){
return _92;
}
var _93=parseFloat(_92)+"";
var _94=_93.toLowerCase().indexOf("e");
if(_94!=-1){
var _95=_93.toLowerCase().indexOf("+");
var _96=_93.toLowerCase().indexOf("-",_94);
var _97=_93.substring(0,_94);
if(_96!=-1){
var _98=_93.substring(_96+1,_93.length);
_97=this.moveDecimalAsString(_97,true,parseInt(_98));
}else{
if(_95==-1){
_95=_94;
}
var _98=_93.substring(_95+1,_93.length);
_97=this.moveDecimalAsString(_97,false,parseInt(_98));
}
_93=_97;
}
return _93;
}
function moveDecimalRightNF(val,_9a){
var _9b="";
if(_9a==null){
_9b=this.moveDecimal(val,false);
}else{
_9b=this.moveDecimal(val,false,_9a);
}
return _9b;
}
function moveDecimalLeftNF(val,_9d){
var _9e="";
if(_9d==null){
_9e=this.moveDecimal(val,true);
}else{
_9e=this.moveDecimal(val,true,_9d);
}
return _9e;
}
function moveDecimalAsStringNF(val,_a0,_a1){
var _a2=(arguments.length<3)?this.places:_a1;
if(_a2<=0){
return val;
}
var _a3=val+"";
var _a4=this.getZeros(_a2);
var re1=new RegExp("([0-9.]+)");
if(_a0){
_a3=_a3.replace(re1,_a4+"$1");
var re2=new RegExp("(-?)([0-9]*)([0-9]{"+_a2+"})(\\.?)");
_a3=_a3.replace(re2,"$1$2.$3");
}else{
var _a7=re1.exec(_a3);
if(_a7!=null){
_a3=_a3.substring(0,_a7.index)+_a7[1]+_a4+_a3.substring(_a7.index+_a7[0].length);
}
var re2=new RegExp("(-?)([0-9]*)(\\.?)([0-9]{"+_a2+"})");
_a3=_a3.replace(re2,"$1$2$4.");
}
_a3=_a3.replace(/\.$/,"");
return _a3;
}
function moveDecimalNF(val,_a9,_aa){
var _ab="";
if(_aa==null){
_ab=this.moveDecimalAsString(val,_a9);
}else{
_ab=this.moveDecimalAsString(val,_a9,_aa);
}
return parseFloat(_ab);
}
function getRoundedNF(val){
val=this.moveDecimalRight(val);
if(this.truncate){
val=val>=0?Math.floor(val):Math.ceil(val);
}else{
val=Math.round(val);
}
val=this.moveDecimalLeft(val);
return val;
}
function preserveZerosNF(val){
var i;
val=this.expandExponential(val);
if(this.places<=0){
return val;
}
var _af=val.indexOf(".");
if(_af==-1){
val+=".";
for(i=0;i<this.places;i++){
val+="0";
}
}else{
var _b0=(val.length-1)-_af;
var _b1=this.places-_b0;
for(i=0;i<_b1;i++){
val+="0";
}
}
return val;
}
function justNumberNF(val){
newVal=val+"";
var _b3=false;
if(newVal.indexOf("%")!=-1){
newVal=newVal.replace(/\%/g,"");
_b3=true;
}
var re=new RegExp("[^\\"+this.inputDecimalValue+"\\d\\-\\+\\(\\)eE]","g");
newVal=newVal.replace(re,"");
var _b5=new RegExp("["+this.inputDecimalValue+"]","g");
var _b6=_b5.exec(newVal);
if(_b6!=null){
var _b7=newVal.substring(_b6.index+_b6[0].length);
newVal=newVal.substring(0,_b6.index)+this.PERIOD+_b7.replace(_b5,"");
}
if(newVal.charAt(newVal.length-1)==this.DASH){
newVal=newVal.substring(0,newVal.length-1);
newVal="-"+newVal;
}else{
if(newVal.charAt(0)==this.LEFT_PAREN&&newVal.charAt(newVal.length-1)==this.RIGHT_PAREN){
newVal=newVal.substring(1,newVal.length-1);
newVal="-"+newVal;
}
}
newVal=parseFloat(newVal);
if(!isFinite(newVal)){
newVal=0;
}
if(_b3){
newVal=this.moveDecimalLeft(newVal,2);
}
return newVal;
}
NumberFormat.getInstance=function(_b8,_b9,_ba){
var num=new NumberFormat();
num.setInputDecimal(".");
num.setPlaces("2",true);
num.setCurrencyValue("$");
num.setCurrency(false);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true,_b8,_b9);
if(_ba!=null){
num.setCurrencyValue(_ba);
}
return num;
};
function DuplicateElementException(_bc){
this.message=_bc;
this.name="DuplicateElementException";
}
DuplicateElementException.prototype=new Error();
DuplicateElementException.prototype.toString=function(){
return this.name+": "+this.message;
};
DuplicateElementException.prototype.constructor=DuplicateElementException;
function IllegalArgumentException(_bd){
this.message=_bd;
this.name="IllegalArgumentException";
}
IllegalArgumentException.prototype=new Error();
IllegalArgumentException.prototype.toString=function(){
return this.name+": "+this.message;
};
IllegalArgumentException.prototype.constructor=IllegalArgumentException;
function IllegalElementException(_be){
this.message=_be;
this.name="IllegalArgumentException";
}
IllegalElementException.prototype=new Error();
IllegalElementException.prototype.toString=function(){
return this.name+": "+this.message;
};
IllegalElementException.prototype.constructor=IllegalElementException;
function IllegalStateException(_bf){
this.message=_bf;
this.name="NoSuchElementException";
}
IllegalStateException.prototype=new Error();
IllegalStateException.prototype.toString=function(){
return this.name+": "+this.message;
};
IllegalStateException.prototype.constructor=IllegalStateException;
function MethodNotSupportedException(_c0){
this.message=_c0;
this.name="MethodNotSupportedException";
}
MethodNotSupportedException.prototype=new Error();
MethodNotSupportedException.prototype.toString=function(){
return this.name+": "+this.message;
};
MethodNotSupportedException.prototype.constructor=MethodNotSupportedException;
function NoSuchElementException(_c1){
this.message=_c1;
this.name="NoSuchElementException";
}
NoSuchElementException.prototype=new Error();
NoSuchElementException.prototype.toString=function(){
return this.name+": "+this.message;
};
NoSuchElementException.prototype.constructor=NoSuchElementException;
function NullPointerException(_c2){
this.message=_c2;
this.name="NullPointerException";
}
NullPointerException.prototype=new Error();
NullPointerException.prototype.toString=function(){
return this.name+": "+this.message;
};
NullPointerException.prototype.constructor=NullPointerException;
AbstractDataModel.prototype.className="AbstractDataModel";
AbstractDataModel.prototype=new Object();
function AbstractDataModel(){
this.dataChangedEvent=new YAHOO.util.CustomEvent("DataChangedEvent",this);
this._fireEvents=true;
}
AbstractDataModel.prototype.addDataListener=function(_c3,_c4){
this.dataChangedEvent.subscribe(_c3,_c4,true);
};
AbstractDataModel.prototype.removeDataListener=function(_c5,_c6){
this.dataChangedEvent.unsubscribe(_c5,_c6);
};
AbstractDataModel.prototype.fireDataChangedEvent=function(){
if(this._fireEvents){
this.dataChangedEvent.fire(this);
}
};
AbstractDataModel.prototype.enableEvents=function(){
this._fireEvents=true;
};
AbstractDataModel.prototype.disableEvents=function(){
this._fireEvents=false;
};
AbstractAjaxDataModel.prototype.className="AbstractAjaxDataModel";
AbstractAjaxDataModel.prototype=new AbstractDataModel();
function AbstractAjaxDataModel(){
AbstractDataModel.call(this);
}
AbstractAjaxDataModel.prototype.processUpdate=function(_c7){
throw new MethodNotSupportedException("Cannot invoke abstract method");
};
AbstractAjaxDataModel.prototype.processJsonUpdate=function(_c8){
throw new MethodNotSupportedException("Cannot invoke abstract method");
};
AbstractAjaxDataModel.prototype.setMessageId=function(id){
this.message_id=id;
ajaxEngine.registerMessageHandler(id,this);
};
AbstractAjaxDataModel.prototype.getMessageId=function(){
return this.message_id;
};
BaseWidget.prototype=new Object();
BaseWidget.prototype.constructor=BaseWidget;
BaseWidget.prototype.baseClass=Object;
function BaseWidget(_ca){
this.canvas_id=_ca;
this.canvas=document.getElementById(_ca);
if(this.canvas==null){
YAHOO.util.Event.addListener(window,"init",setCanvas,this);
}
function setCanvas(e,me){
me.canvas=document.getElementById(me.canvas_id);
}
}
BaseWidget.prototype.render=function(){
if(this.canvas==null){
alert("No target cnavas (div) found for id: "+this.canvas_id);
}else{
alert("No implementation found for child");
}
};
BaseWidget.prototype.getCanvas=function(){
if(this.canvas==null){
this.canvas=document.getElementById(this.canvas_id);
}
return this.canvas;
};
BaseWidget.prototype.setDataSource=function(_cd){
this.dataSource=_cd;
};
BaseWidget.prototype.getDataSource=function(){
return this.dataSource;
};
function Execution(){
}
Execution.executionMap=new Map();
Execution._keyCount=Execution.executionMap.size();
Execution.newKey=function(){
Execution._keyCount++;
return Execution._keyCount;
};
Execution.set=function(_ce,_cf,_d0,_d1,_d2,run){
if(!_ce instanceof Function){
throw new IllegalArgumentException("callback must be of type Function");
}
if((!_cf instanceof Number)&&(isNaN(_cf))){
throw new IllegalArgumentException("interval must be of type int or Integer");
}
if(_d1==(undefined||null)){
_d1=this;
}
if((!_d2 instanceof Number)&&(isNaN(_d2))){
_d2=-1;
}
if(run!=false){
run=true;
}
var _d4=Execution.newKey();
var _d5=new Array();
for(var i=0;i<arguments.length;i++){
_d5[i]=arguments[i];
}
_d5[6]=0;
Execution.executionMap.put(_d4,_d5);
if(_d5[5]){
Execution.start(_d4);
}
return _d4;
};
Execution.run=function(key){
var _d8=Execution.executionMap.get(key);
_d8[0].apply(_d8[3],_d8[2]);
if((_d8[6]++)==_d8[4]){
Execution.stop(key);
}else{
Execution.start(key);
}
};
Execution.stop=function(key){
var _da=Execution.executionMap.get(key);
if(_da[5]){
window.clearTimeout(_da[7]);
_da[5]=false;
}
};
Execution.stopAll=function(key){
var _dc=new Iterator(Execution.keySet);
while(_dc.hasNext()){
Execution.stop(_dc.next().value());
}
};
Execution.start=function(key){
var _de=Execution.executionMap.get(key);
if(_de[5]){
_de[6]=0;
_de[7]=window.setTimeout("Execution.run("+key+")",_de[1]);
}
};
Execution.startAll=function(){
var _df=new Iterator(Execution.keySet);
while(_df.hasNext()){
Execution.start(_df.next().value());
}
};
Execution.clear=function(key){
Execution.stop(key);
Execution.executionMap.remove(key);
};
Execution.clearAll=function(){
var _e1=new Iterator(Execution.keySet);
while(_e1.hasNext()){
Execution.clear(_e1.next().value());
}
};
Execution.keySet=function(){
return Execution.executionMap.keySet();
};
Execution.state=function(key){
var _e3=new Map();
var _e4=Execution.executionMap.get(key);
_e3.put("key",key);
_e3.put("objectContext",_e4[3].className);
_e3.put("interval",_e4[1]);
_e3.put("count",_e4[4]);
_e3.put("run",_e4[5]);
_e3.put("period",_e4[6]);
return _e3;
};
var MarketLocaleInfo=new Object();
MarketLocaleInfo.currencySymbol="$";
MarketLocaleInfo.decimalPlaces=2;
MarketLocaleInfo.decimalSymbol=".";
MarketLocaleInfo.seperator=",";
MarketLocaleInfo.bidIncrement=0.01;
MarketLocaleInfo.minBid=0.1;
MarketLocaleInfo.spendIncrement=1;
MarketLocaleInfo.minAccountDailyBudget=1;
MarketLocaleInfo.minCampaignDailyBudget=1;
MarketLocaleInfo.MONTHS_LONG=["{Januar}","{Februar}","{M?rz}","{April}","{Mai}","{Juni}","{Juli}","{August}","S{eptember}","{Oktober}","{November}","{Dezember}"];
MarketLocaleInfo.WEEKDAYS_SHORT=["{So}","{Mo}","{Di}","{Mi}","{Do}","{Fr}","{Sa}"];
MarketLocaleInfo.START_WEEKDAY=0;
MarketLocaleInfo.SHORT_DATE_FORMAT="MM/dd/yy";
MarketLocaleInfo.FORMAT_ERROR_MESSAGE="Please enter a valid value. ex {format}";
MarketLocaleInfo.isValidBidIncrement=function(bid){
return (bid!=null&&bid>=MarketLocaleInfo.minBid&&((((bid-MarketLocaleInfo.minBid)/MarketLocaleInfo.bidIncrement).toFixed(5)-Math.round((bid-MarketLocaleInfo.minBid)/MarketLocaleInfo.bidIncrement))==0));
};
MarketLocaleInfo.needBidIncrementCheck=function(){
return (Math.pow(10,-MarketLocaleInfo.decimalPlaces)!=MarketLocaleInfo.bidIncrement);
};
MarketLocaleInfo.needIncrementCheck=function(_e6){
return (Math.pow(10,-MarketLocaleInfo.decimalPlaces)!=_e6);
};
MarketLocaleInfo.isValidIncrement=function(_e7,_e8,_e9){
return (_e7!=null&&((((_e7-_e8)/_e9).toFixed(5)-Math.round((_e7-_e8)/_e9))==0));
};
MarketLocaleInfo.getBidIncrementAdjustedValue=function(val){
if(val!=null&&MarketLocaleInfo.needBidIncrementCheck()&&(!MarketLocaleInfo.isValidBidIncrement(val))){
return Math.floor(val/MarketLocaleInfo.bidIncrement)*MarketLocaleInfo.bidIncrement;
}
return val;
};
var InputFormatter=new Object();
InputFormatter.TYPE_NUMBER=1;
InputFormatter.TYPE_CURRENCY=2;
InputFormatter.NUMBER_FORMATTER=null;
InputFormatter.CURRENCY_FORMATTER=null;
InputFormatter.init=function(_eb){
if((_eb==InputFormatter.TYPE_CURRENCY&&InputFormatter.CURRENCY_FORMATTER==null)||(_eb==InputFormatter.TYPE_NUMBER&&InputFormatter.NUMBER_FORMATTER==null)){
var num=new NumberFormat();
num.setInputDecimal(MarketLocaleInfo.decimalSymbol);
num.setPlaces(2,true);
num.setCurrencyValue(MarketLocaleInfo.currencySymbol);
num.setCurrency(false);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true,MarketLocaleInfo.seperator,MarketLocaleInfo.decimalSymbol);
if(_eb==InputFormatter.TYPE_CURRENCY){
num.setPlaces(MarketLocaleInfo.decimalPlaces,true);
InputFormatter.CURRENCY_FORMATTER=num;
}else{
InputFormatter.NUMBER_FORMATTER=num;
}
}
};
InputFormatter.attachHandler=function(e,_ee){
InputFormatter.attachFormatter(document.getElementById(_ee[0]),_ee[1],_ee[2],_ee[3],_ee[4]);
};
InputFormatter.attachFormatter=function(_ef,_f0,_f1,_f2,_f3){
InputFormatter.init(_f0);
var _f4=_ef;
_f4.onblur=function(){
InputFormatter._format(this);
};
var _f5=document.createElement("input");
_f5.value=_ef.value;
_f5.type="hidden";
_f5.name=_f4.name;
_f5.id=_f4.name+"_rawData";
_f4.name=_f4.name+"_formatted";
_f4.setAttribute("hiddenRef",_f5.id);
_f4.setAttribute("formatterType",_f0);
_f4.setAttribute("emptyAs0",_f2==true);
if(_f3!=null){
_f4.setAttribute("errordiv",_f3);
}
if(_f0==InputFormatter.TYPE_CURRENCY){
if(_f1!=null){
_f4.setAttribute("includeSymbol",_f1);
}
InputFormatter._formatCurrency(_f4,_f1,true);
}else{
if(_f1!=null){
_f4.setAttribute("precision",""+_f1);
}
InputFormatter._formatNumber(_f4,_f1,true);
}
_f4.parentNode.insertBefore(_f5,_f4);
};
InputFormatter.displayError=function(_f6,_f7,_f8){
var msg="";
if(_f8){
var arr=new Array();
arr.push("#");
arr.push(MarketLocaleInfo.seperator);
arr.push("###");
if(_f7>0){
arr.push(MarketLocaleInfo.decimalSymbol);
for(var i=0;i<_f7;i++){
arr.push("#");
}
}
msg=MarketLocaleInfo.FORMAT_ERROR_MESSAGE.replace("{format}",arr.join(""));
}
if(_f8){
if(_f6.getAttribute("oldClass")==null){
_f6.setAttribute("oldClass",_f6.className==null?"":_f6.className);
_f6.className+=" error";
}
}else{
if(_f6.getAttribute("oldClass")==null){
if(_f6.className.trim()=="error"){
_f6.className="";
}
}else{
_f6.className=_f6.getAttribute("oldClass");
_f6.removeAttribute("oldClass");
}
}
if(_f6.getAttribute("errordiv")!=null){
var _fc=document.getElementById(_f6.getAttribute("errordiv"));
if(_f8){
_fc.innerHTML=msg;
_fc.style.display="block";
}else{
_fc.style.display="none";
}
}else{
if(_f8){
alert(msg);
}
}
};
InputFormatter._format=function(_fd){
var _fe=_fd.getAttribute("formatterType");
var ref=_fd.getAttribute("hiddenRef");
if(_fe==null||ref==null){
return;
}
var _100=_fd.getAttribute("emptyAs0");
var val=_fd.value.trim();
document.getElementById(ref).value="";
if(val==""&&_100=="false"){
return;
}
if(_fe==InputFormatter.TYPE_CURRENCY){
InputFormatter.init(2);
if(!InputFormatter.isValidCurrencyEntry(val)){
InputFormatter.displayError(_fd,MarketLocaleInfo.decimalPlaces,true);
return false;
}else{
InputFormatter.displayError(_fd,MarketLocaleInfo.decimalPlaces,false);
}
InputFormatter._formatCurrency(_fd,_fd.getAttribute("includeSymbol")=="true");
InputFormatter.CURRENCY_FORMATTER.setSeparators(false,",",".");
InputFormatter.CURRENCY_FORMATTER.setNumber(val);
document.getElementById(ref).value=InputFormatter.CURRENCY_FORMATTER.toFormatted();
InputFormatter.CURRENCY_FORMATTER.setSeparators(true,MarketLocaleInfo.seperator,MarketLocaleInfo.decimalSymbol);
}else{
var prec=_fd.getAttribute("precision");
InputFormatter.init(1);
if(!prec){
prec=2;
}
if(!InputFormatter.isValidNumberEntry(val,prec)){
InputFormatter.displayError(_fd,prec,true);
return false;
}else{
InputFormatter.displayError(_fd,prec,false);
}
InputFormatter._formatNumber(_fd,prec);
InputFormatter.NUMBER_FORMATTER.setPlaces(prec,true);
InputFormatter.NUMBER_FORMATTER.setSeparators(false,",",".");
InputFormatter.NUMBER_FORMATTER.setNumber(val);
document.getElementById(ref).value=InputFormatter.NUMBER_FORMATTER.toFormatted();
InputFormatter.NUMBER_FORMATTER.setSeparators(true,MarketLocaleInfo.seperator,MarketLocaleInfo.decimalSymbol);
InputFormatter.NUMBER_FORMATTER.setPlaces(2,true);
}
};
InputFormatter._formatCurrency=function(_103,_104,_105){
InputFormatter.init(2);
var _106=_103.getAttribute("emptyAs0");
var val=_103.value.trim();
if(val==""&&(_106=="false"||_106==false)){
return;
}
if(_104==true){
InputFormatter.CURRENCY_FORMATTER.setCurrency(true);
}
if(_105==true){
InputFormatter.CURRENCY_FORMATTER.setInputDecimal(".");
}
InputFormatter.CURRENCY_FORMATTER.setNumber(_103.value);
_103.value=InputFormatter.CURRENCY_FORMATTER.toFormatted();
InputFormatter.CURRENCY_FORMATTER.setCurrency(false);
InputFormatter.CURRENCY_FORMATTER.setInputDecimal(MarketLocaleInfo.decimalSymbol);
};
InputFormatter._formatNumber=function(_108,_109,_10a){
InputFormatter.init(1);
var _10b=_108.getAttribute("emptyAs0");
var val=_108.value.trim();
if(val==""&&(_10b=="false"||_10b==false)){
return;
}
if(_109!=null){
InputFormatter.NUMBER_FORMATTER.setPlaces(_109,true);
}
if(_10a==true){
InputFormatter.NUMBER_FORMATTER.setInputDecimal(".");
}
InputFormatter.NUMBER_FORMATTER.setNumber(_108.value);
_108.value=InputFormatter.NUMBER_FORMATTER.toFormatted();
InputFormatter.NUMBER_FORMATTER.setPlaces(2,true);
InputFormatter.NUMBER_FORMATTER.setInputDecimal(MarketLocaleInfo.decimalSymbol);
};
InputFormatter.getRawValue=function(elem){
var ref=elem.getAttribute("hiddenRef");
var ret=elem.value;
if(ref!=null){
ret=document.getElementById(ref).value;
}
return ret;
};
InputFormatter.formatCurrency=function(val,_111){
if(val==null){
return null;
}
var ret=val;
InputFormatter.init(2);
if(_111==true){
InputFormatter.CURRENCY_FORMATTER.setCurrency(true);
}
InputFormatter.CURRENCY_FORMATTER.setInputDecimal(".");
InputFormatter.CURRENCY_FORMATTER.setNumber(val);
ret=InputFormatter.CURRENCY_FORMATTER.toFormatted();
InputFormatter.CURRENCY_FORMATTER.setCurrency(false);
InputFormatter.CURRENCY_FORMATTER.setInputDecimal(MarketLocaleInfo.decimalSymbol);
return ret;
};
InputFormatter.parse=function(val,pre){
if(val==null){
return null;
}
if(!InputFormatter.isValidNumberEntry(val,pre)){
return null;
}
var ret=val;
var p=pre;
if(pre==null){
p=2;
}
InputFormatter.init(1);
InputFormatter.NUMBER_FORMATTER.setSeparators(false,",",".");
InputFormatter.NUMBER_FORMATTER.setPlaces(p,true);
InputFormatter.NUMBER_FORMATTER.setNumber(val);
ret=InputFormatter.NUMBER_FORMATTER.toFormatted();
InputFormatter.NUMBER_FORMATTER.setSeparators(true,MarketLocaleInfo.seperator,MarketLocaleInfo.decimalSymbol);
InputFormatter.NUMBER_FORMATTER.setPlaces(2,true);
return new Number(ret);
};
InputFormatter.formatNumber=function(val,_118){
if(val==null){
return null;
}
var ret=val;
InputFormatter.init(1);
if(_118!=null){
InputFormatter.NUMBER_FORMATTER.setPlaces(_118,true);
}
InputFormatter.NUMBER_FORMATTER.setInputDecimal(".");
InputFormatter.NUMBER_FORMATTER.setNumber(val);
ret=InputFormatter.NUMBER_FORMATTER.toFormatted();
InputFormatter.NUMBER_FORMATTER.setPlaces(2,true);
InputFormatter.NUMBER_FORMATTER.setInputDecimal(MarketLocaleInfo.decimalSymbol);
return ret;
};
InputFormatter._decodeRegex=new RegExp("&(lt|gt|amp|quot|#39);","gi");
InputFormatter.decodeHTML=function(str){
if(str==null){
return null;
}
return str.replace(InputFormatter._decodeRegex,function(m1,m2){
if(m2=="lt"){
return "<";
}
if(m2=="gt"){
return ">";
}
if(m2=="amp"){
return "&";
}
if(m2=="quot"){
return "\"";
}
if(m2=="#39"){
return "'";
}
});
};
InputFormatter._chkGroupSepRegex=null;
InputFormatter._chkFormatRegex=null;
InputFormatter.initFormatValidator=function(){
if(InputFormatter._chkGroupSepRegex==null){
var _11d="^\\s*\\d*";
if(MarketLocaleInfo.decimalPlaces>0){
_11d+=((MarketLocaleInfo.decimalSymbol=="."?"\\":"")+MarketLocaleInfo.decimalSymbol+"?");
for(var i=0;i<MarketLocaleInfo.decimalPlaces;i++){
_11d+=("\\d?");
}
}
_11d+="\\s*$";
InputFormatter._chkGroupSepRegex=new RegExp(_11d);
}
if(InputFormatter._chkFormatRegex==null){
var _11d="^\\s*\\d{0,3}("+(MarketLocaleInfo.seperator=="."?"\\":"")+MarketLocaleInfo.seperator+"?\\d\\d\\d)*";
if(MarketLocaleInfo.decimalPlaces>0){
_11d+=((MarketLocaleInfo.decimalSymbol=="."?"\\":"")+MarketLocaleInfo.decimalSymbol+"?");
for(var i=0;i<MarketLocaleInfo.decimalPlaces;i++){
_11d+=("\\d?");
}
}
_11d+="\\s*$";
InputFormatter._chkFormatRegex=new RegExp(_11d);
}
};
InputFormatter.isValidCurrencyEntry=function(str){
if(str==""){
return true;
}
InputFormatter.initFormatValidator();
if(InputFormatter._chkGroupSepRegex.test(str)){
return true;
}else{
if(InputFormatter._chkFormatRegex.test(str)){
return true;
}
}
return false;
};
InputFormatter.isValidNumberEntry=function(str,prec){
if(str==""){
return true;
}
var _122=null;
var sec=null;
if(_122==null){
var _124="^\\s*\\d*";
if(prec>0){
_124+=((MarketLocaleInfo.decimalSymbol=="."?"\\":"")+MarketLocaleInfo.decimalSymbol+"?");
for(var i=0;i<prec;i++){
_124+=("\\d?");
}
}
_124+="\\s*$";
_122=new RegExp(_124);
}
if(sec==null){
var _124="^\\s*\\d{0,3}("+MarketLocaleInfo.seperator+"?\\d\\d\\d)*";
if(prec>0){
_124+=((MarketLocaleInfo.decimalSymbol=="."?"\\":"")+MarketLocaleInfo.decimalSymbol+"?");
for(var i=0;i<prec;i++){
_124+=("\\d?");
}
}
_124+="\\s*$";
sec=new RegExp(_124);
}
if(_122.test(str)){
return true;
}else{
if(sec.test(str)){
return true;
}
}
return false;
};
YAHOO.namespace("ysm.util");
var YU=YAHOO.ysm.util;
YU.Element=new Object();
YU.Element.addChild=function(_126,_127,_id,_129,_12a,_12b,_12c){
var elem=document.createElement(_127);
if(_id){
elem.id=_id;
}
if(_129){
elem.className=_129;
}
if(_12a){
elem.innerHTML=_12a;
}
if(_12b){
var tmp=new Object();
for(var attr in _12b){
if(attr in tmp){
continue;
}
var val=_12b[attr];
if(typeof attr=="string"&&(typeof val=="string"||typeof val=="number"||typeof val=="boolean")){
elem.setAttribute(attr,val);
}
}
}
_126.appendChild(elem);
if(_12c){
var tmp=new Object();
for(var attr in _12c){
if(attr in tmp){
continue;
}
var val=_12c[attr];
if(typeof attr=="string"&&(typeof val=="string"||typeof val=="number"||typeof val=="boolean")){
elem.setAttribute(attr,val);
}
}
}
return elem;
};
YU.Element.addTextNode=function(_131,text){
if(_131==null||text==null){
return null;
}
var elem=document.createTextNode(text);
_131.appendChild(elem);
return elem;
};
TableWidgetControl.prototype=new BaseWidget();
TableWidgetControl.prototype.constructor=TableWidgetControl;
TableWidgetControl.prototype.baseClass=BaseWidget.prototype.constructor;
function TableWidgetControl(_134,_135,_136,_137){
BaseWidget.apply(this,[_134]);
this.paginationDiv=null;
this.displayIconColumn=true;
this.displayChkBox=true;
this.tableStyle=new TableStyle();
this.rowClickedEvent=new YAHOO.util.CustomEvent("RowClickedEvent",this);
this.sortClickedEvent=new YAHOO.util.CustomEvent("HeaderClickedEvent",this);
this.itemClickedEvent=new YAHOO.util.CustomEvent("ItemClickedEvent",this);
this.paginateEvent=new YAHOO.util.CustomEvent("PaginateEvent",this);
this.iconCellEvent=new YAHOO.util.CustomEvent("IconCellClickEvent",this);
this.pageSizeChangeEvent=new YAHOO.util.CustomEvent("PageSizeChangeEvent",this);
this.masterCheckEvent=new YAHOO.util.CustomEvent("MasterCheckClickedEvent",this);
this.autoSubmitSort=true;
this.enableMasterSelect=false;
this.masterSelect=null;
this.resourceBundle=new TableWidgetResources();
this.iconColumns=new Array();
this.ajaxRegions=null;
this.clientSortOn=false;
this.showPagination=true;
this.rowSpanFactor=1;
this.idList=new Array();
this.checkList=new Array();
this.disableElements=null;
if(TableWidgetControl.length>1){
this.paginationDiv=_135;
}
this.paginationRowObj=null;
this.pageSpanElement=null;
if(TableWidgetControl.length>2){
this.displayChkBox=_136;
}
if(TableWidgetControl.length>3){
this.displayIconColumn=_137;
}
this.showPageSizeSelection=false;
this.currentPageSize=null;
this.pageSizeList=null;
this.pageSizeSelect=null;
this.ajaxEvent="table";
this.noMoreData=false;
this.pageGroupSize=5;
}
TableWidgetControl.prototype.setPageSizeList=function(_138,_139){
if(_138!=null&&_138!=""){
this.showPageSizeSelection=true;
this.pageSizeList=_138.split(",");
this.currentPageSize=""+_139;
}else{
this.showPageSizeSelection=false;
this.pageSizeList=null;
}
};
TableWidgetControl.prototype.setAjaxEvent=function(_13a){
this.ajaxEvent=_13a;
};
TableWidgetControl.prototype.setClientSideSorting=function(val){
this.clientSortOn=val;
};
TableWidgetControl.prototype.addPageSizeChangeListener=function(_13c,obj){
this.pageSizeChangeEvent.subscribe(_13c,obj,true);
};
TableWidgetControl.prototype.removePageSizeChangeListener=function(_13e,obj){
this.pageSizeChangeEvent.unsubscribe(_13e,obj);
};
TableWidgetControl.prototype.addSelectAllListener=function(_140,obj){
this.masterCheckEvent.subscribe(_140,obj,true);
};
TableWidgetControl.prototype.removeSelectAllListener=function(_142,obj){
this.masterCheckEvent.unsubscribe(_142,obj);
};
TableWidgetControl.prototype.addSortClickListener=function(_144,obj){
this.sortClickedEvent.subscribe(_144,obj,true);
};
TableWidgetControl.prototype.addIconCellClickListener=function(_146,obj){
this.iconCellEvent.subscribe(_146,obj,true);
};
TableWidgetControl.prototype.removeSortClickListener=function(_148,obj){
this.sortClickedEvent.unsubscribe(_148,obj);
};
TableWidgetControl.prototype.addItemClickListener=function(_14a,obj){
this.itemClickedEvent.subscribe(_14a,obj,true);
};
TableWidgetControl.prototype.removeItemClickListener=function(_14c,obj){
this.itemClickedEvent.unsubscribe(_14c,obj);
};
TableWidgetControl.prototype.addPaginateListener=function(_14e,obj){
this.paginateEvent.subscribe(_14e,obj,true);
};
TableWidgetControl.prototype.removePaginateListener=function(_150,obj){
this.paginateEvent.unsubscribe(_150,obj);
};
TableWidgetControl.prototype.addRowClickListener=function(_152,obj){
this.rowClickedEvent.subscribe(_152,obj,true);
};
TableWidgetControl.prototype.removeRowClickListener=function(_154,obj){
this.rowClickedEvent.unsubscribe(_154,obj);
};
TableWidgetControl.prototype.getSelectedRows=function(){
return null;
};
TableWidgetControl.prototype.removeSelectedRows=function(){
for(var i=this.rows.length-1;i>=0;i--){
if(this.rows[i].selected){
this.domElement.childNodes[0].removeChild(this.rows[i].getRowElement(null));
this.rows[i]=null;
}
}
this.rows.pack();
};
TableWidgetControl.prototype._masterSelectedCallback=function(_157){
var _158=YAHOO.util.Event.getTarget(_157);
for(var i=0;i<this.checkList.length;i++){
if(!this.checkList[i].disabled){
this.checkList[i].checked=_158.checked;
}
}
this.rowClickedEvent.fire(_158);
this.masterCheckEvent.fire(_158);
};
TableWidgetControl.prototype.render=function(){
if(this.dataSource!=null&&this.dataSource instanceof TableDataModel){
this._clearEvents();
this.iconColumns=new Array();
var _15a=document.createElement("table");
this.tableRef=_15a;
_15a.id="table"+this.canvas_id;
var _15b=null;
_15a.cellPadding="0";
_15a.cellSpacing="0";
_15a.className=this.tableStyle.tableClass;
this.getCanvas().innerHTML="";
this.getCanvas().appendChild(_15a);
var _15c=document.createElement("tbody");
_15a.appendChild(_15c);
var _15d=document.createElement("tr");
_15d.className=this.tableStyle.headerRow;
if(this.displayChkBox){
var _15e=document.createElement("th");
_15e.className=this.tableStyle.checkColumnHeader;
_15e.id=this.canvas_id+"_chk_hdr";
this.masterSelect=null;
if(this.enableMasterSelect){
this.masterSelect=document.createElement("input");
this.masterSelect.setAttribute("type","checkbox");
_15e.appendChild(this.masterSelect);
this.masterSelect.name="master_chk_"+this.dataSource.getIdColumn();
this.masterSelect.id=this.canvas_id+this.masterSelect.name;
YAHOO.util.Event.addListener(this.masterSelect,"click",this._masterSelectedCallback,this,true);
this.masterSelect.style.display="none";
}else{
_15e.innerHTML="&nbsp;";
}
_15d.appendChild(_15e);
}
if(this.displayIconColumn){
var th=document.createElement("th");
th.innerHTML="&nbsp;";
th.id=this.canvas_id+"_icon_hdr";
_15d.appendChild(th);
}
var _160=this.dataSource.getColumns();
var _161=true;
var _162=0;
for(var i=0;i<_160.length;i++){
if(_160[i].isHidden()){
continue;
}
if(_160[i].dataType=="icon"){
this.iconColumns[this.iconColumns.length]=_160[i].dbName;
continue;
}
var th=document.createElement("th");
th.id=this.canvas_id+"_hdr"+_162++;
th.className=this.tableStyle.columnHeader+" ";
if(_160[i].isSortable()&&this.dataSource.getSortedColumn()==_160[i].getDBKey()){
th.className=(_161?this.tableStyle.firstColumnHeader:"")+" "+this.tableStyle.sortedColumn;
th.setAttribute("sort_column",_160[i].getDBKey());
th.setAttribute("sort_order",this.dataSource.getSortedOrder());
var txt=document.createElement("span");
if(this.dataSource.getSortedOrder()=="true"){
txt.className=this.tableStyle.sortedColumnAsc;
}else{
txt.className=this.tableStyle.sortedColumnDesc;
}
txt.innerHTML=_160[i].getDisplayName();
th.appendChild(txt);
YAHOO.util.Event.addListener(txt,"click",this._headerClickCallback,this,true);
YAHOO.util.Event.addListener(txt,"mouseover",this._handleHeaderMouseOver,this,true);
YAHOO.util.Event.addListener(txt,"mouseout",this._handleHeaderMouseOut,this,true);
}else{
if(_160[i].isSortable()){
th.className=(_161?this.tableStyle.firstColumnHeader:"")+" "+this.tableStyle.columnHeader;
th.setAttribute("sort_column",_160[i].getDBKey());
th.setAttribute("sort_order","");
var txt=document.createElement("span");
txt.className=this.tableStyle.columnHeaderTxt;
txt.innerHTML=_160[i].getDisplayName();
th.appendChild(txt);
YAHOO.util.Event.addListener(txt,"click",this._headerClickCallback,this,true);
YAHOO.util.Event.addListener(txt,"mouseover",this._handleHeaderMouseOver,this,true);
YAHOO.util.Event.addListener(txt,"mouseout",this._handleHeaderMouseOut,this,true);
}else{
th.innerHTML=_160[i].getDisplayName();
}
}
if(_160[i].headerStyle!=null){
th.className=_160[i].headerStyle;
}
_15d.appendChild(th);
th.title=_160[i].getToolTip();
if(_161){
th.setAttribute("firstCol","true");
_161=false;
}
}
_15c.appendChild(_15d);
var _165=this.dataSource.getTotalRows();
for(var i=0;i<_165.length;i++){
_161=true;
var tr=document.createElement("tr");
var _167=null;
tr.className=this.tableStyle.totalRow;
if(this.displayChkBox){
var chk=document.createElement("td");
chk.id=this.canvas_id+"total_chk";
chk.className=this.tableStyle.totalCheckCell;
chk.innerHTML="&nbsp;";
tr.appendChild(chk);
}
if(this.displayIconColumn){
var td=document.createElement("td");
td.id=this.canvas_id+"_totalIconCell";
td.className=this.tableStyle.totalIconCell;
tr.appendChild(td);
td.innerHTML="&nbsp;";
YAHOO.util.Event.addListener(td,"click",this._totalIconClick,this,true);
}
var _16a=_165[i].columns.get(this.dataSource.getIdColumn());
var _16b=this.canvas_id+"_total";
for(var j=0;j<_160.length;j++){
if(_160[j].isHidden()){
continue;
}
if(_160[j].dataType=="icon"){
continue;
}
var _16d=_165[i].columns.get(_160[j].getDBKey());
var td=document.createElement("td");
td.id=_16b+j;
if(_161){
td.className=this.tableStyle.firstTotalCell;
_161=false;
}else{
td.className=this.tableStyle.totalCell;
}
if(_16d){
if(_160[j].getLinkType()!=null&&_16d.isLinkable()){
td.setAttribute("column_id",_160[j].getDBKey());
td.setAttribute("column_value",_16d.getRawValue());
td.setAttribute("id_value",_165[i].rowId);
td.setAttribute("row_type","total");
td.innerHTML=_16d.getFormattedValue();
td.className=td.className+" "+this.tableStyle.linkCell;
YAHOO.util.Event.addListener(td,"click",this._cellClickCallback,this,true);
}else{
td.innerHTML=_16d.getFormattedValue();
}
}else{
td.innerHTML="&nbsp;";
}
tr.appendChild(td);
if(_16d.getToolTip()!=null){
td.title=_16d.getToolTip();
}
_167=td;
}
if(_167){
_167.className=this.tableStyle.lastColumn+" "+_167.className;
}
_15c.appendChild(tr);
}
var _16e=this.dataSource.getFilteredRows();
for(var i=0;i<_16e.length;i++){
_161=true;
var _167=null;
var tr=document.createElement("tr");
tr.className=this.tableStyle.filterRow;
if(this.displayChkBox){
var chk=document.createElement("td");
chk.id=this.canvas_id+"_filt_chk"+i;
chk.className=this.tableStyle.filterCheckCell;
tr.appendChild(chk);
}
if(this.displayIconColumn){
var td=document.createElement("td");
td.id=this.canvas_id+"filt_icon"+i;
td.className=this.tableStyle.filterIconCell;
td.innerHTML="&nbsp;";
tr.appendChild(td);
}
var _16a=_16e[i].columns.get(this.dataSource.getIdColumn());
var _16b=this.canvas_id+"_filt"+i;
for(var j=0;j<_160.length;j++){
if(_160[j].isHidden()){
continue;
}
if(_160[j].dataType=="icon"){
continue;
}
var _16d=_16e[i].columns.get(_160[j].getDBKey());
var td=document.createElement("td");
td.id=_16b+j;
if(_161){
td.className=this.tableStyle.firstfilterCell;
_161=false;
}else{
td.className=this.tableStyle.filterCell;
}
if(_16d){
if(_160[j].getLinkType()!=null&&_16d.isLinkable()){
td.setAttribute("column_id",_160[j].getDBKey());
td.setAttribute("column_value",_16d.getRawValue());
td.setAttribute("id_value",_16e[i].rowId);
td.setAttribute("row_type","filtered");
td.innerHTML=_16d.getFormattedValue();
td.className=td.className+" "+this.tableStyle.linkCell;
YAHOO.util.Event.addListener(td,"click",this._cellClickCallback,this,true);
}else{
td.innerHTML=_16d.getFormattedValue();
}
}else{
td.innerHTML="&nbsp;";
}
tr.appendChild(td);
if(_16d.getToolTip()!=null){
td.title=_16d.getToolTip();
}
_167=td;
}
if(_167){
_167.className=this.tableStyle.lastColumn+" "+_167.className;
}
_15c.appendChild(tr);
}
var _16f=this.dataSource.getDataRows();
var _170=new Array();
var _171=new Array();
for(var i=0;i<_16f.length;i++){
var _16a=_16f[i].columns.get(this.dataSource.getIdColumn()).getRawValue();
var _172=_171[_16a];
if(_172==null||_172==undefined){
_172=new Array();
_171[_16a]=_172;
_170[_170.length]=_16a;
}
_172[_172.length]=_16f[i];
}
var _173=false;
for(var i=0;i<_170.length;i++){
var _174=_171[_170[i]];
for(var k=0;k<_174.length;k++){
_161=true;
var _167=null;
var tr=document.createElement("tr");
var _16a=_174[k].columns.get(this.dataSource.getIdColumn()).getRawValue();
tr.className=i%2==1?this.tableStyle.oddRow:this.tableStyle.evenRow;
this.idList[this.idList.length]=_16a;
if(this.displayChkBox&&k==0){
var chk=document.createElement("td");
chk.id=this.canvas_id+"_d_chk"+i;
chk.rowSpan=_174.length;
chk.className=this.tableStyle.checkCell;
var _176=document.createElement("input");
this.checkList[this.checkList.length]=_176;
_176.setAttribute("datavalue",_16a);
_176.setAttribute("type","checkbox");
if(this.dataSource.getAltIdColumn()){
_176.setAttribute("name",this.dataSource.getAltIdColumn());
_176.setAttribute("id",this.dataSource.getAltIdColumn());
}else{
_176.setAttribute("name",this.dataSource.getIdColumn());
_176.setAttribute("id",this.dataSource.getIdColumn());
}
if(_174[k].isDisabled()){
_176.disabled=true;
}else{
_173=true;
}
YAHOO.util.Event.addListener(_176,"click",this._chkClickCallback,this,true);
chk.appendChild(_176);
tr.appendChild(chk);
_176.value=_16a;
}
if(this.displayIconColumn&&k==0){
var td=document.createElement("td");
td.id=this.canvas_id+"d_icon"+i;
td.rowSpan=_174.length;
td.className=this.tableStyle.iconCell;
td.appendChild(this._createIconTable(true,td.id));
tr.appendChild(td);
}
var _16b=this.canvas_id+"_d_"+i+"_"+k;
for(var j=0;j<_160.length;j++){
if(_160[j].isHidden()){
continue;
}
var _16d=_174[k].columns.get(_160[j].getDBKey());
if(_160[j].dataType=="icon"){
if(this.displayIconColumn&&k==0){
var _177=this.displayChkBox?tr.childNodes[1].firstChild:tr.childNodes[0].firstChild;
for(var ii=0;ii<this.iconColumns.length;ii++){
if(this.iconColumns[ii]==_160[j].getDBKey()){
var _179=_160[j].getIconClassFor(_16d.getRawValue());
if(_179){
var _17a=_177.firstChild.firstChild.childNodes[ii];
_17a.className=_179;
if(_16d.getToolTip()!=null){
_17a.title=_16d.getToolTip();
}
}
}
}
}
continue;
}
if(this.dataSource.getRowSpanCols().indexOf(_160[j].getDBKey())!=-1&&k>0){
_161=false;
continue;
}
var td=document.createElement("td");
td.id=_16b+j;
if(_161){
td.className=this.tableStyle.firstCell;
_161=false;
}else{
if(_160[j].getDataType()=="text"){
td.className=this.tableStyle.textCell;
}else{
td.className=this.tableStyle.numCell;
}
}
if(_160[j].isSortable()&&this.dataSource.getSortedColumn()==_160[j].getDBKey()){
td.className=td.className+" "+(i%2==1?this.tableStyle.cellSortOdd:this.tableStyle.cellSortEven);
}
if(this.dataSource.getRowSpanCols().indexOf(_160[j].getDBKey())!=-1){
td.rowSpan=_174.length;
}
if(_16d){
if(_160[j].getLinkType()!=null&&_16d.isLinkable()){
td.setAttribute("column_id",_160[j].getDBKey());
td.setAttribute("column_value",_16d.getRawValue());
td.setAttribute("id_value",_174[k].rowId);
td.setAttribute("row_type","data");
td.innerHTML=_16d.getFormattedValue();
td.className=td.className+" "+this.tableStyle.linkCell;
YAHOO.util.Event.addListener(td,"click",this._cellClickCallback,this,true);
}else{
td.innerHTML=_16d.getFormattedValue();
}
}else{
td.innerHTML="&nbsp;";
}
if(_160[j].dataStyle!=null){
td.className=_160[j].dataStyle;
}
tr.appendChild(td);
if(_16d.getToolTip()!=null){
td.title=_16d.getToolTip();
}
_167=td;
}
_15c.appendChild(tr);
if(_167){
_167.className=this.tableStyle.lastColumn+" "+_167.className;
}
}
}
if(this.masterSelect!=null){
if(_173>0){
this.masterSelect.style.display="block";
}else{
if(this.masterSelect.parentNode){
this.masterSelect.parentNode.innerHTML="&nbsp;";
}
}
}
if(this.showPagination){
this._renderPagination();
}
}
};
TableWidgetControl.prototype._renderPagination=function(){
var _17b=Math.ceil(this.dataSource.lowIndex/this.rowSpanFactor);
var _17c=this.dataSource.totalPages;
var _17d=this.dataSource.currentPage;
var _17e=Math.ceil(this.dataSource.total/this.rowSpanFactor);
var _17f=Math.ceil(this.dataSource.maxRow/this.rowSpanFactor);
var _180=this.dataSource.rows.length/this.rowSpanFactor;
var _181=this.pageGroupSize;
this.noMoreData=false;
var _182=this.canvas_id+"_pag_";
if(this.paginationDiv==null){
this.paginationRowObj=null;
}
if(_17c==1||_17c==-1||_180==0){
this.noMoreData=true;
}
if(this.paginationRowObj==null){
var _183=null;
if(this.paginationDiv){
_183=document.getElementById(this.paginationDiv);
if(_183!=null&&_183.className==null){
_183.className=this.tableStyle.paginationRowDiv;
}
}
if(!_183){
_183=document.createElement("div");
_183.className=this.tableStyle.paginationRowDiv;
_183.id=_182+"gen_div";
this.paginationDiv=null;
}
this.paginationRowObj=_183;
if(!this.paginationDiv){
this.getCanvas().appendChild(this.paginationRowObj);
}
this.pageSpanElement=document.createElement("div");
this.pageSpanElement.id=_182+"_span";
this.pageSpanElement.className=this.tableStyle.paginationDiv;
this.paginationRowObj.appendChild(this.pageSpanElement);
if(this.showPageSizeSelection&&this.pageSizeList.length>0){
this.paginationRowObj.appendChild(document.createTextNode(this.resourceBundle.Display+" "));
this.pageSizeSelect=document.createElement("select");
this.pageSizeSelect.id=_182+"_sel";
this.pageSizeSelect.className=this.tableStyle.pageSelect;
this.paginationRowObj.appendChild(this.pageSizeSelect);
var _184=new Array();
for(var _i=0;_i<this.pageSizeList.length;_i++){
this.pageSizeSelect.options[_i]=new Option(this.pageSizeList[_i],this.pageSizeList[_i]);
if(this.pageSizeList[_i]==this.currentPageSize){
this.pageSizeSelect.options[_i].selected=true;
}
}
this.paginationRowObj.appendChild(document.createTextNode(" "+this.resourceBundle.LinesPerPage));
YAHOO.util.Event.addListener(this.pageSizeSelect,"change",this._pageSizeChangedCallback,this,true);
}else{
var _186=document.createElement("span");
_186.innerHTML="&nbsp;";
this.paginationRowObj.appendChild(_186);
}
}
if(!this.paginationDiv){
this.getCanvas().appendChild(this.paginationRowObj);
}
if(_17d!=undefined||_17d!=-1){
_17b=(_17d-1)*_17f;
}else{
if(_17b==null||_17b==-1||isNaN(_17b)){
_17b=0;
}
}
this.dataSource.lowIndex=_17b;
var _187=_17b+_180;
var _188=new Array();
_188.push(this.resourceBundle.Results);
_188.push(" <strong>"+(_17e==0?0:_17b+1)+"-"+_187+"</strong> ");
_188.push(this.resourceBundle.Of+" <strong>"+_17e+"</strong> &nbsp;&nbsp;");
this.pageSpanElement.innerHTML=_188.join("");
if(this.noMoreData){
return;
}
if(_17b>0){
var _189=(_17b-_17f);
if(_189<0){
_189=0;
}
var _18a=document.createElement("a");
_18a.id=_182+"_first";
_18a.setAttribute("href","javascript:void(0);");
_18a.innerHTML="&laquo; "+this.resourceBundle.First;
YAHOO.util.Event.addListener(_18a,"click",this._paginateClickCallback,this,true);
this.pageSpanElement.appendChild(_18a);
var _186=document.createElement("span");
_186.innerHTML="&nbsp;";
this.pageSpanElement.appendChild(_186);
var _18b=document.createElement("a");
_18b.id=_182+"_prev";
_18b.setAttribute("href","javascript:void(0);");
_18b.innerHTML="&lsaquo; "+this.resourceBundle.Previous;
_18b.setAttribute("lowIndex",_189*this.rowSpanFactor);
YAHOO.util.Event.addListener(_18b,"click",this._paginateClickCallback,this,true);
this.pageSpanElement.appendChild(_18b);
}else{
var _18c=document.createElement("span");
_18c.innerHTML="&laquo; "+this.resourceBundle.First+"&nbsp;&lsaquo; "+this.resourceBundle.Previous;
this.pageSpanElement.appendChild(_18c);
}
var _18d=document.createElement("span");
_18d.innerHTML="&nbsp;|";
this.pageSpanElement.appendChild(_18d);
var _18e=_17d>Math.floor((_181/2));
var _18f=(_17c-_17d)>=Math.floor((_181/2));
if(_17c<_181){
_18e=true;
_18f=false;
_181=_17c;
}
var _190=0;
for(var i=0;i<_181;i++){
if(_18e&&_18f){
_190=_17d-Math.floor((_181/2-i));
}else{
if(!_18e&&_18f){
_190=i+1;
}else{
if(_18e&&!_18f){
_190=_17c-_181+1+i;
}
}
}
var _186=document.createElement("span");
_186.innerHTML="&nbsp;";
this.pageSpanElement.appendChild(_186);
if(_190!=_17d){
var _192=document.createElement("a");
_192.id=_182+_190;
_192.setAttribute("href","javascript:void(0);");
_192.setAttribute("lowIndex",(_190-1)*_17f*this.rowSpanFactor);
_192.innerHTML=_190;
this.pageSpanElement.appendChild(_192);
YAHOO.util.Event.addListener(_192,"click",this._paginateClickCallback,this,true);
}else{
var page=document.createElement("span");
page.innerHTML=_190;
this.pageSpanElement.appendChild(page);
}
}
_18d=document.createElement("span");
_18d.innerHTML="&nbsp;|&nbsp;";
this.pageSpanElement.appendChild(_18d);
if(_187<_17e){
var _194=_187;
var _195=document.createElement("a");
_195.id=_182+"_next";
_195.setAttribute("href","javascript:void(0);");
_195.innerHTML=this.resourceBundle.Next+" &rsaquo; ";
YAHOO.util.Event.addListener(_195,"click",this._paginateClickCallback,this,true);
this.pageSpanElement.appendChild(_195);
_195.setAttribute("lowIndex",_194*this.rowSpanFactor);
var _186=document.createElement("span");
_186.innerHTML="&nbsp;";
this.pageSpanElement.appendChild(_186);
var _196=_17e%_17f;
var _197;
if(_196>0){
_197=_17e-_196;
}else{
_197=_17e-_17f;
}
var _198=document.createElement("a");
_198.id=_182+"_last";
_198.setAttribute("lowIndex",_197*this.rowSpanFactor);
_198.setAttribute("href","javascript:void(0);");
_198.innerHTML=this.resourceBundle.Last+" &raquo;";
YAHOO.util.Event.addListener(_198,"click",this._paginateClickCallback,this,true);
this.pageSpanElement.appendChild(_198);
}else{
var _199=document.createElement("span");
_199.innerHTML=this.resourceBundle.Next+" &rsaquo; "+this.resourceBundle.Last+" &raquo;";
this.pageSpanElement.appendChild(_199);
}
};
TableWidgetControl.prototype._pageSizeChangedCallback=function(e){
var url=this.dataSource.getActionUrl();
this.currentPageSize=this.pageSizeSelect.value;
this.pageSizeChangeEvent.fire();
if(this.isAutoSortAndPaginate()){
var _19c=this._createAjaxRequest(url,null,this.dataSource.additionalParams);
_19c.addAjaxParameter("function","pageSize");
_19c.addAjaxParameter("newPageSize",this.pageSizeSelect.value);
if(this.dataSource.getSortedColumn()){
_19c.addAjaxParameter("colPropertyName",this.dataSource.getSortedColumn());
}
if(this.dataSource.getSortedOrder()){
_19c.addAjaxParameter("asc",this.dataSource.getSortedOrder()=="false"?"false":"true");
}
if(this.disableElements){
_19c.setAjaxButton(this.disableElements);
}
ajaxEngine.sendAjaxRequest(_19c);
window.focus();
}
};
TableWidgetControl.prototype._paginateClickCallback=function(e){
var a=YAHOO.util.Event.getTarget(e);
YAHOO.util.Event.stopPropagation(e);
var _19f=a.getAttribute("pageNum");
var _1a0=a.getAttribute("lowIndex");
this.paginateEvent.fire();
if(this.isAutoSortAndPaginate()){
var url=this.dataSource.getActionUrl();
var _1a2=this._createAjaxRequest(url,null,this.dataSource.additionalParams);
if(_19f){
_1a2.addAjaxParameter("pageNum",_19f);
}
if(_1a0){
_1a2.addAjaxParameter("lowIndex",_1a0);
}
_1a2.addAjaxParameter("function","filter");
if(this.dataSource.getSortedColumn()){
_1a2.addAjaxParameter("colPropertyName",this.dataSource.getSortedColumn());
}
if(this.dataSource.getSortedOrder()){
_1a2.addAjaxParameter("asc",this.dataSource.getSortedOrder()=="false"?"false":"true");
}
if(this.disableElements){
_1a2.setAjaxButton(this.disableElements);
}
ajaxEngine.sendAjaxRequest(_1a2);
}
};
TableWidgetControl.prototype.setAjaxRegions=function(_1a3){
this.ajaxRegions=_1a3;
};
TableWidgetControl.prototype.setDataSource=function(_1a4){
if(this.dataSource!=null){
this.dataSource.removeDataListener(this._refresh,this);
}
this.dataSource=_1a4;
this.dataSource.addTargetDiv(this.canvas_id);
this.dataSource.addDataListener(this._refresh,this);
};
TableWidgetControl.prototype.setAutoSortAndPaginate=function(auto){
this.autoSubmitSort=auto;
};
TableWidgetControl.prototype.isAutoSortAndPaginate=function(){
return this.autoSubmitSort;
};
TableWidgetControl.prototype.getSelectedIDs=function(){
var _1a6=new Array();
for(var i=0;i<this.checkList.length;i++){
if(this.checkList[i].checked){
_1a6[_1a6.length]=this.checkList[i].getAttribute("datavalue");
}
}
return _1a6;
};
TableWidgetControl.prototype.clearSelections=function(){
for(var i=0;i<this.checkList.length;i++){
this.checkList[i].checked=false;
}
if(this.masterSelect){
this.masterSelect.checked=false;
}
};
TableWidgetControl.prototype._headerClickCallback=function(e){
var span=YAHOO.util.Event.getTarget(e);
var _1ab=span.parentNode;
var _1ac=_1ab.getAttribute("sort_column");
var _1ad=_1ab.getAttribute("sort_order");
this.sortClickedEvent.fire(_1ac,(_1ad=="asc"?"desc":"asc"));
if(this.isAutoSortAndPaginate()){
if(this.noMoreData&&this.clientSortOn){
this.dataSource.sort(_1ac,(_1ad=="true")?"false":"true");
this.render();
return;
}
var url=this.dataSource.getActionUrl();
var _1af=this._createAjaxRequest(url,null,this.dataSource.additionalParams);
_1af.addAjaxParameter("function","sort");
_1af.addAjaxParameter("colPropertyName",_1ac);
_1af.addAjaxParameter("asc",(_1ad=="true"?"false":"true"));
_1af.addAjaxParameter("lowIndex",this.dataSource.lowIndex);
if(this.disableElements){
_1af.setAjaxButton(this.disableElements);
}
ajaxEngine.sendAjaxRequest(_1af);
}
};
TableWidgetControl.prototype._refresh=function(_1b0){
this.render();
};
TableWidgetControl.prototype._cellClickCallback=function(e){
var td=YAHOO.util.Event.getTarget(e);
var _1b3=td.getAttribute("eventName");
while(!td.getAttribute("column_id")){
td=td.parentNode;
if(td.id==this.canvas_id){
return;
}
}
var col=td.getAttribute("column_id");
var val=td.getAttribute("column_value");
var id=td.getAttribute("id_value");
var _1b7=td.getAttribute("row_type");
var row=null;
if("total"==_1b7){
row=this.dataSource.findTotalRowByRowId(id);
}else{
if("filtered"==_1b7){
row=this.dataSource.findFilteredRowByRowId(id);
}else{
row=this.dataSource.findRowByRowId(id);
}
}
var _1b9=this.dataSource.findColumn(col);
var _1ba=_1b9.findLinkInfo(_1b3);
var type=_1ba[0];
var url=_1ba[1];
if(url&&url.trim()!=""){
var _1bd=_1b9.getLinkParams();
var _1be=null;
if(row){
_1be=row.columns.get(col).getLinkParams();
}
if(type=="javascript"){
var _1bf=new Map();
if(_1bd){
_1bf.putAll(_1bd);
}
if(_1be){
_1bf.putAll(_1be);
}
var _1c0=new CellEventData(td,col,val,row,_1bf,YAHOO.util.Event.getTarget(e));
eval("var fn = "+url+";");
fn.call(window,_1c0);
}else{
var frm=document.createElement("form");
frm.setAttribute("method","post");
frm.setAttribute("action",url);
if(row){
var _1c2=new Iterator(row.columns);
while(_1c2.hasNext()){
var _1c3=_1c2.next();
var _1c4=document.createElement("input");
_1c4.setAttribute("type","hidden");
_1c4.setAttribute("name",_1c3.getKey());
_1c4.setAttribute("value",_1c3.getValue().getRawValue());
frm.appendChild(_1c4);
}
}
if(_1be){
var _1c2=new Iterator(_1be);
while(_1c2.hasNext()){
var _1c3=_1c2.next();
var _1c4=document.createElement("input");
_1c4.setAttribute("type","hidden");
_1c4.setAttribute("name",_1c3.getKey());
_1c4.setAttribute("value",_1c3.getValue());
frm.appendChild(_1c4);
}
}
if(_1bd){
var _1c2=new Iterator(_1bd);
while(_1c2.hasNext()){
var _1c3=_1c2.next();
if(_1be.containsKey(_1c3.getKey())){
continue;
}
var _1c4=document.createElement("input");
_1c4.setAttribute("type","hidden");
_1c4.setAttribute("name",_1c3.getKey());
_1c4.setAttribute("value",_1c3.getValue());
frm.appendChild(_1c4);
}
}
document.body.appendChild(frm);
frm.submit();
}
}
};
TableWidgetControl.prototype._chkClickCallback=function(e){
var _1c6=YAHOO.util.Event.getTarget(e);
if(this.displayChkBox&&this.enableMasterSelect&&this.masterSelect.checked){
this.masterSelect.checked=_1c6.checked;
}
this.rowClickedEvent.fire(_1c6);
};
TableWidgetControl.prototype._handleHeaderMouseOver=function(_1c7){
var span=YAHOO.util.Event.getTarget(_1c7);
var th=span.parentNode;
var _1ca=this.tableStyle.columnHeaderMouseOver;
if(th.getAttribute("firstCol")&&th.getAttribute("sort_order")&&th.getAttribute("sort_order")!=""){
_1ca=this.tableStyle.firstColumnHeader+" "+this.tableStyle.sortedColumnHeaderMouseOver;
}else{
if(th.getAttribute("firstCol")){
_1ca=this.tableStyle.firstColumnHeader+" "+this.tableStyle.columnHeaderMouseOver;
}else{
if(th.getAttribute("sort_order")&&th.getAttribute("sort_order")!=""){
_1ca=this.tableStyle.sortedColumnHeaderMouseOver;
}
}
}
th.className=_1ca;
};
TableWidgetControl.prototype._handleHeaderMouseOut=function(_1cb){
var span=YAHOO.util.Event.getTarget(_1cb);
var th=span.parentNode;
var _1ce=this.tableStyle.columnHeader;
if(th.getAttribute("firstCol")&&th.getAttribute("sort_order")&&th.getAttribute("sort_order")!=""){
_1ce=this.tableStyle.firstColumnHeader+" "+this.tableStyle.sortedColumn;
}else{
if(th.getAttribute("firstCol")){
_1ce=this.tableStyle.firstColumnHeader+" "+this.tableStyle.columnHeader;
}else{
if(th.getAttribute("sort_order")&&th.getAttribute("sort_order")!=""){
_1ce=this.tableStyle.sortedColumn+" ";
}
}
}
th.className=_1ce;
};
TableWidgetControl.prototype._clearEvents=function(_1cf){
if(this.dd){
for(var i=0;i<this.dd.length;i++){
if(this.dd[i]&&this.dd[i].unreg){
this.dd[i].unreg();
}
}
}
if(this.displayChkBox){
for(var i=0;i<this.checkList.length;i++){
YAHOO.util.Event.removeListener(this.checkList[i],"click",this._chkClickCallback);
}
this.checkList=new Array();
if(this.enableMasterSelect){
YAHOO.util.Event.removeListener(this.masterSelect,"click",this._masterSelectedCallback);
}
}
if(_1cf&&_1cf.tagName=="table"&&_1cf.rows){
for(var i=0;i<_1cf.rows[0].cells.length;i++){
YAHOO.util.Event.removeListener(_1cf.rows[0].cells[i].firstNode,"click",this._headerClickCallback,this);
YAHOO.util.Event.removeListener(_1cf.rows[0].cells[i].firstNode,"mouseover",this._handleHeaderMouseOver,this);
YAHOO.util.Event.removeListener(_1cf.rows[0].cells[i].firstNode,"mouseout",this._handleHeaderMouseOut,this);
}
for(var i=1;i<_1cf.rows.length;i++){
for(var j=0;j<_1cf.rows[i].cells.length;j++){
YAHOO.util.Event.removeListener(_1cf.rows[i].cells[j],"click",this._cellClickCallback,this);
}
}
}
};
TableWidgetControl.prototype._createIconTable=function(_1d2){
var _1d3=document.createElement("table");
_1d3.className=this.tableStyle.iconColumnHeader;
_1d3.cellPadding="0";
_1d3.cellSpacing="0";
var _1d4=document.createElement("tbody");
var _1d5=document.createElement("tr");
if(_1d2&&this.iconColumns.length>0){
for(var i=0;i<this.iconColumns.length;i++){
var _1d7=document.createElement("td");
_1d7.setAttribute("dbName",this.iconColumns[i]);
_1d7.innerHTML="&nbsp;";
_1d5.appendChild(_1d7);
}
}
_1d4.appendChild(_1d5);
_1d3.appendChild(_1d4);
return _1d3;
};
TableWidgetControl.prototype._createAjaxRequest=function(url,row,_1da){
var _1db=new AjaxRequest(url,this.ajaxEvent);
if(row){
var _1dc=row.columns;
var _1dd=this.dataSource.getColumns();
for(var i=0;i<_1dd.length;i++){
_1db.addAjaxParameter(_1dd[i].dbName,_1dc.get(_1dd[i].dbName).getRawValue());
}
}
if(_1da){
var _1df=new Iterator(_1da);
while(_1df.hasNext()){
var _1e0=_1df.next();
_1db.addAjaxParameter(_1e0.getKey(),_1e0.getValue());
}
}
if(this.ajaxRegions!=null){
_1db.setAjaxRegions(this.ajaxRegions);
}else{
_1db.addAjaxRegion(this.canvas_id,"AREA");
}
_1db.addAjaxParameter("dataToken",this.dataSource.dataToken);
return _1db;
};
TableWidgetControl.prototype._totalIconClick=function(e){
this.iconCellEvent.fire(YAHOO.util.Event.getTarget(e));
};
TableWidgetControl.prototype.setResourceBundle=function(_1e2){
this.resourceBundle=_1e2;
};
TableWidgetControl.prototype.getResourceBundle=function(){
return this.resourceBundle;
};
TableWidgetControl.prototype._moveColumn=function moveColumn(_1e3,_1e4,_1e5){
if(_1e3&&_1e3.rows&&_1e3.insertBefore&&_1e4!=_1e5){
var add=0;
if(this.displayChkBox){
add++;
}
if(this.displayIconColumn){
add++;
}
var _1e7=this.dd[_1e4-add];
if(_1e4>_1e5){
for(var i=0;i<_1e3.rows.length;i++){
var row=_1e3.rows[i];
row.insertBefore(row.cells[_1e4],row.cells[_1e5]);
}
for(var i=_1e4-add;i>_1e5-add;i--){
var _1ea=this.dd[i].columnIndex;
this.dd[i]=this.dd[i-1];
this.dd[i].columnIndex=_1ea;
}
this.dd[_1e5-add]=_1e7;
this.dd[_1e5-add].columnIndex=_1e5;
}else{
for(var i=0;i<_1e3.rows.length;i++){
var row=_1e3.rows[i];
row.insertBefore(row.cells[_1e4],row.cells[_1e5]);
}
for(var i=_1e4-add;i<_1e5-add-1;i++){
var _1ea=this.dd[i].columnIndex;
this.dd[i]=this.dd[i+1];
this.dd[i].columnIndex=_1ea;
}
this.dd[_1e5-add-1]=_1e7;
this.dd[_1e5-add-1].columnIndex=_1e5-1;
}
}
};
TableWidgetControl.prototype.hidePagination=function(){
this.showPagination=false;
};
TableWidgetControl.prototype.setDisableElements=function(_1eb){
this.disableElements=_1eb;
};
TableWidgetResources.prototype.className="TableWidgetResources";
TableWidgetResources.prototype=new Object();
function TableWidgetResources(){
this.First="{first}";
this.Previous="{prev}";
this.Next="{next}";
this.Last="{last}";
this.Results="{Results}";
this.Of="{of}";
this.Display="{Display}";
this.LinesPerPage="{Lines Per Page}";
}
CellData.prototype.className="CellData";
CellData.prototype=new Object();
function CellData(){
this.dbCol=null;
this.rawValue=null;
this.formattedValue="&nbsp;";
this.linkable=true;
this.tooltip=null;
this.params=new Map();
this.dataStyle=null;
}
CellData.prototype.getDbColumnKey=function(){
return this.dbCol;
};
CellData.prototype.getRawValue=function(){
return this.rawValue;
};
CellData.prototype.getFormattedValue=function(){
var ret=new Array();
if(this.dataStyle){
ret.push("<span class='");
ret.push(this.dataStyle);
ret.push("'>");
}
ret.push((!this.formattedValue||this.formattedValue=="")?"&nbsp;":this.formattedValue);
if(this.dataStyle){
ret.push("</span>");
}
return ret.join("");
};
CellData.prototype.getToolTip=function(){
return this.tooltip;
};
CellData.prototype.isLinkable=function(){
return this.linkable;
};
CellData.prototype.getDataStyle=function(){
return this.dataStyle;
};
CellData.prototype.getLinkParams=function(){
return this.params;
};
CellData.prototype.loadFromJson=function(json){
if(json.dbCol){
this.dbCol=json.dbCol;
}
if(json.rawValue){
this.rawValue=json.rawValue;
}
if(json.tooltip){
this.tooltip=json.tooltip;
}
if(json.linkable){
this.linkable=(json.linkable=="true");
}
if(json.dataStyle){
this.dataStyle=json.dataStyle;
}
this.formattedValue=json.formattedValue;
this.rawValue=json.rawValue;
if(json.linkParams!=null){
var _1ee=json.linkParams;
for(var j=0;j<_1ee.length;j++){
if(_1ee[j]&&_1ee[j].name&&_1ee[j].value){
this.params.put(_1ee[j].name,_1ee[j].value);
}
}
}
};
CellEventData.prototype=new Object();
CellEventData.prototype.constructor=CellEventData;
CellEventData.prototype.baseClass=Object.prototype.constructor;
CellEventData.prototype.className="CellEventData";
function CellEventData(cell,col,_1f2,row,_1f4,_1f5){
this.htmlElement=cell;
this.dbCol=col;
this.rawValue=_1f2;
this.parentRow=row;
this.params=_1f4;
this.actualTarget=_1f5;
this.rowData=new Array();
var _1f6=new Iterator(row.columns);
while(_1f6.hasNext()){
var _1f7=_1f6.next();
this.rowData[_1f7.getKey()]=_1f7.getValue().getRawValue();
}
}
CellEventData.prototype.getHTMLElement=function(){
return this.htmlElement;
};
CellEventData.prototype.getColumnId=function(){
return this.dbCol;
};
CellEventData.prototype.getValue=function(){
return this.rawValue;
};
CellEventData.prototype.getParentRow=function(){
return this.parentRow;
};
CellEventData.prototype.getRowData=function(){
return this.rowData;
};
CellEventData.prototype.getParams=function(){
return this.params;
};
CellEventData.prototype.getActualTarget=function(){
return this.actualTarget;
};
TableColumn.prototype=new Object();
TableColumn.prototype.constructor=TableColumn;
TableColumn.prototype.baseClass=Object.prototype.constructor;
function TableColumn(_1f8,_1f9){
this.dbName=null;
this.displayName=null;
this.dataType=null;
this.tooltip=null;
this.sortable=false;
this.hidden=false;
this.linktype=null;
this.linkurl=null;
this.headerStyle=null;
this.dataStyle=null;
this.params=new Map();
this.iconMap=new Map();
this.eventMap=new Map();
}
TableColumn.prototype.getDBKey=function(){
return this.dbName;
};
TableColumn.prototype.getDisplayName=function(){
return this.displayName;
};
TableColumn.prototype.getDataType=function(){
return this.dataType;
};
TableColumn.prototype.getToolTip=function(){
return this.tooltip==null?"":this.tooltip;
};
TableColumn.prototype.isSortable=function(){
return this.sortable;
};
TableColumn.prototype.isHidden=function(){
return this.hidden;
};
TableColumn.prototype.getLinkType=function(){
return this.linktype;
};
TableColumn.prototype.getLinkURL=function(){
return this.linkurl;
};
TableColumn.prototype.findLinkInfo=function(_1fa){
if(_1fa&&this.eventMap.containsKey(_1fa)){
return this.eventMap.get(_1fa);
}
return [this.linktype,this.linkurl];
};
TableColumn.prototype.getLinkURL=function(){
return this.linkurl;
};
TableColumn.prototype.getLinkParams=function(){
return this.params;
};
TableColumn.prototype.getIconClassFor=function(val){
if(this.iconMap.containsKey(val)){
return this.iconMap.get(val);
}
return null;
};
TableColumn.prototype.loadFromJson=function(json){
this.params=new Map();
this.iconMap=new Map();
this.eventMap=new Map();
if(json.dbName){
this.dbName=json.dbName;
}
if(json.displayName){
this.displayName=json.displayName;
}
if(json.dataType){
this.dataType=json.dataType;
}
if(json.tooltip){
this.tooltip=json.tooltip;
}
if(json.sortable){
this.sortable=json.sortable=="true"?true:false;
}
if(json.hidden){
this.hidden=json.hidden=="true"?true:false;
}
if(json.linktype){
this.linktype=json.linktype;
}
if(json.linkurl){
this.linkurl=json.linkurl;
}
if(json.iconClass){
var _1fd=json.iconClass.split(",");
for(var i=0;i<_1fd.length;i++){
var map=_1fd[i].split("=");
if(map.length>1){
this.iconMap.put(map[0],map[1]);
}
}
}
if(json.linkParams!=null){
var _200=json.linkParams;
if(_200.length>0){
for(var j=0;j<_200.length;j++){
if(_200[j]&&_200[j].name&&_200[j].value){
this.params.put(_200[j].name,_200[j].value);
}
}
}
}
if(json.columnEvents!=null&&json.columnEvents.length>0){
for(var j=0;j<json.columnEvents.length;j++){
var name=json.columnEvents[j].eventName;
var type=json.columnEvents[j].linktype;
var url=json.columnEvents[j].linkurl;
if(name&&type&&url){
this.eventMap.put(name,[type,url]);
}
}
}
};
TableDataModel.prototype.className="TableDataModel";
TableDataModel.prototype=new AbstractAjaxDataModel();
function TableDataModel(_205){
AbstractAjaxDataModel.call(this);
this.setMessageId(_205);
this.idColumn=null;
this.altIdColumn=null;
this.actionUrl=null;
this.rowspan=false;
this.rowSpanCols="";
this.columns=new Array();
this.total_rows=new Array();
this.filtered_rows=new Array();
this.rows=new Array();
this.indexedRows=new Array();
this.sortedColumn=null;
this.sortedOrder=null;
this.total=-1;
this.maxRow=-1;
this.totalPages=-1;
this.currentPage=-1;
this.lowIndex=-1;
this.additionalParams=new Map();
this.filterText=null;
this.defaultFilterFields=null;
this.searchType=null;
this.filterStr=null;
this.dataToken=null;
this.targetDivs=null;
}
TableDataModel.prototype.addTargetDiv=function(_206){
if(_206==null){
return;
}
if(this.targetDivs==null){
this.targetDivs=new Array();
}
this.targetDivs.push({id:_206});
};
TableDataModel.prototype.setRows=function(_207){
if(_207 instanceof Array){
this.rows=_207;
this.indexedRows=new Array();
for(var i=0;i<_207.length;i++){
this.indexedRows[_207[i].columns.get(this.idColumn).getRawValue()]=_207[i];
}
this.fireDataChangedEvent();
}
};
TableDataModel.prototype.addColumn=function(_209){
this.columns[this.columns.length]=_209;
};
TableDataModel.prototype.getColumns=function(){
return this.columns;
};
TableDataModel.prototype.addTotalRow=function(row){
this.total_rows[this.total_rows.length]=row;
};
TableDataModel.prototype.getTotalRows=function(){
return this.total_rows;
};
TableDataModel.prototype.addFilteredRow=function(row){
this.filtered_rows[this.filtered_rows.length]=row;
};
TableDataModel.prototype.getFilteredRows=function(){
return this.filtered_rows;
};
TableDataModel.prototype.addDataRow=function(row,_20d){
this.indexedRows[row.columns.get(this.idColumn).getRawValue()]=row;
this.rows[this.rows.length]=row;
if(this.fireChange!=false){
this.fireDataChangedEvent();
}
};
TableDataModel.prototype.removeDataRows=function(ids,_20f){
for(var i=this.rows.length;i>-1;i--){
if(ids.indexOf(this.rows[i].columns.get(this.idColumn).getRawValue())>-1){
this.indexedRows[this.rows[i].columns.get(this.idColumn).getRawValue()]=null;
this.rows.splice(i,1);
}
}
if(this.fireChange!=false){
this.fireDataChangedEvent();
}
};
TableDataModel.prototype.getDataRows=function(){
return this.rows;
};
TableDataModel.prototype.ajaxUpdate=function(_211){
};
TableDataModel.prototype.setIdColumn=function(col){
this.idColumn=col;
};
TableDataModel.prototype.getIdColumn=function(){
return this.idColumn;
};
TableDataModel.prototype.setAltIdColumn=function(col){
this.altIdColumn=col;
};
TableDataModel.prototype.getAltIdColumn=function(){
return this.altIdColumn;
};
TableDataModel.prototype.setActionUrl=function(url){
this.actionUrl=url;
};
TableDataModel.prototype.getActionUrl=function(){
return this.actionUrl;
};
TableDataModel.prototype.setAutoRowSpan=function(span){
this.rowspan=span;
};
TableDataModel.prototype.isAutoRowSpan=function(){
return this.rowspan;
};
TableDataModel.prototype.setRowSpanCols=function(col){
this.rowSpanCols=col;
};
TableDataModel.prototype.getRowSpanCols=function(){
return this.rowSpanCols;
};
TableDataModel.prototype.getSortedColumn=function(){
return this.sortedColumn;
};
TableDataModel.prototype.getSortedOrder=function(){
return this.sortedOrder;
};
TableDataModel.prototype.getFirstRow=function(){
return this.firstRow;
};
TableDataModel.prototype.getMaxRow=function(){
return this.maxRow;
};
TableDataModel.prototype.getCurrentIndex=function(){
return this.currentIndex;
};
TableDataModel.prototype.getTotalPages=function(){
return this.totalPages;
};
TableDataModel.prototype.getCurrentPage=function(){
return this.currentPage;
};
TableDataModel.prototype.addAdditionalParam=function(key,_218){
this.additionalParams.put(key,_218);
};
TableDataModel.prototype.setFilterContent=function(col){
this.filterText=col;
};
TableDataModel.prototype.getFilterContent=function(){
return this.filterText;
};
TableDataModel.prototype.setSearchType=function(_21a){
this.searchType=_21a;
};
TableDataModel.prototype.getSearchType=function(){
return this.searchType;
};
TableDataModel.prototype.setFilterStr=function(str){
this.filterStr=str;
};
TableDataModel.prototype.getFilterStr=function(){
return this.filterStr;
};
TableDataModel.prototype.setDefaultFilterFields=function(col){
this.defaultFilterFields=col;
};
TableDataModel.prototype.getDefaultFilterFields=function(){
return this.defaultFilterFields;
};
TableDataModel.prototype.toXMLString=function(){
var xml="<tableData>";
if(this.columns!=null){
xml+="<columns>";
for(var i=0;i<this.columns.length;i++){
xml+=this.columns[i].serialize();
}
xml+="</columns>";
}
if(this.rows!=null){
xml+="<rows>";
for(var i=0;i<this.rows.length;i++){
xml+=this.rows[i].serialize();
}
xml+="</rows>";
}
xml+="</tableData>";
return xml;
};
TableDataModel.prototype.loadFromJson=function(_21f){
var _220=_21f.metaData;
if(_220!=null){
this.setIdColumn(_220.idCol);
if(_220.altIdCol){
this.setAltIdColumn(_220.altIdCol);
}else{
this.setAltIdColumn(_220.idCol);
}
if(_220.actionUrl){
this.setActionUrl(_220.actionUrl);
}
if(_220.rowspan){
this.setAutoRowSpan(_220.rowspan=="true");
}
if(_220.rowspanCols){
this.setRowSpanCols(_220.rowspanCols.split(","));
}
if(_220.colMetaData){
this.columns=new Array();
var _221=_220.colMetaData;
for(var j=0;j<_221.length;j++){
if(_221[j]==null){
continue;
}
var _223=new TableColumn();
_223.loadFromJson(_221[j]);
this.addColumn(_223);
}
}
this.additionalParams=new Map();
if(_220.additionalParams!=null){
var _224=_220.additionalParams;
for(var k=0;k<_224.length;k++){
if(_224[k]==null){
continue;
}
var _key=_224[k].name;
var _val=_224[k].value;
if(_key&&_val){
this.addAdditionalParam(_key,_val);
}
}
}
if(_220.filterInfo!=null){
this.setDefaultFilterFields(_220.filterInfo.fields);
this.setFilterContent(_220.filterInfo.content);
this.setSearchType(_220.filterInfo.searchtype);
this.setFilterStr(_220.filterInfo.filterstr);
}
}
var data=_21f.data;
if(data!=null){
if(data.sortedColumn){
this.sortedColumn=data.sortedColumn;
}
if(data.sortedOrder){
this.sortedOrder=data.sortedOrder;
}
if(data.total){
this.total=(new Number(data.total)).valueOf();
}
if(data.maxRow){
this.maxRow=(new Number(data.maxRow)).valueOf();
}
if(data.lowIndex){
this.lowIndex=(new Number(data.lowIndex)).valueOf();
}
if(data.totalPages){
this.totalPages=(new Number(data.totalPages)).valueOf();
}
if(data.currentPage){
this.currentPage=(new Number(data.currentPage)).valueOf();
}
if(this.sortedColumn&&this.sortedColumn=="null"){
this.sortedColumn="";
}
var _229=true;
var _22a=true;
if("true"!=_21f.cacheTotal){
this.total_rows=new Array();
}
if("true"!=_21f.cacheFilterTotal){
this.filtered_rows=new Array();
}
this.rows=new Array();
this.indexedRows=new Array();
var rows=data.rows;
var _22c=0;
var _22d=0;
var _22e=0;
if(rows!=null){
for(var j=0;j<rows.length;j++){
if(rows[j]==null){
continue;
}
if(rows[j].rowType=="totalRow"){
var row=new TableRow("total");
row.loadFromJson(rows[j]);
row.setRowId(""+_22c++,this.idColumn==null);
if("true"==_21f.cacheTotal&&_229){
this.total_rows=new Array();
_229=false;
}
this.total_rows.push(row);
}else{
if(rows[j].rowType=="filteredRow"){
var row=new TableRow("filtered");
row.loadFromJson(rows[j]);
row.setRowId(""+_22d++,this.idColumn==null);
if("true"==_21f.cacheFilterTotal&&_22a){
this.filtered_rows=new Array();
_22a=false;
}
this.filtered_rows.push(row);
}else{
var row=new TableRow("data");
row.loadFromJson(rows[j]);
row.setRowId(""+_22e++,this.idColumn==null);
if(this.idColumn!=null){
this.indexedRows[row.columns.get(this.idColumn).getRawValue()]=row;
}else{
this.indexedRows[row.rowId]=row;
}
this.rows.push(row);
}
}
}
}
if(this.idColumn==null){
this.idColumn="__rowId";
}
}
};
TableDataModel.prototype.processUpdate=function(_230){
throw new MethodNotSupportedException("TableDataModel no longer supports xml type. Please change to json type.");
};
TableDataModel.prototype.processJsonUpdate=function(obj){
if(obj==null){
return;
}
var _232=false;
if(obj.tableData&&obj.tableData.dataToken){
if(obj.tableData.dataToken!=this.dataToken){
return;
}
}else{
this.dataToken=(new Date()).getTime();
_232=true;
}
this.disableEvents();
this.loadFromJson(obj.tableData);
this.enableEvents();
this.fireDataChangedEvent();
if(_232&&this.targetDivs!=null){
ajaxEngine._enableAjaxRegion(this.targetDivs,true);
}
};
TableDataModel.prototype.findRowById=function(id){
return this.indexedRows[id];
};
TableDataModel.prototype.findRowByRowId=function(id){
return this.rows[id];
};
TableDataModel.prototype.findTotalRowById=function(id){
for(var i=0;i<this.total_rows.length;i++){
if(this.total_rows[i].columns.get(this.idColumn).getRawValue()==id){
return this.total_rows[i];
}
}
return null;
};
TableDataModel.prototype.findTotalRowByRowId=function(id){
return this.total_rows[id];
};
TableDataModel.prototype.findFilteredRowById=function(id){
for(var i=0;i<this.filtered_rows.length;i++){
if(this.filtered_rows[i].columns.get(this.idColumn).getRawValue()==id){
return this.filtered_rows[i];
}
}
return null;
};
TableDataModel.prototype.findFilteredRowByRowId=function(id){
return this.filtered_rows[id];
};
TableDataModel.prototype.findColumn=function(id){
for(var i=0;i<this.columns.length;i++){
if(this.columns[i].dbName==id){
return this.columns[i];
}
}
return null;
};
TableDataModel.ComparatorField="id";
TableDataModel.ComparatorOrder="asc";
TableDataModel.ComparatorDataType=null;
TableDataModel.prototype.sort=function(_23d,_23e){
TableDataModel.ComparatorField=_23d;
TableDataModel.ComparatorOrder=(_23e!="false")?"asc":"desc";
var _23f=this.findColumn(_23d);
TableDataModel.ComparatorDataType=_23f==null?null:_23f.getDataType();
this.sortedOrder=_23e;
this.sortedColumn=_23d;
this.rows.sort(function(a,b){
if(TableDataModel.ComparatorOrder=="desc"){
return b.compare(a,TableDataModel.ComparatorField,TableDataModel.ComparatorDataType);
}
return a.compare(b,TableDataModel.ComparatorField,TableDataModel.ComparatorDataType);
});
};
TableRow.prototype=new Object();
TableRow.prototype.constructor=TableRow;
TableRow.prototype.baseClass=Object.prototype.constructor;
function TableRow(type){
this.columns=new Map();
this.overrideIcon=false;
this.iconImage=null;
this.iconLinkType=null;
this.iconLinkUrl=null;
this.disabled=false;
this.rowId=null;
this.rowType="data";
if(type){
this.rowType=type;
}
}
TableRow.prototype.loadFromJson=function(json){
if(json.overrideIcon){
this.overrideIcon=(json.overrideIcon=="true");
}
if(json.iconImage){
this.iconImage=json.iconImage;
}
if(json.iconLinkType){
this.iconLinkType=json.iconLinkType;
}
if(json.iconLinkUrl){
this.iconLinkUrl=json.iconLinkUrl;
}
if(json.disable){
this.disabled=("true"==json.disable);
}
this.columns=new Map();
var _244=json.cellData;
for(var i=0;i<_244.length;i++){
if(_244[i]==null){
continue;
}
var cell=new CellData();
cell.loadFromJson(_244[i]);
this.columns.put(cell.getDbColumnKey(),cell);
}
};
TableRow.prototype.setRowId=function(_247,_248){
this.rowId=_247;
if(_248){
var _249=new CellData();
_249.dbCol="__rowId";
_249.rawValue=this.rowId;
this.columns.put("__rowId",_249);
}
};
TableRow.prototype.isDisabled=function(){
return this.disabled;
};
TableRow.prototype.getColumns=function(){
return this.columns;
};
TableRow.prototype.compare=function(_24a,_24b,_24c){
var a=this.columns.get(_24b);
if((a==null||a.getRawValue()==null)&&(_24a==null||_24a.columns.get(_24b)==null||_24a.columns.get(_24b).getRawValue()==null)){
return 0;
}
if(a==null||a.getRawValue()==null){
return -1;
}
if(_24a==null||_24a.columns.get(_24b)==null){
return 1;
}
var b=_24a.columns.get(_24b);
if("text"==_24c){
var _a=a.getRawValue().toLowerCase();
var _b=b.getRawValue().toLowerCase();
if(_a>_b){
return 1;
}
if(_a<_b){
return -1;
}
return 0;
}else{
if(a.getRawValue()>b.getRawValue()){
return 1;
}
if(a.getRawValue()<b.getRawValue()){
return -1;
}
return 0;
}
};
TableRow.prototype.getRowType=function(){
return this.rowType;
};
TableStyle.prototype.className="TableStyle";
TableStyle.prototype=new Object();
function TableStyle(){
this.tableClass="data";
this.headerRow="hdrRow";
this.checkColumnHeader="ckbox";
this.iconColumnHeader="icon";
this.columnHeader="";
this.columnHeaderTxt="std";
this.columnHeaderMouseOver="std hdrMseOvr";
this.sortedColumnHeaderMouseOver="sortOdd hdrMseOvr";
this.firstColumnHeader="firstCol";
this.sortedColumn="sortOdd";
this.sortedColumnAsc="sortUp";
this.sortedColumnDesc="sort";
this.totalRow="totalRow";
this.totalCheckCell="ckbox total sectBG";
this.totalCell="total";
this.firstTotalCell="firstColTtl";
this.totalIconCell="icon total";
this.filterRow="sectBG";
this.filterCheckCell="ckbox sectBG";
this.filterIconCell="sectBG";
this.firstfilterCell="filterTotal firstCol";
this.filterCell="filterTotal";
this.firstCell="firstCol";
this.oddRow="odd";
this.selectedRow=null;
this.evenRow="";
this.checkCell="ckbox sectBG";
this.textCell="text";
this.numCell="";
this.linkCell="link";
this.cellSortOdd="sortOdd";
this.cellSortEven="sortEven";
this.iconCell="icon";
this.lastColumn="noRtBdr";
this.customRowStyle=new Array();
this.paginationRowDiv="pagRow tab";
this.paginationDiv="pagination";
this.pageSelect="perPage sectBG";
this.firstPageOff=getImgUrl("images/first_page_off.gif");
this.firstPageOn=getImgUrl("images/first_page_on.gif");
this.lastPageOff=getImgUrl("images/last_page_off.gif");
this.lastPageOn=getImgUrl("images/last_page_on.gif");
this.nextPageOff=getImgUrl("images/next_page_off.gif");
this.nextPageOn=getImgUrl("images/next_page_on.gif");
this.previousPageOff=getImgUrl("images/previous_page_off.gif");
this.previousPageOn=getImgUrl("images/previous_page_on.gif");
}
TableStyle.prototype.addCustomRowStyle=function(_251,_252){
this.customRowStyle[_251]=_252;
};
TableStyle.prototype.getCustomRowStyle=function(_253){
return this.customRowStyle[_253];
};
KeywordSelector.prototype=new BaseWidget();
KeywordSelector.prototype.constructor=KeywordSelector;
KeywordSelector.prototype.baseClass=BaseWidget.prototype.constructor;
function KeywordSelector(_254,url,_256,_257,_258){
this.baseClass(_254);
this.searchDiv=null;
this.searchResultsDiv=null;
this.keywordSearchTxtArea=null;
this.urlTextArea=null;
this.pSeedTextArea=null;
this.nSeedTextArea=null;
this.selectedTextArea=document.createElement("textarea");
this.negativeTextArea=document.createElement("textarea");
this.keywordSuggestionsDiv=null;
this.footNoteDiv=null;
this.addButton=null;
this.styleClass=new KwSelectorStyle();
this.resourceBundle=new KwSelectorResources();
this.simple=_256;
this.showNegativeKWDiv=false;
this.showSearchVolume=true;
this.showCrawlUrl=false;
this.actionUrl=url;
this.searchEvent=_257;
this.refineEvent=_258;
this.keywordTableModel=null;
this.refineTool=new RefineToolManager(_254+"_refine_keyword_list",this.resourceBundle);
this.keywordError=null;
this.negKeywordError=null;
ajaxEngine.registerMessageHandler("suggestionTableDiv",this);
this._rendered=false;
this.tooltipCache=new Array();
this.requestFromRefine=false;
this.maxKeywordsAllowed=500;
this.maxNegativeKeywordsAllowed=50;
this.maxCharsAllowed=100;
this.accountLevelNegatives="";
this.minSeedWordsAllowed=1;
this.maxSeedWordsAllowed=250;
this.maxRequiredKeywordsAllowed=10;
this.maxExcludedKeywordsAllowed=10;
this.minUrlLength=12;
this.maxUrlLength=1024;
this.textareaGridRegEx=/^[ \u3000\S\p{L}]*[\S\p{L}]+[ \u3000\S\p{L}]*$/gm;
this._onAdd=new YAHOO.util.CustomEvent("onAdd",this,true);
this._onAdd.subscribe(this.setKeywordCounter);
this.adGroupId=null;
}
KeywordSelector.prototype.setKeywordCounter=function(e,args){
var _25b=YAHOO.util.Dom.get("kwCounterText");
var _25c=YAHOO.util.Dom.get("kwCounter");
if(_25b&&_25c){
var _25d=args[0];
_25c.innerHTML=_25d;
if(_25d>=this.maxKeywordsAllowed){
YAHOO.util.Dom.addClass(_25b,"err");
}else{
YAHOO.util.Dom.removeClass(_25b,"err");
}
if(_25d>this.maxKeywordsAllowed){
this.displayError(this.keywordErrorDiv,"block",this.resourceBundle.MaxKeywordsExceeded);
}else{
this.displayError(this.keywordErrorDiv,"none");
}
}
};
KeywordSelector.prototype.enforceTextareaGrid=function(e){
var _25f=YAHOO.util.Event.getCharCode(e);
if(_25f){
var _260=this.selectedTextArea.value;
var _261=this.applyTextareaGridRegEx(_260);
if(_261){
var _262=[];
for(var i=0;i<_261.length;i++){
var _264=(window.navigator.userAgent.indexOf("MSIE")>0)?"\r\n":"\n";
_262.push(_261[i]+_264);
}
if(_25f==13){
}
this._onAdd.fire([_261.length]);
}else{
this._onAdd.fire([0]);
}
}
};
KeywordSelector.prototype.applyTextareaGridRegEx=function(_265){
var _266=null;
if(_265){
_266=_265.match(this.textareaGridRegEx);
if(!_266){
_266=[];
var temp=_265.split("\n");
for(var i=0;i<temp.length;i++){
var v=temp[i].trim();
if(v!=""){
_266[_266.length]=v;
}
}
}
}
return _266;
};
KeywordSelector.prototype.setAccountNegativeKeywords=function(str){
this.accountLevelNegatives=str;
};
KeywordSelector.prototype._addTooltip=function(id,_26c,_26d){
this.tooltipCache[this.tooltipCache.length]={id:id,ttHeader:_26c,ttContent:_26d};
};
KeywordSelector.prototype._enableTooltip=function(){
for(var i=0;i<this.tooltipCache.length;i++){
var tt=this.tooltipCache[i];
TooltipManager.scriptToolTipData(tt.id,tt.ttHeader,tt.ttContent,true);
}
};
KeywordSelector.prototype.setActionUrl=function(url){
this.actionUrl=url;
};
KeywordSelector.prototype.setSearchEvent=function(_271){
this.searchEvent=_271;
};
KeywordSelector.prototype.setRefineEvent=function(_272){
this.refineEvent=_272;
};
KeywordSelector.prototype.getKeywords=function(){
if(this.selectedTextArea){
var _273=new Array();
var _274=this.selectedTextArea.value;
var kws=_274.split("\n");
for(var i=0;i<kws.length;i++){
if(kws[i].indexOf("**")>-1){
var _277=kws[i].split(/\*{2}/);
if(_277.length>1&&_277[1]!=null&&_277[1].trim()!=""){
_277[1]=InputFormatter.parse(_277[1],MarketLocaleInfo.decimalPlaces);
_273.push(_277.join("**"));
}else{
_273.push(kws[i]);
}
}else{
_273.push(kws[i]);
}
}
return _273.join("\n");
}
return "";
};
KeywordSelector.prototype.setKeywords=function(_278){
if(this.selectedTextArea){
this.selectedTextArea.value=InputFormatter.decodeHTML(_278);
this._checkKwCount();
}
};
KeywordSelector.prototype.getNegativeKeywords=function(){
if(this.negativeTextArea){
return this.negativeTextArea.value;
}
return "";
};
KeywordSelector.prototype.setNegativeKeywords=function(_279){
if(this.negativeTextArea){
this.negativeTextArea.value=InputFormatter.decodeHTML(_279);
this._checkNegativeCount();
}
};
KeywordSelector.prototype.getPositiveSearchKeywords=function(){
if(this.keywordSearchTxtArea){
return this.keywordSearchTxtArea.value;
}
return null;
};
KeywordSelector.prototype.getNegativeSearchKeywords=function(){
if(this.nSeedTextArea){
return this.nSeedTextArea.value;
}
return null;
};
KeywordSelector.prototype.getRequiredSearchKeywords=function(){
if(this.pSeedTextArea){
return this.pSeedTextArea.value;
}
return null;
};
KeywordSelector.prototype.getCrawlUrl=function(){
if(this.urlTextArea){
return this.urlTextArea.value;
}
return null;
};
KeywordSelector.prototype.showNegativeKeywordDiv=function(){
this.showNegativeKWDiv=true;
};
KeywordSelector.prototype.render=function(){
if(this.keywordSuggestionsTable==null){
this.keywordSuggestionsTable=new TableWidgetControl(this.canvas_id+"_keyword_suggestions",null,true,false);
this.keywordSuggestionsTable.displayIconColumn=false;
this.keywordSuggestionsTable.showPagination=false;
this.keywordSuggestionsTable.enableMasterSelect=true;
this.keywordSuggestionsTable.setDataSource(this._getTableModel());
this.keywordSuggestionsTable.canvas=this.keywordSuggestionsDiv;
this.keywordSuggestionsTable.addRowClickListener(this._tableRowClicked,this);
this._setTableStyle();
}
this.getCanvas().innerHTML="";
this.getCanvas().appendChild(this._generateSearch());
if(!this.simple){
this.getCanvas().appendChild(this._generateSearchResults());
}
this.getCanvas().appendChild(this._generateActionDiv());
this.getCanvas().appendChild(this._generateKeywordDiv());
var br=document.createElement("br");
this.getCanvas().appendChild(br);
if(!this.simple&&this.showNegativeKWDiv){
this.getCanvas().appendChild(this._generateNegativeDiv());
}
if(!this.simple){
this.getCanvas().appendChild(this._generateRefineDiv());
}
this.getCanvas().parentNode.insertBefore(this._generateFootNoteDiv(),this.getCanvas().nextSibling);
this._rendered=true;
this._enableTooltip();
};
KeywordSelector.prototype._generateSearch=function(){
var _27b=document.createElement("div");
document.body.appendChild(_27b);
_27b.innerHTML="&nbsp;";
this.searchDiv=document.createElement("div");
this.searchDiv.innerHTML="&nbsp;";
var _27c=_27b.firstChild;
var _27d=document.createElement("br");
var _27e=document.createElement("p");
this.searchDiv.innerHTML="";
this.searchDiv.className=this.styleClass.kwSearchForm;
this.searchDiv.id=this.canvas_id+"keyword_search_form";
var _27f=document.createElement("div");
if(this.simple){
_27f.className=this.styleClass.kwSimpleSearchBox;
}else{
_27f.className=this.styleClass.kwSearchBox;
}
this.searchDiv.appendChild(_27f);
var _280=document.createElement("div");
_280.className=this.styleClass.kwSearchContent;
_27f.appendChild(_280);
var _281=document.createElement("label");
_281.setAttribute("for",this.canvas_id+"_keyword_search_txt");
_281.id="kw_selector_title";
_281.innerHTML=this.resourceBundle.SelectorTitle;
_280.appendChild(_281);
_280.appendChild(_27d.cloneNode(false));
var _282=_27e.cloneNode(false);
_282.id=this.canvas_id+"_kwHelpText";
_282.innerHTML=this.resourceBundle.SelectorDescription;
_280.appendChild(_282);
var _283=_27e.cloneNode(false);
_283.innerHTML="&nbsp;";
_280.appendChild(_283);
var _284=_27e.cloneNode(false);
_284.id=this.canvas_id+"_keyword_search_lbl";
_284.innerHTML=this.resourceBundle.SelectorFieldLabel;
_280.appendChild(_284);
this.keywordSearchTxtArea=document.createElement("textarea");
this.keywordSearchTxtArea.setAttribute("rows",4);
this.keywordSearchTxtArea.setAttribute("cols",26);
this.keywordSearchTxtArea.name=this.canvas_id+"_keyword_search_txt";
this.keywordSearchTxtArea.id=this.keywordSearchTxtArea.name;
_280.appendChild(this.keywordSearchTxtArea);
var _285=document.createElement("br");
_280.appendChild(_285);
var _286=document.createElement("span");
_286.id=this.canvas_id+"_kw_search_tip_txt";
_280.appendChild(_286);
_286.className="sm";
_286.innerHTML=this.resourceBundle.SelectorFieldTip;
_280.appendChild(_27e.cloneNode(false));
if(!this.simple){
_280.appendChild(_27d.cloneNode(false));
var a3=document.createElement("span");
a3.id=this.canvas_id+"_kw_search_url_lbl";
a3.innerHTML=this.resourceBundle.UrlLabel;
if(this.showCrawlUrl){
_280.appendChild(a3);
}
_280.appendChild(_27c.cloneNode(true));
var _288=a3;
_280.appendChild(_27d.cloneNode(false));
this.urlTextArea=document.createElement("input");
this.urlTextArea.setAttribute("type","text");
this.urlTextArea.className=this.styleClass.kwSearchText;
this.urlTextArea.name=this.canvas_id+"_keyword_search_url";
this.urlTextArea.id=this.urlTextArea.name;
if(this.showCrawlUrl){
_280.appendChild(this.urlTextArea);
}
_280.appendChild(_27e.cloneNode(false));
if(this.showCrawlUrl){
var _289=document.createElement("span");
_289.id=this.canvas_id+"_kw_url_examp_txt";
_280.appendChild(_289);
_289.innerHTML=this.resourceBundle.UrlExampleText;
_289.className="sm";
_280.appendChild(_27e.cloneNode(false));
var _br=document.createElement("br");
_280.appendChild(_br);
}
var _28b=this.urlTextArea;
var a4=_288.cloneNode(false);
a4.id=this.canvas_id+"_kw_posi_seed_lbl";
a4.innerHTML=this.resourceBundle.PositiveSeedLabel;
_280.appendChild(a4);
_280.appendChild(_27c.cloneNode(true));
_280.appendChild(_27d.cloneNode(false));
this.pSeedTextArea=_28b.cloneNode(false);
this.pSeedTextArea.name=this.canvas_id+"_keyword_positive_seed";
this.pSeedTextArea.id=this.pSeedTextArea.name;
_280.appendChild(this.pSeedTextArea);
_280.appendChild(_27e.cloneNode(false));
var a5=_288.cloneNode(false);
a5.innerHTML=this.resourceBundle.NegativeSeedLabel;
a5.id=this.canvas_id+"_kw_nega_seed_lbl";
_280.appendChild(a5);
_280.appendChild(_27c.cloneNode(true));
_280.appendChild(_27d.cloneNode(false));
this.nSeedTextArea=_28b.cloneNode(false);
this.nSeedTextArea.name=this.canvas_id+"_keyword_negative_seed";
this.nSeedTextArea.id=this.nSeedTextArea.name;
_280.appendChild(this.nSeedTextArea);
var _28e=document.createElement("div");
_28e.className=this.styleClass.kwSearchButtonDiv;
var _28f=document.createElement("input");
_28f.setAttribute("type","button");
_28f.className=this.styleClass.submitButton;
_28f.id=this.canvas_id+"_search_kw_button";
_28f.value=this.resourceBundle.GetKeywordsLabel;
YAHOO.util.Event.addListener(_28f,"click",this._handleInvokeShowKeywordResults,this,true);
_28e.appendChild(_28f);
_280.appendChild(_28e);
if(this._defaultRunQueueId){
this.searchDiv.style.display="none";
}
}else{
var _290=document.createElement("br");
_280.appendChild(_290);
_280.appendChild(_27c.cloneNode(true));
var _28f=document.createElement("input");
_28f.setAttribute("type","button");
_28f.className=this.styleClass.submitButton;
_28f.value=this.resourceBundle.GetKeywordsLabel;
_28f.id=this.canvas_id+"_get_kw_button";
YAHOO.util.Event.addListener(_28f,"click",this._handleInvokeShowKeywordResults,this,true);
_280.appendChild(_28f);
_280.appendChild(document.createTextNode("\n"));
this._generateSuggestionsDiv();
this.keywordSuggestionsDiv.style.display="none";
_27f.appendChild(this.keywordSuggestionsDiv);
if(this._defaultRunQueueId){
_282.style.display="none";
this.keywordSuggestionsDiv.style.display="block";
}
}
return this.searchDiv;
};
KeywordSelector.prototype._handleInvokeShowKeywordResults=function(_291){
var _292=document.getElementById("selectorErrors");
if(_292){
_292.style.display="none";
}
var _293=this.keywordSearchTxtArea;
var _294="\n";
if(window.navigator.userAgent.indexOf("MSIE")>0){
_294="\r\n";
}
var _295=_293.value.split(_294);
var _296=0;
for(var idx=0;idx<_295.length;idx++){
if(_295[idx].length>0){
_296=_296+1;
}
}
if(_296<this.minSeedWordsAllowed){
var _298=document.createTextNode(this.resourceBundle.MinimumSeedWordsNotEntered);
if(_292){
_292.innerHTML="";
_292.appendChild(_298);
_292.style.display="block";
}
return;
}
if(_296>this.maxSeedWordsAllowed){
var _298=document.createTextNode(this.resourceBundle.MaxSeedWordsExceeded);
if(_292){
_292.innerHTML="";
_292.appendChild(_298);
_292.style.display="block";
}
return;
}
for(var idx=0;idx<_295.length;idx++){
if(_295[idx].length>=this.maxCharsAllowed){
var _298=document.createTextNode(this.resourceBundle.SeedWordTooLong);
if(_292){
_292.innerHTML="";
_292.appendChild(_298);
_292.style.display="block";
}
return;
}
}
var _299=this.urlTextArea;
if(_299){
var _29a=_299.value.length;
if(_29a>0&&_29a<this.minUrlLength){
var _298=document.createTextNode(this.resourceBundle.MinUrlLengthNotMet);
if(_292){
_292.innerHTML="";
_292.appendChild(_298);
_292.style.display="block";
}
return;
}
if(_29a>this.maxUrlLength){
var _298=document.createTextNode(this.resourceBundle.MaxUrlLengthExceeded);
if(_292){
_292.innerHTML="";
_292.appendChild(_298);
_292.style.display="block";
}
return;
}
}
var _29b=this.pSeedTextArea;
if(_29b){
var _29c=_29b.value;
if(_29c.length>0){
var _29d=_29c.split(",");
var _296=0;
for(var idx=0;idx<_29d.length;idx++){
if(_29d[idx].length>0){
_296=_296+1;
}
}
if(_296>this.maxRequiredKeywordsAllowed){
var _298=document.createTextNode(this.resourceBundle.MaxRequiredKeywordsExceeded);
if(_292){
_292.innerHTML="";
_292.appendChild(_298);
_292.style.display="block";
}
return;
}
for(var idx=0;idx<_29d.length;idx++){
if(_29d[idx].length>=this.maxCharsAllowed){
var _298=document.createTextNode(this.resourceBundle.SeedWordTooLong);
if(_292){
_292.innerHTML="";
_292.appendChild(_298);
_292.style.display="block";
}
return;
}
}
}
}
var _29e=this.nSeedTextArea;
if(_29e){
var _29f=_29e.value;
if(_29f.length>0){
var _2a0=_29f.split(",");
var _296=0;
for(var idx=0;idx<_2a0.length;idx++){
if(_2a0[idx].length>0){
_296=_296+1;
}
}
if(_296>this.maxExcludedKeywordsAllowed){
var _298=document.createTextNode(this.resourceBundle.MaxExcludedPhrasesExceeded);
if(_292){
_292.innerHTML="";
_292.appendChild(_298);
_292.style.display="block";
}
return;
}
for(var idx=0;idx<_2a0.length;idx++){
if(_2a0[idx].length>=this.maxCharsAllowed){
var _298=document.createTextNode(this.resourceBundle.SeedWordTooLong);
if(_292){
_292.innerHTML="";
_292.appendChild(_298);
_292.style.display="block";
}
return;
}
}
}
}
if(!this.simple){
this._toggleKeywordToolControls(true);
}else{
var desc=document.getElementById(this.canvas_id+"_kwHelpText");
desc.innerHTML=this.resourceBundle.ChooseDescription;
this.keywordSuggestionsDiv.style.display="block";
this.footNoteDiv.style.display="block";
var tip=document.getElementById(this.canvas_id+"_kw_search_tip_txt");
tip.style.display="none";
}
var _2a3=new AjaxRequest(this.actionUrl,this.searchEvent);
var url=this.urlTextArea;
var _2a5=this.pSeedTextArea;
var _2a6=this.nSeedTextArea;
var _2a7=this.selectedTextArea;
if(_2a5){
_2a3.addAjaxParameter("requiredPhrases",_2a5.value);
}
if(url){
_2a3.addAjaxParameter("url",url.value);
}
if(_293){
_2a3.addAjaxParameter("positiveKeywords",_293.value);
}
if(_2a7){
_2a3.addAjaxParameter("selectedKeywords",_2a7.value);
}
if(_2a6){
_2a3.addAjaxParameter("excludedPhrases",_2a6.value);
}
if(this.adGroupId){
_2a3.addAjaxParameter("adGroupId",this.adGroupId);
}
_2a3.addAjaxRegion(this.keywordSuggestionsDiv.id,"AREA");
ajaxEngine.sendAjaxRequest(_2a3);
};
KeywordSelector.prototype._handleInvokeKeywordRefine=function(_2a8){
var more=this.refineTool.getMoreKeywords()==null?"":this.refineTool.getMoreKeywords().toString();
var _2aa=this.selectedTextArea;
var _2ab=this.keywordSearchTxtArea;
var _2ac="";
if(_2ab){
_2ac=_2ab.value;
}
if(more.length>0){
if(_2ac.length>0){
_2ac=_2ac+"\n";
}
_2ac=_2ac+more;
}
var _2ad=this.refineTool.getFewerKeywords()==null?"":this.refineTool.getFewerKeywords().toString();
this.refineTool.clearKeyword();
var _2ae=new AjaxRequest(this.actionUrl,this.refineEvent);
_2ae.addAjaxParameter("positiveKeywords",_2ac);
_2ae.addAjaxParameter("negativeKeywords",_2ad);
if(_2aa){
_2ae.addAjaxParameter("selectedKeywords",_2aa.value);
}
if(this.adGroupId){
_2ae.addAjaxParameter("adGroupId",this.adGroupId);
}
var _2af=this.nSeedTextArea;
if(_2af){
_2ae.addAjaxParameter("excludedPhrases",_2af.value);
}
var _2b0=this.pSeedTextArea;
if(_2b0){
_2ae.addAjaxParameter("requiredPhrases",_2b0.value);
}
_2ae.addAjaxRegion(this.keywordSuggestionsDiv.id,"AREA");
ajaxEngine.registerMessageHandler("suggestionTableDiv",this);
ajaxEngine.sendAjaxRequest(_2ae);
this.requestFromRefine=true;
dialog.hide();
};
KeywordSelector.prototype._toggleKeywordToolControls=function(_2b1){
var _2b2=this.searchDiv;
var _2b3=this.searchResultsDiv;
if(_2b2&&_2b3){
if(_2b1){
_2b2.style.display="none";
_2b3.style.display="block";
this.refineButtonDiv.style.display="block";
this.footNoteDiv.style.display="block";
}else{
_2b2.style.display="block";
_2b3.style.display="none";
this.refineButtonDiv.style.display="none";
this.footNoteDiv.style.display="none";
this.refineTool.resetRefineTool();
}
}
};
KeywordSelector.prototype.processUpdate=function(_2b4){
var _2b5=$(this.canvas_id+"_refine_button");
var _2b6=_2b4.firstChild;
if(_2b6&&_2b6.tagName=="suggestions"){
var note=_2b6.getAttribute("note");
if(note){
var _2b8=document.getElementById("selectorErrors");
var _2b9=null;
if(note=="unknown.host"){
_2b9=document.createTextNode(this.resourceBundle.UnknownHost);
}else{
if(note=="timeout"){
_2b9=document.createTextNode(this.resourceBundle.Timeout);
}
}
if(_2b8&&_2b9){
_2b8.innerHTML="";
_2b8.appendChild(_2b9);
_2b8.style.display="block";
}
}
var _2ba=_2b6.childNodes;
var _2bb=this._getTableModel();
var rows=new Array();
if(_2ba.length>0){
this.keywordSuggestionsTable.displayChkBox=true;
for(var i=0;i<_2ba.length;i++){
var row=new TableRow();
var _2bf=_2ba[i].getAttribute("text");
var _2c0=_2ba[i].getAttribute("impressions");
var _2c1=_2ba[i].getAttribute("minRange");
var _2c2=_2ba[i].getAttribute("maxRange");
var _2c3=null;
if(_2c0==0){
_2c3="&nbsp;";
}else{
if(_2c0==5){
_2c3=InputFormatter.formatNumber(Math.ceil(_2c1),0)+" +";
}else{
_2c3=InputFormatter.formatNumber(Math.ceil(_2c1),0)+" - "+InputFormatter.formatNumber(Math.ceil(_2c2),0);
}
}
var _2c4=new CellData();
_2c4.dbCol="name";
_2c4.formattedValue=_2bf;
_2c4.rawValue=_2bf;
row.columns.put(_2c4.getDbColumnKey(),_2c4);
if(this.showSearchVolume){
var _2c5=new CellData();
_2c5.dbCol="impressions";
_2c5.formattedValue=_2c3;
_2c5.rawValue=_2c3;
row.columns.put(_2c5.getDbColumnKey(),_2c5);
}
rows.push(row);
if(!this.simple){
this.refineTool.addKeyword(new KeywordResult(_2bf,_2c3));
}
}
if(_2b5){
_2b5.disabled=false;
_2b5.className=this.styleClass.submitButton;
}
}else{
if(_2b5){
_2b5.disabled=true;
_2b5.className=this.styleClass.disabledSubmitButton;
}
this.keywordSuggestionsTable.displayChkBox=false;
var row=new TableRow();
var _2c4=new CellData();
_2c4.dbCol="name";
_2c4.formattedValue=this.resourceBundle.NoResults;
_2c4.rawValue=this.resourceBundle.NoResults;
row.columns.put(_2c4.getDbColumnKey(),_2c4);
rows.push(row);
if(this.showSearchVolume){
var _2c5=new CellData();
_2c5.dbCol="impressions";
_2c5.formattedValue="";
_2c5.rawValue="";
row.columns.put(_2c5.getDbColumnKey(),_2c5);
}
}
_2bb.setRows(rows);
if(!this.simple){
this.refineTool.buildRefineList(this.showSearchVolume);
}
}else{
if(_2b6&&_2b6.tagName=="errors"){
var _2b8=document.getElementById("selectorErrors");
if(this.requestFromRefine){
this._refineButtonClicked(null);
_2b8=document.getElementById("refineErrors");
}else{
if(!this.simple){
this._toggleKeywordToolControls(false);
}
}
if(_2b8){
_2b8.innerHTML="";
var _2c6=_2b6.childNodes;
for(var i=0;i<_2c6.length;i++){
if(_2c6[i].getAttribute("key")=="NoSeedKeywords"){
var _2b9=document.createTextNode(this.resourceBundle.NoSeedWordsError);
_2b8.appendChild(_2b9);
}else{
if(_2c6[i].getAttribute("key")=="invalid.url"){
var _2b9=document.createTextNode(this.resourceBundle.InvalidUrlError);
_2b8.appendChild(_2b9);
}else{
var _2b9=document.createTextNode(_2c6[i].getAttribute("key"));
_2b8.appendChild(_2b9);
}
}
}
_2b8.style.display="block";
}
}else{
if(_2b6&&_2b6.tagName=="internalError"){
var _2b8=document.getElementById("selectorErrors");
if(_2b8){
_2b8.innerHTML="";
var _2b9=document.createTextNode(this.resourceBundle.InternalError);
_2b8.appendChild(_2b9);
_2b8.style.display="block";
}
}
}
}
this.requestFromRefine=false;
};
KeywordSelector.prototype._generateSearchResults=function(){
this.searchResultsDiv=document.createElement("div");
this.searchResultsDiv.id=this.canvas_id+"_keywords_search_results";
this.searchResultsDiv.className=this.styleClass.kwResults;
this.searchResultsDiv.style.display="none";
if(this._defaultRunQueueId){
this.searchResultsDiv.style.display="block";
}
var _2c7=document.createElement("div");
_2c7.className=this.styleClass.kwResultsBox;
this.searchResultsDiv.appendChild(_2c7);
var _2c8=document.createElement("div");
_2c8.className=this.styleClass.kwResultsTop;
_2c7.appendChild(_2c8);
var _2c9=document.createElement("div");
_2c9.className=this.styleClass.kwSearchButtonDiv;
_2c8.appendChild(_2c9);
var _2ca=document.createElement("input");
_2ca.setAttribute("type","button");
_2ca.className=this.styleClass.submitButton;
_2ca.id=this.canvas_id+"_back2Search_button";
_2ca.value=this.resourceBundle.NewSearchLabel;
YAHOO.util.Event.addListener(_2ca,"click",this._back2SearchClicked,this,true);
_2c9.appendChild(_2ca);
var text=document.createElement("h3");
text.id="sText_chooseKwds";
text.innerHTML=this.resourceBundle.ChooseTitle;
_2c8.appendChild(text);
var _2cc=document.createElement("p");
_2c8.appendChild(_2cc);
_2cc.innerHTML=this.resourceBundle.ChooseInstructions;
var txt=document.createTextNode(" ");
_2c8.appendChild(txt);
if(!this.simple){
_2c7.appendChild(this._generateSuggestionsDiv());
}
if(!this.simple){
this.searchResultsDiv.appendChild(this._generateRefineButtonDiv());
}
return this.searchResultsDiv;
};
KeywordSelector.prototype._generateRefineButtonDiv=function(){
this.refineButtonDiv=document.createElement("div");
this.refineButtonDiv.className=this.styleClass.refineButtonDiv;
var _2ce=document.createElement("input");
_2ce.id=this.canvas_id+"_refine_button";
_2ce.setAttribute("type","button");
_2ce.disabled=true;
_2ce.className=this.styleClass.disabledSubmitButton;
_2ce.value=this.resourceBundle.RefineButtonLabel;
YAHOO.util.Event.addListener(_2ce,"click",this._refineButtonClicked,this,true);
this.refineButtonDiv.innerHTML="&nbsp;";
var _2cf=this.refineButtonDiv.firstChild;
this.refineButtonDiv.appendChild(_2ce);
this.refineButtonDiv.appendChild(_2cf);
this.refineButtonDiv.style.display="none";
return this.refineButtonDiv;
};
KeywordSelector.prototype._generateSuggestionsDiv=function(){
this.keywordSuggestionsDiv=document.createElement("div");
if(!this.simple){
this.keywordSuggestionsDiv.className=this.styleClass.kwSuggestionTableDiv;
}else{
this.keywordSuggestionsDiv.className=this.styleClass.kwSimpleSuggestionDiv;
}
this.keywordSuggestionsDiv.id=this.canvas_id+"_keyword_suggestions";
return this.keywordSuggestionsDiv;
};
KeywordSelector.prototype._generateActionDiv=function(){
var div=document.createElement("div");
div.className=this.styleClass.actionDiv;
div.id="addBtn";
this.addButton=document.createElement("input");
this.addButton.setAttribute("type","button");
this.addButton.className=this.styleClass.submitButton;
this.addButton.setAttribute("disabled","true");
this.addButton.id=this.canvas_id+"_addKeywords";
this.addButton.value=this.resourceBundle.AddButtonLabel;
YAHOO.util.Event.addListener(this.addButton,"click",this._addButtonClicked,this,true);
div.appendChild(this.addButton);
return div;
};
KeywordSelector.prototype._generateKeywordDiv=function(){
var div=document.createElement("div");
div.className=this.styleClass.selectedDiv;
var div1=document.createElement("div");
div1.className=this.styleClass.selectedDiv1;
div.appendChild(div1);
var div2=document.createElement("div");
div2.className=this.styleClass.selectedDiv2;
div2.id=this.canvas_id+"_selected_kws";
if(!this.simple){
}else{
div1.className=this.styleClass.simpleSelectedDiv1;
}
div1.appendChild(div2);
var _2d4=document.createElement("label");
_2d4.innerHTML=this.resourceBundle.EnterKeywordsLabel;
_2d4.setAttribute("for",this.canvas_id+"_keywords");
_2d4.id=this.canvas_id+"_enter_kw_lbl";
div2.appendChild(_2d4);
div2.appendChild(document.createElement("br"));
var desc=document.createTextNode(this.resourceBundle.EnterKeywordsDescription);
div2.appendChild(desc);
var _2d6=document.createElement("p");
_2d6.id=this.canvas_id+"_enter_kw_desc";
div2.appendChild(_2d6);
_2d6.innerHTML=this.resourceBundle.EnterKeywordsNote;
_2d6.className="sm";
var _2d7=document.createElement("p");
_2d7.align="right";
_2d7.id="kwCounterText";
div2.appendChild(_2d7);
var _2d8=document.createTextNode(this.resourceBundle.KeywordsEntered+": ");
_2d7.appendChild(_2d8);
var _2d9=document.createElement("span");
_2d9.id="kwCounter";
_2d9.innerHTML=0;
_2d7.appendChild(_2d9);
var _2da=document.createTextNode(" "+this.resourceBundle.Of+" ");
_2d7.appendChild(_2da);
var _2db=document.createTextNode(" ");
_2d7.appendChild(_2db);
var _2dc=document.createElement("span");
_2dc.id="kwMax";
_2dc.innerHTML=this.maxKeywordsAllowed;
_2d7.appendChild(_2dc);
this.selectedTextArea.rows=10;
this.selectedTextArea.cols=40;
this.selectedTextArea.className="full";
this.selectedTextArea.id=this.canvas_id+"_keywords";
div2.appendChild(this.selectedTextArea);
YAHOO.util.Event.addListener(this.selectedTextArea,"blur",this._checkKwCount,this,true);
YAHOO.util.Event.addListener(this.selectedTextArea,"keyup",this.enforceTextareaGrid,this,true);
this.keywordErrorDiv=document.createElement("p");
this.keywordErrorDiv.id=this.canvas_id+"_kw_err_div";
this.keywordErrorDiv.className=this.styleClass.fieldError;
div2.appendChild(this.keywordErrorDiv);
this.keywordErrorDiv.style.display="none";
if(this.keywordError){
this.keywordErrorDiv.innerHTML=this.keywordError;
this.keywordErrorDiv.style.display="block";
}
return div;
};
KeywordSelector.prototype._generateNegativeDiv=function(){
var div=document.createElement("div");
div.className=this.styleClass.negativeDiv;
var div1=document.createElement("div");
div1.className=this.styleClass.negativeDiv1;
div.appendChild(div1);
var span=document.createElement("span");
span.className=this.styleClass.moduleControl;
span.id=this.canvas_id+"_moduleControl";
div1.appendChild(span);
var a=document.createElement("a");
a.id=this.canvas_id+"_tog_nega_kw_link";
a.setAttribute("href","javascript:void(0);");
YAHOO.util.Event.addListener(a,"click",this._toggleModuleControl,this,true);
span.appendChild(a);
var _2e1=document.createElement("span");
_2e1.className="bold";
_2e1.id=this.canvas_id+"_nega_kw_lbl";
_2e1.innerHTML=this.resourceBundle.AddNegativeWordsLabel;
a.appendChild(_2e1);
var div2=document.createElement("div");
div2.style.display="none";
div2.style._height="287px";
div2.id=this.canvas_id+"_moduleDisplay";
if(this.negKeywordError){
span.className=this.styleClass.moduleControlDown;
div2.style.display="block";
}
div1.appendChild(div2);
var _2e3=document.createElement("p");
var p=_2e3.cloneNode(true);
p.innerHTML=this.resourceBundle.AddNegativeDescription;
p.id=this.canvas_id+"_nega_kw_desc";
div2.appendChild(p);
div2.appendChild(_2e3);
this.negativeTextArea.setAttribute("rows",6);
this.negativeTextArea.setAttribute("cols",40);
this.negativeTextArea.className="full";
this.negativeTextArea.id=this.canvas_id+"_negative_keywords";
div2.appendChild(this.negativeTextArea);
this.keywordNegativeErrorDiv=_2e3.cloneNode(true);
this.keywordNegativeErrorDiv.className=this.styleClass.fieldError;
div2.appendChild(this.keywordNegativeErrorDiv);
this.keywordNegativeErrorDiv.style.display="none";
if(this.negKeywordError){
this.keywordNegativeErrorDiv.innerHTML=this.negKeywordError;
this.keywordNegativeErrorDiv.style.display="block";
}
div2.appendChild(_2e3.cloneNode(true));
var _2e5=_2e1.cloneNode(true);
_2e5.innerHTML=this.resourceBundle.AccountNegativeWordsLabel;
_2e5.id=this.canvas_id+"_acc_nega_kw_lbl";
div2.appendChild(_2e5);
var _2e6=document.createElement("br");
div2.appendChild(_2e6);
var _2e7=this.negativeTextArea.cloneNode(true);
_2e7.id=this.canvas_id+"_acct_excluded";
_2e7.className="readonly";
_2e7.readonly="true";
_2e7.disabled=true;
_2e7.value=this.accountLevelNegatives;
div2.appendChild(_2e7);
YAHOO.util.Event.addListener(this.negativeTextArea,"blur",this._checkNegativeCount,this,true);
return div;
};
KeywordSelector.prototype._generateFootNoteDiv=function(){
if(this.footNoteDiv!=null){
return this.footNoteDiv;
}
this.footNoteDiv=document.createElement("span");
this.footNoteDiv.id=this.canvas_id+"_footnote";
this.footNoteDiv.className=this.styleClass.footNote;
this.footNoteDiv.style.display="none";
this.footNoteDiv.innerHTML=this.resourceBundle.FootNote;
return this.footNoteDiv;
};
KeywordSelector.prototype._generateRefineDiv=function(){
var _2e8=document.createElement("div");
_2e8.id=this.canvas_id+"_refine_control";
_2e8.className=this.styleClass.refineDiv;
_2e8.style.width="380px";
_2e8.style.display="none";
var _2e9=document.createElement("div");
_2e9.className=this.styleClass.refineDivBorder;
_2e8.appendChild(_2e9);
var _2ea=document.createElement("div");
_2ea.className=this.styleClass.refineDivBox;
_2e9.appendChild(_2ea);
var _2eb=document.createElement("div");
_2eb.className=this.styleClass.refineDivHdrSect;
_2ea.appendChild(_2eb);
var _2ec=document.createElement("div");
_2ec.id=this.canvas_id+"_ref_dial_close";
_2ec.className=this.styleClass.refineDivHdrClose;
_2ec.innerHTML="";
_2eb.appendChild(_2ec);
var hdr=document.createElement("div");
hdr.id=this.canvas_id+"_ref_dial_title";
hdr.className=this.styleClass.refineDivHdr;
hdr.innerHTML=this.resourceBundle.RefineDialogTitle;
_2eb.appendChild(hdr);
var _2ee=document.createElement("div");
_2ee.className=this.styleClass.refineDivContent;
_2ee.id=this.canvas_id+"_ref_content_div";
_2ea.appendChild(_2ee);
var _2ef=this.resourceBundle.RefineDialogDescription.replace("{plus}",this.refineTool.plus);
_2ef=_2ef.replace("{minus}",this.refineTool.minus);
_2ee.innerHTML=_2ef;
var _2f0=document.createElement("div");
_2f0.id="refineErrors";
_2ee.appendChild(_2f0);
_2f0.className="fieldError";
_2f0.style.display="none";
var _2f1=document.createElement("div");
_2f1.className=this.styleClass.refineDivTable;
_2f1.id=this.canvas_id+"_refine_keyword_list";
_2ee.appendChild(_2f1);
var _2f2=document.createElement("div");
_2f2.className=this.styleClass.refineDivAction;
_2ea.appendChild(_2f2);
var done=document.createElement("input");
done.id=this.canvas_id+"_ref_cancel_button";
done.setAttribute("type","button");
done.className=this.styleClass.refineDivCancelButton;
done.value=this.resourceBundle.RefineDialogCancel;
YAHOO.util.Event.addListener(done,"click",dialog.hide,dialog);
_2f2.appendChild(done);
_2f2.appendChild(document.createTextNode("  "));
var _2f4=document.createElement("input");
_2f4.id=this.canvas_id+"_ref_update_button";
_2f4.setAttribute("type","button");
_2f4.className=this.styleClass.refineDivButton;
_2f4.value=this.resourceBundle.RefineDialogUpdate;
YAHOO.util.Event.addListener(_2f4,"click",this._handleInvokeKeywordRefine,this,true);
_2f2.appendChild(_2f4);
return _2e8;
};
KeywordSelector.prototype._getTableModel=function(){
if(this.keywordTableModel!=null){
return this.keywordTableModel;
}
this.keywordTableModel=new TableDataModel("test");
var col1=new TableColumn();
col1.dbName="name";
col1.displayName=this.resourceBundle.TblNameCol;
col1.headerStyle="sm center";
col1.dataStyle="firstCol";
col1.tooltip=this.resourceBundle.TblKeywordTtip;
this.keywordTableModel.addColumn(col1);
if(this.showSearchVolume){
var col2=new TableColumn();
col2.dbName="impressions";
col2.displayName=this.resourceBundle.TblImpressions;
col2.headerStyle="sm center";
col2.tooltip=this.resourceBundle.TblImpressionsTtip;
this.keywordTableModel.addColumn(col2);
}
this.keywordTableModel.setIdColumn("name");
return this.keywordTableModel;
};
KeywordSelector.prototype._back2SearchClicked=function(){
this._toggleKeywordToolControls(false);
this.keywordSearchTxtArea.value="";
this.urlTextArea.value="";
this.pSeedTextArea.value="";
this.nSeedTextArea.value="";
this.keywordSuggestionsDiv.innerHTML="";
};
KeywordSelector.prototype._refineButtonClicked=function(_2f7){
var _2f8=document.getElementById("refineErrors");
if(_2f8){
_2f8.style.display="none";
}
dialog.createDialog(null,this.canvas_id+"_refine_control",true,0,0);
};
KeywordSelector.prototype._addButtonClicked=function(e){
var _2fa="\n";
if(window.navigator.userAgent.indexOf("MSIE")>0){
_2fa="\r\n";
}
if(this.selectedTextArea){
var _2fb=true;
var _2fc=this._getAppliedKeywords();
var _2fd=false;
var _2fe=this.resourceBundle.AlreadyInListMsg+":\n";
var _2ff=this.keywordSuggestionsTable.getSelectedIDs();
for(var i=0;i<_2ff.length;i++){
var _301=_2ff[i];
if(_2fc[_301]!=undefined){
_2fd=true;
_2fe+=_301+"\n";
}else{
var _302=this.selectedTextArea.value;
if(_302.length>0&&_302.substring(_302.length-1,_302.length)!="\n"){
this.selectedTextArea.value+=_2fa;
}
this.selectedTextArea.value+=(_301+_2fa);
}
_2fb=false;
}
if(_2fd){
alert(_2fe);
}
if(_2fb){
alert(this.resourceBundle.SelectKeywordsFromList);
}
this._checkKwCount();
}
YAHOO.util.Event.getTarget(e).setAttribute("disabled","true");
this.keywordSuggestionsTable.clearSelections();
};
KeywordSelector.prototype._toggleModuleControl=function(_303){
var _304=document.getElementById(this.canvas_id+"_moduleDisplay");
var _305=document.getElementById(this.canvas_id+"_moduleControl");
if(_305&&_304){
if(_304.style.display=="none"){
_304.style.display="block";
_305.className=this.styleClass.moduleControlDown;
}else{
_304.style.display="none";
_305.className=this.styleClass.moduleControl;
}
}
};
KeywordSelector.prototype._getAppliedKeywords=function(){
var _306=new Array();
if(this.selectedTextArea){
var _307=this.selectedTextArea.value;
if(_307.indexOf("\n")==-1){
_306[_307]="";
return _306;
}
_307+="\n";
var _308="";
for(var i=0;i<_307.length;i++){
var c=_307.charAt(i);
if(c!="\n"){
_308+=c;
}else{
if(c=="\n"){
if(_308.indexOf("**")!=-1){
_308=_308.substring(0,_308.indexOf("**"));
}else{
if(_308.indexOf("\r")!=-1){
_308=_308.substring(0,_308.length-1);
}
}
if(_308!=""){
_306[_308]="";
}
_308="";
}
}
}
}
return _306;
};
KeywordSelector.prototype._tableRowClicked=function(){
var _30b=this.keywordSuggestionsTable.getSelectedIDs();
if(_30b.length>0){
this.addButton.removeAttribute("disabled");
}else{
this.addButton.setAttribute("disabled","true");
}
};
KeywordSelector.prototype._setTableStyle=function(){
this.keywordSuggestionsTable.tableStyle.tableClass="data";
this.keywordSuggestionsTable.tableStyle.headerRow="hdrRow";
this.keywordSuggestionsTable.tableStyle.checkColumnHeader="ckbox";
this.keywordSuggestionsTable.tableStyle.columnHeader="firstCol";
this.keywordSuggestionsTable.tableStyle.oddRow="odd";
this.keywordSuggestionsTable.tableStyle.evenRow="";
this.keywordSuggestionsTable.tableStyle.checkCell="ckbox";
this.keywordSuggestionsTable.tableStyle.lastColumn="noRtBdr";
this.keywordSuggestionsTable.tableStyle.actionHeader=null;
this.keywordSuggestionsTable.tableStyle.actionCell=null;
};
KeywordSelector.prototype.setKeywordError=function(msg){
this.keywordError=msg;
};
KeywordSelector.prototype.setNegKeywordError=function(msg){
this.negKeywordError=msg;
};
KeywordSelector.prototype.setDefaultParams=function(_30e,_30f,reqd,url){
if(this._rendered){
if(this._defaultRunQueueId){
Execution.stop(this._defaultRunQueueId);
this._defaultRunQueueId=null;
}
var _312=false;
if(_30e&&_30e.trim()!=""&&this.keywordSearchTxtArea){
this.keywordSearchTxtArea.value=InputFormatter.decodeHTML(_30e);
_312=true;
}
if(_30f&&_30f.trim()!=""&&this.nSeedTextArea){
this.nSeedTextArea.value=InputFormatter.decodeHTML(_30f);
_312=true;
}
if(reqd&&reqd.trim()!=""&&this.pSeedTextArea){
this.pSeedTextArea.value=InputFormatter.decodeHTML(reqd);
_312=true;
}
if(url&&url.trim()!=""&&this.urlTextArea){
this.urlTextArea.value=url;
_312=true;
}
if(_312){
this._handleInvokeShowKeywordResults(null);
}
}else{
if(!this._defaultRunQueueId){
var args=new Array();
if(_30e&&_30e.trim()!=""){
args[0]=_30e;
}
if(!this.simple){
if(_30f&&_30f.trim()!=""){
args[1]=_30f;
}
if(reqd&&reqd.trim()!=""){
args[2]=reqd;
}
if(url&&url.trim()!=""){
args[3]=url;
}
}
if(args.count()>0){
this._defaultRunQueueId=Execution.set(this.setDefaultParams,50,args,this,-1,true);
}
}
}
};
KeywordSelector.prototype._checkKwCount=function(){
if(isNaN(this.maxKeywordsAllowed)||this.maxKeywordsAllowed<=0){
return;
}
if(this.selectedTextArea){
var _314=this.selectedTextArea.value;
var _315=this.applyTextareaGridRegEx(_314);
if(_315){
this._onAdd.fire([_315.length]);
}
var kws=_314.split("\n");
var _317=new Array();
for(var i=0;i<kws.length;i++){
if(kws[i].indexOf("**")>-1){
var _319=kws[i].split(/\*{2}/);
if(_319.length>1&&_319[1]!=null&&_319[1].trim()!=""){
_319[1]=InputFormatter.formatCurrency(_319[1]);
_317.push(_319.join("**"));
}else{
_317.push(kws[i]);
}
}else{
_317.push(kws[i]);
}
}
this.selectedTextArea.value=_317.join("\n");
var _31a=0;
for(var x=0;x<kws.length;x++){
var _31c=kws[x].replace(/^\s+/,"").replace(/\s+$/,"");
if(_31c.length>0){
_31a++;
}
}
if(_31a>this.maxKeywordsAllowed){
this.displayError(this.keywordErrorDiv,"block",this.resourceBundle.MaxKeywordsExceeded);
return;
}
for(var i=0;i<kws.length;i++){
var len=kws[i].indexOf("**");
if(len==-1){
len=kws[i].length;
}
if(len>this.maxCharsAllowed){
this.displayError(this.keywordErrorDiv,"block",this.resourceBundle.MaxCharSizeExceeded);
return;
}
}
this.displayError(this.keywordErrorDiv,"none");
}
};
KeywordSelector.prototype._checkNegativeCount=function(){
if(isNaN(this.maxNegativeKeywordsAllowed)||this.maxNegativeKeywordsAllowed<=0){
return;
}
if(this.negativeTextArea){
var _31e=this.negativeTextArea.value;
var kws=_31e.split("\n");
var _320=0;
for(var x=0;x<kws.length;x++){
var _322=kws[x].replace(/^\s+/,"").replace(/\s+$/,"");
if(_322.length>0){
_320++;
}
}
if(_320>this.maxNegativeKeywordsAllowed){
this.displayError(this.keywordNegativeErrorDiv,"block",this.resourceBundle.MaxNegativeKeywordsExceeded);
return;
}
for(var i=0;i<kws.length;i++){
var len=kws[i].indexOf("**");
if(len==-1){
len=kws[i].length;
}
if(len>this.maxCharsAllowed){
this.displayError(this.keywordNegativeErrorDiv,"block",this.resourceBundle.MaxCharSizeExceeded);
return;
}
}
this.displayError(this.keywordNegativeErrorDiv,"none");
}
};
KeywordSelector.prototype.displayError=function(div,_326,msg){
if(div!=null){
if(msg!=null){
div.innerHTML=msg;
}
div.style.display=_326;
}
};
KeywordSelector.prototype.checkAltTxts=function(){
if(isNaN(this.maxKeywordsAllowed)||this.maxKeywordsAllowed<=0){
return;
}
var _328=new RegExp("[\\{|#|\\[|\\(|~]\\s*([K|k|E|e|Y|y|W|w|O|o|R|r|D|d|\\-|\\s]+)\\s*[:|;|\\-]*(\\s*[\\w|\\s|,|'|\"|#|\\.]*\\s*)[\\}|#|\\]|\\)|~]?","g");
if(this.selectedTextArea){
var _329=this.selectedTextArea.value;
var kws=_329.split("\n");
for(var i=0;i<kws.length;i++){
if(kws[i].indexOf("**")>-1){
var _32c=kws[i].split(/\*{2}/);
if(_32c.length>2&&_32c[3]!=null&&_32c[2].trim()!=""){
var _32d=_32c[3].match(_328);
if(_32d!=null&&_32d.length>0){
return true;
}
}
}
}
}
return false;
};
KeywordSelector.prototype.hasErrors=function(){
return (this.keywordErrorDiv!=null&&this.keywordErrorDiv.style.display=="block")||(this.keywordNegativeErrorDiv!=null&&this.keywordNegativeErrorDiv.style.display=="block");
};
KeywordSelector.prototype.hideSearchVolume=function(){
this.showSearchVolume=false;
};
KwSelectorResources.prototype.className="KwSelectorResources";
KwSelectorResources.prototype=new Object();
function KwSelectorResources(){
this.SelectorTitle="{Find Keywords}";
this.SelectorDescription="{Provide three words or phrases, one per line, that describe the products and services that you sell on the URL below. Then, click Get Keywords to see a list of keywords to consider.}";
this.SearchHelpIconTitle="{Keyword Selector help text}";
this.TooltipHeader="{Tooltip Header text}";
this.TooltipContent="{Tooltip content text description}";
this.SelectorFieldLabel="{Words that describe your products and services:}";
this.SelectorFieldTip="{Tip: Please be specific - include product names, model numbers, and brands.}";
this.UrlLabel="{Look for keyword suggestions at this URL.}";
this.UrlExampleText="{Example: www.yahoo.com}";
this.PositiveSeedLabel="{Specify words that must appear in each keyword}";
this.NegativeSeedLabel="{Specify words that must not appear in any of the keywords}";
this.OptionalText="{ (optional)}";
this.GetKeywordsLabel="{Get Keywords}";
this.ChooseTitle="{Choose Your Keywords}";
this.ChooseInstructions="{To add a keyword to your account, select its corresponding checkbox and click the Add Keywords button.}";
this.TblDescription="{Use the check boxes on the left to select keywords to add to your account. When finished, click 'Continue' to proceed to bidding.}";
this.TblNameCol="{Keywords}";
this.TblImpressions="{Estimated Impressions}";
this.TblKeywordTtip="{Word or phrase that relates to the products or services you wish to advertise.}";
this.TblImpressionsTtip="{Estimated number of impressions you might receive.}";
this.NewSearchLabel="{New Search}";
this.RefineButtonLabel="{Refine this List}";
this.RefineHelpIconTitle="{Refine this List help}";
this.AddButtonLabel="{Add >>}";
this.EnterKeywordsLabel="{Enter Keywords}";
this.EnterKeywordsDescription="{Enter one word or phrase per line, up to 100 characters in length.}";
this.EnterKeywordsNote="{Note: Keywords may contain multiple words and can be up to 100 characters in length.  Please do not use commas or semicolons after each keywords.}";
this.AddNegativeWordsLabel="{Add Excluded Keywords}";
this.AddNegativeDescription="{Enter words or phrases that are not relevant to your business to block potentially irrelevant matches.}";
this.AccountNegativeWordsLabel="{Account level excluded keywords}";
this.RefineDialogTitle="{Refine Keyword List}";
this.RefineDialogDescription="{View the list of possible keywords below. To build off of this list and generate even more keywords, include and reject keywords as needed, then click Get More Keywords.}";
this.RefineDialogCancel="{Cancel}";
this.RefineDialogUpdate="{Update List}";
this.RefineTableMore="{Include}";
this.RefineTableFewer="{Reject}";
this.FootNote="{Estimated impressions are based on last month's data}";
this.InternalError="{An internal error occurred}";
this.NoSeedWordsError="{Please enter at least one seed word}";
this.UnknownHost="{The URL did not respond.}";
this.Timeout="{The URL timed out.}";
this.MaxKeywordsExceeded="{You have exceeded the number of keywords allowed.}";
this.MaxNegativeKeywordsExceeded="{You have exceeded the number of negative keywords allowed.}";
this.SelectKeywordsFromList="{Please select one or more keywords from the list on the left.}";
this.MaxCharSizeExceeded="{Only 100 chars per keyword are permitted}";
this.AlreadyInListMsg="{The following keywords are already in the list}";
this.MinimumSeedWordsNotEntered="{You must enter at least three seed keywords.}";
this.InvalidUrlError="{Please enter a valid URL.}";
this.MaxSeedWordsExceeded="{You may not enter more than 250 seed words.}";
this.SeedWordTooLong="{Seed words may not be longer than 100 characters.}";
this.MinUrlLengthNotMet="{The URL must be at least 12 characters long.}";
this.MaxUrlLengthExceeded="{The URL may not be longer than 1024 characters.}";
this.MaxRequiredKeywordsExceeded="{You may enter only 10 required keywords.}";
this.MaxExcludedPhrasesExceeded="{You may enter only 10 excluded keywords.}";
this.NoResults="{No results}";
this.KeywordsEntered="{Keywords Entered}";
this.Of="{of}";
}
KwSelectorStyle.prototype.className="KwSelectorStyle";
KwSelectorStyle.prototype=new Object();
function KwSelectorStyle(){
this.submitButton="std";
this.disabledSubmitButton="disabledButton";
this.kwTextArea="";
this.helpIcon="helpIcon";
this.helpImg="helpImg";
this.glossTerm="glossTerm";
this.canvasStyle="clearfloat";
this.kwSearchForm="kwdSrchForm wrapper";
this.kwSearchBox="boxContent";
this.kwSimpleSearchBox="boxContent clearfloat";
this.kwSearchContent="kwdSrchTxt clearfloat";
this.kwSearchText="";
this.kwSearchButtonDiv="kwdSrch";
this.kwSearchFieldLabel="bold";
this.kwResults="kwdSrchForm";
this.kwResultsBox="boxContent";
this.kwResultsTop="kwdSrchTxt clearfloat";
this.kwResultsFieldLabel="bold";
this.kwResultsSubmit="grayButton";
this.kwSuggestionTableDiv="kwdSuggTbl setup";
this.kwSimpleSuggestionDiv="kwdSuggTbl signup";
this.actionDiv="addBtn";
this.refineButtonDiv="refineAction";
this.selectedDiv="enterKwds wrapper";
this.selectedDiv1="boxContent";
this.simpleSelectedDiv1="boxContent";
this.selectedDiv2="kwdSrchTxt";
this.moduleControl="gryArw";
this.moduleControlDown="gryArwDwn";
this.negativeDiv="excludedKwds wrapper";
this.negativeDiv1="boxContent";
this.refineDiv="refineKwdPop popup";
this.refineDivBorder="popWhtBdr";
this.refineDivBox="box";
this.refineDivHdrSect="popTop clearfloat sectBG";
this.refineDivHdrClose="popClose";
this.refineDivHdr="popHdr";
this.refineDivContent="content clearfloat";
this.refineDivTable="listTable box";
this.refineDivAction="popAction sectBG";
this.refineDivButton="button";
this.refineDivCancelButton="cnclPrv";
this.footNote="footnote";
this.fieldError="fieldError";
}
RefineToolManager.prototype.className="RefineToolManager";
RefineToolManager.prototype=new Object();
function RefineToolManager(_32e,_32f){
this.refineKeywordList=_32e;
this.keywords=new Array();
this.moreKeywords=new Array();
this.fewerKeywords=new Array();
this.resourceBundle=_32f;
this.plus=getImgUrl("images/plus.gif");
this.plusOn=getImgUrl("images/plus-on.gif");
this.minus=getImgUrl("images/minus.gif");
this.minusOn=getImgUrl("images/minus-on.gif");
}
RefineToolManager.prototype.addKeyword=function(_330){
this.keywords[this.keywords.length]=_330;
};
RefineToolManager.prototype.clearKeyword=function(){
this.keywords=new Array();
};
RefineToolManager.prototype.resetRefineTool=function(){
this.clearKeyword();
this.clearRefinedKeywords();
};
RefineToolManager.prototype.buildRefineList=function(_331){
var _332=document.getElementById(this.refineKeywordList);
if(_332){
this.clearRefinedKeywords();
_332.innerHTML="";
var _333=document.createElement("table");
_332.appendChild(_333);
_333.className="data";
_333.cellPadding="0";
_333.cellSpacing="0";
var _334=document.createElement("tbody");
_333.appendChild(_334);
var tr_1=document.createElement("tr");
tr_1.className="hdrRow";
_334.appendChild(tr_1);
var th_1=document.createElement("th");
tr_1.appendChild(th_1);
th_1.className="center";
th_1.innerHTML=this.resourceBundle.RefineTableMore;
var th_2=document.createElement("th");
tr_1.appendChild(th_2);
th_2.className="center";
th_2.innerHTML=this.resourceBundle.RefineTableFewer;
var th_3=document.createElement("th");
tr_1.appendChild(th_3);
th_3.className="text";
th_3.innerHTML=this.resourceBundle.TblNameCol;
if(_331){
var th_4=document.createElement("th");
tr_1.appendChild(th_4);
th_4.className="sm center";
th_4.innerHTML=this.resourceBundle.TblImpressions;
}
for(var i=0;i<this.keywords.length;i++){
var _33b=(i%2==0)?"":"odd";
var _33c=(i%2==0)?"sortEven":"sortOdd";
var _33d=this.keywords[i];
var tr=document.createElement("tr");
_334.appendChild(tr);
tr.className=_33b;
var td_1=document.createElement("td");
tr.appendChild(td_1);
td_1.className=_33c;
var _340=document.createElement("img");
td_1.appendChild(_340);
_340.src=this.plus;
_340.height=16;
_340.width=16;
_340.style.cursor="pointer";
var td_2=document.createElement("td");
tr.appendChild(td_2);
td_2.className=_33c;
var _342=document.createElement("img");
td_2.appendChild(_342);
_342.src=this.minus;
_342.height=16;
_342.width=16;
_342.style.cursor="pointer";
var td_3=document.createElement("td");
tr.appendChild(td_3);
td_3.className="kwd";
td_3.innerHTML=_33d.getKeyword();
if(_331){
var td_4=document.createElement("td");
tr.appendChild(td_4);
td_4.className="noRtBdr";
td_4.innerHTML=_33d.getImpression();
}
this.addRefineImgEvent(_340,_342,_33d);
}
}
};
RefineToolManager.prototype.addRefineImgEvent=function(_345,_346,_347){
_345.minusImg=_346;
_345.keywordRef=_347;
_346.plusImg=_345;
_346.keywordRef=_347;
YAHOO.util.Event.addListener(_345,"click",this._manageMoreKeywords,this,true);
YAHOO.util.Event.addListener(_346,"click",this._manageFewerKeywords,this,true);
};
RefineToolManager.prototype._manageMoreKeywords=function(_348){
var img=YAHOO.util.Event.getTarget(_348,true);
if(img&&img.tagName.toLowerCase()=="img"){
var _34a=img.keywordRef;
if(img.minusImg.src.indexOf(this.minusOn)!=-1){
img.minusImg.src=this.minus;
if(this.fewerKeywords[_34a.getKeyword()]!=undefined){
delete this.fewerKeywords[_34a.getKeyword()];
}
}
if(img.src.indexOf(this.plus)!=-1){
img.src=this.plusOn;
if(this.moreKeywords[_34a.getKeyword()]==undefined){
this.moreKeywords[_34a.getKeyword()]=_34a;
}
}else{
img.src=this.plus;
if(this.moreKeywords[_34a.getKeyword()]!=undefined){
delete this.moreKeywords[_34a.getKeyword()];
}
}
}
};
RefineToolManager.prototype.getMoreKeywords=function(){
var _34b=new Array();
var _34c=0;
for(var i in this.moreKeywords){
if(this.isTypeOfKeywordResult(this.moreKeywords[i])){
_34b[_34c]=this.moreKeywords[i].getKeyword();
_34c++;
}
}
return _34b;
};
RefineToolManager.prototype._manageFewerKeywords=function(_34e){
var img=YAHOO.util.Event.getTarget(_34e,true);
if(img&&img.tagName.toLowerCase()=="img"){
var _350=img.keywordRef;
if(img.plusImg.src.indexOf(this.plusOn)!=-1){
img.plusImg.src=this.plus;
if(this.moreKeywords[_350.getKeyword()]!=undefined){
delete this.moreKeywords[_350.getKeyword()];
}
}
if(img.src.indexOf(this.minus)!=-1){
img.src=this.minusOn;
if(this.fewerKeywords[_350.getKeyword()]==undefined){
this.fewerKeywords[_350.getKeyword()]=_350;
}
}else{
img.src=this.minus;
if(this.fewerKeywords[_350.getKeyword()]!=undefined){
delete this.fewerKeywords[_350.getKeyword()];
}
}
}
};
RefineToolManager.prototype.getFewerKeywords=function(){
var _351=new Array();
var _352=0;
for(var i in this.fewerKeywords){
if(this.isTypeOfKeywordResult(this.fewerKeywords[i])){
_351[_352]=this.fewerKeywords[i].getKeyword();
_352++;
}
}
return _351;
};
RefineToolManager.prototype.isTypeOfKeywordResult=function(ref){
return (ref&&ref.__keywordResult);
};
RefineToolManager.prototype.clearRefinedKeywords=function(){
this.moreKeywords=new Array();
this.fewerKeywords=new Array();
};
KeywordResult.prototype.className="KeywordResult";
KeywordResult.prototype=new Object();
function KeywordResult(_355,_356){
this.keyword=_355;
this.impressions=_356;
this.__keywordResult=true;
}
KeywordResult.prototype.getKeyword=function(){
return this.keyword;
};
KeywordResult.prototype.getImpression=function(){
return this.impressions;
};
Pricing.prototype=new BaseWidget();
Pricing.prototype.constructor=Pricing;
Pricing.prototype.baseClass=BaseWidget.prototype.constructor;
function Pricing(_357,num,_359,_35a,est,_35c,_35d,_35e){
this.baseClass(_357);
this.divId=_357;
this.num=num;
this.est=est;
this.decimalFormatter=new DecimalFormatter(MarketLocaleInfo.currencySymbol,MarketLocaleInfo.seperator,MarketLocaleInfo.decimalSymbol);
this.selector=_35c;
this.isBidOptOn=_35d;
this.initialize();
if(_35a){
this.setMatchType(_35a);
}
this.styleClass=new PricingStyle();
this.resourceBundle=null;
this.isBulk=false;
this.isKeyword=_35e;
this.campaignSpendLimit=null;
this.accountSpendLimit=null;
this.marketMinBid=null;
this.marketMaxBid=null;
}
Pricing.prototype.initialize=function(){
this.estPPC=null;
this.PPC=null;
this.defaultPPC=null;
this.bestPPC=null;
this.isSponsoredSearch=true;
this.isContentMatch=false;
this.isMixed=false;
this.vtpError=null;
this.isDefault=this.selector;
this.originalState=new PricingState();
this.changeInOriginalState=false;
this.inlineSave=false;
};
Pricing.prototype.reInitialize=function(){
this.initialize();
this.isDefault=this.selector;
if(this.getCheckBoxElem()){
this.getCheckBoxElem().checked=false;
}
this.handleCheckBox();
};
Pricing.prototype.setMatchType=function(_35f){
if(_35f==MatchType.sponsoredSearch){
this.isSponsoredSearch=true;
this.isContentMatch=false;
this.isMixed=false;
}else{
if(_35f==MatchType.contentMatch){
this.isSponsoredSearch=false;
this.isContentMatch=true;
this.isMixed=false;
}else{
if(_35f==MatchType.mixed){
this.isSponsoredSearch=false;
this.isContentMatch=false;
this.isMixed=true;
}else{
this.isSponsoredSearch=false;
this.isContentMatch=false;
this.isMixed=false;
}
}
}
};
Pricing.prototype.hasChangedFromOriginalState=function(){
if(!this.isDefault&&this.originalState.getBidType()=="default"){
return true;
}
if(this.isDefault&&this.originalState.getBidType()=="custom"){
return true;
}
if(this.PPC!=this.originalState.getBid()){
return true;
}
return false;
};
Pricing.prototype.resetOriginalState=function(){
if(this.isDefault){
this.originalState.setBidType("default");
}else{
this.originalState.setBidType("custom");
}
this.originalState.setBid(this.PPC);
};
Pricing.prototype.changedFromOriginalState=function(_360){
if(this.changeInOriginalState&&!_360){
return;
}
this.changeInOriginalState=true;
if(this.inlineSave){
if(this.isDefault){
this.getMaxBidUseDefaultElem().className="prcSelCustom";
Element.show(this.getSaveCancelDefaultId());
}else{
this.getMaxBidUseCustomElem().className="prcSelCustom";
Element.show(this.getSaveCancelCustomId());
}
}
};
Pricing.prototype.setResourceBundle=function(_361){
this.resourceBundle=_361;
};
Pricing.prototype.setFirstTime=function(_362){
return;
};
Pricing.prototype.getCustomPPC=function(){
return this.customPPC;
};
Pricing.prototype.canInlineSave=function(bool){
this.inlineSave=bool;
};
Pricing.prototype.render=function(){
var _364=this.table.firstChild;
if(!_364||_364==null){
_364=document.createElement("tbody");
this.table.appendChild(_364);
}
_364.appendChild(this._generateEstimateDiv());
};
Pricing.prototype.setDivId=function(_365){
this.div_id=_365;
};
Pricing.prototype._generateEstimateDiv=function(){
var tr=document.createElement("tr");
var td=document.createElement("td");
td.appendChild(this._generateEntryDiv());
tr.appendChild(td);
return tr;
};
Pricing.prototype._generateEntryDiv=function(){
var _368=document.createElement("div");
_368.id=this.getEntryDivId();
if(this.isComplex){
_368.className="prcBidNrw";
}else{
_368.className="prcBid";
}
if(this.isBulk){
var _369=document.createElement("div");
_369.className="prcBulkShed";
_368.className="";
_368.appendChild(_369);
var _36a=document.createElement("input");
_36a.setAttribute("type","checkbox");
_36a.checked=false;
_36a.id=this.getCheckBoxId();
YAHOO.util.Event.addListener(_36a,"click",this.handleCheckBox,this,true);
_369.appendChild(_36a);
var _36b=document.createElement("span");
_36b.innerHTML=" ";
_369.appendChild(_36b);
var _36c=document.createElement("strong");
_369.appendChild(_36c);
if(this.isContentMatch){
_36c.innerHTML=this.resourceBundle.cmAdgroupBid;
}else{
_36c.innerHTML=this.resourceBundle.ssAdgroupBid;
}
}
if(!this.isKeyword&&this.est){
var _36d=document.createElement("div");
_36d.id=this.getEstimatedPPCBlurbId();
_36d.className="prcBidStndTxt";
var txt1=document.createElement("span");
txt1.id=this.getBestPPCText();
txt1.innerHTML=this.resourceBundle.getTheMost+" ";
_36d.appendChild(txt1);
var a1=document.createElement("a");
a1.id=this.getBestPPCId();
YAHOO.util.Event.addListener(a1,"click",this.populateFromPPC,this,true);
a1.className=this.styleClass.bold;
_36d.appendChild(a1);
_368.appendChild(_36d);
}else{
if(this.isKeyword&&this.est){
var _370=document.createElement("div");
_370.className="prcBidStndTxt";
_370.id=this.generateId("maximumAmountBlurb");
_370.innerHTML=this.resourceBundle.maximumAmountPay;
_368.appendChild(_370);
}
}
if(this.selector){
var _371=document.createElement("div");
_371.id=this.getMaxBidUseDefaultId();
_368.appendChild(_371);
_371.className="prcSelected";
var _372=document.createElement("input");
_372.setAttribute("type","radio");
_372.id=this.getDefaultRadioId();
_372.name=this.num+"-default_custom_radio";
YAHOO.util.Event.addListener(_372,"click",this.handleDefaultBidTypeChange,this,true);
_371.appendChild(_372);
var _373=document.createElement("span");
_373.id=this.getDefaultTextSpanId();
if(this.isBidOptOn&&!this.isKeyword){
_373.innerHTML=" "+this.resourceBundle.defaultCamapaignBid+" ";
}else{
_373.innerHTML=" "+this.resourceBundle.defaultAdroupBid+" ";
}
_371.appendChild(_373);
var tt=document.createElement("span");
tt.className="helpImg";
tt.id=this.generateId("tt-default");
tt.innerHTML="&nbsp;";
_373.appendChild(tt);
TooltipManager.scriptToolTipData(tt.id,this.resourceBundle.tooltipDefaultBidHeader,this.resourceBundle.tooltipDefaultBid,true);
TooltipManager.scriptToolTipData(_373.id,this.resourceBundle.tooltipDefaultBidHeader,this.resourceBundle.tooltipDefaultBid,true);
_373.appendChild(document.createTextNode(": "));
var _375=document.createElement("strong");
_375.id=this.getDefaultTextSpanId()+"strong";
_375.innerHTML=MarketLocaleInfo.currencySymbol+this.decimalFormatter.formatCurrency(this.defaultPPC,MarketLocaleInfo.decimalPlaces);
_373.appendChild(_375);
var _376=document.createElement("div");
_376.className="systemError";
_376.id=this.getDefaultErrorDivId();
_376.style.display="none";
_371.appendChild(_376);
if(this.isKeyword&&!($("tags-dialog")&&this.isInline)){
_368.appendChild(this.generateSavingText(this.getSaveChangesDefaultId()));
_368.appendChild(this.generateSaveCancel(this.getSaveCancelDefaultId()));
}
var _377=document.createElement("div");
_377.id=this.getMaxBidUseCustomId();
_368.appendChild(_377);
_377.className="prcUnselected";
var _378=document.createElement("input");
_378.setAttribute("type","radio");
_378.name=this.num+"-default_custom_radio";
_378.id=this.getCustomRadioId();
YAHOO.util.Event.addListener(_378,"click",this.handleCustomBidTypeChange,this,true);
_377.appendChild(_378);
var _379=document.createElement("span");
_379.id=this.getCustomTextSpanId();
if(this.isBidOptOn&&!this.isKeyword){
_379.innerHTML=" "+this.resourceBundle.customAdgroupBid+" ";
}else{
_379.innerHTML=" "+this.resourceBundle.customKeywordBid+" ";
}
_377.appendChild(_379);
var tt=document.createElement("span");
tt.className="helpImg";
tt.id=this.generateId("tt-custom");
tt.innerHTML="&nbsp;";
_379.appendChild(tt);
var _37a=document.createElement("div");
_37a.id=this.getInputCustomDivId();
_37a.className="prcBidUseCustomInp";
if(this.isDefault){
_37a.style.display="none";
}
var txt2=document.createTextNode(MarketLocaleInfo.currencySymbol+" ");
_37a.appendChild(txt2);
var _37c=document.createElement("input");
_37c.setAttribute("type","text");
_37c.setAttribute("size",10);
_37c.id=this.getPPCId();
YAHOO.util.Event.addListener(_37c,"keypress",this.changedFromOriginalState,this,true);
_37c.name="PPC";
if(this.PPC>0){
_37c.value=this.PPC;
}
_37c.setAttribute("tabIndex","1");
_37a.appendChild(_37c);
InputFormatter.attachFormatter(_37c,InputFormatter.TYPE_CURRENCY,false,false,this.getErrorDivId());
if(this.est){
_37a.appendChild(document.createTextNode(" "));
var _37d=document.createElement("input");
_37d.setAttribute("type","button");
_37d.className="button shift";
_37d.id=this.getEstimateButtonId();
_37d.setAttribute("value",this.resourceBundle.estimate);
YAHOO.util.Event.addListener(_37d,"click",this.updateEstValues,this,true);
_37a.appendChild(_37d);
}
_377.appendChild(_37a);
if(this.isKeyword&&!($("tags-dialog")&&this.isInline)){
_368.appendChild(this.generateSavingText(this.getSaveChangesCustomId()));
_368.appendChild(this.generateSaveCancel(this.getSaveCancelCustomId()));
}
var _37e=document.createElement("div");
_37e.style.display="none";
_37e.id=this.getErrorWarnDivId();
_377.appendChild(_37e);
var _37f=document.createElement("div");
_37f.className="systemError";
_37f.id=this.getErrorDivId();
_37f.style.display="none";
_37e.appendChild(_37f);
var _380=document.createElement("div");
_380.id=this.getVtpWarningDivId();
_380.style.display="none";
_37e.appendChild(_380);
if(this.isBulk){
this.isDefault=true;
_37c.value=this.decimalFormatter.formatCurrency(this.defaultPPC,MarketLocaleInfo.decimalPlaces);
_37c.disabled=true;
_372.checked=true;
_378.checked=false;
_37a.style.display="none";
_372.disabled=true;
_378.disabled=true;
}
}else{
var _381=document.createElement("div");
_381.className="prcSelected";
_381.appendChild(document.createTextNode(this.resourceBundle.adGroupBid+": "));
_381.id=this.generateId("divText");
_368.appendChild(_381);
var _37a=document.createElement("div");
_381.appendChild(_37a);
_37a.id=this.getInputCustomDivId();
_37a.className="prcBidUseCustomInp";
var txt2=document.createTextNode(MarketLocaleInfo.currencySymbol+" ");
_37a.appendChild(txt2);
var _37c=document.createElement("input");
_37c.setAttribute("type","text");
_37c.setAttribute("size",10);
_37c.id=this.getPPCId();
_37c.name="PPC";
if(this.PPC>0){
_37c.value=this.PPC;
}
_37c.setAttribute("tabIndex","1");
_37a.appendChild(_37c);
InputFormatter.attachFormatter(_37c,InputFormatter.TYPE_CURRENCY,false,false,this.getErrorDivId());
if(this.est){
_37a.appendChild(document.createTextNode(" "));
var _37d=document.createElement("input");
_37d.setAttribute("type","button");
_37d.className="button shift";
_37d.id=this.getEstimateButtonId();
_37d.setAttribute("value",this.resourceBundle.estimate);
YAHOO.util.Event.addListener(_37d,"click",this.updateEstValues,this,true);
_37a.appendChild(_37d);
}
var _37f=document.createElement("div");
_37f.className="systemError";
_37f.id=this.getErrorDivId();
_37f.style.display="none";
_381.appendChild(_37f);
var _380=document.createElement("div");
_380.id=this.getVtpWarningDivId();
_380.style.display="none";
_381.appendChild(_380);
if(this.isBulk){
_37c.disabled=true;
}
}
if(this._generatePremRangeDiv()!=null){
var _382=document.createElement("div");
_382.className="clearfloat";
_382.innerHTML="&nbsp;";
_368.appendChild(_382);
_368.appendChild(this._generatePremRangeDiv());
var _383=document.createElement("div");
_383.className="clearfloat";
_383.innerHTML="&nbsp;";
_368.appendChild(_383);
}
return _368;
};
Pricing.prototype.handleCheckBox=function(){
var _384=this.getCheckBoxElem();
var _385=this.getPPCElem();
if(_384&&_385){
var _386=!_384.checked;
_385.disabled=_386;
if(this.getDefaultRadioElem()){
this.getDefaultRadioElem().checked=true;
this.getDefaultRadioElem().disabled=_386;
}
if(this.getCustomRadioElem()){
this.getCustomRadioElem().checked=false;
this.getCustomRadioElem().disabled=_386;
}
if(_386){
_385.value=this.decimalFormatter.formatCurrency(this.defaultPPC,MarketLocaleInfo.decimalPlaces);
}
}
};
Pricing.prototype.generateSavingText=function(id){
var _388=document.createElement("div");
_388.id=id;
_388.className="prcSavWrap";
_388.style.display="none";
var _389=document.createElement("div");
_389.className="prcSavChanges";
_389.innerHTML=this.resourceBundle.savingChanges;
_388.appendChild(_389);
return _388;
};
Pricing.prototype.generateSaveCancel=function(id){
var _38b=document.createElement("div");
_38b.id=id;
_38b.className="prcCtaBtns";
_38b.style.display="none";
var _38c=document.createElement("input");
_38c.setAttribute("type","button");
_38c.className="cnclPrv";
_38c.id=this.generateId(id+"-cancel");
_38c.setAttribute("value",this.resourceBundle.cancelText);
YAHOO.util.Event.addListener(_38c,"click",this.cancelInput,this,true);
_38b.appendChild(_38c);
var save=document.createElement("input");
save.setAttribute("type","button");
save.className="button shift";
save.id=this.generateId(id+"-save");
save.setAttribute("value",this.resourceBundle.saveText);
YAHOO.util.Event.addListener(save,"click",this.saveInput,this,true);
_38b.appendChild(save);
return _38b;
};
Pricing.prototype.handleDefaultBidTypeChange=function(){
var _38e=this.getMaxBidUseDefaultElem();
_38e.className="prcSelected";
var _38f=this.getMaxBidUseCustomElem();
_38f.className="prcUnselected";
this.getDefaultRadioElem().checked=true;
this.getCustomRadioElem().checked=false;
Element.hide(this.getInputCustomDivId());
Element.hide(this.getSaveCancelCustomId());
Element.hide(this.getErrorWarnDivId());
Element.show(this.getDefaultErrorDivId());
this.isDefault=true;
var _390=this.getPPCElem();
_390.value=this.decimalFormatter.formatCurrency(this.defaultPPC,MarketLocaleInfo.decimalPlaces);
this._disableActions();
this.removeErrorMessage();
if(this.inlineSave&&this.hasChangedFromOriginalState()){
this.changedFromOriginalState(true);
}else{
this.changeInOriginalState=false;
}
};
Pricing.prototype.handleCustomBidTypeChange=function(){
var _391=this.getMaxBidUseDefaultElem();
_391.className="prcUnselected";
var _392=this.getMaxBidUseCustomElem();
_392.className="prcSelected";
this.getDefaultRadioElem().checked=false;
this.getCustomRadioElem().checked=true;
Element.hide(this.getSaveCancelDefaultId());
Element.hide(this.getDefaultErrorDivId());
Element.show(this.getInputCustomDivId());
Element.show(this.getErrorWarnDivId());
this.isDefault=false;
this._enableActions();
if(this.hasChangedFromOriginalState()&&this.inlineSave){
this.changedFromOriginalState(true);
}else{
this.changeInOriginalState=false;
}
};
Pricing.prototype.cancelInput=function(e){
this.changeInOriginalState=false;
this.setPPC(this.originalState.getBid());
this.getPPCElem().value=this.decimalFormatter.formatCurrency(this.PPC,MarketLocaleInfo.decimalPlaces);
if(this.originalState.getBidType()=="custom"){
this.handleCustomBidTypeChange();
}else{
this.handleDefaultBidTypeChange();
}
Element.hide(this.getSaveCancelDefaultId());
Element.hide(this.getSaveCancelCustomId());
};
Pricing.prototype.saveInput=function(e){
if(!this.isDefault&&(!this.isValidBid())){
return false;
}else{
if(this.isDefault&&!this.validateForVtpMinBid()){
return false;
}
}
if(this.isDefault){
Element.hide(this.getMaxBidUseDefaultId());
Element.show(this.getSaveChangesDefaultId());
}else{
Element.hide(this.getMaxBidUseCustomId());
Element.show(this.getSaveChangesCustomId());
}
if(isInScope(window.saveBid)){
window.saveBid();
}
this.PPC=this.getInputPPC();
this.changeInOriginalState=false;
this.resetOriginalState();
};
Pricing.prototype.populateFromPPC=function(){
if(this.selector){
this.handleCustomBidTypeChange();
this.isDefault=false;
this.getPPCElem().disabled=false;
if(this.getEstimateButtonElem()){
this.getEstimateButtonElem().disabled=false;
}
}
this.getPPCElem().value=this.decimalFormatter.formatCurrency(this.bestPPC,MarketLocaleInfo.decimalPlaces);
if(this.est){
this.updateEstValues();
}
};
Pricing.prototype.getBidType=function(){
if(this.isDefault){
return "default";
}
return "custom";
};
Pricing.prototype._disableActions=function(){
this.PPC=this.defaultPPC;
};
Pricing.prototype._enableActions=function(){
return;
};
Pricing.prototype._generateBlank=function(){
return;
};
Pricing.prototype._generatePremRangeDiv=function(){
return null;
};
Pricing.prototype.isAboveVtpMinBid=function(){
return true;
};
Pricing.prototype.validateForVtpMinBid=function(){
if(this.isKeyword){
if(!this.isAboveVtpMinBid()&&this.vtpError){
if(!this.isDefault){
this.setErrorMessage(this.vtpError);
}
return false;
}
}
return true;
};
Pricing.prototype.getVtpMinBid=function(){
return null;
};
Pricing.prototype.isValidBid=function(){
if(!InputFormatter.isValidCurrencyEntry(this.getPPCElem().value)){
return false;
}
var _395=this.decimalFormatter.parse(this.getPPCElem().value,MarketLocaleInfo.decimalPlaces);
var _396=true;
if(this.marketMinBid&&this.marketMaxBid){
var _397=this.marketMinBid;
if(this.isKeyword){
if(this.vtpMinBid!=null&&this.vtpMinBid>this.marketMinBid){
_397=this.vtpMinBid;
}
}
if(this.campaignSpendLimit||this.accountSpendLimit){
var _398=false;
var _399=false;
var _39a=false;
if(this.campaignSpendLimit>0&&!this.isBidOptOn){
if(this.accountSpendLimit>0){
if(this.campaignSpendLimit<=this.accountSpendLimit){
if(this.campaignSpendLimit<=this.marketMaxBid){
_398=true;
}else{
_39a=true;
}
}else{
if(this.accountSpendLimit<=this.marketMaxBid){
_399=true;
}else{
_39a=true;
}
}
}else{
if(this.campaignSpendLimit<=this.marketMaxBid){
_398=true;
}else{
_39a=true;
}
}
}else{
if(this.accountSpendLimit>0&&this.accountSpendLimit<=this.marketMaxBid){
_399=true;
}else{
_39a=true;
}
}
if(_39a){
if(isNaN(_395)||_395<_397||_395>this.marketMaxBid||(MarketLocaleInfo.needBidIncrementCheck()&&!MarketLocaleInfo.isValidBidIncrement(_395))){
var _39b=this.resourceBundle.bidExceedMarket.replace("|lower_limit|",InputFormatter.formatCurrency(_397,true));
this.setErrorMessage(_39b);
_396=false;
}
}else{
if(_398){
if(isNaN(_395)||_395<_397||_395>this.campaignSpendLimit||(MarketLocaleInfo.needBidIncrementCheck()&&!MarketLocaleInfo.isValidBidIncrement(_395))){
var _39b=this.resourceBundle.bidExceedCampaign.replace("|lower_limit|",InputFormatter.formatCurrency(_397,true));
this.setErrorMessage(_39b);
_396=false;
}
}else{
if(_399){
if(isNaN(_395)||_395<_397||_395>this.accountSpendLimit||(MarketLocaleInfo.needBidIncrementCheck()&&!MarketLocaleInfo.isValidBidIncrement(_395))){
var _39b=this.resourceBundle.bidExceedAccount.replace("|lower_limit|",InputFormatter.formatCurrency(_397,true));
this.setErrorMessage(_39b);
_396=false;
}
}
}
}
}else{
if(isNaN(_395)||_395<_397||_395>this.marketMaxBid||(MarketLocaleInfo.needBidIncrementCheck()&&!MarketLocaleInfo.isValidBidIncrement(_395))){
this.setErrorMessage(this.resourceBundle.invalidBid);
_396=false;
}
}
if(_396){
this.removeErrorMessage();
}
}else{
if(isNaN(_395)||_395<=0){
this.setErrorMessage(this.resourceBundle.invalidBid);
if(this.dgs){
this.setPPC(this.defaultPPC);
}
_396=false;
}else{
_396=true;
this.removeErrorMessage();
}
}
return _396;
};
Pricing.prototype.loadFromXML=function(_39c){
if(_39c&&_39c.tagName=="cpcInfo"){
if(_39c.hasAttribute("bestPPC")){
this.bestPPC=MarketLocaleInfo.getBidIncrementAdjustedValue(new Number(_39c.getAttribute("bestPPC"))).valueOf();
}
if(_39c.hasAttribute("PPC")){
this.PPC=(new Number(_39c.getAttribute("PPC"))).valueOf();
this.originalState.setBid(this.PPC);
}
if(_39c.hasAttribute("defaultPPC")){
this.defaultPPC=(new Number(_39c.getAttribute("defaultPPC"))).valueOf();
}
if(_39c.hasAttribute("isDefault")){
var _39d=_39c.getAttribute("isDefault");
if(_39d=="false"){
this.isDefault=false;
this.originalState.setBidType("custom");
}else{
if(_39d=="true"){
this.isDefault=true;
this.originalState.setBidType("default");
}
}
}
if(_39c.hasAttribute("matchType")){
var _39e=_39c.getAttribute("matchType");
this.setMatchType(_39e);
}
}
this.reRender();
};
Pricing.prototype.reRender=function(){
if(!this.isKeyword&&this.getBestPPCElem()){
if(this.accountSpendLimit!=null&&this.accountSpendLimit>0&&this.accountSpendLimit<=this.bestPPC&&(this.isBidOptOn||this.campaignSpendLimit==0||this.accountSpendLimit<=this.campaignSpendLimit)){
this.bestPPC=MarketLocaleInfo.getBidIncrementAdjustedValue(this.accountSpendLimit);
this.getBestPPCTextElem().innerHTML=this.resourceBundle.getTheMost_based_on_account_dailyspendinglimit+" ";
}else{
if(!this.isBidOptOn&&this.campaignSpendLimit!=null&&this.campaignSpendLimit>0&&this.campaignSpendLimit<=this.bestPPC&&(this.accountSpendLimit==0||this.campaignSpendLimit<=this.accountSpendLimit)){
this.bestPPC=MarketLocaleInfo.getBidIncrementAdjustedValue(this.campaignSpendLimit);
this.getBestPPCTextElem().innerHTML=this.resourceBundle.getTheMost_based_on_campaign_dailyspendinglimit+" ";
}
}
this.getBestPPCElem().innerHTML="";
var _39f=document.createElement("span");
_39f.innerHTML=" ";
this.getBestPPCElem().appendChild(_39f);
this.getBestPPCElem().appendChild(document.createTextNode(MarketLocaleInfo.currencySymbol+this.decimalFormatter.formatCurrency(this.bestPPC,MarketLocaleInfo.decimalPlaces)+" "));
}
if(this.selector){
var _3a0=(this.accountSpendLimit==null||this.accountSpendLimit==0||this.defaultPPC<=this.accountSpendLimit);
if(this.isDefault&&_3a0){
this.handleDefaultBidTypeChange();
this.getDefaultRadioElem().checked=true;
this.getCustomRadioElem().checked=false;
}else{
this.handleCustomBidTypeChange();
if(!_3a0){
this.getDefaultRadioElem().disabled=true;
}else{
this.getDefaultRadioElem().checked=false;
}
this.getCustomRadioElem().checked=true;
}
}
if(this.isKeyword&&this.vtpMinBid!=null&&this.defaultPPC!=null&&this.vtpMinBid>this.defaultPPC){
this.getDefaultRadioElem().disabled=true;
}
this.setDefaultBidText();
var _3a1=this.getPPCElem();
if(this.isDefault){
if(this.defaultPPC){
_3a1.value=this.decimalFormatter.formatCurrency(this.defaultPPC,MarketLocaleInfo.decimalPlaces);
}
}else{
if(this.PPC){
if(arguments[0]&&arguments[0]==true){
this.PPC=this.bestPPC;
}
_3a1.value=this.decimalFormatter.formatCurrency(this.PPC,MarketLocaleInfo.decimalPlaces);
}else{
_3a1.value="";
if(this.bestPPC){
this.populateFromPPC();
}
}
}
};
Pricing.prototype.setDefaultBidText=function(){
if(this.defaultPPC){
var _3a2=document.getElementById(this.getDefaultTextSpanId()+"strong");
if(_3a2){
_3a2.innerHTML=MarketLocaleInfo.currencySymbol+this.decimalFormatter.formatCurrency(this.defaultPPC,MarketLocaleInfo.decimalPlaces);
}
}
};
Pricing.prototype.setErrorMessage=function(_3a3){
if(_3a3){
var _3a4=this.getErrorDivElem();
_3a4.style.display="";
_3a4.innerHTML=_3a3;
}
};
Pricing.prototype.setInvalidNumberError=function(){
this.setErrorMessage(this.resourceBundle.notValidNumber);
};
Pricing.prototype.removeErrorMessage=function(){
var _3a5=this.getErrorDivElem();
if(_3a5){
_3a5.innerHTML="";
_3a5.style.display="none";
}
var _3a6=this.getPPCElem();
if(_3a6){
InputFormatter._format(_3a6);
}
};
Pricing.prototype.isChecked=function(){
if(this.isBulk&&this.getCheckBoxElem()){
return this.getCheckBoxElem().checked;
}
return true;
};
Pricing.prototype.setMarketRanges=function(_3a7,_3a8){
this.minMarketBid=_3a7;
this.maxMarketBid=_3a8;
};
Pricing.prototype.getMinMarketBid=function(){
return this.marketMinBid;
};
Pricing.prototype.getMaxMarketBid=function(){
return this.marketMaxBid;
};
Pricing.prototype.getPPCElem=function(){
return document.getElementById(this.getPPCId());
};
Pricing.prototype.getGraphDisplayElem=function(){
return document.getElementById(this.getGraphDisplayId());
};
Pricing.prototype.getTacticTitleElem=function(){
return document.getElementById(this.getTacticTitleId());
};
Pricing.prototype.getBestPPCElem=function(){
return document.getElementById(this.getBestPPCId());
};
Pricing.prototype.getBestPPCTextElem=function(){
return document.getElementById(this.getBestPPCText());
};
Pricing.prototype.getEntryDivElem=function(){
return document.getElementById(this.getEntryDivId());
};
Pricing.prototype.getErrorDivElem=function(){
return document.getElementById(this.getErrorDivId());
};
Pricing.prototype.getDefaultErrorDivElem=function(){
return document.getElementById(this.getDefaultErrorDivId());
};
Pricing.prototype.getEstimateButtonElem=function(){
return document.getElementById(this.getEstimateButtonId());
};
Pricing.prototype.getEstimatedPPCBlurbElem=function(){
return document.getElementById(this.getEstimatedPPCBlurbId());
};
Pricing.prototype.getCheckBoxElem=function(){
return document.getElementById(this.getCheckBoxId());
};
Pricing.prototype.getVtpWarningDivElem=function(){
return document.getElementById(this.getVtpWarningDivId());
};
Pricing.prototype.getSaveCancelElem=function(){
return document.getElementById(this.getSaveCancelId());
};
Pricing.prototype.getMaxBidUseDefaultElem=function(){
return document.getElementById(this.getMaxBidUseDefaultId());
};
Pricing.prototype.getMaxBidUseCustomElem=function(){
return document.getElementById(this.getMaxBidUseCustomId());
};
Pricing.prototype.getInputCustomDivElem=function(){
return document.getElementById(this.getInputCustomDivId());
};
Pricing.prototype.getDefaultTextSpanElem=function(){
return document.getElementById(this.getDefaultTextSpanId());
};
Pricing.prototype.getDefaultRadioElem=function(){
return document.getElementById(this.getDefaultRadioId());
};
Pricing.prototype.getCustomRadioElem=function(){
return document.getElementById(this.getCustomRadioId());
};
Pricing.prototype.setCampaignLimit=function(_3a9){
this.campaignSpendLimit=_3a9;
};
Pricing.prototype.getCampaignLimit=function(){
return this.campaignSpendLimit;
};
Pricing.prototype.setAccountLimit=function(_3aa){
this.accountSpendLimit=_3aa;
};
Pricing.prototype.getAccountLimit=function(){
return this.accountSpendLimit;
};
Pricing.prototype.getDivId=function(){
return this.divId;
};
Pricing.prototype.getPPCId=function(){
return this.num+this.divId+"-PPC";
};
Pricing.prototype.getTacticTitleId=function(){
return this.num+this.divId+"-tacticTitle";
};
Pricing.prototype.getBestPPCId=function(){
return this.num+this.divId+"-bestPPCId";
};
Pricing.prototype.getBestPPCText=function(){
return this.num+this.divId+"-bestPPCText";
};
Pricing.prototype.getEntryDivId=function(){
return this.num+this.divId+"-entryDiv";
};
Pricing.prototype.getErrorDivId=function(){
return this.num+this.divId+"-errorDiv";
};
Pricing.prototype.getDefaultErrorDivId=function(){
return this.num+this.divId+"-errorDefaultDiv";
};
Pricing.prototype.getErrorWarnDivId=function(){
return this.num+this.divId+"-errorWarnDiv";
};
Pricing.prototype.getSaveCancelDefaultId=function(){
return this.num+this.divId+"-saveCancel-default";
};
Pricing.prototype.getSaveCancelCustomId=function(){
return this.num+this.divId+"-saveCancel-custom";
};
Pricing.prototype.getSaveChangesDefaultId=function(){
return this.num+this.divId+"-saveChanges-default";
};
Pricing.prototype.getSaveChangesCustomId=function(){
return this.num+this.divId+"-saveChanges-custom";
};
Pricing.prototype.getMaxBidUseDefaultId=function(){
return this.num+this.divId+"-maxBidUseDefault";
};
Pricing.prototype.getMaxBidUseCustomId=function(){
return this.num+this.divId+"-maxBidUseCustom";
};
Pricing.prototype.getInputCustomDivId=function(){
return this.num+this.divId+"-inputCustomDiv";
};
Pricing.prototype.getDefaultTextSpanId=function(){
return this.num+this.divId+"-defaultTextSpan";
};
Pricing.prototype.getCustomTextSpanId=function(){
return this.num+this.divId+"-customTextSpan";
};
Pricing.prototype.getDefaultRadioId=function(){
return this.num+this.divId+"-defaultRadio";
};
Pricing.prototype.getCustomRadioId=function(){
return this.num+this.divId+"-customRadio";
};
Pricing.prototype.getEstimateButtonId=function(){
return this.num+this.divId+"-estimateButton";
};
Pricing.prototype.getEstimatedPPCBlurbId=function(){
return this.num+this.divId+"-estimatedPPCBlurb";
};
Pricing.prototype.getCheckBoxId=function(){
return this.num+this.divId+"-checkBox";
};
Pricing.prototype.getVtpWarningDivId=function(){
return this.num+this.divId+"-vtpWarningDiv";
};
Pricing.prototype.generateId=function(name){
return this.num+this.divId+name;
};
Pricing.prototype.getInputPPC=function(){
var _3ac=InputFormatter.parse(this.getPPCElem().value,MarketLocaleInfo.decimalPlaces);
return _3ac==null?0:_3ac;
};
ForecastBean.prototype=new Object();
ForecastBean.prototype.constructor=ForecastBean;
function ForecastBean(){
this.type="";
this.maxCpc=0;
this.avgCpc=0;
this.impressions=0;
this.clicks=0;
this.position=0;
this.sharePotential=0;
this.missedClicks=0;
this.number=0;
}
ForecastBean.prototype.getType=function(){
return this.type;
};
ForecastBean.prototype.getMaxCpc=function(){
return this.maxCpc;
};
ForecastBean.prototype.getAvgCpc=function(){
return this.avgCpc;
};
ForecastBean.prototype.getImpressions=function(){
return this.impressions;
};
ForecastBean.prototype.getClicks=function(){
return this.clicks;
};
ForecastBean.prototype.getPosition=function(){
return this.position;
};
ForecastBean.prototype.getSharePotential=function(){
return this.sharePotential;
};
ForecastBean.prototype.getMissedClicks=function(){
return this.missedClicks;
};
ForecastBean.prototype.getNumber=function(){
return this.number;
};
ForecastBean.prototype.setType=function(type){
this.type=type;
};
ForecastBean.prototype.setMaxCpc=function(_3ae){
this.maxCpc=_3ae;
};
ForecastBean.prototype.setAvgCpc=function(_3af){
this.avgCpc=_3af;
};
ForecastBean.prototype.setImpressions=function(_3b0){
this.impressions=_3b0;
};
ForecastBean.prototype.setClicks=function(_3b1){
this.clicks=_3b1;
};
ForecastBean.prototype.setPosition=function(_3b2){
this.position=_3b2;
};
ForecastBean.prototype.setSharePotential=function(_3b3){
this.sharePotential=_3b3;
};
ForecastBean.prototype.setMissedClicks=function(_3b4){
this.missedClicks=_3b4;
};
ForecastBean.prototype.setNumber=function(_3b5){
this.number=_3b5;
};
ForecastBean.prototype.toString=function(){
var _3b6="";
_3b6+="type="+this.type+"\n";
_3b6+="maxCpc="+this.maxCpc+"\n";
_3b6+="avgCpc="+this.avgCpc+"\n";
_3b6+="impressions="+this.impressions+"\n";
_3b6+="clicks="+this.clicks+"\n";
_3b6+="position="+this.position+"\n";
_3b6+="sharePotential="+this.sharePotential+"\n";
_3b6+="missedClicks="+this.missedClicks+"\n";
_3b6+="number="+this.number+"\n";
return _3b6;
};
ForecastBean.prototype.cpcComparator=function(a,b){
if(a.getCpc()>b.getCpc()){
return 1;
}
if(a.getCpc()<b.getCpc()){
return -1;
}
return 0;
};
ForecastInfo.prototype=new Object();
ForecastInfo.prototype.constructor=ForecastInfo;
function ForecastInfo(){
this.forecastBean=null;
this.landscape=null;
}
ForecastInfo.prototype.getForecastBean=function(){
return this.forecastBean;
};
ForecastInfo.prototype.getLandscape=function(){
return this.landscape;
};
ForecastInfo.prototype.setForecastBean=function(_3b9){
this.forecastBean=_3b9;
};
ForecastInfo.prototype.setLandscape=function(_3ba){
this.landscape=_3ba;
};
ForecastInfo.prototype.toString=function(){
return this.forecastBean.toString()+"\n"+this.landscape.toString();
};
MarketState.prototype=new Object();
MarketState.prototype.constructor=MarketState;
function MarketState(){
this.min=0;
this.max=0;
}
MarketState.prototype.getMin=function(){
return this.min;
};
MarketState.prototype.getMax=function(){
return this.max;
};
MarketState.prototype.setMin=function(min){
this.min=min;
};
MarketState.prototype.setMax=function(max){
this.max=max;
};
PricingState.prototype=new Object();
PricingState.prototype.constructor=PricingState;
function PricingState(bid,_3be){
this.bid=bid;
this.bidType=_3be;
}
PricingState.prototype.getBid=function(){
return this.bid;
};
PricingState.prototype.getBidType=function(){
return this.bidType;
};
PricingState.prototype.setBid=function(bid){
this.bid=bid;
};
PricingState.prototype.setBidType=function(_3c0){
this.bidType=_3c0;
};
function MatchType(_3c1){
this.matchType=_3c1;
}
MatchType.prototype.toString=function(){
return this.matchType;
};
MatchType.sponsoredSearch=new MatchType("ss");
MatchType.contentMatch=new MatchType("cm");
MatchType.mixed=new MatchType("mix");
PricingForecasting.prototype.className="PricingForecasting";
PricingForecasting.prototype=new Pricing();
PricingForecasting.prototype.constructor=PricingForecasting;
PricingForecasting.prototype.basePricingClass=Pricing.prototype.constructor;
PricingForecasting.superclass=Pricing.prototype;
function PricingForecasting(_3c2,_3c3,num,_3c5,_3c6,_3c7,_3c8,_3c9,_3ca){
this.basePricingClass(_3c2,num,_3c5,_3c6,true,_3c9,_3ca,_3c8);
this.divId=_3c2;
this.actionUrl=_3c3;
this.decimalFormatter=new DecimalFormatter(MarketLocaleInfo.currencySymbol,MarketLocaleInfo.seperator,MarketLocaleInfo.decimalSymbol);
this.defaultForecastBean=new ForecastBean();
this.customForecastBean=new ForecastBean();
this.marketState=new MarketState();
this.landscape=new Array();
if(_3c6){
this.setMatchType(_3c6);
}
this.styleClass=new PricingStyle();
this.resourceBundle=null;
this.isFirstTime=true;
this.isNewAdGroup=false;
this.initialize();
this.isComplex=_3c7;
}
PricingForecasting.prototype.initialize=function(){
this.isDefault=false;
this.checkedDisplay=this.getClickToBidValue();
this.url=null;
this.chartWidth=210;
this.chartHeight=78;
this.backgroundPosOffset=14;
this.lineWidth=SliderImageInfo.imageWidth;
this.lineHeight=SliderImageInfo.imageHeight;
this.lineOffSet=SliderImageInfo.lineOffSet;
this.lineSrc=getImgUrl("images/"+SliderImageInfo.imageSrc);
this.arrowHeight=SliderImageInfo.arrowOffSet;
this.xOffset=null;
this.yOffset=null;
this.markerOffset=0;
this.lowerBound=0;
this.maxBound=0;
this.dataRange=0;
this.initialPPC=0;
this.isMarketStateError=false;
this.isForecastError=false;
this.defaultPPC=null;
this.PPC=null;
this.campaignLevel=null;
this.dgs=null;
this.defaultBidError=false;
this.customBidError=false;
this.landscapeError=false;
this.table=null;
this.vtpMinBid=null;
this.debugWidget=false;
this.graphNotAvailable=false;
};
PricingForecasting.prototype.setResourceBundle=function(_3cb){
this.resourceBundle=_3cb;
};
PricingForecasting.prototype.setFirstTime=function(_3cc){
this.isFirstTime=_3cc;
};
PricingForecasting.prototype.setNewAdGroup=function(_3cd){
this.isNewAdGroup=_3cd;
};
PricingForecasting.prototype._generateBlank=function(){
this.reRenderPricingForecasting();
};
PricingForecasting.prototype.render=function(){
var _3ce=this.table.firstChild;
if(!_3ce||_3ce==null){
_3ce=document.createElement("tbody");
this.table.appendChild(_3ce);
}
var tr=document.createElement("tr");
_3ce.appendChild(tr);
var _3d0=document.createElement("td");
_3d0.className="prcBidWrap";
_3d0.appendChild(this._generateEntryDiv());
tr.appendChild(_3d0);
var _3d1=document.createElement("td");
_3d1.setAttribute("vAlign","top");
_3d1.className="prcData";
tr.appendChild(_3d1);
var _3d2=document.createElement("div");
_3d2.className="prcForecast";
var _3d3=document.createElement("span");
_3d3.innerHTML=this.resourceBundle.monthlyEstimates+" ";
_3d3.id=this.generateId("spanGrphTitle1");
_3d2.appendChild(_3d3);
var _3d4=document.createElement("span");
_3d4.innerHTML=this.resourceBundle.monthlyEstimatesForBid+"**";
_3d4.id=this.getForBidId();
_3d4.style.display="none";
_3d2.appendChild(_3d4);
_3d2.appendChild(document.createTextNode(" "));
_3d1.appendChild(_3d2);
var tt=document.createElement("span");
tt.className="helpImg";
tt.id=this.generateId("tt-header");
tt.innerHTML="&nbsp;";
_3d2.appendChild(tt);
TooltipManager.scriptToolTipData(tt.id,this.resourceBundle.tooltipEstimatedMonthlyForecastHeader,this.resourceBundle.tooltipEstimatedMonthlyForecast,true);
TooltipManager.scriptToolTipData(_3d3.id,this.resourceBundle.tooltipEstimatedMonthlyForecastHeader,this.resourceBundle.tooltipEstimatedMonthlyForecast,true);
TooltipManager.scriptToolTipData(_3d4.id,this.resourceBundle.tooltipEstimatedMonthlyForecastHeader,this.resourceBundle.tooltipEstimatedMonthlyForecast,true);
var _3d6=document.createElement("table");
_3d6.cellPadding="0";
_3d6.cellSpacing="0";
_3d6.border="0";
_3d6.className="prcDataMwrap";
_3d1.appendChild(_3d6);
var _3d7=document.createElement("tbody");
_3d6.appendChild(_3d7);
var tr2=document.createElement("tr");
_3d7.appendChild(tr2);
tr2.appendChild(this._generateMonthEstTableDiv());
tr2.appendChild(this._generateGraphDiv());
tr2.appendChild(this._generateErrorDiv());
};
PricingForecasting.prototype.clearTable=function(){
for(var i=0;i<this.table.rows.length;i++){
this.table.deleteRow(i);
}
};
PricingForecasting.prototype.resetTable=function(){
this.clearTable();
this.render();
};
PricingForecasting.prototype._generateGraphDiv=function(){
var _3da=document.createElement("td");
_3da.className="prcGraphWrap";
_3da.id=this.getTdGrphDsplyId();
return _3da;
};
PricingForecasting.prototype._generateErrorDiv=function(){
var td=document.createElement("td");
td.className="prcNoDataWrap";
td.id=this.getErrorDsplyId();
td.style.display="none";
td.setAttribute("align","center");
return td;
};
PricingForecasting.prototype._generatePremRangeDiv=function(){
var _3dc=document.createElement("div");
_3dc.id=this.getPremRangeId();
return _3dc;
};
PricingForecasting.prototype._reGenerateGraphDiv=function(_3dd){
if(this.graphNotAvailable){
return;
}
if(this.isComplex&&!this.isContentMatch){
var _3de=document.createElement("div");
_3dd.appendChild(_3de);
_3de.id=this.generateId("slctDsplyDiv");
_3de.className="prcGraphSelect";
_3de.appendChild(document.createTextNode(this.resourceBundle.graphDisplay+": "));
var _3df=document.createElement("select");
_3df.id=this.getSlctDsplyId();
_3de.appendChild(_3df);
YAHOO.util.Event.addListener(_3df,"change",this.handleSelectorChange,this,true);
var _3e0=document.createElement("option");
_3e0.value=this.getClickToBidValue();
_3e0.appendChild(document.createTextNode(this.resourceBundle.clickToBid));
_3e0.id=this.getGraphDisplayClickToBidId();
_3df.appendChild(_3e0);
var _3e1=document.createElement("option");
_3e1.value=this.getShareOfPotentialValue();
_3e1.appendChild(document.createTextNode(this.resourceBundle.shareOfPotential));
_3e1.id=this.getGraphDisplayShareOfPotentionId();
_3df.appendChild(_3e1);
if(this.checkedDisplay==this.getClickToBidValue()){
_3e0.selected=true;
_3e1.selected=false;
}
if(this.checkedDisplay==this.getShareOfPotentialValue()){
_3e0.selected=false;
_3e1.selected=true;
}
}
var _3e2=document.createElement("div");
_3e2.id=this.getPieGraphId();
_3e2.style.display="none";
_3dd.appendChild(_3e2);
};
PricingForecasting.prototype._reGenerateSimpleGraphDiv=function(){
var _3e3=this.getTdGrphDsplyElem();
_3e3.innerHTML="";
this._reGenerateGraphDiv(_3e3);
this._appendAreaGraphDiv(_3e3);
};
PricingForecasting.prototype._appendAreaGraphDiv=function(_3e4){
if(this.graphNotAvailable){
_3e4.className="prcNoDataWrap";
_3e4.setAttribute("align","center");
var _3e5=document.createElement("div");
_3e4.appendChild(_3e5);
_3e5.className="prcNoDataView";
_3e5.id="prcNoDataView-"+this.num;
_3e5.innerHTML=this.resourceBundle.forecastingNoClicks;
}else{
var _3e5=document.createElement("div");
_3e5.id=this.getGraphAreaId();
_3e4.appendChild(_3e5);
if(this.url){
var _3e6=document.createElement("div");
_3e6.className="prcClickMrk";
_3e6.innerHTML=this.resourceBundle.clicksCaps;
_3e5.appendChild(_3e6);
}
var _3e7=document.createElement("div");
_3e7.id=this.getGraphId();
_3e5.appendChild(_3e7);
_3e7.style.backgroundRepeat="no-repeat";
_3e7.style.padding="0px 0px 0px 0px";
_3e7.style.height="138px";
_3e7.style.width="353px";
_3e7.style.backgroundPosition=this.backgroundPosOffset+"px 0px";
if(this.url){
_3e7.style.backgroundImage="url("+this.url+")";
}else{
_3e7.style.backgroundImage="url("+getImgUrl("images/spacer.gif")+")";
}
if(this.url){
var _3e8=document.createElement("div");
_3e8.id=this.getLineId();
_3e7.appendChild(_3e8);
_3e8.style.height=this.lineHeight+"px";
_3e8.style.width=this.lineWidth+"px";
_3e8.style.position="relative";
var _3e9=document.createElement("img");
_3e8.appendChild(_3e9);
_3e9.setAttribute("src",this.lineSrc);
_3e9.style.width=this.lineWidth+"px";
_3e9.style.height=this.lineHeight+"px";
_3e9.setAttribute("border","0");
}
if(this.url){
var _3ea=document.createElement("div");
_3ea.className="prcBidMrk";
_3ea.innerHTML=this.resourceBundle.bidCaps;
_3e5.appendChild(_3ea);
}
}
};
PricingForecasting.prototype._generateMonthEstTableDiv=function(){
var _3eb=document.createElement("td");
_3eb.id=this.getMonthEstTableId();
return _3eb;
};
PricingForecasting.prototype._reGenerateMonthEstTableDiv=function(){
this.recalcForecast(this.PPC);
var _3ec=this.getMonthEstTableElem();
if(_3ec==null){
return;
}
_3ec.innerHTML="";
_3ec.className="prcDataWrap";
if(this.graphNotAvailable){
var div=document.createElement("div");
div.className="prcEMIview";
div.appendChild(document.createTextNode(this.resourceBundle.estimateMontlyImpressions+":"));
div.appendChild(document.createElement("br"));
var _3ee=document.createElement("span");
_3ee.id=this.getEstImprId();
_3ee.innerHTML=this.decimalFormatter.formatNumber(this.defaultForecastBean.getImpressions(),0);
div.appendChild(_3ee);
_3ec.appendChild(div);
return;
}
var _3ef=document.createElement("table");
_3ef.cellPadding="0";
_3ef.cellSpacing="0";
_3ef.className="prcDataContent";
_3ec.appendChild(_3ef);
var _3f0=document.createElement("tbody");
_3ef.appendChild(_3f0);
var _3f1="prcHed";
if(this.isComplex&&!this.isContentMatch){
_3f1="prcHedAlt";
}
var _3f2=this.calculateTotal(this.defaultForecastBean);
if(this.isComplex&&!this.isContentMatch){
var _3f3=document.createElement("tr");
_3f0.appendChild(_3f3);
var _3f4=document.createElement("th");
_3f4.className=_3f1;
_3f4.innerHTML=" ";
_3f3.appendChild(_3f4);
var _3f5=document.createElement("th");
_3f5.className="prcValue";
_3f5.innerHTML=this.resourceBundle.defaultBiddedKeywords+" ("+this.defaultForecastBean.getNumber()+")";
_3f3.appendChild(_3f5);
var _3f6=document.createElement("th");
_3f6.className="prcValueAlt";
_3f6.innerHTML=this.resourceBundle.adGroupTotal+" ("+_3f2.getNumber()+")";
_3f3.appendChild(_3f6);
}
var _3f7=document.createElement("tr");
_3f7.className="prcDataOdd";
_3f0.appendChild(_3f7);
var _3f8=document.createElement("td");
_3f8.className=_3f1;
_3f7.appendChild(_3f8);
_3f8.innerHTML=this.resourceBundle.avgPos+":";
var _3f9=document.createElement("td");
_3f7.appendChild(_3f9);
_3f9.className="prcValue";
_3f9.id=this.getEstAvgPosViewId();
if(this.defaultBidError){
_3f9.innerHTML="--";
}else{
_3f9.innerHTML=this.decimalFormatter.formatNumber(this.defaultForecastBean.getPosition());
}
if(this.isComplex&&!this.isContentMatch){
var _3fa=document.createElement("td");
_3f7.appendChild(_3fa);
_3fa.className="prcValueAlt";
_3fa.id=this.getTotalEstAvgPosViewId();
if(this.defaultBidError){
_3fa.innerHTML="--";
}else{
_3fa.innerHTML=this.decimalFormatter.formatNumber(_3f2.getPosition());
}
}
var _3fb=document.createElement("tr");
_3f0.appendChild(_3fb);
var _3fc=document.createElement("td");
_3fc.className=_3f1;
_3fb.appendChild(_3fc);
_3fc.innerHTML=this.resourceBundle.impressions+":";
var _3fd=document.createElement("td");
_3fd.className="prcValue";
_3fb.appendChild(_3fd);
_3fd.id=this.getEstImprId();
if(this.defaultBidError){
_3fd.innerHTML="--";
}else{
_3fd.innerHTML=this.decimalFormatter.formatNumber(this.defaultForecastBean.getImpressions(),0);
}
if(this.isComplex&&!this.isContentMatch){
var _3fe=document.createElement("td");
_3fb.appendChild(_3fe);
_3fe.className="prcValueAlt";
_3fe.id=this.getTotalEstImprId();
if(this.defaultBidError){
_3fe.innerHTML="--";
}else{
_3fe.innerHTML=this.decimalFormatter.formatNumber(_3f2.getImpressions(),0);
}
}
var _3ff=document.createElement("tr");
_3ff.className="prcDataOdd";
_3f0.appendChild(_3ff);
var _400=document.createElement("td");
_400.className=_3f1;
_3ff.appendChild(_400);
_400.innerHTML=this.resourceBundle.clicks+":";
var _401=document.createElement("td");
_401.className="prcValue";
_3ff.appendChild(_401);
_401.id=this.getEstMonClickId();
if(this.defaultBidError){
_401.innerHTML="--";
}else{
_401.innerHTML=this.decimalFormatter.formatNumber(this.defaultForecastBean.getClicks(),0);
}
if(this.isComplex&&!this.isContentMatch){
var _402=document.createElement("td");
_3ff.appendChild(_402);
_402.className="prcValueAlt";
_402.id=this.getTotalEstMonClickId();
if(this.defaultBidError){
_402.innerHTML="--";
}else{
_402.innerHTML=this.decimalFormatter.formatNumber(_3f2.getClicks(),0);
}
}
var _403=document.createElement("tr");
_3f0.appendChild(_403);
var _404=document.createElement("td");
_404.className=_3f1;
_403.appendChild(_404);
_404.innerHTML=this.resourceBundle.avgCPC+" ("+MarketLocaleInfo.currencySymbol+"):";
var _405=document.createElement("td");
_405.className="prcValue";
_403.appendChild(_405);
_405.id=this.getEstAvgCPCId();
if(this.defaultBidError){
_405.innerHTML="--";
}else{
_405.innerHTML=this.decimalFormatter.formatCurrency(this.defaultForecastBean.getAvgCpc(),MarketLocaleInfo.decimalPlaces);
}
if(this.isComplex&&!this.isContentMatch){
var _406=document.createElement("td");
_403.appendChild(_406);
_406.className="prcValueAlt";
_406.id=this.getTotalEstAvgCPCId();
if(this.defaultBidError){
_406.innerHTML="--";
}else{
_406.innerHTML=this.decimalFormatter.formatCurrency(_3f2.getAvgCpc(),MarketLocaleInfo.decimalPlaces);
}
}
var _407=document.createElement("tr");
_407.className="prcDataOdd";
_3f0.appendChild(_407);
var _408=document.createElement("td");
_408.className=_3f1;
_407.appendChild(_408);
_408.innerHTML=this.resourceBundle.shareOfAvilableClicks+":";
var _409=document.createElement("td");
_409.className="prcValue";
_407.appendChild(_409);
_409.id=this.getSharePotentialId();
if(this.defaultBidError){
_409.innerHTML="--";
}else{
_409.innerHTML=this.decimalFormatter.formatPercentage(this.defaultForecastBean.getSharePotential());
}
if(this.isComplex&&!this.isContentMatch){
var _40a=document.createElement("td");
_407.appendChild(_40a);
_40a.className="prcValueAlt";
_40a.id=this.getTotalSharePotentialId();
if(this.defaultBidError){
_40a.innerHTML="--";
}else{
_40a.innerHTML=this.decimalFormatter.formatPercentage(_3f2.getSharePotential());
}
}
if(this.isComplex&&!this.isContentMatch){
var _40b=document.createElement("div");
_3ec.appendChild(_40b);
_40b.className="prcDataNote";
var _40c=(this.customForecastBean.getClicks()/_3f2.getClicks())*100;
_40b.innerHTML=MessageUtil.replaceParams(this.resourceBundle.percentOfOveridBids,[this.decimalFormatter.formatPercentage(_40c)]);
}
};
PricingForecasting.prototype._generatePieChart=function(_40d){
var _40e=this.getPieGraphElem();
_40e.innerHTML="";
_40e.style.display="";
var _40f=document.createElement("div");
_40f.className="prcPieWrap";
_40e.appendChild(_40f);
var _410=document.createElement("img");
_410.style.height="100px";
_410.style.width="100px";
_40f.appendChild(_410);
_410.setAttribute("src",_40d);
_410.setAttribute("border","0");
var _411=document.createElement("div");
_411.className="prcLegendWrap";
_40e.appendChild(_411);
if(!this.defaultBidError){
var _412=document.createElement("strong");
_412.id=this.generateId("defaultBidTraffic");
_412.innerHTML=this.resourceBundle.defaultBidTraffic+" - "+MarketLocaleInfo.currencySymbol+" "+this.decimalFormatter.formatCurrency(this.defaultForecastBean.getAvgCpc(),MarketLocaleInfo.decimalPlaces);
_411.appendChild(_412);
_411.appendChild(document.createElement("br"));
var _413=document.createElement("div");
_413.id=this.generateId("defaultEstClicks");
_413.className=this.styleClass.estClicks;
_413.appendChild(document.createTextNode(this.resourceBundle.estimatedClicks));
var _414=document.createTextNode(": "+this.decimalFormatter.formatNumber(this.defaultForecastBean.getClicks(),0));
var _415=document.createElement("strong");
_415.appendChild(_414);
_413.appendChild(_415);
_411.appendChild(_413);
var _416=document.createElement("div");
_416.id=this.generateId("defaultMissedClicks");
_416.className=this.styleClass.missedClicks;
_416.appendChild(document.createTextNode(this.resourceBundle.missedClicks));
var _417=document.createTextNode(": "+this.decimalFormatter.formatNumber(this.defaultForecastBean.getMissedClicks(),0));
var _418=document.createElement("strong");
_418.appendChild(_417);
_416.appendChild(_418);
_411.appendChild(_416);
_411.appendChild(document.createElement("br"));
}
var _419=document.createElement("strong");
_419.id=this.generateId("customBidTraffic");
_419.innerHTML=this.resourceBundle.customBidTraffic+" - "+MarketLocaleInfo.currencySymbol+" "+this.decimalFormatter.formatCurrency(this.customForecastBean.getAvgCpc(),MarketLocaleInfo.decimalPlaces);
_411.appendChild(_419);
_411.appendChild(document.createElement("br"));
var _41a=document.createElement("div");
_41a.id=this.generateId("customEstClicks");
_41a.className=this.styleClass.custEstClicks;
_41a.appendChild(document.createTextNode(this.resourceBundle.estimatedClicks));
var _41b=document.createElement("strong");
if(this.customBidError){
_41b.appendChild(document.createTextNode(" -- "));
}else{
_41b.appendChild(document.createTextNode(": "+this.decimalFormatter.formatNumber(this.customForecastBean.getClicks(),0)));
}
_41a.appendChild(_41b);
_411.appendChild(_41a);
var _41c=document.createElement("div");
_41c.id=this.generateId("customMissedClicks");
_41c.className=this.styleClass.custMissedClicks;
_41c.appendChild(document.createTextNode(this.resourceBundle.missedClicks));
var _41d=document.createElement("strong");
if(this.customBidError){
_41d.appendChild(document.createTextNode(" -- "));
}else{
_41d.appendChild(document.createTextNode(": "+this.decimalFormatter.formatNumber(this.customForecastBean.getMissedClicks(),0)));
}
_41c.appendChild(_41d);
_411.appendChild(_41c);
};
PricingForecasting.prototype._reGeneratePremRangeDiv=function(){
var _41e=this.getPremRangeElem();
if(_41e==null){
return;
}
_41e.innerHTML="";
_41e.className="prcBidRange";
var tt1=document.createElement("span");
tt1.id=this.generateId("tt1");
tt1.innerHTML=this.resourceBundle.rangePrimePlace+" ";
_41e.appendChild(tt1);
var tt2=document.createElement("span");
tt2.className="helpImg";
tt2.id=this.generateId("tt2");
tt2.innerHTML="&nbsp;";
_41e.appendChild(tt2);
TooltipManager.scriptToolTipData(tt1.id,this.resourceBundle.tooltipRecentBidRangeHeader,this.resourceBundle.tooltipRecentBidRange,true);
TooltipManager.scriptToolTipData(tt2.id,this.resourceBundle.tooltipRecentBidRangeHeader,this.resourceBundle.tooltipRecentBidRange,true);
_41e.appendChild(document.createTextNode(": "));
var _421=document.createElement("strong");
_41e.appendChild(_421);
_421.appendChild(document.createTextNode(MarketLocaleInfo.currencySymbol+this.decimalFormatter.formatCurrency(this.marketState.getMax(),MarketLocaleInfo.decimalPlaces)));
_421.appendChild(document.createTextNode(" - "));
_421.appendChild(document.createTextNode(MarketLocaleInfo.currencySymbol+this.decimalFormatter.formatCurrency(this.marketState.getMin(),MarketLocaleInfo.decimalPlaces)));
};
PricingForecasting.prototype.isAboveVtpMinBid=function(){
if(this.vtpMinBid){
var _422=this.decimalFormatter.parse(this.getPPCElem().value,MarketLocaleInfo.decimalPlaces);
if(this.vtpMinBid){
if(_422<this.vtpMinBid){
return false;
}
}
}
return true;
};
PricingForecasting.prototype.getVtpMinBid=function(){
return this.vtpMinBid;
};
PricingForecasting.prototype.updateEstValues=function(){
var _423=this.isValidBid();
if(_423){
var _424=this.decimalFormatter.parse(this.getPPCElem().value,MarketLocaleInfo.decimalPlaces);
if(this.isFirstTime){
this.PPC=_424;
this.reRenderPricingForecasting();
this.isFirstTime=false;
this.initGraph();
}
this.setPPC(_424);
this._enableActions();
if(this.checkedDisplay==this.getShareOfPotentialValue()){
this._handleInvokeSwitchToPieGraph();
}
}
};
PricingForecasting.prototype.handleSelectorChange=function(e,_426){
var _427=YAHOO.util.Event.getTarget(e);
var _428=_427.options[_427.selectedIndex].value;
if(_428==_426.getClickToBidValue()){
_426.switchToClickToBidGraph();
}else{
if(_428==_426.getShareOfPotentialValue()){
_426.switchToShareOfPotentialGraph();
}
}
};
PricingForecasting.prototype.switchToClickToBidGraph=function(){
document.getElementById(this.getGraphDisplayClickToBidId()).selected=true;
document.getElementById(this.getGraphDisplayShareOfPotentionId()).selected=false;
this.checkedDisplay=this.getClickToBidValue();
this.getPieGraphElem().style.display="none";
this.getGraphAreaElem().style.display="";
this.getGraphAreaElem().style.visibility="hidden";
this.setPPC(this.PPC);
this.getGraphAreaElem().style.visibility="visible";
};
PricingForecasting.prototype.switchToShareOfPotentialGraph=function(){
document.getElementById(this.getGraphDisplayShareOfPotentionId()).selected=true;
document.getElementById(this.getGraphDisplayClickToBidId()).selected=false;
this.checkedDisplay=this.getShareOfPotentialValue();
this.getGraphAreaElem().style.display="none";
this._handleInvokeSwitchToPieGraph();
};
PricingForecasting.prototype._handleInvokeSwitchToPieGraph=function(){
var _429=new AjaxRequest(this.actionUrl,"changeGraphType");
_429.addAjaxParameter("defaultClicks",this.defaultForecastBean.getClicks());
_429.addAjaxParameter("defaultMissedClicks",this.defaultForecastBean.getMissedClicks());
_429.addAjaxParameter("customClicks",this.customForecastBean.getClicks());
_429.addAjaxParameter("customMissedClicks",this.customForecastBean.getMissedClicks());
_429.addAjaxRegion(this.getTdGrphDsplyId(),"AREA");
ajaxEngine.registerMessageHandler("changeGraphType",this);
ajaxEngine.sendAjaxRequest(_429);
};
PricingForecasting.prototype.processUpdate=function(_42a){
this.loadFromXML(_42a.firstChild);
};
PricingForecasting.prototype._disableActions=function(){
if(!this.isForecastError&&!this.defaultBidError&&this.dgs){
this.setPPC(this.defaultPPC);
}else{
this.PPC=this.defaultPPC;
}
};
PricingForecasting.prototype._enableActions=function(){
if(!this.isForecastError&&!this.defaultBidError&&this.dgs){
this.setPPC(this.PPC);
}
};
PricingForecasting.prototype.calculateTotal=function(_42b){
var _42c=new ForecastBean();
if(_42b!=null){
_42c.setType("total");
_42c.setClicks(_42b.getClicks()+this.customForecastBean.getClicks());
_42c.setImpressions(_42b.getImpressions()+this.customForecastBean.getImpressions());
if(_42c.getImpressions()>0){
_42c.setPosition(((_42b.getPosition()*_42b.getImpressions())+(this.customForecastBean.getPosition()*this.customForecastBean.getImpressions()))/(_42c.getImpressions()));
}
if(_42c.getClicks()>0){
_42c.setAvgCpc(((_42b.getAvgCpc()*_42b.getClicks())+(this.customForecastBean.getAvgCpc()*this.customForecastBean.getClicks()))/_42c.getClicks());
}
var _42d=_42b.getClicks()+this.customForecastBean.getClicks();
var _42e=(_42b.getClicks()+_42b.getMissedClicks()+this.customForecastBean.getClicks()+this.customForecastBean.getMissedClicks());
_42c.setSharePotential((_42d/_42e)*100);
_42c.setNumber(_42b.getNumber()+this.customForecastBean.getNumber());
}
return _42c;
};
PricingForecasting.prototype.loadFromXML=function(_42f){
if(_42f&&_42f.tagName=="cpcInfo"){
if(_42f.getAttribute("bestPPC")){
this.bestPPC=MarketLocaleInfo.getBidIncrementAdjustedValue(new Number(_42f.getAttribute("bestPPC"))).valueOf();
}
if(_42f.getAttribute("PPC")){
this.PPC=(new Number(_42f.getAttribute("PPC"))).valueOf();
this.originalState.setBid(this.PPC);
}
if(_42f.getAttribute("defaultPPC")){
this.defaultPPC=(new Number(_42f.getAttribute("defaultPPC"))).valueOf();
}
if(_42f.getAttribute("marketMinBid")){
this.marketMinBid=(new Number(_42f.getAttribute("marketMinBid"))).valueOf();
}
if(_42f.getAttribute("marketMaxBid")){
this.marketMaxBid=(new Number(_42f.getAttribute("marketMaxBid"))).valueOf();
}
if(_42f.getAttribute("vtpMinBid")){
this.vtpMinBid=(new Number(_42f.getAttribute("vtpMinBid"))).valueOf();
}
if(_42f.getAttribute("isDefault")){
var _430=_42f.getAttribute("isDefault");
if(_430=="false"){
this.isDefault=false;
this.originalState.setBidType("custom");
}else{
if(_430=="true"){
this.isDefault=true;
this.originalState.setBidType("default");
}
}
}
if(_42f.getAttribute("isComplex")){
var _431=_42f.getAttribute("isComplex");
var _432;
if(_431=="false"){
_432=false;
}else{
if(_431=="true"){
_432=true;
}
}
if(this.isComplex!=_432){
this.isComplex=_432;
this.resetTable();
}
}
if(_42f.getAttribute("matchType")){
var _433=_42f.getAttribute("matchType");
this.setMatchType(_433);
}
for(var i=0;i<_42f.childNodes.length;i++){
if(_42f.childNodes[i].tagName=="forecastData"){
var _435=_42f.childNodes[i];
var _436=this._extractForecastData(_435);
if(_435.getAttribute("error")){
if(_436.getType()=="custom"){
this.customBidError=true;
}else{
this.defaultBidError=true;
}
}
if(_436.getType()=="custom"){
this.customForecastBean=_436;
}else{
this.defaultForecastBean=_436;
}
}
if(_42f.childNodes[i].tagName=="landscape"){
var _437=_42f.childNodes[i];
this.landscape=new Array();
if(_437.getAttribute("error")){
this.landscapeError=true;
}else{
for(var j=0;j<_437.childNodes.length;j++){
if(_437.childNodes[j].tagName=="forecastData"){
var _435=_437.childNodes[j];
var _436=this._extractForecastData(_435);
this.landscape[this.landscape.length]=_436;
}
}
for(var j=0;j<this.landscape.length;j++){
var _436=this.landscape[j];
if(_436.getMaxCpc()>this.maxBound){
this.maxBound=_436.getMaxCpc();
}
}
this.lowerBound=this.maxBound;
for(var j=0;j<this.landscape.length;j++){
var _436=this.landscape[j];
if(_436.getMaxCpc()<this.lowerBound){
this.lowerBound=_436.getMaxCpc();
}
}
if(this.lowerBound==0&&this.maxBound==0){
this.maxBound=1;
}
this.dataRange=this.maxBound-this.lowerBound;
}
}
if(_42f.childNodes[i].tagName=="cpcGraph"){
if(_42f.childNodes[i].getAttribute("error")){
this.graphNotAvailable=true;
}
if(_42f.childNodes[i].getAttribute("url")){
this.url=_42f.childNodes[i].getAttribute("url");
}
if(_42f.childNodes[i].getAttribute("chartWidth")){
this.chartWidth=(new Number(_42f.childNodes[i].getAttribute("chartWidth"))).valueOf();
}
if(_42f.childNodes[i].getAttribute("chartHeight")){
this.chartHeight=(new Number(_42f.childNodes[i].getAttribute("chartHeight"))).valueOf();
}
if(_42f.childNodes[i].getAttribute("xOffset")){
this.xOffset=(new Number(_42f.childNodes[i].getAttribute("xOffset"))).valueOf();
}
if(_42f.childNodes[i].getAttribute("yOffset")){
this.yOffset=(new Number(_42f.childNodes[i].getAttribute("yOffset"))).valueOf();
}
}
if(_42f.childNodes[i].tagName=="marketState"){
if(_42f.childNodes[i].getAttribute("min")){
this.marketState.setMin(_42f.childNodes[i].getAttribute("min"));
}
if(_42f.childNodes[i].getAttribute("max")){
this.marketState.setMax(_42f.childNodes[i].getAttribute("max"));
}
}
}
if(!this.isForecastError){
if(!this.isFirstTime){
if(this.getForBidElem()){
this.getForBidElem().style.display="";
this.getForBidElem().innerHTML=MessageUtil.replaceParams(this.resourceBundle.monthlyEstimatesForBid,[(MarketLocaleInfo.currencySymbol+this.decimalFormatter.formatCurrency(this.PPC,MarketLocaleInfo.decimalPlaces))]);
}
this.reRenderPricingForecasting();
if(this.checkedDisplay==this.getClickToBidValue()&&!this.defaultBidError){
this.initGraph();
}
}else{
if(this.getBestPPCElem()){
if(!this.defaultBidError){
this.getBestPPCElem().innerHTML=" "+MarketLocaleInfo.currencySymbol+" "+this.decimalFormatter.formatCurrency(this.bestPPC,MarketLocaleInfo.decimalPlaces)+" ";
}
}
}
this.setPPC(this.PPC);
}
if(!this.isMarketStateError){
if(this.isKeyword){
this._reGeneratePremRangeDiv();
}
}
if(this.defaultBidError){
this.reRenderPricingForecasting();
if(this.getEstimateButtonElem()){
this.getEstimateButtonElem().style.display="none";
}
if(this.getEstimatedPPCBlurbElem()){
this.getEstimatedPPCBlurbElem().innerHTML="";
}
this.fillWithErrorMessage("noDefaultKeywords");
}
}else{
if(_42f&&_42f.tagName=="cpcGraph"){
var _439;
if(_42f.getAttribute("url")){
_439=_42f.getAttribute("url");
}
this._generatePieChart(_439);
}else{
if(_42f&&_42f.tagName=="error"){
if(_42f.getAttribute("type")=="forecast"||_42f.getAttribute("type")=="service"||_42f.getAttribute("type")=="noDefaultKeywords"||_42f.getAttribute("type")=="noDataForKW"){
if(!this.isFirstTime){
this.bestPPC=0;
if(_42f.getAttribute("PPC")){
this.PPC=(new Number(_42f.getAttribute("PPC"))).valueOf();
}
if(_42f.getAttribute("defaultPPC")){
this.defaultPPC=(new Number(_42f.getAttribute("defaultPPC"))).valueOf();
}
if(_42f.getAttribute("marketMinBid")){
this.marketMinBid=(new Number(_42f.getAttribute("marketMinBid"))).valueOf();
}
if(_42f.getAttribute("marketMaxBid")){
this.marketMaxBid=(new Number(_42f.getAttribute("marketMaxBid"))).valueOf();
}
if(_42f.getAttribute("vtpMinBid")){
this.vtpMinBid=(new Number(_42f.getAttribute("vtpMinBid"))).valueOf();
}
if(_42f.getAttribute("isDefault")){
var _430=_42f.getAttribute("isDefault");
if(_430=="false"){
this.isDefault=false;
}else{
if(_430=="true"){
this.isDefault=true;
}
}
}
if(this.selector){
if(this.isDefault){
this.handleDefaultBidTypeChange();
this.getDefaultRadioElem().checked=true;
this.getCustomRadioElem().checked=false;
}else{
this.handleCustomBidTypeChange();
this.getDefaultRadioElem().checked=false;
this.getCustomRadioElem().checked=true;
}
}
this.setDefaultBidText();
var _43a=this.getPPCElem();
if(this.isDefault){
_43a.value=this.decimalFormatter.formatCurrency(this.defaultPPC,MarketLocaleInfo.decimalPlaces);
}else{
if(this.PPC){
_43a.value=this.decimalFormatter.formatCurrency(this.PPC,MarketLocaleInfo.decimalPlaces);
}else{
_43a.value="";
}
}
}
if(this.getEstimateButtonElem()){
this.getEstimateButtonElem().style.display="none";
}
if(this.getEstimatedPPCBlurbElem()){
this.getEstimatedPPCBlurbElem().innerHTML="";
}
this.fillWithErrorMessage(_42f.getAttribute("type"),_42f.getAttribute("matchType"));
this.isForecastError=true;
}else{
if(_42f.getAttribute("type")=="marketStateService"||_42f.getAttribute("type")=="marketStateNoData"){
this.getPremRangeElem().innerHTML="";
var _43b=document.createElement("div");
_43b.className=this.styleClass.fieldError;
_43b.id=this.getErrorDivId();
this.getPremRangeElem().appendChild(_43b);
var type=_42f.getAttribute("type");
if(type=="marketStateService"){
_43b.innerHTML=this.resourceBundle.forecastingMSError;
}else{
if(type=="marketStateNoData"){
_43b.innerHTML=this.resourceBundle.forecastingMSNoData;
}
}
this.isMarketStateError=true;
}
}
}else{
if(_42f&&_42f.tagName=="msgInfo"){
if(_42f.getAttribute("type")&&_42f.getAttribute("type")=="vtpWarn"){
if(this.getVtpWarningDivElem()){
var _43d=this.getVtpWarningDivElem();
_43d.style.display="";
if(!this.isKeyword){
_43d.className="systemNote";
}
_43d.innerHTML=_42f.getAttribute("message");
if(this.isKeyword&&this.defaultPPC&&this.vtpMinBid&&(this.defaultPPC<this.vtpMinBid)){
this.getDefaultErrorDivElem().innerHTML=_42f.getAttribute("message");
Element.hide(this.generateId(this.getSaveCancelDefaultId()+"-save"));
}
}
}else{
if(_42f.getAttribute("type")&&_42f.getAttribute("type")=="vtpError"){
this.vtpError=_42f.getAttribute("message");
}
}
}
}
}
}
};
PricingForecasting.prototype.reRenderPricingForecasting=function(){
this.reRender(this.isNewAdGroup);
this._reGenerateMonthEstTableDiv();
this._reGenerateSimpleGraphDiv();
if(this.isKeyword&&!this.isMarketStateError){
this._reGeneratePremRangeDiv();
}
};
PricingForecasting.prototype.fillWithErrorMessage=function(type,_43f){
if(type=="forecast"){
if(_43f=="cm"){
this.fillTableGraphWithErrorMessage(this.resourceBundle.forecastingUnavailableCm);
}else{
this.fillTableGraphWithErrorMessage(this.resourceBundle.forecastingUnavailable);
}
}else{
if(type=="service"){
this.fillTableGraphWithErrorMessage(this.resourceBundle.forecastingError);
}else{
if(type=="noDefaultKeywords"){
this.fillGraphTdWithErrorMessage(this.resourceBundle.forecastingNoDefaultKWs);
}else{
if(type=="noDataForKW"){
this.fillTableGraphWithErrorMessage(this.resourceBundle.forecastingNoDataForKW);
}else{
if(type=="noClicks"){
this.fillGraphTdWithErrorMessage(this.resourceBundle.forecastingNoClicks);
}
}
}
}
}
};
PricingForecasting.prototype.fillGraphTdWithErrorMessage=function(msg){
var td=this.getTdGrphDsplyElem();
td.innerHTML="";
td.className="prcNoDataWrap";
td.setAttribute("align","center");
var div=document.createElement("div");
td.appendChild(div);
div.className="prcNoDataView";
div.id="prcNoDataView-"+this.num;
div.innerHTML=msg;
};
PricingForecasting.prototype.fillTableGraphWithErrorMessage=function(msg){
Element.hide(this.getMonthEstTableId());
Element.hide(this.getTdGrphDsplyId());
var _444=document.getElementById(this.getErrorDsplyId());
_444.innerHTML="";
var div=document.createElement("div");
div.className="prcNoDataView";
div.id="prcNoDataView-"+this.num;
div.innerHTML=msg;
_444.appendChild(div);
Element.show(this.getErrorDsplyId());
};
PricingForecasting.prototype._extractForecastData=function(_446){
var _447=new ForecastBean();
if(_446!=null){
if(_446.getAttribute("type")){
_447.setType(_446.getAttribute("type"));
}
if(_446.getAttribute("maxBid")){
_447.setMaxCpc((new Number(_446.getAttribute("maxBid"))).valueOf());
}
if(_446.getAttribute("avgBid")){
_447.setAvgCpc((new Number(_446.getAttribute("avgBid"))).valueOf());
}
if(_446.getAttribute("impressions")){
_447.setImpressions((new Number(_446.getAttribute("impressions"))).valueOf());
}
if(_446.getAttribute("clicks")){
_447.setClicks((new Number(_446.getAttribute("clicks"))).valueOf());
}
if(_446.getAttribute("position")){
_447.setPosition((new Number(_446.getAttribute("position"))).valueOf());
}
if(_446.getAttribute("sharePotential")){
_447.setSharePotential((new Number(_446.getAttribute("sharePotential"))).valueOf());
}
if(_446.getAttribute("missedClicks")){
_447.setMissedClicks((new Number(_446.getAttribute("missedClicks"))).valueOf());
}
if(_446.getAttribute("number")){
_447.setNumber((new Number(_446.getAttribute("number"))).valueOf());
}
}
return _447;
};
PricingForecasting.prototype.getEstAvgPosViewElem=function(){
return document.getElementById(this.getEstAvgPosViewId());
};
PricingForecasting.prototype.getEstMonClickElem=function(){
return document.getElementById(this.getEstMonClickId());
};
PricingForecasting.prototype.getEstImprElem=function(){
return document.getElementById(this.getEstImprId());
};
PricingForecasting.prototype.getSharePotentialElem=function(){
return document.getElementById(this.getSharePotentialId());
};
PricingForecasting.prototype.getTotalEstAvgPosViewElem=function(){
return document.getElementById(this.getTotalEstAvgPosViewId());
};
PricingForecasting.prototype.getTotalEstMonClickElem=function(){
return document.getElementById(this.getTotalEstMonClickId());
};
PricingForecasting.prototype.getTotalSharePotentialElem=function(){
return document.getElementById(this.getTotalSharePotentialId());
};
PricingForecasting.prototype.getTotalEstImprElem=function(){
return document.getElementById(this.getTotalEstImprId());
};
PricingForecasting.prototype.getGraphElem=function(){
return document.getElementById(this.getGraphId());
};
PricingForecasting.prototype.getLineElem=function(){
return document.getElementById(this.getLineId());
};
PricingForecasting.prototype.getPPCElem=function(){
return document.getElementById(this.getPPCId());
};
PricingForecasting.prototype.getGraphDisplayElem=function(){
return document.getElementById(this.getGraphDisplayId());
};
PricingForecasting.prototype.getEstTableElem=function(){
return document.getElementById(this.getEstTableId());
};
PricingForecasting.prototype.getTdGrphDsplyElem=function(){
return document.getElementById(this.getTdGrphDsplyId());
};
PricingForecasting.prototype.getGraphAreaElem=function(){
return document.getElementById(this.getGraphAreaId());
};
PricingForecasting.prototype.getPieGraphElem=function(){
return document.getElementById(this.getPieGraphId());
};
PricingForecasting.prototype.getTd0Elem=function(){
return document.getElementById(this.getTd0Id());
};
PricingForecasting.prototype.getTd3Elem=function(){
return document.getElementById(this.getTd3Id());
};
PricingForecasting.prototype.getEstAvgCPCElem=function(){
return document.getElementById(this.getEstAvgCPCId());
};
PricingForecasting.prototype.getTotalEstAvgCPCElem=function(){
return document.getElementById(this.getTotalEstAvgCPCId());
};
PricingForecasting.prototype.getPremRangeElem=function(){
return document.getElementById(this.getPremRangeId());
};
PricingForecasting.prototype.getGrphTitleElem=function(){
return document.getElementById(this.getGrphTitleId());
};
PricingForecasting.prototype.getMonthEstTableElem=function(){
return document.getElementById(this.getMonthEstTableId());
};
PricingForecasting.prototype.getForBidElem=function(){
return document.getElementById(this.getForBidId());
};
PricingForecasting.prototype.getDivId=function(){
return this.divId;
};
PricingForecasting.prototype.getPrefix=function(){
return this.num+"-"+this.divId;
};
PricingForecasting.prototype.getEstAvgPosViewId=function(){
return this.getPrefix()+"-estAvgPosView";
};
PricingForecasting.prototype.getEstMonClickId=function(){
return this.getPrefix()+"-estMonClick";
};
PricingForecasting.prototype.getEstImprId=function(){
return this.getPrefix()+"-estImprClick";
};
PricingForecasting.prototype.getSharePotentialId=function(){
return this.getPrefix()+"-sharePotential";
};
PricingForecasting.prototype.getTotalEstAvgPosViewId=function(){
return this.getPrefix()+"-totalEstAvgPosView";
};
PricingForecasting.prototype.getTotalEstMonClickId=function(){
return this.getPrefix()+"-totalEstMonClick";
};
PricingForecasting.prototype.getTotalEstImprId=function(){
return this.getPrefix()+"-totalEstImprClick";
};
PricingForecasting.prototype.getTotalSharePotentialId=function(){
return this.getPrefix()+"-totalSharePotential";
};
PricingForecasting.prototype.getGraphId=function(){
return this.getPrefix()+"-graph";
};
PricingForecasting.prototype.getLineId=function(){
return this.getPrefix()+"-line";
};
PricingForecasting.prototype.getPPCId=function(){
return this.getPrefix()+"-PPC";
};
PricingForecasting.prototype.getGraphDisplayId=function(){
return this.getPrefix()+"-graphGraphDisplayId";
};
PricingForecasting.prototype.getGraphDisplayClickToBidId=function(){
return this.getPrefix()+"-graphDisplayClickToBidId";
};
PricingForecasting.prototype.getGraphDisplayShareOfPotentionId=function(){
return this.getPrefix()+"-graphDisplayShareOfPotentionId";
};
PricingForecasting.prototype.getClickToBidValue=function(){
return "clickToBid";
};
PricingForecasting.prototype.getShareOfPotentialValue=function(){
return "shareOfPotential";
};
PricingForecasting.prototype.getEstTableId=function(){
return this.getPrefix()+"-estTable";
};
PricingForecasting.prototype.getGraphTableId=function(){
return this.getPrefix()+"-GraphTable";
};
PricingForecasting.prototype.getTdGrphDsplyId=function(){
return this.getPrefix()+"-tdGrphDsply";
};
PricingForecasting.prototype.getPremRangeId=function(){
return this.getPrefix()+"-premRange";
};
PricingForecasting.prototype.getMonthEstTableId=function(){
return this.getPrefix()+"-monthEstTable";
};
PricingForecasting.prototype.getGraphAreaId=function(){
return this.getPrefix()+"-graphAreaId";
};
PricingForecasting.prototype.getPieGraphId=function(){
return this.getPrefix()+"-pieGraphId";
};
PricingForecasting.prototype.getTd0Id=function(){
return this.getPrefix()+"-td0Id";
};
PricingForecasting.prototype.getTd3Id=function(){
return this.getPrefix()+"-td3Id";
};
PricingForecasting.prototype.getEstAvgCPCId=function(){
return this.getPrefix()+"-estAvgCPCId";
};
PricingForecasting.prototype.getTotalEstAvgCPCId=function(){
return this.getPrefix()+"-estTotalAvgCPCId";
};
PricingForecasting.prototype.getGrphTitleId=function(){
return this.getPrefix()+"-grphTitle";
};
PricingForecasting.prototype.getForBidId=function(){
return this.getPrefix()+"-forbid";
};
PricingForecasting.prototype.getSlctDsplyId=function(){
return this.getPrefix()+"-slctDsply";
};
PricingForecasting.prototype.getErrorDsplyId=function(){
return this.getPrefix()+"-errorDsplyDiv";
};
PricingForecasting.prototype.setPPC=function(val){
if(val&&this.PPC!=val){
this.PPC=val;
this.getForBidElem().innerHTML=MessageUtil.replaceParams(this.resourceBundle.monthlyEstimatesForBid,[(MarketLocaleInfo.currencySymbol+this.decimalFormatter.formatCurrency(this.PPC,MarketLocaleInfo.decimalPlaces))]);
if(!this.defaultBidError){
this.recalcForecast(val);
if(this.checkedDisplay==this.getClickToBidValue()){
this.positionMarker(val);
}
}
}
};
PricingForecasting.prototype.getDelta=function(val){
if(val){
var _44a=val;
if(val<this.lowerBound){
_44a=this.lowerBound;
}else{
if(val>this.maxBound){
_44a=this.maxBound;
}
}
return _44a-this.initialPPC;
}
};
PricingForecasting.prototype.recalcForecast=function(val){
if(val){
var bean;
if(this.landscape!=null){
var _44d=this.landscape;
if(_44d&&_44d.length>1){
if(val<_44d[_44d.length-1].getMaxCpc()&&val>=_44d[0].getMaxCpc()){
bean=this.getForecast(_44d,val);
}else{
if(val>=_44d[_44d.length-1].getMaxCpc()){
bean=_44d[_44d.length-1];
}else{
bean=_44d[0];
}
}
}
}
if(bean!=null){
this.updateTable(bean);
this.defaultForecastBean=bean;
}
}
};
PricingForecasting.prototype.updateTable=function(_44e){
if(_44e!=null){
if(this.getEstMonClickElem()&&!this.defaultBidError){
this.getEstMonClickElem().innerHTML=this.decimalFormatter.formatNumber(_44e.getClicks(),0);
}
if(this.getEstImprElem()&&!this.defaultBidError){
this.getEstImprElem().innerHTML=this.decimalFormatter.formatNumber(_44e.getImpressions(),0);
}
if(this.getEstAvgPosViewElem()&&!this.defaultBidError){
this.getEstAvgPosViewElem().innerHTML=this.decimalFormatter.formatNumber(_44e.getPosition());
}
if(this.getSharePotentialElem()&&!this.defaultBidError){
this.getSharePotentialElem().innerHTML=this.decimalFormatter.formatPercentage(_44e.getSharePotential());
}
if(this.getEstAvgCPCElem()&&!this.defaultBidError){
this.getEstAvgCPCElem().innerHTML=this.decimalFormatter.formatCurrency(_44e.getAvgCpc(),MarketLocaleInfo.decimalPlaces);
}
var _44f=this.calculateTotal(_44e);
if(this.getTotalEstMonClickElem()){
this.getTotalEstMonClickElem().innerHTML=this.decimalFormatter.formatNumber(_44f.getClicks(),0);
}
if(this.getTotalEstImprElem()){
this.getTotalEstImprElem().innerHTML=this.decimalFormatter.formatNumber(_44f.getImpressions(),0);
}
if(this.getTotalEstAvgPosViewElem()){
this.getTotalEstAvgPosViewElem().innerHTML=this.decimalFormatter.formatNumber(_44f.getPosition());
}
if(this.getTotalSharePotentialElem()){
this.getTotalSharePotentialElem().innerHTML=this.decimalFormatter.formatPercentage(_44f.getSharePotential());
}
if(this.getTotalEstAvgCPCElem()){
this.getTotalEstAvgCPCElem().innerHTML=this.decimalFormatter.formatCurrency(_44f.getAvgCpc(),MarketLocaleInfo.decimalPlaces);
}
}
};
PricingForecasting.prototype.getForecast=function(_450,cpc){
var _452=this.findForecast(_450,cpc,0,_450.length);
if(_452==null){
return new ForecastBean();
}
return _452;
};
PricingForecasting.prototype.findForecast=function(_453,cpc,st,end){
if(st<end){
eval("var index = "+((st+end)/2).toFixed(0));
eval("var next = "+index+" + 1");
eval("var prev = "+index+" - 1");
if(_453[index].getMaxCpc()==cpc){
return _453[index];
}
if(cpc>_453[index].getMaxCpc()){
if(index==end-1){
if(cpc<=_453[next].getMaxCpc()){
return this.estimateForecast(cpc,_453[index],_453[next]);
}
}else{
return this.findForecast(_453,cpc,index,end);
}
}
if(cpc<_453[index].getMaxCpc()){
if(index==st||prev==st){
if(cpc>=_453[prev].getMaxCpc()){
return this.estimateForecast(cpc,_453[index],_453[prev]);
}
}else{
return this.findForecast(_453,cpc,st,index);
}
}
}
if(st==end){
if(_453[st].getMaxCpc()==cpc){
return _453[st];
}
if(cpc>_453[st].getMaxCpc()){
if(st<_453.length){
return this.estimateForecast(cpc,_453[st],_453[st+1]);
}else{
return _453[st];
}
}
if(cpc<_453[st].getMaxCpc()){
if(st>0){
return this.estimateForecast(cpc,_453[st],_453[st-1]);
}else{
return _453[st];
}
}
}
return null;
};
PricingForecasting.prototype.estimateForecast=function(_457,f1,f2){
var _45a=new ForecastBean();
_45a.setMaxCpc(_457);
var _45b=(_457-f1.getMaxCpc())/(f2.getMaxCpc()-f1.getMaxCpc());
if(f1.getClicks()&&f2.getClicks()){
_45a.setClicks(f1.getClicks()+(f2.getClicks()-f1.getClicks())*_45b);
}
if(f1.getMissedClicks()&&f2.getMissedClicks()){
_45a.setMissedClicks(f1.getMissedClicks()+(f2.getMissedClicks()-f1.getMissedClicks())*_45b);
}
if(f1.getPosition()&&f2.getPosition()){
_45a.setPosition(f1.getPosition()+(f2.getPosition()-f1.getPosition())*_45b);
}
if(f1.getSharePotential()&&f2.getSharePotential()){
_45a.setSharePotential(f1.getSharePotential()+(f2.getSharePotential()-f1.getSharePotential())*_45b);
}
if(f1.getImpressions()&&f2.getImpressions()){
_45a.setImpressions(f1.getImpressions()+(f2.getImpressions()-f1.getImpressions())*_45b);
}
if(f1.getAvgCpc()&&f2.getAvgCpc()){
_45a.setAvgCpc(f1.getAvgCpc()+(f2.getAvgCpc()-f1.getAvgCpc())*_45b);
}
_45a.setNumber(f1.getNumber());
return _45a;
};
PricingForecasting.prototype.initGraph=function(){
if(this.graphNotAvailable){
return;
}
this.initLine();
this.positionMarker(this.PPC);
};
PricingForecasting.prototype.initLine=function(){
if(this.graphNotAvailable){
return;
}
if(this.dgs){
this.dgs.thumb.unreg();
this.dgs.unreg();
this.dgs=null;
}
var val=this.PPC;
if(val<this.lowerBound){
val=this.lowerBound;
}else{
if(val>this.maxBound){
val=this.maxBound;
}
}
var _45d=(this.lineOffSet-this.backgroundPosOffset)-this.xOffset;
var _45e=this.chartWidth-(this.lineOffSet-this.backgroundPosOffset)+this.xOffset;
var _45f=null;
if(MarketLocaleInfo.needBidIncrementCheck()){
_45f=MarketLocaleInfo.bidIncrement*this.chartWidth/(this.maxBound-this.lowerBound);
if(_45f!=null){
this._customTick=_45f;
var diff=0-this.calculatePosition(MarketLocaleInfo.bidIncrement);
this.lineOffSet=this.lineOffSet-diff;
var line=this.getLineElem();
line.style.position="relative";
line.style.left=(-1*diff)+"px";
_45d=(this.lineOffSet-this.backgroundPosOffset)-this.xOffset;
_45e=this.chartWidth-(this.lineOffSet-this.backgroundPosOffset)+this.xOffset;
this.dgs=YAHOO.widget.Slider.getHorizSlider(this.getGraphId(),this.getLineId(),_45d,_45e,_45f);
}
}else{
this.dgs=YAHOO.widget.Slider.getHorizSlider(this.getGraphId(),this.getLineId(),_45d,_45e);
}
this.dgs.pricingForecasting=this;
if(!this.isDefault){
var _462=this.decimalFormatter.parse(this.getPPCElem().value,MarketLocaleInfo.decimalPlaces);
if(this.isValidBid()){
this.removeErrorMessage();
}
}
this.dgs.subscribe("change",function(_463){
if(this.ignoreOnChange){
this.ignoreOnChange=false;
return;
}
if(this.pricingForecasting.debugWidget){
this.pricingForecasting.getGraphElem().title="offsetFromStart = "+_463;
this.pricingForecasting.getLineElem().title="left= "+this.pricingForecasting.getLineElem().style.left+", top="+this.pricingForecasting.getLineElem().style.top;
}
var _464=this.pricingForecasting.lowerBound+this.pricingForecasting.dataRange*((_463+this.pricingForecasting.lineOffSet-this.pricingForecasting.backgroundPosOffset-this.pricingForecasting.xOffset)/this.pricingForecasting.chartWidth);
if(MarketLocaleInfo.needBidIncrementCheck()){
_464=Math.round(_464/MarketLocaleInfo.bidIncrement)*MarketLocaleInfo.bidIncrement;
}
if(_464<this.pricingForecasting.lowerBound){
_464=this.pricingForecasting.lowerBound;
}
if(_464>this.pricingForecasting.maxBound){
_464=this.pricingForecasting.maxBound;
}
this.pricingForecasting.PPC=_464;
if(this.pricingForecasting.isDefault){
this.pricingForecasting.handleCustomBidTypeChange();
}
this.pricingForecasting.changedFromOriginalState(false);
this.pricingForecasting.removeErrorMessage();
this.pricingForecasting.getPPCElem().value=this.pricingForecasting.decimalFormatter.formatCurrency(_464,MarketLocaleInfo.decimalPlaces);
this.pricingForecasting.getForBidElem().innerHTML=MessageUtil.replaceParams(this.pricingForecasting.resourceBundle.monthlyEstimatesForBid,[(MarketLocaleInfo.currencySymbol+this.pricingForecasting.decimalFormatter.formatCurrency(_464,MarketLocaleInfo.decimalPlaces))]);
this.pricingForecasting.recalcForecast(this.pricingForecasting.decimalFormatter.parse(this.pricingForecasting.getPPCElem().value,MarketLocaleInfo.decimalPlaces));
});
};
PricingForecasting.prototype.calculatePosition=function(val){
return (this.chartWidth*((val-this.lowerBound)/this.dataRange))-(this.lineOffSet-this.backgroundPosOffset)+this.xOffset;
};
PricingForecasting.prototype.positionMarker=function(val){
if(this.graphNotAvailable){
return;
}
if(this.dgs){
if(val<this.lowerBound){
val=this.lowerBound;
}else{
if(val>this.maxBound){
val=this.maxBound;
}
}
this.dgs.ignoreOnChange=true;
this.dgs.setValue(this.calculatePosition(val),true);
}
};
var PricingManager=new function(){
this.adGroupBulkPricingModuleAdvBidOn=null;
this.adGroupBulkPricingModuleAdvBidOff=null;
this.adGroupInlinePricingModule=null;
this.keywordBulkPricingModuleAdvBidOn=null;
this.keywordBulkPricingModuleAdvBidOff=null;
this.keywordInlinePricingModule=null;
this._ajax_url="campaign/pricingModuleAjax.do";
this._countryCode=0;
this.setAjaxUrl=function(_467){
this._ajax_url=_467;
};
this.serCountryCod=function(_468){
this._countryCod=_468;
};
this.createAdGroupPricingForecastingModule=function(_469,_46a,_46b,_46c,_46d,_46e,_46f,_470){
if(!_46b&&!_46c){
alert("You must have at least one tatic enabled.");
return;
}
var _471;
if(_46a){
var _472=new Map();
if(_46b){
var _473=new PricingForecasting(_469,this._ajax_url,1,this._countryCode,MatchType.sponsoredSearch,_46d,false,_46e,_46e);
if(_46f!=null){
_473.setCampaignLimit(_46f);
}
if(_470!=null){
_473.setAccountLimit(_470);
}
_473.isInline=true;
_472.put(MatchType.sponsoredSearch,_473);
}
if(_46c){
var _474=new PricingForecasting(_469,this._ajax_url,2,this._countryCode,MatchType.contentMatch,_46d,false,_46e,_46e);
if(_46f!=null){
_474.setCampaignLimit(_46f);
}
if(_470!=null){
_474.setAccountLimit(_470);
}
_474.isInline=true;
_472.put(MatchType.contentMatch,_474);
}
_471=new PricingModule(_469,this._ajax_url,_472);
}else{
var _475=new PricingForecasting(_469,this._ajax_url,0,this._countryCode,MatchType.mixed,_46d,false,_46e,_46e);
_475.isInline=true;
if(_46f!=null){
_475.setCampaignLimit(_46f);
}
if(_470!=null){
_475.setAccountLimit(_470);
}
var _472=new Map();
_472.put(MatchType.mixed,_475);
_471=new PricingModule(_469,this._ajax_url,_472);
}
return _471;
};
this.createAdGroupBulkPricingForecastingModule=function(_476,_477,_478,_479,_47a,_47b,_47c){
if(_477){
if(this.adGroupBulkPricingModuleAdvBidOn==null){
var _47d=new Map();
var _47e=new Pricing(_476,1,this._countryCode,MatchType.sponsoredSearch,false,_478,_478);
_47e.isBulk=true;
_47e.marketMinBid=_479;
_47e.marketMaxBid=_47a;
_47e.setCampaignLimit(_47b);
_47e.setAccountLimit(_47c);
_47d.put(MatchType.sponsoredSearch,_47e);
var _47f=new Pricing(_476,2,this._countryCode,MatchType.contentMatch,false,_478,_478);
_47f.isBulk=true;
_47f.marketMinBid=_479;
_47f.marketMaxBid=_47a;
_47f.setCampaignLimit(_47b);
_47f.setAccountLimit(_47c);
_47d.put(MatchType.contentMatch,_47f);
this.adGroupBulkPricingModuleAdvBidOn=new PricingModule(_476,this._ajax_url,_47d);
}else{
this.adGroupBulkPricingModuleAdvBidOn.clear();
}
return this.adGroupBulkPricingModuleAdvBidOn;
}else{
if(this.keywordBulkPricingModuleAdvBidOff==null){
var _47d=new Map();
var _47e=new Pricing(_476,0,this._countryCode,MatchType.mixed,false,_478,_478);
_47e.marketMinBid=_479;
_47e.marketMaxBid=_47a;
_47e.setCampaignLimit(_47b);
_47e.setAccountLimit(_47c);
_47d.put(MatchType.mixed,_47e);
this.keywordBulkPricingModuleAdvBidOff=new PricingModule(_476,this._ajax_url,_47d);
}else{
this.keywordBulkPricingModuleAdvBidOff.clear();
}
return this.keywordBulkPricingModuleAdvBidOff;
}
};
this.createAdGroupInlinePricingModule=function(_480,_481,_482){
if(this.adGroupInlinePricingModule==null){
var _483=new Map();
var _484=new PricingForecasting(_480,this._ajax_url,0,this._countryCode,_481,false,false,_482,_482);
_484.isInline=true;
_483.put(_481,_484);
this.adGroupInlinePricingModule=new PricingModule(_480,this._ajax_url,_483);
}else{
this.adGroupInlinePricingModule.clear();
}
return this.adGroupInlinePricingModule;
};
this.createKeywordBulkPricingModule=function(_485,_486,_487,_488,_489,_48a){
if(this.keywordInlinePricingModule==null){
var _48b=new Map();
var _48c=new Pricing(_485,1,this._countryCode,null,false,true,_486);
_48b.put(MatchType.sponsoredSearch,_48c);
_48c.marketMinBid=_487;
_48c.marketMaxBid=_488;
_48c.setCampaignLimit(_489);
_48c.setAccountLimit(_48a);
this.keywordInlinePricingModule=new PricingModule(_485,this._ajax_url,_48b);
}else{
this.keywordInlinePricingModule.clear();
}
return this.keywordInlinePricingModule;
};
this.createKeywordInlinePricingModule=function(_48d,_48e,_48f,_490){
var _491=new Map();
var _492=new PricingForecasting(_48d,this._ajax_url,0,this._countryCode,null,false,true,true,_48e);
if(_48f!=null){
_492.setCampaignLimit(_48f);
}
if(_490!=null){
_492.setAccountLimit(_490);
}
_492.isInline=true;
_491.put(MatchType.sponsoredSearch,_492);
var _493=new PricingModule(_48d,this._ajax_url,_491);
return _493;
};
this.createKeywordPricingModule=function(_494,_495,_496,_497){
var _498=new Map();
var _499=new PricingForecasting(_494,this._ajax_url,0,this._countryCode,null,false,true,true,_495);
if(_496!=null){
_499.setCampaignLimit(_496);
}
if(_497!=null){
_499.setAccountLimit(_497);
}
_498.put(MatchType.sponsoredSearch,_499);
var _49a=new PricingModule(_494,this._ajax_url,_498);
return _49a;
};
};
PricingModule.prototype=new BaseWidget();
PricingModule.prototype.constructor=PricingModule;
PricingModule.prototype.baseClass=BaseWidget.prototype.constructor;
function PricingModule(_49b,_49c,_49d){
this.div_id=_49b;
this.pricingMap=_49d;
this.actionUrl=_49c;
this.resourceBundle=new PricingResources();
this.isBidOptOn=this.pricingMap.values().toArray()[0].isBidOptOn;
this.isBulk=this.pricingMap.values().toArray()[0].isBulk;
}
PricingModule.prototype.clear=function(){
document.getElementById(this.div_id).innerHTML="";
var _49e=this.pricingMap.values().toArray();
for(var i=0;i<_49e.length;i++){
_49e[i].initialize();
}
};
PricingModule.prototype.reInitialize=function(){
var _4a0=this.pricingMap.values().toArray();
for(var i=0;i<_4a0.length;i++){
_4a0[i].reInitialize();
_4a0[i].reRender();
}
};
PricingModule.prototype.render=function(){
var _4a2=this.pricingMap.values().toArray();
var _4a3=document.getElementById(this.div_id);
for(var i=0;i<_4a2.length;i++){
var _4a5=document.createElement("div");
if(_4a2.length>1&&!this.isBulk){
_4a5.className="box";
_4a3.appendChild(_4a5);
var _4a6=document.createElement("div");
_4a5.appendChild(_4a6);
_4a6.className="kwdSubHed";
var _4a7=document.createElement("h3");
if(_4a2[i].isSponsoredSearch){
_4a7.id="SSHeaderText";
}else{
_4a7.id="CMHeaderText";
}
_4a6.appendChild(_4a7);
}else{
if(this.isBulk){
_4a5.className="prcBulkWrap";
}else{
_4a5.className="clearfloat";
}
}
_4a3.appendChild(_4a5);
var _4a8=document.createElement("table");
_4a5.appendChild(_4a8);
_4a8.cellPadding="0";
_4a8.cellSpacing="0";
_4a8.width="100%";
_4a8.id="pricingModule";
_4a2[i].setResourceBundle(this.resourceBundle);
_4a2[i].table=_4a8;
_4a2[i].render();
if(_4a2.length>1&&i<_4a2.length-1){
_4a3.appendChild(document.createElement("p"));
}
}
this._generateBlank();
};
PricingModule.prototype._generateBlank=function(){
var _4a9=this.pricingMap.values().toArray();
for(var i=0;i<_4a9.length;i++){
_4a9[i]._generateBlank();
}
};
PricingModule.prototype.get_ss_errorDivId=function(){
if(this.pricingMap.containsKey(MatchType.sponsoredSearch)){
var ss=this.pricingMap.get(MatchType.sponsoredSearch);
if(ss){
return ss.getErrorDivId();
}
}
};
PricingModule.prototype.get_cm_errorDivId=function(){
if(this.pricingMap.containsKey(MatchType.contentMatch)){
var cm=this.pricingMap.get(MatchType.contentMatch);
if(cm){
return cm.getErrorDivId();
}
}
};
PricingModule.prototype.get_mixed_errorDivId=function(){
if(this.pricingMap.containsKey(MatchType.mixed)){
var _4ad=this.pricingMap.get(MatchType.mixed);
if(_4ad){
return _4ad.getErrorDivId();
}
}
};
PricingModule.prototype.clearErrorDivs=function(){
var _4ae=document.getElementById(this.get_ss_errorDivId());
if(_4ae){
_4ae.innerHTML="";
_4ae.style.display="none";
}
_4ae=document.getElementById(this.get_cm_errorDivId());
if(_4ae){
_4ae.innerHTML="";
_4ae.style.display="none";
}
_4ae=document.getElementById(this.get_mixed_errorDivId());
if(_4ae){
_4ae.innerHTML="";
_4ae.style.display="none";
}
};
PricingModule.prototype.setFirstTime=function(_4af){
var _4b0=this.pricingMap.values().toArray();
for(var i=0;i<_4b0.length;i++){
_4b0[i].setFirstTime(_4af);
}
};
PricingModule.prototype._generateSubmit=function(){
var _4b2=document.createElement("div");
_4b2.className="action sectBG";
var _4b3=document.createElement("input");
_4b3.setAttribute("type","button");
_4b3.className="button";
_4b3.setAttribute("value","Cancel");
var _4b4=document.createElement("input");
_4b4.setAttribute("type","button");
_4b4.className="button";
_4b4.setAttribute("value","Submit");
_4b2.appendChild(_4b3);
_4b2.appendChild(document.createTextNode(" "));
_4b2.appendChild(_4b4);
return _4b2;
};
PricingModule.prototype.setNewAdGroup=function(_4b5){
var _4b6=this.pricingMap.values().toArray();
for(var i=0;i<_4b6.length;i++){
_4b6[i].setNewAdGroup(_4b5);
}
};
PricingModule.prototype.loadAdGroupModule=function(_4b8,_4b9,_4ba,_4bb,_4bc,_4bd,_4be){
var _4bf=false;
this.setFirstTime(_4bf);
if(_4bd&&_4bd==true){
this.setNewAdGroup(true);
}
if(_4b8){
this.clear();
this.render();
var _4c0=new AjaxRequest(this.actionUrl,"loadAdGroupModule");
_4c0.addAjaxParameter("ad_group_id",_4b8);
if(_4b9){
_4c0.addAjaxParameter("account_id",_4b9);
}
if(_4ba>0){
_4c0.addAjaxParameter("ss_bid",_4ba);
}
if(_4bb>0){
_4c0.addAjaxParameter("cm_bid",_4bb);
}
if(_4bc){
_4c0.addAjaxParameter("market_id",_4bc);
}
if(_4bd){
_4c0.addAjaxParameter("isNewAdGroup",_4bd);
}
if(_4be){
_4c0.addAjaxParameter("tacticType",_4be);
}
_4c0.addAjaxParameter("isBidOptOn",this.isBidOptOn);
_4c0.addAjaxRegion(this.div_id,"AREA");
_4c0.addAjaxParameter("onload","true");
ajaxEngine.registerMessageHandler("adGroupPricing",this);
ajaxEngine.sendAjaxRequest(_4c0);
}else{
alert("ad_group_id is required");
}
};
PricingModule.prototype.loadKeywordModule=function(_4c1,_4c2,bid,_4c4,_4c5){
this.setFirstTime(false);
if(_4c1){
this.clear();
this.render();
var _4c6=new AjaxRequest(this.actionUrl,"loadKeywordModule");
_4c6.addAjaxParameter("ad_group_id",_4c1);
if(_4c2){
_4c6.addAjaxParameter("search_term_id",_4c2);
}
if(bid>0){
_4c6.addAjaxParameter("bid",bid);
}
if(_4c4){
_4c6.addAjaxParameter("account_id",_4c4);
}
if(_4c5){
_4c6.addAjaxParameter("market_id",_4c5);
}
_4c6.addAjaxParameter("isBidOptOn",this.isBidOptOn);
_4c6.addAjaxRegion(this.div_id,"AREA");
_4c6.addAjaxParameter("onload","true");
ajaxEngine.registerMessageHandler("keywordPricing",this);
ajaxEngine.sendAjaxRequest(_4c6);
}else{
alert("ad_group_id is required");
}
};
PricingModule.prototype.updateDiv=function(_4c7){
var _4c8=this.pricingMap.values().toArray();
for(var i=0;i<_4c8.length;i++){
_4c8[i].setDivId(_4c7);
}
};
PricingModule.prototype.processUpdate=function(_4ca){
for(var i=0;i<_4ca.childNodes.length;i++){
if(_4ca.childNodes[i]&&_4ca.childNodes[i].tagName=="cpcInfo"){
var _4cc=_4ca.childNodes[i];
try{
var _4cd=this.getPricingModule(_4cc.getAttribute("matchType"));
if(_4cd!=null){
_4cd.loadFromXML(_4cc);
}else{
alert("XML data is returning an incorrect matchtype.");
}
}
catch(illegalArgumentException){
alert(illegalArgumentException);
}
}else{
if(_4ca.childNodes[i]&&(_4ca.childNodes[i].tagName=="error"||_4ca.childNodes[i].tagName=="msgInfo")){
var _4cc=_4ca.childNodes[i];
var _4cd=this.getPricingModule(_4cc.getAttribute("matchType"));
if(_4cd!=null){
_4cd.loadFromXML(_4cc);
}
}
}
}
if(_4ca.childNodes.length==0){
var _4ce=this.pricingMap.values().toArray();
for(var j=0;j<_4ce.length;j++){
if(_4ce[j].getEstimateButtonElem()){
_4ce[j].getEstimateButtonElem().disabled=true;
}
if(_4ce[j].getBidTypeElem()){
_4ce[j].getBidTypeElem().style.display="none";
}
}
}
};
PricingModule.prototype.getPricingModule=function(_4d0){
if(this.pricingMap.containsKey(_4d0)){
return this.pricingMap.get(_4d0);
}
if(this.pricingMap.containsKey(MatchType.sponsoredSearch)){
return this.pricingMap.get(MatchType.sponsoredSearch);
}
return null;
};
PricingModule.prototype.get_ss_bid=function(){
if(this.pricingMap.containsKey(MatchType.sponsoredSearch)){
var ss=this.pricingMap.get(MatchType.sponsoredSearch);
if(ss){
return ss.getInputPPC();
}
}
};
PricingModule.prototype.get_cm_bid=function(){
if(this.pricingMap.containsKey(MatchType.contentMatch)){
var cm=this.pricingMap.get(MatchType.contentMatch);
if(cm){
return cm.getInputPPC();
}
}
};
PricingModule.prototype.get_ss_complex=function(){
if(this.pricingMap.containsKey(MatchType.sponsoredSearch)){
var ss=this.pricingMap.get(MatchType.sponsoredSearch);
if(ss){
return ss.isComplex;
}
}
};
PricingModule.prototype.get_mixed_bid=function(){
if(this.pricingMap.containsKey(MatchType.mixed)){
var _4d4=this.pricingMap.get(MatchType.mixed);
if(_4d4){
return _4d4.getInputPPC();
}
}
};
PricingModule.prototype.get_ss_bidType=function(){
if(this.pricingMap.containsKey(MatchType.sponsoredSearch)){
var ss=this.pricingMap.get(MatchType.sponsoredSearch);
if(ss){
return ss.getBidType();
}
}
};
PricingModule.prototype.get_cm_bidType=function(){
if(this.pricingMap.containsKey(MatchType.contentMatch)){
var cm=this.pricingMap.get(MatchType.contentMatch);
if(cm){
return cm.getBidType();
}
}
};
PricingModule.prototype.validate_for_vtp_min_bid=function(){
if(this.pricingMap.containsKey(MatchType.sponsoredSearch)){
var ss=this.pricingMap.get(MatchType.sponsoredSearch);
if(ss){
return ss.validateForVtpMinBid();
}
}
};
PricingModule.prototype.is_mixed_bid_valid=function(){
if(this.pricingMap.containsKey(MatchType.mixed)){
var _4d8=this.pricingMap.get(MatchType.mixed);
if(_4d8){
return _4d8.isValidBid();
}
}
};
PricingModule.prototype.is_ss_bid_valid=function(){
if(this.pricingMap.containsKey(MatchType.sponsoredSearch)){
var ss=this.pricingMap.get(MatchType.sponsoredSearch);
if(ss){
return ss.isValidBid();
}
}
};
PricingModule.prototype.is_cm_bid_valid=function(){
if(this.pricingMap.containsKey(MatchType.contentMatch)){
var cm=this.pricingMap.get(MatchType.contentMatch);
if(cm){
return cm.isValidBid();
}
}
};
PricingModule.prototype.is_bid_valid=function(_4db){
if(this.pricingMap.containsKey(_4db)){
var pm=this.pricingMap.get(_4db);
if(pm){
return pm.isValidBid();
}
}
};
PricingModule.prototype.is_mixed_above_vtp_bid=function(){
if(this.pricingMap.containsKey(MatchType.mixed)){
var _4dd=this.pricingMap.get(MatchType.mixed);
if(_4dd){
return _4dd.isAboveVtpMinBid();
}
}
};
PricingModule.prototype.is_ss_above_vtp_bid=function(){
if(this.pricingMap.containsKey(MatchType.sponsoredSearch)){
var ss=this.pricingMap.get(MatchType.sponsoredSearch);
if(ss){
return ss.isAboveVtpMinBid();
}
}
};
PricingModule.prototype.is_cm_above_vtp_bid=function(){
if(this.pricingMap.containsKey(MatchType.contentMatch)){
var cm=this.pricingMap.get(MatchType.contentMatch);
if(cm){
return cm.isAboveVtpMinBid();
}
}
};
PricingModule.prototype.is_above_vtp_bid=function(_4e0){
if(this.pricingMap.containsKey(_4e0)){
var pm=this.pricingMap.get(_4e0);
if(pm){
return pm.isAboveVtpMinBid();
}
}
};
PricingModule.prototype.get_ss_vtp_bid=function(){
if(this.pricingMap.containsKey(MatchType.sponsoredSearch)){
var ss=this.pricingMap.get(MatchType.sponsoredSearch);
if(ss){
return ss.getVtpMinBid();
}
}
};
PricingModule.prototype.get_cm_vtp_bid=function(){
if(this.pricingMap.containsKey(MatchType.contentMatch)){
var cm=this.pricingMap.get(MatchType.contentMatch);
if(cm){
return cm.getVtpMinBid();
}
}
};
PricingModule.prototype.get_vtp_bid=function(_4e4){
if(this.pricingMap.containsKey(_4e4)){
var pm=this.pricingMap.get(_4e4);
if(pm){
return pm.getVtpMinBid();
}
}
};
PricingModule.prototype.is_ss_checked=function(){
if(this.pricingMap.containsKey(MatchType.sponsoredSearch)){
var ss=this.pricingMap.get(MatchType.sponsoredSearch);
if(ss){
return ss.isChecked();
}
}
};
PricingModule.prototype.is_cm_checked=function(){
if(this.pricingMap.containsKey(MatchType.contentMatch)){
var cm=this.pricingMap.get(MatchType.contentMatch);
if(cm){
return cm.isChecked();
}
}
};
PricingModule.prototype.get_mixed_bidType=function(){
if(this.pricingMap.containsKey(MatchType.mixed)){
var _4e8=this.pricingMap.get(MatchType.mixed);
if(_4e8){
return _4e8.getBidType();
}
}
};
PricingModule.prototype.isValid=function(){
var _4e9=this.pricingMap.values().toArray();
var _4ea=true;
for(var i=0;i<_4e9.length;i++){
var _4ec=_4e9[i].getInputPPC();
if(isNaN(_4ec)||_4ec<=0){
_4e9[i].setInvalidNumberError();
_4ea=false;
}else{
_4e9[i].removeErrorMessage();
}
}
return _4ea;
};
PricingResources.prototype.className="PricingResources";
PricingResources.prototype=new Object();
function PricingResources(){
this.sponsoredSearch="(Sponsored Search)";
this.contentMatch="(Content Match)";
this.sponsoredSearchBid="(Set a Sponsored Search Ad Group Bid)";
this.contentMatchBid="(Set a Content Match Ad Group Bid)";
this.mixed="(AdGroup Pricing)";
this.getTheMost="(To get the most available traffic we estimate a PPC of)";
this.getTheMost_based_on_account_dailyspendinglimit="(To get the estimated maximum number of clicks based on your account daily spending limit, enter an ad group bid of)";
this.getTheMost_based_on_campaign_dailyspendinglimit="(To get the estimated maximum number of clicks based on your campaign daily spending limit, enter an ad group bid of)";
this.currency="($)";
this.maxPPC="(Maximum Price Per Click)";
this.maxCPCHelp="(Max CPC help text)";
this.customBid="(Specify Custom Bid)";
this.defaultBid="(Use Default Bid)";
this.estMonClks="(Estimated Monthly Clicks)";
this.estAvgPos="(Estimated Average Position)";
this.avgPos="(Average Position)";
this.impressions="(Impressions)";
this.shrOfPot="(Share of Potential)";
this.alertNumValue="(Enter a numeric value for bid.)";
this.defaultBiddedKeywords="(Default Bidded Keywords)";
this.adGroupTotal="(Ad Group Total)";
this.graphDisplay="(Graph Display):";
this.clickToBid="(Clicks to Bid)";
this.shareOfPotential="(Share of Potential)";
this.estimatedAvgCPC="(Your Estimated Average CPC:)";
this.monthlyEstimates="(Monthly Estimates)";
this.defaultBidTraffic="(Default Bid Traffic Avg. PPC)";
this.customBidTraffic="(Custom Bid Traffic Avg. PPC)";
this.clicks="Clicks";
this.avgCPC="(Average CPC)";
this.estimatedClicks="(Estimated Clicks)";
this.shareOfAvilableClicks="(Share of Available Clicks)";
this.missedClicks="(Missed Clicks)";
this.percentOfOveridBids="(of your traffic is from overridden bids on Sponsored Search keywords.)";
this.notValidNumber="(Please input a valid Max PPC.)";
this.forecastingUnavailable="(Forecasting data is currently unavailable due to insufficient forecasting data for the given keyword(s))";
this.forecastingUnavailableCm="(Bid forecasting information is not available for the keywords in this ad group)";
this.forecastingNoDefaultKWs="(Bid forecasting information is not available when all keywords in the ad group have custom price specified.)";
this.forecastingNoDataForKW="(Bid forecasting information is not available for this keyword.)";
this.forecastingNoClicks="(Click information is not available for the given keyword(s))";
this.forecastingError="(Forecasting data is currently unavailable.)";
this.forecastingMSError="(We're sorry. An error occurred while displaying the bid range for top available positions. Please try again later.)";
this.forecastingMSNoData="(A bid range for top positions is not available for this keyword.)";
this.avgHistPricTrend="(Average Historical Pricing Trend.)";
this.rangePrimePlace="(Current Price Range for Prime Placement)";
this.specifyAdGroupBid="(Specify Ad Group Bid)";
this.to="(to)";
this.estimate="(Estimate)";
this.limit="(Limit)";
this.primePlaceToolTip="(The current bid range for the first and last available positions at the top of the search results page for a particular keyword.)";
}
PricingStyle.prototype.className="PricingStyle";
PricingStyle.prototype=new Object();
function PricingStyle(){
this.pmEst="pmEst";
this.entryDiv="estimate clearfloat sectBG";
this.dualEntryDiv="dual estimate clearfloat sectBG";
this.fieldError="fieldError";
this.slctBid="slctBid";
this.firstCol="firstCol";
this.firstColOddRow="firstCol oddRow";
this.firstColNoRtBdr="firstCol noRtBdr";
this.oddRow="oddRow";
this.odd="odd";
this.bold="bold";
this.helpImg="helpImg";
this.grayButton="grayButton";
this.estTable="estTable";
this.estTableSmpl="estTable smpl";
this.data="data";
this.hdr="hdr";
this.hdrRow="hdrRow";
this.noRtRdr="noRtBdr";
this.hdrNoRtRdr="hdr noRtBdr";
this.oddRowNoRtBdr="oddRow noRtBdr";
this.grphDsply="grphDsply";
this.estGrphDsply="estGrphDsply";
this.cntrCntnr="cntrCntnr";
this.dualGrphDsply="dual grphDsply";
this.slctDsply="slctDsply";
this.marker=getImgUrl("images/slider_eng.gif");
this.markerLimit=getImgUrl("images/slider_limit_eng.gif");
this.std="std";
this.pieAndLgnd="pieAndLgnd";
this.chart="chart";
this.legend="legend";
this.estClicks="estClicks";
this.missedClicks="missedClicks";
this.custEstClicks="custEstClicks";
this.custMissedClicks="custMissedClicks";
this.premRange="premRange";
this.bidRange="bidRange";
this.glossTerm="glossTerm";
this.contentBox="contentBox";
this.estGrphTitle="estGrphTitle";
this.value="value";
}
GraphWidgetControl.prototype=new BaseWidget();
GraphWidgetControl.prototype.constructor=GraphWidgetControl;
GraphWidgetControl.prototype.baseClass=BaseWidget.prototype.constructor;
function GraphWidgetControl(_4ed,_4ee,_4ef){
this.baseClass(_4ed);
var _4f0=new GraphDataModel(_4ee);
if(_4ef){
this.showOptions=_4ef;
}else{
this.showOptions=false;
}
this.setDataSource(_4f0);
this.selectList=null;
this.resourceBundle=new GraphWidgetControlResources();
}
GraphWidgetControl.prototype.isGraphCached=function(_4f1){
var _4f2=this.getDataSource().getGraph(_4f1);
if(_4f2!=null){
return this.getDataSource().getGraph(_4f1).isCache();
}else{
return false;
}
};
GraphWidgetControl.prototype.setSelectedGraph=function(_4f3){
var _4f4=this.getDataSource().getGraph(_4f3);
if(_4f4!=null){
return this.getDataSource().getGraph(reportLabel).isCache();
}else{
return false;
}
};
GraphWidgetControl.prototype.showCachedGraph=function(_4f5){
var _4f6=this.getDataSource().getGraph(_4f5);
if(_4f6!=null){
this.getDataSource().setSelectedGraph(_4f5);
this.render();
}else{
this._populateGraphDivWithErrorMsg();
}
};
GraphWidgetControl.prototype.render=function(){
this._populateGraphDivWithImg();
};
GraphWidgetControl.prototype._populateGraphDivWithImg=function(){
var _4f7=this.getDataSource().getSelectedGraph();
if(this.selectList!=null){
_4f7=this.selectList.value;
}
var _4f8=this.getDataSource().getGraph(_4f7);
if(_4f8==null){
_4f7=this.getDataSource().getSelectedGraph();
_4f8=this.getDataSource().getGraph(_4f7);
}
if(_4f8!=null){
var _4f9=false;
var _4fa=null;
this.getCanvas().innerHTML="";
if(_4f8.isNoDataImg()==true){
if(this.showOptions==false){
var _4fa=_4f8.getNoDataStr();
var _4fb=_4f8.getHeight()+"px";
var _4fc=_4f8.getWidth()+"px";
var _4fd=document.createElement("div");
_4fd.id="noData_"+_4f8.getLabel();
var _4fe="font-weight: bold;font-size:16px;  color: #666;background-image: url("+_4f8.getUrl()+");width:"+_4fc+";height:"+_4fb+";line-height:"+_4fb;
if(document.all&&window.ActiveXObject&&(navigator.userAgent.toLowerCase().indexOf("msie")>-1)){
_4fe+=";text-align:center";
}else{
_4fe+=";text-align:-moz-center";
}
_4fd.style.cssText=_4fe;
this.getCanvas().appendChild(_4fd);
var _4ff=document.getElementById("noData_"+_4f8.getLabel());
_4ff.innerHTML=_4fa;
return;
}
}
this.imgTag=document.createElement("img");
this.imgTag.id=this.getCanvas().id+"_img";
this.imgDiv=document.createElement("div");
var img=null;
var _501=null;
if(_4f8.getTooltipLinksMap()!=null){
this.imgTag.setAttribute("useMap","#mapname");
this.imgTag.setAttribute("border","0");
img=_4f8.getTooltipLinksMap();
this.imgDiv.innerHTML=img;
}
if(this.showOptions){
var _502=document.createElement("span");
var _503=document.createElement("select");
_502.appendChild(document.createTextNode(this.resourceBundle.chartLabel));
_502.appendChild(_503);
this.getCanvas().appendChild(_502);
_503.id=this.getCanvas().id+"_select";
YAHOO.util.Event.addListener(_503,"change",this._changeGraph,this,true);
var _504=this.getDataSource().getGraphList();
var _505=null;
if(_504.length>0){
for(var i=0;i<_504.length;i++){
if(_504[i].isNoDataImg()==true){
var _4fb=_504[i].getHeight()+"px";
var _4fc=_504[i].getWidth()+"px";
var _4fd=document.createElement("div");
var _4fe="font-weight: bold;font-size:16px;  color: #666;background-image: url("+_4f8.getUrl()+");width:"+_4fc+";height:"+_4fb+";line-height:"+_4fb;
if(document.all&&window.ActiveXObject&&(navigator.userAgent.toLowerCase().indexOf("msie")>-1)){
_4fe+=";text-align:center";
}else{
_4fe+=";text-align:-moz-center";
}
_4fd.style.cssText=_4fe;
if(_504[i].getLabel()==_4f7){
this.imgTag=_4fd;
_504[i].imgTag=this.imgTag;
this.imgTag.id=this.getCanvas().id+"_img_"+_504[i].getLabel();
var _507=document.createElement("option");
_507.value=_504[i].getLabel();
_507.text=_504[i].getLabel();
_503.options[_503.options.length]=_507;
_507.selected=true;
_505=_507;
_503.value=_4f7;
_4f9=true;
_4fa=_504[i].getNoDataStr();
continue;
}
_504[i].imgTag=_4fd;
_504[i].imgTag.id=this.getCanvas().id+"_img_"+_504[i].getLabel();
var _507=document.createElement("option");
_507.value=_504[i].getLabel();
_507.text=_504[i].getLabel();
_503.options[_503.options.length]=_507;
}else{
if(_504[i].getLabel()==_4f7){
_504[i].imgTag=this.imgTag;
this.imgTag.id=this.getCanvas().id+"_img_"+_504[i].getLabel();
var _507=document.createElement("option");
_507.value=_504[i].getLabel();
_507.text=_504[i].getLabel();
_503.options[_503.options.length]=_507;
_507.selected=true;
_505=_507;
_503.value=_4f7;
continue;
}
_504[i].imgTag=document.createElement("img");
_504[i].imgTag.id=this.getCanvas().id+"_img_"+_504[i].getLabel();
_504[i].imgTag.src=_504[i].getUrl();
_504[i].imgTag.setAttribute("useMap","#mapname");
_504[i].imgTag.setAttribute("border","0");
var _507=document.createElement("option");
_507.value=_504[i].getLabel();
_507.text=_504[i].getLabel();
_503.options[_503.options.length]=_507;
}
}
}
this.selectList=_503;
this.getCanvas().appendChild(_503);
if(_505!=null){
_505.selected=true;
}
this.getCanvas().appendChild(document.createElement("br"));
}
this.imgDiv.appendChild(this.imgTag);
this.getCanvas().appendChild(this.imgDiv);
if(_4f9==true){
var g=document.getElementById(this.imgTag.id);
g.innerHTML=_4fa;
}
this.imgTag.setAttribute("src",_4f8.getUrl());
}else{
this._populateGraphDivWithErrorMsg;
}
};
GraphWidgetControl.prototype._changeGraph=function(e){
var _50a=YAHOO.util.Event.getTarget(e);
var _50b=_50a.options[_50a.selectedIndex].value;
var _50c=this.getDataSource().getGraph(_50b);
this.imgDiv.innerHTML="";
if(_50c.getTooltipLinksMap()!=null){
this.imgDiv.innerHTML=_50c.getTooltipLinksMap();
}
this.imgDiv.appendChild(_50c.imgTag);
this.getDataSource().setSelectedGraph(_50b);
if(_50c.isNoDataImg()==true){
var g=document.getElementById(this.getCanvas().id+"_img_"+_50c.getLabel());
g.innerHTML=_50c.getNoDataStr();
}
};
GraphWidgetControl.prototype._populateGraphDivWithErrorMsg=function(){
this.getCanvas().innerHTML="";
this.getCanvas().appendChild(document.createTextNode(this.resourceBundle.graphErrorMessage));
};
GraphWidgetControl.prototype.getResourceBundle=function(){
return this.resourceBundle;
};
GraphWidgetControl.prototype.getDataSource=function(){
if(this.dataSource!=null){
return this.dataSource;
}
this.dataSource=new GraphDataModel("graph");
return this.dataSource;
};
GraphWidgetControl.prototype.setDataSource=function(_50e){
if(this.dataSource!=null){
this.dataSource.removeDataListener(this.render,this);
}
this.dataSource=_50e;
this.dataSource.addDataListener(this.render,this);
};
GraphWidgetControlResources.prototype.className="GraphWidgetControlResources";
GraphWidgetControlResources.prototype=new Object();
function GraphWidgetControlResources(){
this.defaultGraphMessage="Select a report from the menus above";
this.graphErrorMessage="Graph Unavailable";
this.chartLabel="Chart: ";
}
GraphDataModel.prototype.className="GraphDataModel";
GraphDataModel.prototype=new AbstractAjaxDataModel();
function GraphDataModel(_50f){
AbstractAjaxDataModel.call(this);
this.setMessageId(_50f);
this.graphs=new Array();
this.graphList=new Array();
this.selectedGraph="Report Graph";
}
GraphDataModel.prototype.setGraphs=function(_510){
this.graphs=_510;
};
GraphDataModel.prototype.getGraphs=function(){
return this.graphs;
};
GraphDataModel.prototype.getGraphList=function(){
return this.graphList;
};
GraphDataModel.prototype.getGraph=function(_511){
return this.graphs[_511];
};
GraphDataModel.prototype.setSelectedGraph=function(_512){
this.selectedGraph=_512;
};
GraphDataModel.prototype.getSelectedGraph=function(){
return this.selectedGraph;
};
GraphDataModel.prototype._loadFromXML=function(_513){
var _514=null;
var _515="Report Graph";
var _516="false";
var _517=false;
var _518=null;
var _519="false";
var _51a=false;
var _51b=null;
var _51c=null;
var _51d=null;
this.graphList=new Array();
if(_513.tagName=="graphs"){
for(var i=0;i<_513.childNodes.length;i++){
if(_513.childNodes[i].tagName=="graphData"){
_519=_513.childNodes[i].getAttribute("isNoDataImage");
if(_519==null){
_519="false";
}
if((_519!="false")&&(_519!="true")){
_519="false";
}
_51b=_513.childNodes[i].getAttribute("height");
if(_51b==null){
_51b="125";
}
_51c=_513.childNodes[i].getAttribute("width");
if(_51c==null){
_51c="600";
}
_51d=_513.childNodes[i].getAttribute("noDataStr");
if(_51d==null){
_51d="No Data Available";
}
_514=_513.childNodes[i].getAttribute("url");
_515=_513.childNodes[i].getAttribute("label");
_516=_513.childNodes[i].getAttribute("cache");
var _51f=_513.childNodes[i];
for(var y=0;y<_51f.childNodes.length;y++){
if(_51f.childNodes[y].tagName=="tooltipLinksMap"){
var _521=_51f.childNodes[y];
_518=ajaxEngine.getContentAsString(_521);
}
}
}
if(i==0){
this.selectedGraph=_515;
}
if(_516=="true"){
_517=true;
}else{
if(_516=="false"){
_517=false;
}
}
if(_519=="true"){
_51a=true;
}else{
if(_519=="false"){
_51a=false;
}
}
var _522=new GraphData(_514,_517,_518,_51a,_51c,_51b,_51d);
_522.setLabel(_515);
this.graphs[_515]=_522;
this.graphList[this.graphList.length]=_522;
_514=null;
_515="Report Graph";
_516="false";
_517=false;
_518=null;
_519="false";
}
this.dataChangedEvent.fire(this);
}
};
GraphDataModel.prototype.processUpdate=function(_523){
var _524=_523.firstChild;
if(_524&&_524.tagName=="graphs"){
this._loadFromXML(_524);
}
};
GraphData.prototype.className="GraphData";
function GraphData(url,_526,_527,_528,_529,_52a,_52b){
this.url=url;
this.cache=_526;
this.tooltipLinksMap=_527;
this.noDataImg=_528;
this.width=_529;
this.height=_52a;
this.noDataStr=_52b;
}
GraphData.prototype.setUrl=function(_52c){
this.url=_52c;
};
GraphData.prototype.getUrl=function(){
return this.url;
};
GraphData.prototype.setLabel=function(_52d){
this.label=_52d;
};
GraphData.prototype.getLabel=function(){
return this.label;
};
GraphData.prototype.setCache=function(_52e){
this.cache=_52e;
};
GraphData.prototype.isCache=function(){
return this.cache;
};
GraphData.prototype.setTooltipLinksMap=function(_52f){
this.tooltipLinksMap=_52f;
};
GraphData.prototype.getTooltipLinksMap=function(){
return this.tooltipLinksMap;
};
GraphData.prototype.setNoDataImg=function(_530){
this.noDataImg=_530;
};
GraphData.prototype.isNoDataImg=function(){
return this.noDataImg;
};
GraphData.prototype.setWidth=function(_531){
this.width=_531;
};
GraphData.prototype.getWidth=function(){
return this.width;
};
GraphData.prototype.setHeight=function(_532){
this.height=_532;
};
GraphData.prototype.getHeight=function(){
return this.height;
};
GraphData.prototype.setNoDataStr=function(_533){
this.noDataStr=_533;
};
GraphData.prototype.getNoDataStr=function(){
return this.noDataStr;
};
ListViewControl.prototype=new TableWidgetControl();
ListViewControl.prototype.constructor=ListViewControl;
ListViewControl.prototype.baseClass=TableWidgetControl.prototype.constructor;
function ListViewControl(_534,_535,_536,_537){
TableWidgetControl.apply(this,[_534,_535,_536,false]);
this.tableStyle=new ListViewStyle();
this.numberOfCols=3;
if(ListViewControl.length>3){
this.numberOfCols=_537;
}
this.displayField=null;
this.deleteEvent="delete";
this.resourceBundle.deleteLabel="Delete";
this.resourceBundle.selectItemsMessage="Please select items to delete.";
}
ListViewControl.prototype.setDisplayField=function(name){
this.displayField=name;
};
ListViewControl.prototype.setDeleteEvent=function(_539){
this.deleteEvent=_539;
};
ListViewControl.prototype._deleteCallback=function(_53a){
var ids=this.getSelectedIDs();
if(ids.length==0){
alert(this.resourceBundle.selectItemsMessage);
return;
}
var _53c=new AjaxRequest(this.dataSource.getActionUrl(),this.deleteEvent);
for(var i=0;i<ids.length;i++){
_53c.addAjaxParameter(this.dataSource.getIdColumn(),ids[i]);
}
ajaxEngine.sendAjaxRequest(_53c);
};
ListViewControl.prototype.render=function(){
if(this.dataSource!=null&&this.dataSource instanceof TableDataModel){
this._clearEvents();
this.getCanvas().innerHTML="";
var _53e=document.createElement("table");
_53e.id="contentMatch";
_53e.cellPadding="0";
_53e.cellSpacing="0";
_53e.className=this.tableStyle.tableClass;
_53e.width="100%";
var _53f=document.createElement("tbody");
this.getCanvas().appendChild(_53e);
_53e.appendChild(_53f);
var _540=document.createElement("tr");
var _541=document.createElement("th");
_541.className=this.tableStyle.statColumn;
_540.appendChild(_541);
var _542=this.dataSource.getTotalRows();
var _543=this.dataSource.getFilteredRows();
if(_542.length>0){
var _544=document.createElement("table");
_544.cellPadding="0";
_544.cellSpacing="0";
_544.className=this.tableStyle.statTable;
_541.appendChild(_544);
var _545=document.createElement("tbody");
_544.appendChild(_545);
var _546=document.createElement("tr");
var _547=document.createElement("tr");
_547.className=this.tableStyle.totalRow;
var _548=null;
var _549=this.dataSource.getColumns();
var _54a=_542[0].columns.get(this.dataSource.getIdColumn());
var _54b=document.createElement("th");
_54b.className=this.tableStyle.checkColumn;
this.masterSelect=document.createElement("input");
this.masterSelect.setAttribute("type","checkbox");
_54b.appendChild(this.masterSelect);
YAHOO.util.Event.addListener(this.masterSelect,"click",this._masterSelectedCallback,this,true);
_546.appendChild(_54b);
var _td=document.createElement("td");
_td.className=this.tableStyle.totalCell;
_td.innerHTML="&nbsp;";
_547.appendChild(_td);
var _54d=true;
for(var i=0;i<_549.length;i++){
if(_549[i].isHidden()){
continue;
}
if(_549[i].dataType=="icon"){
continue;
}
var th=document.createElement("th");
th.innerHTML=_549[i].getDisplayName();
th.title=_549[i].getToolTip();
_546.appendChild(th);
var td=document.createElement("td");
if(_54d){
td.className=this.tableStyle.firstTotalCell;
_54d=false;
}else{
td.className=this.tableStyle.totalCell;
}
var _551=_542[0].columns.get(_549[i].getDBKey());
if(_551){
if(_549[i].getLinkType()!=null&&_551.isLinkable()){
td.setAttribute("column_id",_549[i].getDBKey());
td.setAttribute("column_value",_551.getRawValue());
td.setAttribute("id_value",_542[0].rowId);
td.setAttribute("row_type","total");
td.className=td.className+" "+this.tableStyle.linkCell;
YAHOO.util.Event.addListener(td,"click",this._cellClickCallback,this,true);
}
td.innerHTML=_551.getFormattedValue();
}else{
td.innerHTML="&nbsp;";
}
_547.appendChild(td);
_548=td;
}
if(_548){
_548.className=this.tableStyle.lastColumn+" "+this.tableStyle.totalCell;
}
_545.appendChild(_546);
_545.appendChild(_547);
if(_543.length>0){
for(var row=0;row<_543.length;row++){
var fRow=document.createElement("tr");
fRow.className=this.tableStyle.filterRow;
_548=null;
_54a=_543[row].columns.get(this.dataSource.getIdColumn());
_td=_td.cloneNode(false);
_td.inn
