var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(_1){
_1=_1.toUpperCase();
var _2=this.NODEMAP[_1]||"div";
var _3=document.createElement(_2);
try{
_3.innerHTML="<"+_1+"></"+_1+">";
}
catch(e){
}
var _4=_3.firstChild||null;
if(_4&&(_4.tagName.toUpperCase()!=_1)){
_4=_4.getElementsByTagName(_1)[0];
}
if(!_4){
_4=document.createElement(_1);
}
if(!_4){
return;
}
if(arguments[1]){
if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){
this._children(_4,arguments[1]);
}else{
var _5=this._attributes(arguments[1]);
if(_5.length){
try{
_3.innerHTML="<"+_1+" "+_5+"></"+_1+">";
}
catch(e){
}
_4=_3.firstChild||null;
if(!_4){
_4=document.createElement(_1);
for(attr in arguments[1]){
_4[attr=="class"?"className":attr]=arguments[1][attr];
}
}
if(_4.tagName.toUpperCase()!=_1){
_4=_3.getElementsByTagName(_1)[0];
}
}
}
}
if(arguments[2]){
this._children(_4,arguments[2]);
}
return _4;
},_text:function(_6){
return document.createTextNode(_6);
},ATTR_MAP:{"className":"class","htmlFor":"for"},_attributes:function(_7){
var _8=[];
for(attribute in _7){
_8.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+"=\""+_7[attribute].toString().escapeHTML().gsub(/"/,"&quot;")+"\"");
}
return _8.join(" ");
},_children:function(_9,_a){
if(_a.tagName){
_9.appendChild(_a);
return;
}
if(typeof _a=="object"){
_a.flatten().each(function(e){
if(typeof e=="object"){
_9.appendChild(e);
}else{
if(Builder._isStringOrNumber(e)){
_9.appendChild(Builder._text(e));
}
}
});
}else{
if(Builder._isStringOrNumber(_a)){
_9.appendChild(Builder._text(_a));
}
}
},_isStringOrNumber:function(_c){
return (typeof _c=="string"||typeof _c=="number");
},build:function(_d){
var _e=this.node("div");
$(_e).update(_d.strip());
return _e.down();
},dump:function(_f){
if(typeof _f!="object"&&typeof _f!="function"){
_f=window;
}
var _10=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY "+"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET "+"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
_10.each(function(tag){
_f[tag]=function(){
return Builder.node.apply(Builder,[tag].concat($A(arguments)));
};
});
}};
String.prototype.parseColor=function(){
var _12="#";
if(this.slice(0,4)=="rgb("){
var _13=this.slice(4,this.length-1).split(",");
var i=0;
do{
_12+=parseInt(_13[i]).toColorPart();
}while(++i<3);
}else{
if(this.slice(0,1)=="#"){
if(this.length==4){
for(var i=1;i<4;i++){
_12+=(this.charAt(i)+this.charAt(i)).toLowerCase();
}
}
if(this.length==7){
_12=this.toLowerCase();
}
}
}
return (_12.length==7?_12:(arguments[0]||this));
};
Element.collectTextNodes=function(_15){
return $A($(_15).childNodes).collect(function(_16){
return (_16.nodeType==3?_16.nodeValue:(_16.hasChildNodes()?Element.collectTextNodes(_16):""));
}).flatten().join("");
};
Element.collectTextNodesIgnoreClass=function(_17,_18){
return $A($(_17).childNodes).collect(function(_19){
return (_19.nodeType==3?_19.nodeValue:((_19.hasChildNodes()&&!Element.hasClassName(_19,_18))?Element.collectTextNodesIgnoreClass(_19,_18):""));
}).flatten().join("");
};
Element.setContentZoom=function(_1a,_1b){
_1a=$(_1a);
_1a.setStyle({fontSize:(_1b/100)+"em"});
if(Prototype.Browser.WebKit){
window.scrollBy(0,0);
}
return _1a;
};
Element.getInlineOpacity=function(_1c){
return $(_1c).style.opacity||"";
};
Element.forceRerendering=function(_1d){
try{
_1d=$(_1d);
var n=document.createTextNode(" ");
_1d.appendChild(n);
_1d.removeChild(n);
}
catch(e){
}
};
Array.prototype.call=function(){
var _1f=arguments;
this.each(function(f){
f.apply(this,_1f);
});
};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(_21){
if(typeof Builder=="undefined"){
throw ("Effect.tagifyText requires including script.aculo.us' builder.js library");
}
var _22="position:relative";
if(Prototype.Browser.IE){
_22+=";zoom:1";
}
_21=$(_21);
$A(_21.childNodes).each(function(_23){
if(_23.nodeType==3){
_23.nodeValue.toArray().each(function(_24){
_21.insertBefore(Builder.node("span",{style:_22},_24==" "?String.fromCharCode(160):_24),_23);
});
Element.remove(_23);
}
});
},multiple:function(_25,_26){
var _27;
if(((typeof _25=="object")||(typeof _25=="function"))&&(_25.length)){
_27=_25;
}else{
_27=$(_25).childNodes;
}
var _28=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var _29=_28.delay;
$A(_27).each(function(_2a,_2b){
new _26(_2a,Object.extend(_28,{delay:_2b*_28.speed+_29}));
});
},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(_2c,_2d){
_2c=$(_2c);
_2d=(_2d||"appear").toLowerCase();
var _2e=Object.extend({queue:{position:"end",scope:(_2c.id||"global"),limit:1}},arguments[2]||{});
Effect[_2c.visible()?Effect.PAIRS[_2d][1]:Effect.PAIRS[_2d][0]](_2c,_2e);
}};
var Effect2=Effect;
Effect.Transitions={linear:Prototype.K,sinoidal:function(pos){
return (-Math.cos(pos*Math.PI)/2)+0.5;
},reverse:function(pos){
return 1-pos;
},flicker:function(pos){
var pos=((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
return (pos>1?1:pos);
},wobble:function(pos){
return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
},pulse:function(pos,_34){
_34=_34||5;
return (Math.round((pos%(1/_34))*_34)==0?((pos*_34*2)-Math.floor(pos*_34*2)):1-((pos*_34*2)-Math.floor(pos*_34*2)));
},none:function(pos){
return 0;
},full:function(pos){
return 1;
}};
Effect.ScopedQueue=Class.create();
Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){
this.effects=[];
this.interval=null;
},_each:function(_37){
this.effects._each(_37);
},add:function(_38){
var _39=new Date().getTime();
var _3a=(typeof _38.options.queue=="string")?_38.options.queue:_38.options.queue.position;
switch(_3a){
case "front":
this.effects.findAll(function(e){
return e.state=="idle";
}).each(function(e){
e.startOn+=_38.finishOn;
e.finishOn+=_38.finishOn;
});
break;
case "with-last":
_39=this.effects.pluck("startOn").max()||_39;
break;
case "end":
_39=this.effects.pluck("finishOn").max()||_39;
break;
}
_38.startOn+=_39;
_38.finishOn+=_39;
if(!_38.options.queue.limit||(this.effects.length<_38.options.queue.limit)){
this.effects.push(_38);
}
if(!this.interval){
this.interval=setInterval(this.loop.bind(this),15);
}
},remove:function(_3d){
this.effects=this.effects.reject(function(e){
return e==_3d;
});
if(this.effects.length==0){
clearInterval(this.interval);
this.interval=null;
}
},loop:function(){
var _3f=new Date().getTime();
for(var i=0,len=this.effects.length;i<len;i++){
this.effects[i]&&this.effects[i].loop(_3f);
}
}});
Effect.Queues={instances:$H(),get:function(_42){
if(typeof _42!="string"){
return _42;
}
if(!this.instances[_42]){
this.instances[_42]=new Effect.ScopedQueue();
}
return this.instances[_42];
}};
Effect.Queue=Effect.Queues.get("global");
Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"};
Effect.Base=function(){
};
Effect.Base.prototype={position:null,start:function(_43){
function codeForEvent(_44,_45){
return ((_44[_45+"Internal"]?"this.options."+_45+"Internal(this);":"")+(_44[_45]?"this.options."+_45+"(this);":""));
}
if(_43.transition===false){
_43.transition=Effect.Transitions.linear;
}
this.options=Object.extend(Object.extend({},Effect.DefaultOptions),_43||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.fromToDelta=this.options.to-this.options.from;
this.totalTime=this.finishOn-this.startOn;
this.totalFrames=this.options.fps*this.options.duration;
eval("this.render = function(pos){ "+"if(this.state==\"idle\"){this.state=\"running\";"+codeForEvent(_43,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(_43,"afterSetup")+"};if(this.state==\"running\"){"+"pos=this.options.transition(pos)*"+this.fromToDelta+"+"+this.options.from+";"+"this.position=pos;"+codeForEvent(_43,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(_43,"afterUpdate")+"}}");
this.event("beforeStart");
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this);
}
},loop:function(_46){
if(_46>=this.startOn){
if(_46>=this.finishOn){
this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){
this.finish();
}
this.event("afterFinish");
return;
}
var pos=(_46-this.startOn)/this.totalTime,_48=Math.round(pos*this.totalFrames);
if(_48>this.currentFrame){
this.render(pos);
this.currentFrame=_48;
}
}
},cancel:function(){
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this);
}
this.state="finished";
},event:function(_49){
if(this.options[_49+"Internal"]){
this.options[_49+"Internal"](this);
}
if(this.options[_49]){
this.options[_49](this);
}
},inspect:function(){
var _4a=$H();
for(property in this){
if(typeof this[property]!="function"){
_4a[property]=this[property];
}
}
return "#<Effect:"+_4a.inspect()+",options:"+$H(this.options).inspect()+">";
}};
Effect.Parallel=Class.create();
Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(_4b){
this.effects=_4b||[];
this.start(arguments[1]);
},update:function(_4c){
this.effects.invoke("render",_4c);
},finish:function(_4d){
this.effects.each(function(_4e){
_4e.render(1);
_4e.cancel();
_4e.event("beforeFinish");
if(_4e.finish){
_4e.finish(_4d);
}
_4e.event("afterFinish");
});
}});
Effect.Event=Class.create();
Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){
var _4f=Object.extend({duration:0},arguments[0]||{});
this.start(_4f);
},update:Prototype.emptyFunction});
Effect.Opacity=Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(_50){
this.element=$(_50);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
var _51=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(_51);
},update:function(_52){
this.element.setOpacity(_52);
}});
Effect.Move=Class.create();
Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(_53){
this.element=$(_53);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _54=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(_54);
},setup:function(){
this.element.makePositioned();
this.originalLeft=parseFloat(this.element.getStyle("left")||"0");
this.originalTop=parseFloat(this.element.getStyle("top")||"0");
if(this.options.mode=="absolute"){
this.options.x=this.options.x-this.originalLeft;
this.options.y=this.options.y-this.originalTop;
}
},update:function(_55){
this.element.setStyle({left:Math.round(this.options.x*_55+this.originalLeft)+"px",top:Math.round(this.options.y*_55+this.originalTop)+"px"});
}});
Effect.MoveBy=function(_56,_57,_58){
return new Effect.Move(_56,Object.extend({x:_58,y:_57},arguments[3]||{}));
};
Effect.Scale=Class.create();
Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(_59,_5a){
this.element=$(_59);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _5b=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_5a},arguments[2]||{});
this.start(_5b);
},setup:function(){
this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");
this.originalStyle={};
["top","left","width","height","fontSize"].each(function(k){
this.originalStyle[k]=this.element.style[k];
}.bind(this));
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var _5d=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(_5e){
if(_5d.indexOf(_5e)>0){
this.fontSize=parseFloat(_5d);
this.fontSizeType=_5e;
}
}.bind(this));
this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
this.dims=null;
if(this.options.scaleMode=="box"){
this.dims=[this.element.offsetHeight,this.element.offsetWidth];
}
if(/^content/.test(this.options.scaleMode)){
this.dims=[this.element.scrollHeight,this.element.scrollWidth];
}
if(!this.dims){
this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
}
},update:function(_5f){
var _60=(this.options.scaleFrom/100)+(this.factor*_5f);
if(this.options.scaleContent&&this.fontSize){
this.element.setStyle({fontSize:this.fontSize*_60+this.fontSizeType});
}
this.setDimensions(this.dims[0]*_60,this.dims[1]*_60);
},finish:function(_61){
if(this.restoreAfterFinish){
this.element.setStyle(this.originalStyle);
}
},setDimensions:function(_62,_63){
var d={};
if(this.options.scaleX){
d.width=Math.round(_63)+"px";
}
if(this.options.scaleY){
d.height=Math.round(_62)+"px";
}
if(this.options.scaleFromCenter){
var _65=(_62-this.dims[0])/2;
var _66=(_63-this.dims[1])/2;
if(this.elementPositioning=="absolute"){
if(this.options.scaleY){
d.top=this.originalTop-_65+"px";
}
if(this.options.scaleX){
d.left=this.originalLeft-_66+"px";
}
}else{
if(this.options.scaleY){
d.top=-_65+"px";
}
if(this.options.scaleX){
d.left=-_66+"px";
}
}
}
this.element.setStyle(d);
}});
Effect.Highlight=Class.create();
Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(_67){
this.element=$(_67);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _68=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(_68);
},setup:function(){
if(this.element.getStyle("display")=="none"){
this.cancel();
return;
}
this.oldStyle={};
if(!this.options.keepBackgroundImage){
this.oldStyle.backgroundImage=this.element.getStyle("background-image");
this.element.setStyle({backgroundImage:"none"});
}
if(!this.options.endcolor){
this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff");
}
if(!this.options.restorecolor){
this.options.restorecolor=this.element.getStyle("background-color");
}
this._base=$R(0,2).map(function(i){
return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
}.bind(this));
this._delta=$R(0,2).map(function(i){
return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
}.bind(this));
},update:function(_6b){
this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){
return m+(Math.round(this._base[i]+(this._delta[i]*_6b)).toColorPart());
}.bind(this))});
},finish:function(){
this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));
}});
Effect.ScrollTo=Class.create();
Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(_6f){
this.element=$(_6f);
this.start(arguments[1]||{});
},setup:function(){
Position.prepare();
var _70=Position.cumulativeOffset(this.element);
if(this.options.offset){
_70[1]+=this.options.offset;
}
var max=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);
this.scrollStart=Position.deltaY;
this.delta=(_70[1]>max?max:_70[1])-this.scrollStart;
},update:function(_72){
Position.prepare();
window.scrollTo(Position.deltaX,this.scrollStart+(_72*this.delta));
}});
Effect.Fade=function(_73){
_73=$(_73);
var _74=_73.getInlineOpacity();
var _75=Object.extend({from:_73.getOpacity()||1,to:0,afterFinishInternal:function(_76){
if(_76.options.to!=0){
return;
}
_76.element.hide().setStyle({opacity:_74});
}},arguments[1]||{});
return new Effect.Opacity(_73,_75);
};
Effect.Appear=function(_77){
_77=$(_77);
var _78=Object.extend({from:(_77.getStyle("display")=="none"?0:_77.getOpacity()||0),to:1,afterFinishInternal:function(_79){
_79.element.forceRerendering();
},beforeSetup:function(_7a){
_7a.element.setOpacity(_7a.options.from).show();
}},arguments[1]||{});
return new Effect.Opacity(_77,_78);
};
Effect.Puff=function(_7b){
_7b=$(_7b);
var _7c={opacity:_7b.getInlineOpacity(),position:_7b.getStyle("position"),top:_7b.style.top,left:_7b.style.left,width:_7b.style.width,height:_7b.style.height};
return new Effect.Parallel([new Effect.Scale(_7b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(_7b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(_7d){
Position.absolutize(_7d.effects[0].element);
},afterFinishInternal:function(_7e){
_7e.effects[0].element.hide().setStyle(_7c);
}},arguments[1]||{}));
};
Effect.BlindUp=function(_7f){
_7f=$(_7f);
_7f.makeClipping();
return new Effect.Scale(_7f,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_80){
_80.element.hide().undoClipping();
}},arguments[1]||{}));
};
Effect.BlindDown=function(_81){
_81=$(_81);
var _82=_81.getDimensions();
return new Effect.Scale(_81,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_82.height,originalWidth:_82.width},restoreAfterFinish:true,afterSetup:function(_83){
_83.element.makeClipping().setStyle({height:"0px"}).show();
},afterFinishInternal:function(_84){
_84.element.undoClipping();
}},arguments[1]||{}));
};
Effect.SwitchOff=function(_85){
_85=$(_85);
var _86=_85.getInlineOpacity();
return new Effect.Appear(_85,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(_87){
new Effect.Scale(_87.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(_88){
_88.element.makePositioned().makeClipping();
},afterFinishInternal:function(_89){
_89.element.hide().undoClipping().undoPositioned().setStyle({opacity:_86});
}});
}},arguments[1]||{}));
};
Effect.DropOut=function(_8a){
_8a=$(_8a);
var _8b={top:_8a.getStyle("top"),left:_8a.getStyle("left"),opacity:_8a.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(_8a,{x:0,y:100,sync:true}),new Effect.Opacity(_8a,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(_8c){
_8c.effects[0].element.makePositioned();
},afterFinishInternal:function(_8d){
_8d.effects[0].element.hide().undoPositioned().setStyle(_8b);
}},arguments[1]||{}));
};
Effect.Shake=function(_8e){
_8e=$(_8e);
var _8f={top:_8e.getStyle("top"),left:_8e.getStyle("left")};
return new Effect.Move(_8e,{x:20,y:0,duration:0.05,afterFinishInternal:function(_90){
new Effect.Move(_90.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_91){
new Effect.Move(_91.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_92){
new Effect.Move(_92.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_93){
new Effect.Move(_93.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_94){
new Effect.Move(_94.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(_95){
_95.element.undoPositioned().setStyle(_8f);
}});
}});
}});
}});
}});
}});
};
Effect.SlideDown=function(_96){
_96=$(_96).cleanWhitespace();
var _97=_96.down().getStyle("bottom");
var _98=_96.getDimensions();
return new Effect.Scale(_96,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:_98.height,originalWidth:_98.width},restoreAfterFinish:true,afterSetup:function(_99){
_99.element.makePositioned();
_99.element.down().makePositioned();
if(window.opera){
_99.element.setStyle({top:""});
}
_99.element.makeClipping().setStyle({height:"0px"}).show();
},afterUpdateInternal:function(_9a){
_9a.element.down().setStyle({bottom:(_9a.dims[0]-_9a.element.clientHeight)+"px"});
},afterFinishInternal:function(_9b){
_9b.element.undoClipping().undoPositioned();
_9b.element.down().undoPositioned().setStyle({bottom:_97});
}},arguments[1]||{}));
};
Effect.SlideUp=function(_9c){
_9c=$(_9c).cleanWhitespace();
var _9d=_9c.down().getStyle("bottom");
return new Effect.Scale(_9c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_9e){
_9e.element.makePositioned();
_9e.element.down().makePositioned();
if(window.opera){
_9e.element.setStyle({top:""});
}
_9e.element.makeClipping().show();
},afterUpdateInternal:function(_9f){
_9f.element.down().setStyle({bottom:(_9f.dims[0]-_9f.element.clientHeight)+"px"});
},afterFinishInternal:function(_a0){
_a0.element.hide().undoClipping().undoPositioned().setStyle({bottom:_9d});
_a0.element.down().undoPositioned();
}},arguments[1]||{}));
};
Effect.Squish=function(_a1){
return new Effect.Scale(_a1,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(_a2){
_a2.element.makeClipping();
},afterFinishInternal:function(_a3){
_a3.element.hide().undoClipping();
}});
};
Effect.Grow=function(_a4){
_a4=$(_a4);
var _a5=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var _a6={top:_a4.style.top,left:_a4.style.left,height:_a4.style.height,width:_a4.style.width,opacity:_a4.getInlineOpacity()};
var _a7=_a4.getDimensions();
var _a8,_a9;
var _aa,_ab;
switch(_a5.direction){
case "top-left":
_a8=_a9=_aa=_ab=0;
break;
case "top-right":
_a8=_a7.width;
_a9=_ab=0;
_aa=-_a7.width;
break;
case "bottom-left":
_a8=_aa=0;
_a9=_a7.height;
_ab=-_a7.height;
break;
case "bottom-right":
_a8=_a7.width;
_a9=_a7.height;
_aa=-_a7.width;
_ab=-_a7.height;
break;
case "center":
_a8=_a7.width/2;
_a9=_a7.height/2;
_aa=-_a7.width/2;
_ab=-_a7.height/2;
break;
}
return new Effect.Move(_a4,{x:_a8,y:_a9,duration:0.01,beforeSetup:function(_ac){
_ac.element.hide().makeClipping().makePositioned();
},afterFinishInternal:function(_ad){
new Effect.Parallel([new Effect.Opacity(_ad.element,{sync:true,to:1,from:0,transition:_a5.opacityTransition}),new Effect.Move(_ad.element,{x:_aa,y:_ab,sync:true,transition:_a5.moveTransition}),new Effect.Scale(_ad.element,100,{scaleMode:{originalHeight:_a7.height,originalWidth:_a7.width},sync:true,scaleFrom:window.opera?1:0,transition:_a5.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(_ae){
_ae.effects[0].element.setStyle({height:"0px"}).show();
},afterFinishInternal:function(_af){
_af.effects[0].element.undoClipping().undoPositioned().setStyle(_a6);
}},_a5));
}});
};
Effect.Shrink=function(_b0){
_b0=$(_b0);
var _b1=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var _b2={top:_b0.style.top,left:_b0.style.left,height:_b0.style.height,width:_b0.style.width,opacity:_b0.getInlineOpacity()};
var _b3=_b0.getDimensions();
var _b4,_b5;
switch(_b1.direction){
case "top-left":
_b4=_b5=0;
break;
case "top-right":
_b4=_b3.width;
_b5=0;
break;
case "bottom-left":
_b4=0;
_b5=_b3.height;
break;
case "bottom-right":
_b4=_b3.width;
_b5=_b3.height;
break;
case "center":
_b4=_b3.width/2;
_b5=_b3.height/2;
break;
}
return new Effect.Parallel([new Effect.Opacity(_b0,{sync:true,to:0,from:1,transition:_b1.opacityTransition}),new Effect.Scale(_b0,window.opera?1:0,{sync:true,transition:_b1.scaleTransition,restoreAfterFinish:true}),new Effect.Move(_b0,{x:_b4,y:_b5,sync:true,transition:_b1.moveTransition})],Object.extend({beforeStartInternal:function(_b6){
_b6.effects[0].element.makePositioned().makeClipping();
},afterFinishInternal:function(_b7){
_b7.effects[0].element.hide().undoClipping().undoPositioned().setStyle(_b2);
}},_b1));
};
Effect.Pulsate=function(_b8){
_b8=$(_b8);
var _b9=arguments[1]||{};
var _ba=_b8.getInlineOpacity();
var _bb=_b9.transition||Effect.Transitions.sinoidal;
var _bc=function(pos){
return _bb(1-Effect.Transitions.pulse(pos,_b9.pulses));
};
_bc.bind(_bb);
return new Effect.Opacity(_b8,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(_be){
_be.element.setStyle({opacity:_ba});
}},_b9),{transition:_bc}));
};
Effect.Fold=function(_bf){
_bf=$(_bf);
var _c0={top:_bf.style.top,left:_bf.style.left,width:_bf.style.width,height:_bf.style.height};
_bf.makeClipping();
return new Effect.Scale(_bf,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(_c1){
new Effect.Scale(_bf,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_c2){
_c2.element.hide().undoClipping().setStyle(_c0);
}});
}},arguments[1]||{}));
};
Effect.Morph=Class.create();
Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(_c3){
this.element=$(_c3);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _c4=Object.extend({style:{}},arguments[1]||{});
if(typeof _c4.style=="string"){
if(_c4.style.indexOf(":")==-1){
var _c5="",_c6="."+_c4.style;
$A(document.styleSheets).reverse().each(function(_c7){
if(_c7.cssRules){
cssRules=_c7.cssRules;
}else{
if(_c7.rules){
cssRules=_c7.rules;
}
}
$A(cssRules).reverse().each(function(_c8){
if(_c6==_c8.selectorText){
_c5=_c8.style.cssText;
throw $break;
}
});
if(_c5){
throw $break;
}
});
this.style=_c5.parseStyle();
_c4.afterFinishInternal=function(_c9){
_c9.element.addClassName(_c9.options.style);
_c9.transforms.each(function(_ca){
if(_ca.style!="opacity"){
_c9.element.style[_ca.style]="";
}
});
};
}else{
this.style=_c4.style.parseStyle();
}
}else{
this.style=$H(_c4.style);
}
this.start(_c4);
},setup:function(){
function parseColor(_cb){
if(!_cb||["rgba(0, 0, 0, 0)","transparent"].include(_cb)){
_cb="#ffffff";
}
_cb=_cb.parseColor();
return $R(0,2).map(function(i){
return parseInt(_cb.slice(i*2+1,i*2+3),16);
});
}
this.transforms=this.style.map(function(_cd){
var _ce=_cd[0],_cf=_cd[1],_d0=null;
if(_cf.parseColor("#zzzzzz")!="#zzzzzz"){
_cf=_cf.parseColor();
_d0="color";
}else{
if(_ce=="opacity"){
_cf=parseFloat(_cf);
if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
}else{
if(Element.CSS_LENGTH.test(_cf)){
var _d1=_cf.match(/^([\+\-]?[0-9\.]+)(.*)$/);
_cf=parseFloat(_d1[1]);
_d0=(_d1.length==3)?_d1[2]:null;
}
}
}
var _d2=this.element.getStyle(_ce);
return {style:_ce.camelize(),originalValue:_d0=="color"?parseColor(_d2):parseFloat(_d2||0),targetValue:_d0=="color"?parseColor(_cf):_cf,unit:_d0};
}.bind(this)).reject(function(_d3){
return ((_d3.originalValue==_d3.targetValue)||(_d3.unit!="color"&&(isNaN(_d3.originalValue)||isNaN(_d3.targetValue))));
});
},update:function(_d4){
var _d5={},_d6,i=this.transforms.length;
while(i--){
_d5[(_d6=this.transforms[i]).style]=_d6.unit=="color"?"#"+(Math.round(_d6.originalValue[0]+(_d6.targetValue[0]-_d6.originalValue[0])*_d4)).toColorPart()+(Math.round(_d6.originalValue[1]+(_d6.targetValue[1]-_d6.originalValue[1])*_d4)).toColorPart()+(Math.round(_d6.originalValue[2]+(_d6.targetValue[2]-_d6.originalValue[2])*_d4)).toColorPart():_d6.originalValue+Math.round(((_d6.targetValue-_d6.originalValue)*_d4)*1000)/1000+_d6.unit;
}
this.element.setStyle(_d5,true);
}});
Effect.Transform=Class.create();
Object.extend(Effect.Transform.prototype,{initialize:function(_d8){
this.tracks=[];
this.options=arguments[1]||{};
this.addTracks(_d8);
},addTracks:function(_d9){
_d9.each(function(_da){
var _db=$H(_da).values().first();
this.tracks.push($H({ids:$H(_da).keys().first(),effect:Effect.Morph,options:{style:_db}}));
}.bind(this));
return this;
},play:function(){
return new Effect.Parallel(this.tracks.map(function(_dc){
var _dd=[$(_dc.ids)||$$(_dc.ids)].flatten();
return _dd.map(function(e){
return new _dc.effect(e,Object.extend({sync:true},_dc.options));
});
}).flatten(),this.options);
}});
Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle "+"borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth "+"borderRightColor borderRightStyle borderRightWidth borderSpacing "+"borderTopColor borderTopStyle borderTopWidth bottom clip color "+"fontSize fontWeight height left letterSpacing lineHeight "+"marginBottom marginLeft marginRight marginTop markerOffset maxHeight "+"maxWidth minHeight minWidth opacity outlineColor outlineOffset "+"outlineWidth paddingBottom paddingLeft paddingRight paddingTop "+"right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
String.prototype.parseStyle=function(){
var _df=document.createElement("div");
_df.innerHTML="<div style=\""+this+"\"></div>";
var _e0=_df.childNodes[0].style,_e1=$H();
Element.CSS_PROPERTIES.each(function(_e2){
if(_e0[_e2]){
_e1[_e2]=_e0[_e2];
}
});
if(Prototype.Browser.IE&&this.indexOf("opacity")>-1){
_e1.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1];
}
return _e1;
};
Element.morph=function(_e3,_e4){
new Effect.Morph(_e3,Object.extend({style:_e4},arguments[2]||{}));
return _e3;
};
["getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","morph"].each(function(f){
Element.Methods[f]=Element[f];
});
Element.Methods.visualEffect=function(_e6,_e7,_e8){
s=_e7.dasherize().camelize();
effect_class=s.charAt(0).toUpperCase()+s.substring(1);
new Effect[effect_class](_e6,_e8);
return $(_e6);
};
Element.addMethods();
function setCookie(_1,_2,_3,_4,_5,_6){
document.cookie=_1+"="+escape(_2)+((_3)?"; expires="+_3.toGMTString():"")+((_4)?"; path="+_4:"")+((_5)?"; domain="+_5:"")+((_6)?"; secure":"");
}
function getCookie(_7){
var dc=document.cookie;
var _9=_7+"=";
var _a=dc.indexOf("; "+_9);
if(_a==-1){
_a=dc.indexOf(_9);
if(_a!=0){
return null;
}
}else{
_a+=2;
}
var _b=document.cookie.indexOf(";",_a);
if(_b==-1){
_b=dc.length;
}
return unescape(dc.substring(_a+_9.length,_b));
}
function deleteCookie(_c,_d,_e){
if(getCookie(_c)){
document.cookie=_c+"="+((_d)?"; path="+_d:"")+((_e)?"; domain="+_e:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
if(typeof deconcept=="undefined"){
var deconcept=new Object();
}
if(typeof deconcept.util=="undefined"){
deconcept.util=new Object();
}
if(typeof deconcept.SWFObjectUtil=="undefined"){
deconcept.SWFObjectUtil=new Object();
}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){
if(!document.getElementById){
return;
}
this.DETECT_KEY=_a?_a:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){
this.setAttribute("swf",_1);
}
if(id){
this.setAttribute("id",id);
}
if(w){
this.setAttribute("width",w);
}
if(h){
this.setAttribute("height",h);
}
if(_5){
this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));
}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7){
deconcept.SWFObject.doPrepUnload=true;
}
if(c){
this.addParam("bgcolor",c);
}
var q=_7?_7:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",false);
this.setAttribute("doExpressInstall",false);
var _c=(_8)?_8:window.location;
this.setAttribute("xiRedirectUrl",_c);
this.setAttribute("redirectUrl","");
if(_9){
this.setAttribute("redirectUrl",_9);
}
};
deconcept.SWFObject.prototype={useExpressInstall:function(_d){
this.xiSWFPath=!_d?"expressinstall.swf":_d;
this.setAttribute("useExpressInstall",true);
},setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){
_16[_16.length]=key+"="+_18[key];
}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
this.setAttribute("swf",this.xiSWFPath);
}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){
_19+=[key]+"=\""+_1a[key]+"\" ";
}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){
_19+="flashvars=\""+_1c+"\"";
}
_19+="/>";
}else{
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","ActiveX");
this.setAttribute("swf",this.xiSWFPath);
}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){
_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";
}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){
_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";
}
_19+="</object>";
}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);
}
}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){
document.location.replace(this.getAttribute("redirectUrl"));
}
}
return false;
}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){
_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));
}
}else{
if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){
var axo=1;
var _26=3;
while(axo){
try{
_26++;
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);
_23=new deconcept.PlayerVersion([_26,0,0]);
}
catch(e){
axo=null;
}
}
}else{
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}
catch(e){
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";
}
catch(e){
if(_23.major==6){
return _23;
}
}
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}
catch(e){
}
}
if(axo!=null){
_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}
}
}
return _23;
};
deconcept.PlayerVersion=function(_29){
this.major=_29[0]!=null?parseInt(_29[0]):0;
this.minor=_29[1]!=null?parseInt(_29[1]):0;
this.rev=_29[2]!=null?parseInt(_29[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){
return false;
}
if(this.major>fv.major){
return true;
}
if(this.minor<fv.minor){
return false;
}
if(this.minor>fv.minor){
return true;
}
if(this.rev<fv.rev){
return false;
}
return true;
};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(_2b==null){
return q;
}
if(q){
var _2d=q.substring(1).split("&");
for(var i=0;i<_2d.length;i++){
if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){
return _2d[i].substring((_2d[i].indexOf("=")+1));
}
}
}
return "";
}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
var _2f=document.getElementsByTagName("OBJECT");
for(var i=_2f.length-1;i>=0;i--){
_2f[i].style.display="none";
for(var x in _2f[i]){
if(typeof _2f[i][x]=="function"){
_2f[i][x]=function(){
};
}
}
}
};
if(deconcept.SWFObject.doPrepUnload){
if(!deconcept.unloadSet){
deconcept.SWFObjectUtil.prepUnload=function(){
__flash_unloadHandler=function(){
};
__flash_savedUnloadHandler=function(){
};
window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);
};
window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);
deconcept.unloadSet=true;
}
}
if(!document.getElementById&&document.all){
document.getElementById=function(id){
return document.all[id];
};
}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;
var YOBOINPUTDEFAULT={msgStyle:{color:"#cccccc","text-align":"left"},style:{color:"#000","text-align":"left"},msgValue:"\u8bf7\u8f93\u5165",clearMsgButton:"submit",groupName:"default"};
var inputGroup={"default":0};
function YInput(_126,args,_128){
if(!args){
args={};
}
if(!args.msgStyle){
args.msgStyle={color:"#cccccc"};
}
if(!args.style){
args.style={color:"#000000"};
}
if(!args.msgValue){
args.msgValue="\u8bf7\u8f93\u5165";
}
if(!args.groupName){
args.groupName="default";
}
this.dom=$(_126);
this.disable=false;
this.dom.readOnly=false;
this.groupFlag=false;
this.args=args;
this.handles=_128;
if(args.groupName&&typeof inputGroup[args.groupName]=="undefined"){
inputGroup[args.groupName]=0;
}
this.setMsg();
this.observeEvent();
}
YInput.prototype.observeEvent=function(){
Event.observe(this.dom,"focus",this.focus.bindAsEventListener(this));
Event.observe(this.dom,"blur",this.blur.bindAsEventListener(this));
Event.observe(this.dom,"keyup",this.keyup.bindAsEventListener(this));
if(this.args.clearMsgButton){
var _129=$(this.args.clearMsgButton);
Event.observe(_129,"click",this.beforeSubmit.bindAsEventListener(this));
}
};
YInput.prototype.disabled=function(){
if(this.disable){
return false;
}
this.disable=true;
this.dom.readOnly=true;
this.dom.addClassName("readonly");
if(this.dom.value==""||this.dom.value==this.args.msgValue){
this.clearInput();
}
};
YInput.prototype.enabled=function(){
if(!this.disable){
return false;
}
this.dom.removeClassName("readonly");
this.disable=false;
this.dom.readOnly=false;
this.setMsg();
};
YInput.prototype.clearInput=function(){
this.dom.value="";
this.dom.style.color=this.args.style.color;
this.miniGroupFlag();
};
YInput.prototype.setMsg=function(){
try{
if(this.dom.value==""||this.dom.value==this.args.msgValue){
this.dom.value=this.args.msgValue;
this.dom.style.color=this.args.msgStyle.color;
this.addGroupFlag();
}
}
catch(e){
alert(e);
}
};
YInput.prototype.beforeSubmit=function(){
if(this.dom.value==this.args.msgValue){
this.clearInput();
}
};
YInput.prototype.focus=function(){
if(this.disable){
return false;
}
if(this.dom.value==this.args.msgValue){
this.clearInput();
}
if(this.args.borderFColor){
this.dom.style.border="1px solid "+this.args.borderFColor;
}
};
YInput.prototype.blur=function(){
if(this.disable){
return false;
}
if(this.dom.value==""){
this.setMsg();
}else{
}
if(this.handles){
if(this.handles.blur){
this.handles.blur();
}
}
if(this.args.borderColor){
this.dom.style.border="1px solid "+this.args.borderColor;
}
};
YInput.prototype.keyup=function(){
if(this.disable){
return false;
}
if(this.handles){
if(this.handles.keyup){
this.handles.keyup();
}
}
};
YInput.prototype.addGroupFlag=function(){
if(!this.groupFlag){
if(this.args.groupName){
inputGroup[this.args.groupName]++;
}
this.groupFlag=true;
}
};
YInput.prototype.miniGroupFlag=function(){
if(this.groupFlag){
if(this.args.groupName){
inputGroup[this.args.groupName]--;
}
this.groupFlag=false;
}
};
function yoboInput(_12a,args,_12c){
if(!args){
args={};
}
if(!args.msgStyle){
args.msgStyle={color:"#cccccc"};
}
if(!args.style){
args.style={color:"#000000"};
}
if(!args.msgValue){
args.msgValue="\u8bf7\u8f93\u5165";
}
if(!args.groupName){
args.groupName="default";
}
if(args.groupName&&typeof inputGroup[args.groupName]=="undefined"){
inputGroup[args.groupName]=0;
}
var _12d=$(_12a);
if(_12d){
if(_12d.value==""||_12d.value==args.msgValue){
setMsg();
}
}
Event.observe(_12d,"focus",function(_12e){
if(this.value==args.msgValue){
clearInput();
}
if(args.borderFColor){
_12d.style.border="1px solid "+args.borderFColor;
}
});
Event.observe(_12d,"blur",function(_12f){
if(this.value==""){
setMsg();
}else{
}
if(_12c){
if(_12c.blur){
_12c.blur();
}
}
if(args.borderColor){
_12d.style.border="1px solid "+args.borderColor;
}
});
Event.observe(_12d,"keyup",function(_130){
if(_12c){
if(_12c.keyup){
_12c.keyup();
}
}
});
function clearInput(){
_12d.value="";
_12d.style.color=args.style.color;
if(args.groupName){
inputGroup[args.groupName]--;
}
}
function setMsg(){
_12d.value=args.msgValue;
_12d.style.color=args.msgStyle.color;
if(args.groupName){
inputGroup[args.groupName]++;
}
}
if(args.clearMsgButton){
var _131=$(args.clearMsgButton);
Event.observe(_131,"click",function(_132){
if(this.value==args.msgValue){
clearInput();
}
});
}
}
var Scriptaculous={Version:"1.7.1_beta3",require:function(_133){
document.write("<script type=\"text/javascript\" src=\""+_133+"\"></script>");
},REQUIRED_PROTOTYPE:"1.5.1",load:function(){
function convertVersionString(_134){
var r=_134.split(".");
return parseInt(r[0])*100000+parseInt(r[1])*1000+parseInt(r[2]);
}
if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||(convertVersionString(Prototype.Version)<convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE))){
throw ("script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE);
}
$A(document.getElementsByTagName("script")).findAll(function(s){
return (s.src&&s.src.match(/scriptaculous\.js(\?.*)?$/));
}).each(function(s){
var path=s.src.replace(/scriptaculous\.js(\?.*)?$/,"");
var _139=s.src.match(/\?.*load=([a-z,]*)/);
(_139?_139[1]:"builder,effects,dragdrop,controls,slider,sound").split(",").each(function(_13a){
Scriptaculous.require(path+_13a+".js");
});
});
}};
Scriptaculous.load();
if(typeof Effect=="undefined"){
throw ("controls.js requires including script.aculo.us' effects.js library");
}
var Autocompleter={};
Autocompleter.Base=function(){
};
Autocompleter.Base.prototype={baseInitialize:function(_13b,_13c,_13d){
_13b=$(_13b);
this.element=_13b;
this.update=$(_13c);
this.hasFocus=false;
this.changed=false;
this.active=false;
this.index=0;
this.entryCount=0;
if(this.setOptions){
this.setOptions(_13d);
}else{
this.options=_13d||{};
}
this.options.paramName=this.options.paramName||this.element.name;
this.options.tokens=this.options.tokens||[];
this.options.frequency=this.options.frequency||0.4;
this.options.minChars=this.options.minChars||1;
this.options.onShow=this.options.onShow||function(_13e,_13f){
if(!_13f.style.position||_13f.style.position=="absolute"){
_13f.style.position="absolute";
Position.clone(_13e,_13f,{setHeight:false,offsetTop:_13e.offsetHeight});
}
Effect.Appear(_13f,{duration:0.15});
};
this.options.onHide=this.options.onHide||function(_140,_141){
new Effect.Fade(_141,{duration:0.15});
};
if(typeof (this.options.tokens)=="string"){
this.options.tokens=new Array(this.options.tokens);
}
this.observer=null;
this.element.setAttribute("autocomplete","off");
Element.hide(this.update);
Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));
Event.observe(this.element,"keypress",this.onKeyPress.bindAsEventListener(this));
Event.observe(window,"beforeunload",function(){
_13b.setAttribute("autocomplete","on");
});
},show:function(){
if(Element.getStyle(this.update,"display")=="none"){
this.options.onShow(this.element,this.update);
}
if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){
new Insertion.After(this.update,"<iframe id=\""+this.update.id+"_iefix\" "+"style=\"display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);\" "+"src=\"javascript:false;\" frameborder=\"0\" scrolling=\"no\"></iframe>");
this.iefix=$(this.update.id+"_iefix");
}
if(this.iefix){
setTimeout(this.fixIEOverlapping.bind(this),50);
}
},fixIEOverlapping:function(){
Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});
this.iefix.style.zIndex=1;
this.update.style.zIndex=2;
Element.show(this.iefix);
},hide:function(){
this.stopIndicator();
if(Element.getStyle(this.update,"display")!="none"){
this.options.onHide(this.element,this.update);
}
if(this.iefix){
Element.hide(this.iefix);
}
},startIndicator:function(){
if(this.options.indicator){
Element.show(this.options.indicator);
}
},stopIndicator:function(){
if(this.options.indicator){
Element.hide(this.options.indicator);
}
},onKeyPress:function(_142){
if(this.active){
switch(_142.keyCode){
case Event.KEY_TAB:
case Event.KEY_RETURN:
this.selectEntry();
Event.stop(_142);
case Event.KEY_ESC:
this.hide();
this.active=false;
Event.stop(_142);
return;
case Event.KEY_LEFT:
case Event.KEY_RIGHT:
return;
case Event.KEY_UP:
this.markPrevious();
this.render();
if(Prototype.Browser.WebKit){
Event.stop(_142);
}
return;
case Event.KEY_DOWN:
this.markNext();
this.render();
if(Prototype.Browser.WebKit){
Event.stop(_142);
}
return;
}
}else{
if(_142.keyCode==Event.KEY_TAB||_142.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&_142.keyCode==0)){
return;
}
}
this.changed=true;
this.hasFocus=true;
if(this.observer){
clearTimeout(this.observer);
}
this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);
},activate:function(){
this.changed=false;
this.hasFocus=true;
this.getUpdatedChoices();
},onHover:function(_143){
var _144=Event.findElement(_143,"LI");
if(this.index!=_144.autocompleteIndex){
this.index=_144.autocompleteIndex;
this.render();
}
Event.stop(_143);
},onClick:function(_145){
var _146=Event.findElement(_145,"LI");
this.index=_146.autocompleteIndex;
this.selectEntry();
this.hide();
},onBlur:function(_147){
setTimeout(this.hide.bind(this),250);
this.hasFocus=false;
this.active=false;
},render:function(){
if(this.entryCount>0){
for(var i=0;i<this.entryCount;i++){
this.index==i?Element.addClassName(this.getEntry(i),"selected"):Element.removeClassName(this.getEntry(i),"selected");
}
if(this.hasFocus){
this.show();
this.active=true;
}
}else{
this.active=false;
this.hide();
}
},markPrevious:function(){
if(this.index>0){
this.index--;
}else{
this.index=this.entryCount-1;
}
this.getEntry(this.index).scrollIntoView(true);
},markNext:function(){
if(this.index<this.entryCount-1){
this.index++;
}else{
this.index=0;
}
this.getEntry(this.index).scrollIntoView(false);
},getEntry:function(_149){
return this.update.firstChild.childNodes[_149];
},getCurrentEntry:function(){
return this.getEntry(this.index);
},selectEntry:function(){
this.active=false;
this.updateElement(this.getCurrentEntry());
},updateElement:function(_14a){
if(this.options.updateElement){
this.options.updateElement(_14a);
return;
}
var _14b="";
if(this.options.select){
var _14c=document.getElementsByClassName(this.options.select,_14a)||[];
if(_14c.length>0){
_14b=Element.collectTextNodes(_14c[0],this.options.select);
}
}else{
_14b=Element.collectTextNodesIgnoreClass(_14a,"informal");
}
var _14d=this.findLastToken();
if(_14d!=-1){
var _14e=this.element.value.substr(0,_14d+1);
var _14f=this.element.value.substr(_14d+1).match(/^\s+/);
if(_14f){
_14e+=_14f[0];
}
this.element.value=_14e+_14b;
}else{
this.element.value=_14b;
}
this.element.focus();
if(this.options.afterUpdateElement){
this.options.afterUpdateElement(this.element,_14a);
}
},updateChoices:function(_150){
if(!this.changed&&this.hasFocus){
this.update.innerHTML=_150;
Element.cleanWhitespace(this.update);
Element.cleanWhitespace(this.update.down());
if(this.update.firstChild&&this.update.down().childNodes){
this.entryCount=this.update.down().childNodes.length;
for(var i=0;i<this.entryCount;i++){
var _152=this.getEntry(i);
_152.autocompleteIndex=i;
this.addObservers(_152);
}
}else{
this.entryCount=0;
}
this.stopIndicator();
this.index=0;
if(this.entryCount==1&&this.options.autoSelect){
this.selectEntry();
this.hide();
}else{
this.render();
}
}
},addObservers:function(_153){
Event.observe(_153,"mouseover",this.onHover.bindAsEventListener(this));
Event.observe(_153,"click",this.onClick.bindAsEventListener(this));
},onObserverEvent:function(){
this.changed=false;
if(this.getToken().length>=this.options.minChars){
this.getUpdatedChoices();
}else{
this.active=false;
this.hide();
}
},getToken:function(){
var _154=this.findLastToken();
if(_154!=-1){
var ret=this.element.value.substr(_154+1).replace(/^\s+/,"").replace(/\s+$/,"");
}else{
var ret=this.element.value;
}
return /\n/.test(ret)?"":ret;
},findLastToken:function(){
var _156=-1;
for(var i=0;i<this.options.tokens.length;i++){
var _158=this.element.value.lastIndexOf(this.options.tokens[i]);
if(_158>_156){
_156=_158;
}
}
return _156;
}};
Ajax.Autocompleter=Class.create();
Object.extend(Object.extend(Ajax.Autocompleter.prototype,Autocompleter.Base.prototype),{initialize:function(_159,_15a,url,_15c){
this.baseInitialize(_159,_15a,_15c);
this.options.asynchronous=true;
this.options.onComplete=this.onComplete.bind(this);
this.options.defaultParams=this.options.parameters||null;
this.url=url;
},getUpdatedChoices:function(){
this.startIndicator();
var _15d=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());
this.options.parameters=this.options.callback?this.options.callback(this.element,_15d):_15d;
if(this.options.defaultParams){
this.options.parameters+="&"+this.options.defaultParams;
}
new Ajax.Request(this.url,this.options);
},onComplete:function(_15e){
this.updateChoices(_15e.responseText);
}});
Autocompleter.Local=Class.create();
Autocompleter.Local.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(_15f,_160,_161,_162){
this.baseInitialize(_15f,_160,_162);
this.options.array=_161;
},getUpdatedChoices:function(){
this.updateChoices(this.options.selector(this));
},setOptions:function(_163){
this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(_164){
var ret=[];
var _166=[];
var _167=_164.getToken();
var _168=0;
for(var i=0;i<_164.options.array.length&&ret.length<_164.options.choices;i++){
var elem=_164.options.array[i];
var _16b=_164.options.ignoreCase?elem.toLowerCase().indexOf(_167.toLowerCase()):elem.indexOf(_167);
while(_16b!=-1){
if(_16b==0&&elem.length!=_167.length){
ret.push("<li><strong>"+elem.substr(0,_167.length)+"</strong>"+elem.substr(_167.length)+"</li>");
break;
}else{
if(_167.length>=_164.options.partialChars&&_164.options.partialSearch&&_16b!=-1){
if(_164.options.fullSearch||/\s/.test(elem.substr(_16b-1,1))){
_166.push("<li>"+elem.substr(0,_16b)+"<strong>"+elem.substr(_16b,_167.length)+"</strong>"+elem.substr(_16b+_167.length)+"</li>");
break;
}
}
}
_16b=_164.options.ignoreCase?elem.toLowerCase().indexOf(_167.toLowerCase(),_16b+1):elem.indexOf(_167,_16b+1);
}
}
if(_166.length){
ret=ret.concat(_166.slice(0,_164.options.choices-ret.length));
}
return "<ul>"+ret.join("")+"</ul>";
}},_163||{});
}});
Field.scrollFreeActivate=function(_16c){
setTimeout(function(){
Field.activate(_16c);
},1);
};
Ajax.InPlaceEditor=Class.create();
Ajax.InPlaceEditor.defaultHighlightColor="#FFFF99";
Ajax.InPlaceEditor.prototype={initialize:function(_16d,url,_16f){
this.url=url;
this.element=$(_16d);
this.options=Object.extend({paramName:"value",okButton:true,okLink:false,okText:"ok",cancelButton:false,cancelLink:true,cancelText:"cancel",textBeforeControls:"",textBetweenControls:"",textAfterControls:"",savingText:"Saving...",clickToEditText:"Click to edit",okText:"ok",rows:1,onComplete:function(_170,_171){
new Effect.Highlight(_171,{startcolor:this.options.highlightcolor});
},onFailure:function(_172){
alert("Error communicating with the server: "+_172.responseText.stripTags());
},callback:function(form){
return Form.serialize(form);
},handleLineBreaks:true,loadingText:"Loading...",savingClassName:"inplaceeditor-saving",loadingClassName:"inplaceeditor-loading",formClassName:"inplaceeditor-form",highlightcolor:Ajax.InPlaceEditor.defaultHighlightColor,highlightendcolor:"#FFFFFF",externalControl:null,submitOnBlur:false,ajaxOptions:{},evalScripts:false},_16f||{});
if(!this.options.formId&&this.element.id){
this.options.formId=this.element.id+"-inplaceeditor";
if($(this.options.formId)){
this.options.formId=null;
}
}
if(this.options.externalControl){
this.options.externalControl=$(this.options.externalControl);
}
this.originalBackground=Element.getStyle(this.element,"background-color");
if(!this.originalBackground){
this.originalBackground="transparent";
}
this.element.title=this.options.clickToEditText;
this.onclickListener=this.enterEditMode.bindAsEventListener(this);
this.mouseoverListener=this.enterHover.bindAsEventListener(this);
this.mouseoutListener=this.leaveHover.bindAsEventListener(this);
Event.observe(this.element,"click",this.onclickListener);
Event.observe(this.element,"mouseover",this.mouseoverListener);
Event.observe(this.element,"mouseout",this.mouseoutListener);
if(this.options.externalControl){
Event.observe(this.options.externalControl,"click",this.onclickListener);
Event.observe(this.options.externalControl,"mouseover",this.mouseoverListener);
Event.observe(this.options.externalControl,"mouseout",this.mouseoutListener);
}
},enterEditMode:function(evt){
if(this.saving){
return;
}
if(this.editing){
return;
}
this.editing=true;
this.onEnterEditMode();
if(this.options.externalControl){
Element.hide(this.options.externalControl);
}
Element.hide(this.element);
this.createForm();
this.element.parentNode.insertBefore(this.form,this.element);
if(!this.options.loadTextURL){
Field.scrollFreeActivate(this.editField);
}
if(evt){
Event.stop(evt);
}
return false;
},createForm:function(){
this.form=document.createElement("form");
this.form.id=this.options.formId;
Element.addClassName(this.form,this.options.formClassName);
this.form.onsubmit=this.onSubmit.bind(this);
this.createEditField();
if(this.options.textarea){
var br=document.createElement("br");
this.form.appendChild(br);
}
if(this.options.textBeforeControls){
this.form.appendChild(document.createTextNode(this.options.textBeforeControls));
}
if(this.options.okButton){
var _176=document.createElement("input");
_176.type="submit";
_176.value=this.options.okText;
_176.className="editor_ok_button";
this.form.appendChild(_176);
}
if(this.options.okLink){
var _177=document.createElement("a");
_177.href="#";
_177.appendChild(document.createTextNode(this.options.okText));
_177.onclick=this.onSubmit.bind(this);
_177.className="editor_ok_link";
this.form.appendChild(_177);
}
if(this.options.textBetweenControls&&(this.options.okLink||this.options.okButton)&&(this.options.cancelLink||this.options.cancelButton)){
this.form.appendChild(document.createTextNode(this.options.textBetweenControls));
}
if(this.options.cancelButton){
var _178=document.createElement("input");
_178.type="submit";
_178.value=this.options.cancelText;
_178.onclick=this.onclickCancel.bind(this);
_178.className="editor_cancel_button";
this.form.appendChild(_178);
}
if(this.options.cancelLink){
var _179=document.createElement("a");
_179.href="#";
_179.appendChild(document.createTextNode(this.options.cancelText));
_179.onclick=this.onclickCancel.bind(this);
_179.className="editor_cancel editor_cancel_link";
this.form.appendChild(_179);
}
if(this.options.textAfterControls){
this.form.appendChild(document.createTextNode(this.options.textAfterControls));
}
},hasHTMLLineBreaks:function(_17a){
if(!this.options.handleLineBreaks){
return false;
}
return _17a.match(/<br/i)||_17a.match(/<p>/i);
},convertHTMLLineBreaks:function(_17b){
return _17b.replace(/<br>/gi,"\n").replace(/<br\/>/gi,"\n").replace(/<\/p>/gi,"\n").replace(/<p>/gi,"");
},createEditField:function(){
var text;
if(this.options.loadTextURL){
text=this.options.loadingText;
}else{
text=this.getText();
}
var obj=this;
if(this.options.rows==1&&!this.hasHTMLLineBreaks(text)){
this.options.textarea=false;
var _17e=document.createElement("input");
_17e.obj=this;
_17e.type="text";
_17e.name=this.options.paramName;
_17e.value=text;
_17e.style.backgroundColor=this.options.highlightcolor;
_17e.className="editor_field";
var size=this.options.size||this.options.cols||0;
if(size!=0){
_17e.size=size;
}
if(this.options.submitOnBlur){
_17e.onblur=this.onSubmit.bind(this);
}
this.editField=_17e;
}else{
this.options.textarea=true;
var _180=document.createElement("textarea");
_180.obj=this;
_180.name=this.options.paramName;
_180.value=this.convertHTMLLineBreaks(text);
_180.rows=this.options.rows;
_180.cols=this.options.cols||40;
_180.className="editor_field";
if(this.options.submitOnBlur){
_180.onblur=this.onSubmit.bind(this);
}
this.editField=_180;
}
if(this.options.loadTextURL){
this.loadExternalText();
}
this.form.appendChild(this.editField);
},getText:function(){
return this.element.innerHTML;
},loadExternalText:function(){
Element.addClassName(this.form,this.options.loadingClassName);
this.editField.disabled=true;
new Ajax.Request(this.options.loadTextURL,Object.extend({asynchronous:true,onComplete:this.onLoadedExternalText.bind(this)},this.options.ajaxOptions));
},onLoadedExternalText:function(_181){
Element.removeClassName(this.form,this.options.loadingClassName);
this.editField.disabled=false;
this.editField.value=_181.responseText.stripTags();
Field.scrollFreeActivate(this.editField);
},onclickCancel:function(){
this.onComplete();
this.leaveEditMode();
return false;
},onFailure:function(_182){
this.options.onFailure(_182);
if(this.oldInnerHTML){
this.element.innerHTML=this.oldInnerHTML;
this.oldInnerHTML=null;
}
return false;
},onSubmit:function(){
var form=this.form;
var _184=this.editField.value;
this.onLoading();
if(this.options.evalScripts){
new Ajax.Request(this.url,Object.extend({parameters:this.options.callback(form,_184),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this),asynchronous:true,evalScripts:true},this.options.ajaxOptions));
}else{
new Ajax.Updater({success:this.element,failure:null},this.url,Object.extend({parameters:this.options.callback(form,_184),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this)},this.options.ajaxOptions));
}
if(arguments.length>1){
Event.stop(arguments[0]);
}
return false;
},onLoading:function(){
this.saving=true;
this.removeForm();
this.leaveHover();
this.showSaving();
},showSaving:function(){
this.oldInnerHTML=this.element.innerHTML;
this.element.innerHTML=this.options.savingText;
Element.addClassName(this.element,this.options.savingClassName);
this.element.style.backgroundColor=this.originalBackground;
Element.show(this.element);
},removeForm:function(){
if(this.form){
if(this.form.parentNode){
Element.remove(this.form);
}
this.form=null;
}
},enterHover:function(){
if(this.saving){
return;
}
this.element.style.backgroundColor=this.options.highlightcolor;
if(this.effect){
this.effect.cancel();
}
Element.addClassName(this.element,this.options.hoverClassName);
},leaveHover:function(){
if(this.options.backgroundColor){
this.element.style.backgroundColor=this.oldBackground;
}
Element.removeClassName(this.element,this.options.hoverClassName);
if(this.saving){
return;
}
this.effect=new Effect.Highlight(this.element,{startcolor:this.options.highlightcolor,endcolor:this.options.highlightendcolor,restorecolor:this.originalBackground});
},leaveEditMode:function(){
Element.removeClassName(this.element,this.options.savingClassName);
this.removeForm();
this.leaveHover();
this.element.style.backgroundColor=this.originalBackground;
Element.show(this.element);
if(this.options.externalControl){
Element.show(this.options.externalControl);
}
this.editing=false;
this.saving=false;
this.oldInnerHTML=null;
this.onLeaveEditMode();
},onComplete:function(_185){
this.leaveEditMode();
this.options.onComplete.bind(this)(_185,this.element);
},onEnterEditMode:function(){
},onLeaveEditMode:function(){
},dispose:function(){
if(this.oldInnerHTML){
this.element.innerHTML=this.oldInnerHTML;
}
this.leaveEditMode();
Event.stopObserving(this.element,"click",this.onclickListener);
Event.stopObserving(this.element,"mouseover",this.mouseoverListener);
Event.stopObserving(this.element,"mouseout",this.mouseoutListener);
if(this.options.externalControl){
Event.stopObserving(this.options.externalControl,"click",this.onclickListener);
Event.stopObserving(this.options.externalControl,"mouseover",this.mouseoverListener);
Event.stopObserving(this.options.externalControl,"mouseout",this.mouseoutListener);
}
}};
Ajax.InPlaceCollectionEditor=Class.create();
Object.extend(Ajax.InPlaceCollectionEditor.prototype,Ajax.InPlaceEditor.prototype);
Object.extend(Ajax.InPlaceCollectionEditor.prototype,{createEditField:function(){
if(!this.cached_selectTag){
var _186=document.createElement("select");
var _187=this.options.collection||[];
var _188;
_187.each(function(e,i){
_188=document.createElement("option");
_188.value=(e instanceof Array)?e[0]:e;
if((typeof this.options.value=="undefined")&&((e instanceof Array)?this.element.innerHTML==e[1]:e==_188.value)){
_188.selected=true;
}
if(this.options.value==_188.value){
_188.selected=true;
}
_188.appendChild(document.createTextNode((e instanceof Array)?e[1]:e));
_186.appendChild(_188);
}.bind(this));
this.cached_selectTag=_186;
}
this.editField=this.cached_selectTag;
if(this.options.loadTextURL){
this.loadExternalText();
}
this.form.appendChild(this.editField);
this.options.callback=function(form,_18c){
return "value="+encodeURIComponent(_18c);
};
}});
Form.Element.DelayedObserver=Class.create();
Form.Element.DelayedObserver.prototype={initialize:function(_18d,_18e,_18f){
this.delay=_18e||0.5;
this.element=$(_18d);
this.callback=_18f;
this.timer=null;
this.lastValue=$F(this.element);
Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this));
},delayedListener:function(_190){
if(this.lastValue==$F(this.element)){
return;
}
if(this.timer){
clearTimeout(this.timer);
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);
this.lastValue=$F(this.element);
},onTimerEvent:function(){
this.timer=null;
this.callback(this.element,$F(this.element));
}};
if(!Control){
var Control={};
}
Control.Slider=Class.create();
Control.Slider.prototype={initialize:function(_191,_192,_193){
var _194=this;
if(_191 instanceof Array){
this.handles=_191.collect(function(e){
return $(e);
});
}else{
this.handles=[$(_191)];
}
this.track=$(_192);
this.options=_193||{};
this.axis=this.options.axis||"horizontal";
this.increment=this.options.increment||1;
this.step=parseInt(this.options.step||"1");
this.range=this.options.range||$R(0,1);
this.value=0;
this.values=this.handles.map(function(){
return 0;
});
this.spans=this.options.spans?this.options.spans.map(function(s){
return $(s);
}):false;
this.options.startSpan=$(this.options.startSpan||null);
this.options.endSpan=$(this.options.endSpan||null);
this.restricted=this.options.restricted||false;
this.maximum=this.options.maximum||this.range.end;
this.minimum=this.options.minimum||this.range.start;
this.alignX=parseInt(this.options.alignX||"0");
this.alignY=parseInt(this.options.alignY||"0");
this.trackLength=this.maximumOffset()-this.minimumOffset();
this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));
this.active=false;
this.dragging=false;
this.disabled=false;
if(this.options.disabled){
this.setDisabled();
}
this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;
if(this.allowedValues){
this.minimum=this.allowedValues.min();
this.maximum=this.allowedValues.max();
}
this.eventMouseDown=this.startDrag.bindAsEventListener(this);
this.eventMouseUp=this.endDrag.bindAsEventListener(this);
this.eventMouseMove=this.update.bindAsEventListener(this);
this.handles.each(function(h,i){
i=_194.handles.length-1-i;
_194.setValue(parseFloat((_194.options.sliderValue instanceof Array?_194.options.sliderValue[i]:_194.options.sliderValue)||_194.range.start),i);
Element.makePositioned(h);
Event.observe(h,"mousedown",_194.eventMouseDown);
});
Event.observe(this.track,"mousedown",this.eventMouseDown);
Event.observe(document,"mouseup",this.eventMouseUp);
Event.observe(document,"mousemove",this.eventMouseMove);
this.initialized=true;
},dispose:function(){
var _199=this;
Event.stopObserving(this.track,"mousedown",this.eventMouseDown);
Event.stopObserving(document,"mouseup",this.eventMouseUp);
Event.stopObserving(document,"mousemove",this.eventMouseMove);
this.handles.each(function(h){
Event.stopObserving(h,"mousedown",_199.eventMouseDown);
});
},setDisabled:function(){
this.disabled=true;
},setEnabled:function(){
this.disabled=false;
},getNearestValue:function(_19b){
if(this.allowedValues){
if(_19b>=this.allowedValues.max()){
return (this.allowedValues.max());
}
if(_19b<=this.allowedValues.min()){
return (this.allowedValues.min());
}
var _19c=Math.abs(this.allowedValues[0]-_19b);
var _19d=this.allowedValues[0];
this.allowedValues.each(function(v){
var _19f=Math.abs(v-_19b);
if(_19f<=_19c){
_19d=v;
_19c=_19f;
}
});
return _19d;
}
if(_19b>this.range.end){
return this.range.end;
}
if(_19b<this.range.start){
return this.range.start;
}
return _19b;
},setValue:function(_1a0,_1a1){
if(!this.active){
this.activeHandleIdx=_1a1||0;
this.activeHandle=this.handles[this.activeHandleIdx];
this.updateStyles();
}
_1a1=_1a1||this.activeHandleIdx||0;
if(this.initialized&&this.restricted){
if((_1a1>0)&&(_1a0<this.values[_1a1-1])){
_1a0=this.values[_1a1-1];
}
if((_1a1<(this.handles.length-1))&&(_1a0>this.values[_1a1+1])){
_1a0=this.values[_1a1+1];
}
}
_1a0=this.getNearestValue(_1a0);
this.values[_1a1]=_1a0;
this.value=this.values[0];
this.handles[_1a1].style[this.isVertical()?"top":"left"]=this.translateToPx(_1a0);
this.drawSpans();
if(!this.dragging||!this.event){
this.updateFinished();
}
},setValueBy:function(_1a2,_1a3){
this.setValue(this.values[_1a3||this.activeHandleIdx||0]+_1a2,_1a3||this.activeHandleIdx||0);
},translateToPx:function(_1a4){
return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(_1a4-this.range.start))+"px";
},translateToValue:function(_1a5){
return ((_1a5/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start);
},getRange:function(_1a6){
var v=this.values.sortBy(Prototype.K);
_1a6=_1a6||0;
return $R(v[_1a6],v[_1a6+1]);
},minimumOffset:function(){
return (this.isVertical()?this.alignY:this.alignX);
},maximumOffset:function(){
return (this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignY);
},isVertical:function(){
return (this.axis=="vertical");
},drawSpans:function(){
var _1a8=this;
if(this.spans){
$R(0,this.spans.length-1).each(function(r){
_1a8.setSpan(_1a8.spans[r],_1a8.getRange(r));
});
}
if(this.options.startSpan){
this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value));
}
if(this.options.endSpan){
this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum));
}
},setSpan:function(span,_1ab){
if(this.isVertical()){
span.style.top=this.translateToPx(_1ab.start);
span.style.height=this.translateToPx(_1ab.end-_1ab.start+this.range.start);
}else{
span.style.left=this.translateToPx(_1ab.start);
span.style.width=this.translateToPx(_1ab.end-_1ab.start+this.range.start);
}
},updateStyles:function(){
this.handles.each(function(h){
Element.removeClassName(h,"selected");
});
Element.addClassName(this.activeHandle,"selected");
},startDrag:function(_1ad){
if(Event.isLeftClick(_1ad)){
if(!this.disabled){
this.active=true;
var _1ae=Event.element(_1ad);
var _1af=[Event.pointerX(_1ad),Event.pointerY(_1ad)];
var _1b0=_1ae;
if(_1b0==this.track){
var _1b1=Position.cumulativeOffset(this.track);
this.event=_1ad;
this.setValue(this.translateToValue((this.isVertical()?_1af[1]-_1b1[1]:_1af[0]-_1b1[0])-(this.handleLength/2)));
var _1b1=Position.cumulativeOffset(this.activeHandle);
this.offsetX=(_1af[0]-_1b1[0]);
this.offsetY=(_1af[1]-_1b1[1]);
}else{
while((this.handles.indexOf(_1ae)==-1)&&_1ae.parentNode){
_1ae=_1ae.parentNode;
}
if(this.handles.indexOf(_1ae)!=-1){
this.activeHandle=_1ae;
this.activeHandleIdx=this.handles.indexOf(this.activeHandle);
this.updateStyles();
var _1b1=Position.cumulativeOffset(this.activeHandle);
this.offsetX=(_1af[0]-_1b1[0]);
this.offsetY=(_1af[1]-_1b1[1]);
}
}
}
Event.stop(_1ad);
}
},update:function(_1b2){
if(this.active){
if(!this.dragging){
this.dragging=true;
}
this.draw(_1b2);
if(Prototype.Browser.WebKit){
window.scrollBy(0,0);
}
Event.stop(_1b2);
}
},draw:function(_1b3){
var _1b4=[Event.pointerX(_1b3),Event.pointerY(_1b3)];
var _1b5=Position.cumulativeOffset(this.track);
_1b4[0]-=this.offsetX+_1b5[0];
_1b4[1]-=this.offsetY+_1b5[1];
this.event=_1b3;
this.setValue(this.translateToValue(this.isVertical()?_1b4[1]:_1b4[0]));
if(this.initialized&&this.options.onSlide){
this.options.onSlide(this.values.length>1?this.values:this.value,this);
}
},endDrag:function(_1b6){
if(this.active&&this.dragging){
this.finishDrag(_1b6,true);
Event.stop(_1b6);
}
this.active=false;
this.dragging=false;
},finishDrag:function(_1b7,_1b8){
this.active=false;
this.dragging=false;
this.updateFinished();
},updateFinished:function(){
if(this.initialized&&this.options.onChange){
this.options.onChange(this.values.length>1?this.values:this.value,this);
}
this.event=null;
}};
Sound={tracks:{},_enabled:true,template:new Template("<embed style=\"height:0\" id=\"sound_#{track}_#{id}\" src=\"#{url}\" loop=\"false\" autostart=\"true\" hidden=\"true\"/>"),enable:function(){
Sound._enabled=true;
},disable:function(){
Sound._enabled=false;
},play:function(url){
if(!Sound._enabled){
return;
}
var _1ba=Object.extend({track:"global",url:url,replace:false},arguments[1]||{});
if(_1ba.replace&&this.tracks[_1ba.track]){
$R(0,this.tracks[_1ba.track].id).each(function(id){
var _1bc=$("sound_"+_1ba.track+"_"+id);
_1bc.Stop&&_1bc.Stop();
_1bc.remove();
});
this.tracks[_1ba.track]=null;
}
if(!this.tracks[_1ba.track]){
this.tracks[_1ba.track]={id:0};
}else{
this.tracks[_1ba.track].id++;
}
_1ba.id=this.tracks[_1ba.track].id;
if(Prototype.Browser.IE){
var _1bd=document.createElement("bgsound");
_1bd.setAttribute("id","sound_"+_1ba.track+"_"+_1ba.id);
_1bd.setAttribute("src",_1ba.url);
_1bd.setAttribute("loop","1");
_1bd.setAttribute("autostart","true");
$$("body")[0].appendChild(_1bd);
}else{
new Insertion.Bottom($$("body")[0],Sound.template.evaluate(_1ba));
}
}};
if(Prototype.Browser.Gecko&&navigator.userAgent.indexOf("Win")>0){
if(navigator.plugins&&$A(navigator.plugins).detect(function(p){
return p.name.indexOf("QuickTime")!=-1;
})){
Sound.template=new Template("<object id=\"sound_#{track}_#{id}\" width=\"0\" height=\"0\" type=\"audio/mpeg\" data=\"#{url}\"/>");
}else{
Sound.play=function(){
};
}
}
var SelectorLiteAddon=Class.create();
SelectorLiteAddon.prototype={initialize:function(_1bf){
this.r=[];
this.s=[];
this.i=0;
for(var i=_1bf.length-1;i>=0;i--){
var s=["*","",[]];
var t=_1bf[i];
var _1c3=t.length-1;
do{
var d=t.lastIndexOf("#");
var p=t.lastIndexOf(".");
_1c3=Math.max(d,p);
if(_1c3==-1){
s[0]=t.toUpperCase();
}else{
if(d==-1||p==_1c3){
s[2].push(t.substring(p+1));
}else{
if(!s[1]){
s[1]=t.substring(d+1);
}
}
}
t=t.substring(0,_1c3);
}while(_1c3>0);
this.s[i]=s;
}
},get:function(root){
this.explore(root||document,this.i==(this.s.length-1));
return this.r;
},explore:function(elt,leaf){
var s=this.s[this.i];
var r=[];
if(s[1]){
e=$(s[1]);
if(e&&(s[0]=="*"||e.tagName==s[0])&&e.childOf(elt)){
r=[e];
}
}else{
r=$A(elt.getElementsByTagName(s[0]));
}
if(s[2].length==1){
r=r.findAll(function(o){
if(o.className.indexOf(" ")==-1){
return o.className==s[2][0];
}else{
return o.className.split(/\s+/).include(s[2][0]);
}
});
}else{
if(s[2].length>0){
r=r.findAll(function(o){
if(o.className.indexOf(" ")==-1){
return false;
}else{
var q=o.className.split(/\s+/);
return s[2].all(function(c){
return q.include(c);
});
}
});
}
}
if(leaf){
this.r=this.r.concat(r);
}else{
++this.i;
r.each(function(o){
this.explore(o,this.i==(this.s.length-1));
}.bind(this));
}
}};
var $$old=$$;
var $$=function(a,b){
if(b||a.indexOf("[")>=0){
return $$old.apply(this,arguments);
}
return new SelectorLiteAddon(a.split(/\s+/)).get();
};
function addLoadListener(fn){
if(typeof window.addEventListener!="undefined"){
window.addEventListener("load",fn,false);
}else{
if(typeof document.addEventListener!="undefined"){
document.addEventListener("load",fn,false);
}else{
if(typeof window.attachEvent!="undefined"){
window.attachEvent("onload",fn);
}else{
var _1d3=window.onload;
if(typeof window.onload!="function"){
window.onload=fn;
}else{
window.onload=function(){
_1d3();
fn();
};
}
}
}
}
}
function attachEventListener(_1d4,_1d5,_1d6,_1d7){
if(typeof _1d4.addEventListener!="undefined"){
_1d4.addEventListener(_1d5,_1d6,_1d7);
}else{
if(typeof _1d4.attachEvent!="undefined"){
_1d4.attachEvent("on"+_1d5,_1d6);
}else{
_1d5="on"+_1d5;
if(typeof _1d4[_1d5]=="function"){
var _1d8=_1d4[_1d5];
_1d4[_1d5]=function(){
_1d8();
return _1d6();
};
}else{
_1d4[_1d5]=_1d6;
}
}
}
return true;
}
function detachEventListener(_1d9,_1da,_1db,_1dc){
if(typeof _1d9.removeEventListener!="undefined"){
_1d9.removeEventListener(_1da,_1db,_1dc);
}else{
if(typeof _1d9.detachEvent!="undefined"){
_1d9.detachEvent("on"+_1da,_1db);
}else{
_1d9["on"+_1da]=null;
}
}
return true;
}
function getEventTarget(_1dd){
if(typeof _1dd=="undefined"){
_1dd=window.event;
}
var _1de=null;
if(typeof _1dd.target!="undefined"){
_1de=_1dd.target;
}else{
_1de=_1dd.srcElement;
}
while(_1de.nodeType==3&&_1de.parentNode!=null){
_1de=_1de.parentNode;
}
return _1de;
}
function stopDefaultAction(_1df){
_1df.returnValue=false;
if(typeof _1df.preventDefault!="undefined"){
_1df.preventDefault();
}
}
function getScrollingPosition(){
var _1e0=[0,0];
if(typeof window.pageYOffset!="undefined"){
_1e0=[window.pageXOffset,window.pageYOffset];
}
if(typeof document.documentElement.scrollTop!="undefined"&&document.documentElement.scrollTop>0){
_1e0=[document.documentElement.scrollLeft,document.documentElement.scrollTop];
}else{
if(typeof document.body.scrollTop!="undefined"){
_1e0=[document.body.scrollLeft,document.body.scrollTop];
}
}
return _1e0;
}
function getPosition(_1e1){
var _1e2=0;
var _1e3=0;
while(_1e1!=null){
_1e2+=_1e1.offsetLeft;
_1e3+=_1e1.offsetTop;
_1e1=_1e1.offsetParent;
}
return [_1e2,_1e3];
}
function getElementsByAttribute(_1e4,_1e5){
var _1e6=new Array();
var _1e7=new Array();
if(document.all){
_1e6=document.all;
}else{
_1e6=document.getElementsByTagName("*");
}
for(var i=0;i<_1e6.length;i++){
if(_1e4=="class"){
var _1e9=new RegExp("(^| )"+_1e5+"( |$)");
if(_1e6[i].className.match(_1e9)){
_1e7[_1e7.length]=_1e6[i];
}
}else{
if(_1e4=="for"){
if(_1e6[i].getAttribute("htmlFor")||_1e6[i].getAttribute("for")){
if(_1e6[i].htmlFor==_1e5){
_1e7[_1e7.length]=_1e6[i];
}
}
}else{
if(_1e6[i].getAttribute(_1e4)==_1e5){
_1e7[_1e7.length]=_1e6[i];
}
}
}
}
return _1e7;
}
function identifyOS(){
var _1ea=navigator.userAgent.toLowerCase();
if(_1ea.indexOf("win")!=-1){
return "win";
}else{
if(_1ea.indexOf("mac")){
return "mac";
}else{
return "unix";
}
}
return false;
}
function identifyBrowser(){
var _1eb=navigator.userAgent.toLowerCase();
if(typeof navigator.vendor!="undefined"&&navigator.vendor=="KDE"&&typeof window.sidebar!="undefined"){
return "kde";
}else{
if(typeof window.opera!="undefined"){
var _1ec=parseFloat(_1eb.replace(/.*opera[\/ ]([^ $]+).*/,"$1"));
if(_1ec>=7){
return "opera7";
}else{
if(_1ec>=5){
return "opera5";
}
}
return false;
}else{
if(typeof document.all!="undefined"){
if(typeof document.getElementById!="undefined"){
var _1ed=_1eb.replace(/.*ms(ie[\/ ][^ $]+).*/,"$1").replace(/ /,"");
if(typeof document.uniqueID!="undefined"){
if(_1ed.indexOf("5.5")!=-1){
return _1ed.replace(/(.*5\.5).*/,"$1");
}else{
return _1ed.replace(/(.*)\..*/,"$1");
}
}else{
return "ie5mac";
}
}
return false;
}else{
if(typeof document.getElementById!="undefined"){
if(navigator.vendor.indexOf("Apple Computer, Inc.")!=-1){
if(typeof window.XMLHttpRequest!="undefined"){
return "safari1.2";
}
return "safari1";
}else{
if(_1eb.indexOf("gecko")!=-1){
return "mozilla";
}
}
}
}
}
}
return false;
}
function getXMLHttpRequest(){
var _1ee;
try{
_1ee=new XMLHttpRequest();
}
catch(error){
try{
_1ee=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(error){
_1ee=null;
}
}
return _1ee;
}
function XMLFactory(){
return true;
}
function getViewportSize(){
var size=[0,0];
if(typeof window.innerWidth!="undefined"){
size=[window.innerWidth,window.innerHeight];
}else{
if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){
size=[document.documentElement.clientWidth,document.documentElement.clientHeight];
}else{
size=[document.getElementsByTagName("body")[0].clientWidth,document.getElementsByTagName("body")[0].clientHeight];
}
}
return size;
}
function getPageDimensions(){
var body=document.getElementsByTagName("body")[0];
var _1f1=0;
var _1f2=0;
var _1f3=0;
var _1f4=0;
var _1f5=[0,0];
if(typeof document.documentElement!="undefined"&&typeof document.documentElement.scrollWidth!="undefined"){
_1f5[0]=document.documentElement.scrollWidth;
_1f5[1]=document.documentElement.scrollHeight;
}
_1f1=body.offsetWidth;
_1f2=body.offsetHeight;
_1f3=body.scrollWidth;
_1f4=body.scrollHeight;
if(_1f1>_1f5[0]){
_1f5[0]=_1f1;
}
if(_1f2>_1f5[1]){
_1f5[1]=_1f2;
}
if(_1f3>_1f5[0]){
_1f5[0]=_1f3;
}
if(_1f4>_1f5[1]){
_1f5[1]=_1f4;
}
return _1f5;
}
function addClass(_1f6,_1f7){
var _1f8=new RegExp("(^| )"+_1f7+"( |$)");
if(!_1f8.test(_1f6.className)){
if(_1f6.className==""){
_1f6.className=_1f7;
}else{
_1f6.className+=" "+_1f7;
}
}
return true;
}
function removeClass(_1f9,_1fa){
var _1fb=_1f9.className;
var _1fc=new RegExp("(^| )"+_1fa+"( |$)");
_1fb=_1fb.replace(_1fc,"$1");
_1fb=_1fb.replace(/ $/,"");
_1f9.className=_1fb;
return true;
}
var YOBO_SP_STATUS_STOP=0;
var YOBO_SP_STATUS_LOAD=1;
var YOBO_SP_STATUS_PLAY=2;
var YOBO_SP_STATUS_PAUSE=3;
var YOBO_SL_LOOP_ORDER=0;
var YOBO_SL_LOOP_RND=1;
var YOBO_SL_LOOP_BACK=2;
Event.observe(window,"load",function(){
var _1fd=document.createElement("DIV");
_1fd.id="yobo_float_music_menu";
_1fd.style.position="absolute";
_1fd.style.display="none";
_1fd.style.width="84px";
_1fd.style.cursor="pointer";
_1fd.onmouseover=function(){
_1fd.style.display="block";
};
_1fd.onmouseout=function(){
_1fd.style.display="none";
};
document.body.appendChild(_1fd);
});
function yobo_song_floatmenu(_1fe,_1ff,_200){
var _201=80;
var menu=$(_1ff);
try{
var _203=$("yobo_float_music_menu");
if(!_203){
return false;
}
if(!_200){
_203.hide();
return;
}
var _204=Position.cumulativeOffset(_1fe)[0]+$(_1fe).getWidth()-_201-10;
var _205=Position.cumulativeOffset(_1fe)[1];
_203.innerHTML=menu.innerHTML;
var _206=document.createElement("input");
_206.type="hidden";
_206.name="hidden";
_206.id="yobo_songmenubar_hidden";
_203.appendChild(_206);
_206=document.createElement("input");
_206.type="hidden";
_206.name="from";
_206.id="yobo_songmenubar_from";
_203.appendChild(_206);
_206=document.createElement("input");
_206.type="hidden";
_206.name="fr";
_206.id="yobo_songmenubar_pagefrom";
_203.appendChild(_206);
_203.setStyle({left:_204+"px",top:_205+"px"});
_203.show();
}
catch(e){
}
}
if(typeof (yobo_songPlayer)!="function"){
var yobo_songPlayer=Class.create();
yobo_songPlayer.prototype={initialize:function(){
this.ext_flash=null;
this.win_flash=null;
this.dom_pagebtn=null;
this.is_pagebtn=false;
this.sp_status=YOBO_SP_STATUS_STOP;
this.sp_songlist=[];
this.is_songlist=false;
this.sp_listmethod=YOBO_SL_LOOP_ORDER;
this.sp_listcuridx=0;
this.dom_listouter=null;
this.dom_listprev=null;
this.dom_listplay=null;
this.dom_listnext=null;
this.dom_listorder=null;
this.sp_songurl="nourl";
this.sp_songid=-1;
this.sp_songrnd=-1;
this.dom_songouter=null;
this.dom_songctrl=null;
this.dom_songtable=null;
this.dom_songtime=null;
this.sp_loadtimer=null;
this.sp_looptimer=null;
this.is_init=false;
this.is_upload=false;
},initPlayer:function(){
try{
if(navigator.appName.indexOf("Microsoft")!=-1){
this.ext_flash=window["pagesongplayer"];
this.win_flash=window["finalPlayer"];
}else{
this.ext_flash=document["pagesongplayer"];
this.win_flash=document["finalPlayer"];
}
this.dom_pagebtn=$("yobo_largesongctrlbtn");
this.is_pagebtn=false;
this.sp_status=YOBO_SP_STATUS_STOP;
this.sp_songlist=[];
this.is_songlist=false;
this.sp_listmethod=YOBO_SL_LOOP_ORDER;
this.sp_listcuridx=0;
this.dom_listouter=$("yobo_songctrlbar");
this.dom_listprev=$("yobo_sctrl_prev");
this.dom_listplay=$("yobo_sctrl_play");
this.dom_listnext=$("yobo_sctrl_next");
this.dom_listorder=$("yobo_sctrl_order");
this.sp_songurl="nourl";
this.sp_songid=-1;
this.sp_songrnd=-1;
this.dom_songouter=null;
this.dom_songctrl=null;
this.dom_songtable=null;
this.dom_songtime=null;
this.sp_loadtimer=null;
this.sp_looptimer=null;
this.is_init=true;
this.is_upload=false;
}
catch(e){
traceError("Error initPlayer::initialize -> "+e);
}
},playSong:function(url,sid,rnd,_20a,isup){
try{
if(this.is_init){
this.is_pagebtn=_20a?true:false;
this.is_songlist=false;
this.startSong(url,sid,rnd,true,isup);
}
}
catch(e){
traceError("Error yobo_songPlayer::play -> "+e);
}
},playList:function(list){
try{
if(this.is_init){
this.is_pagebtn=false;
if(list&&list.length>0){
this.is_songlist=true;
if(this.sp_songlist==list){
this.sp_listcuridx=(this.sp_listcuridx+this.sp_songlist.length)%this.sp_songlist.length;
}else{
this.sp_songlist=list;
this.sp_listcuridx=0;
}
var _20d=this.sp_songlist[this.sp_listcuridx];
this.startSong(_20d.url,_20d.sid,_20d.rnd,false,_20d.isup);
}else{
traceError("Error yobo_songPlayer::playList -> invalid list");
}
}
}
catch(e){
traceError("Error yobo_songPlayer::playList -> "+e);
}
},initList:function(list){
try{
if(list&&list.length>0){
this.sp_songlist=list;
this.sp_listcuridx=0;
}else{
traceError("Error yobo_songPlayer::playList -> invalid list");
}
}
catch(e){
traceError("Error yobo_songPlayer::initList -> "+e);
}
},updateListMethod:function(){
try{
if(this.is_init){
this.is_songlist=true;
this.sp_listmethod=(this.sp_listmethod+1)%3;
if(this.dom_listouter&&this.dom_listorder){
switch(this.sp_listmethod){
case YOBO_SL_LOOP_BACK:
this.dom_listorder.className="ctrlback";
break;
case YOBO_SL_LOOP_RND:
this.dom_listorder.className="ctrlrnd";
break;
default:
this.dom_listorder.className="ctrlorder";
}
}
}
}
catch(e){
traceError("Error yobo_songPlayer::updateListMethod -> "+e);
}
},stopSong:function(_20f){
try{
if(this.is_init){
clearTimeout(this.sp_loadtimer);
clearTimeout(this.sp_looptimer);
this.sp_status=YOBO_SP_STATUS_STOP;
try{
this.ext_flash.close();
}
catch(e){
traceError("Error yobo_songPlayer::stopSong(EXT) -> "+e);
}
if(this.dom_pagebtn){
this.dom_pagebtn.className="frameplay";
}
if(this.dom_songouter&&this.dom_songctrl&&this.dom_songtime&&this.dom_songtable){
this.dom_songctrl.className="ybscontrol";
this.dom_songtime.innerHTML="00:00";
this.dom_songtable.style.backgroundPosition=(this.dom_songtable.offsetWidth-614)+"px 0px";
}
if(this.dom_listouter&&this.dom_listplay&&this.is_songlist){
this.dom_listplay.className="ctrlplay";
}
this.dom_songouter=null;
this.dom_songctrl=null;
this.dom_songtable=null;
this.dom_songtime=null;
if(!_20f){
if(this.is_songlist){
this.playNext();
}else{
this.loadSong(this.sp_songurl,this.sp_songid,this.sp_songrnd,this.is_upload);
}
}
}
}
catch(e){
traceError("Error yobo_songPlayer::stopSong -> "+e);
}
},playNext:function(){
try{
if(this.is_init){
if(this.getNextIndex(true)){
this.is_songlist=true;
var _210=this.sp_songlist[this.sp_listcuridx];
this.startSong(_210.url,_210.sid,_210.rnd,false,_210.isup);
}
}
}
catch(e){
traceError("Error yobo_songPlayer::playNext -> "+e);
}
},playPrev:function(){
try{
if(this.is_init){
if(this.getNextIndex(false)){
this.is_songlist=true;
var _211=this.sp_songlist[this.sp_listcuridx];
this.startSong(_211.url,_211.sid,_211.rnd,false,_211.isup);
}
}
}
catch(e){
traceError("Error yobo_songPlayer::playPrev -> "+e);
}
},startSong:function(url,sid,rnd,_215,isup){
try{
if(this.is_init){
if(url==this.sp_songurl&&sid==this.sp_songid&&rnd==this.sp_songrnd){
switch(this.sp_status){
case YOBO_SP_STATUS_STOP:
this.loadSong(this.sp_songurl,this.sp_songid,this.sp_songrnd,this.is_upload);
break;
case YOBO_SP_STATUS_LOAD:
break;
case YOBO_SP_STATUS_PLAY:
this.pauseSong();
break;
case YOBO_SP_STATUS_PAUSE:
this.resumeSong();
break;
default:
traceError("Error yobo_songPlayer::playList -> unknown status: "+this.sp_status);
}
}else{
if(_215){
this.sp_listcuridx=this.getIndexInList(url,sid,rnd);
}
if(this.sp_status!=YOBO_SP_STATUS_STOP){
this.stopSong(true);
}
if(url==""||url=="-1"){
show_oninvaildsongurl(sid);
return false;
}else{
this.loadSong(url,sid,rnd,isup);
}
}
}
}
catch(e){
traceError("Error yobo_songPlayer::startSong -> "+e);
}
},loadSong:function(url,sid,rnd,isup){
try{
if(this.is_init){
clearTimeout(this.sp_loadtimer);
clearTimeout(this.sp_looptimer);
if(this.sp_status==YOBO_SP_STATUS_STOP){
this.sp_status=YOBO_SP_STATUS_LOAD;
if(this.win_flash){
try{
this.win_flash.PauseMP3();
}
catch(e){
traceError("Error yobo_songPlayer::loadSong(WIN) -> "+e);
}
}
this.dom_songouter=$("ybs"+sid+rnd);
this.dom_songctrl=$("ybs"+sid+rnd+"_ctrl");
this.dom_songtable=$("ybs"+sid+rnd);
this.dom_songtime=$("ybs"+sid+rnd+"_time");
if(this.dom_songouter&&this.dom_songctrl&&this.dom_songtable&&this.dom_songtime){
this.sp_songurl=url;
this.sp_songid=sid;
this.sp_songrnd=rnd;
this.is_upload=isup;
this.dom_songctrl.className="ybscontrolpause";
if(this.dom_pagebtn&&this.is_pagebtn){
this.dom_pagebtn.className="framepause";
}
if(this.dom_listouter&&this.dom_listplay&&this.is_songlist){
this.dom_listplay.className="ctrlstop";
}
try{
this.ext_flash.start(this.sp_songurl);
}
catch(e){
traceError("Error yobo_songPlayer::loadSong(EXT) -> "+e);
}
var _21b=this;
this.sp_loadtimer=setTimeout(function(){
_21b.loadTimeout();
},30*1000);
this.sp_looptimer=setTimeout(function(){
_21b.loopSong();
},700);
show_loading(this.dom_songctrl);
try{
pageTracker._trackPageview("/ajax/song_bar/play");
}
catch(e){
}
}else{
this.removeFromList(url,sid,rnd);
this.stopSong(!this.is_songlist);
}
}
}
}
catch(e){
traceError("Error yobo_songPlayer::loadSong -> "+e);
}
},loadTimeout:function(){
try{
clearTimeout(this.sp_loadtimer);
clearTimeout(this.sp_looptimer);
if(this.sp_status==YOBO_SP_STATUS_STOP||this.sp_status==YOBO_SP_STATUS_LOAD){
printE({title:ERROR_GENERAL_MSG,li:[ERROR_LOADSONG_TIMEOUT],type:"alert",className:"error"});
this.stopSong(!this.is_songlist);
}
}
catch(e){
traceError("Error yobo_songPlayer::loadTimeout -> "+e);
}
},loopSong:function(){
try{
clearTimeout(this.sp_looptimer);
if(this.sp_status!=YOBO_SP_STATUS_STOP){
var dur=parseInt(this.ext_flash.getDur());
var pos=parseInt(this.ext_flash.getPosi());
var off=Math.floor((dur-pos)/1000);
if(off>1){
if(this.sp_status==YOBO_SP_STATUS_LOAD){
clearTimeout(this.sp_loadtimer);
this.sp_status=YOBO_SP_STATUS_PLAY;
hide_loading();
if(this.sp_songid!=-1&&!this.is_upload){
new Ajax.Request("/player/write_log?song_id="+this.sp_songid+"&flag=1",{method:"get",asynchronous:true,evalScripts:true});
}
}
var len=this.dom_songtable.offsetWidth*(pos/dur)-614;
this.dom_songtable.style.backgroundPosition=len+"px 0px";
var dm=(Math.floor(off/60)).toString();
var ds=(off%60).toString();
if(dm.length==1){
dm="0"+dm;
}
if(ds.length==1){
ds="0"+ds;
}
this.dom_songtime.innerHTML=dm+":"+ds;
}else{
if(this.sp_status!=YOBO_SP_STATUS_STOP&&this.sp_status!=YOBO_SP_STATUS_LOAD){
if(this.sp_songid!=-1&&!this.is_upload){
new Ajax.Request("/player/write_log?song_id="+this.sp_songid+"&flag=0",{method:"get",asynchronous:true,evalScripts:true});
try{
pageTracker._trackPageview("/ajax/song_bar/play_finish");
}
catch(e){
}
}
this.stopSong(false);
}
}
var _222=this;
this.sp_looptimer=setTimeout(function(){
_222.loopSong();
},700);
}
}
catch(e){
traceError("Error yobo_songPlayer::loopSong -> "+e);
}
},pauseSong:function(){
try{
if(this.is_init){
if(this.sp_status==YOBO_SP_STATUS_PLAY){
clearTimeout(this.sp_looptimer);
this.sp_status=YOBO_SP_STATUS_PAUSE;
try{
this.ext_flash.pause();
}
catch(e){
traceError("Error yobo_songPlayer::pauseSong(EXT) -> "+e);
}
if(this.dom_pagebtn&&this.is_pagebtn){
this.dom_pagebtn.className="frameplay";
}
if(this.dom_songouter&&this.dom_songctrl){
this.dom_songctrl.className="ybscontrolplay";
}
if(this.dom_listouter&&this.dom_listplay&&this.is_songlist){
this.dom_listplay.className="ctrlplay";
}
}
}
}
catch(e){
traceError("Error yobo_songPlayer::pauseSong -> "+e);
}
},resumeSong:function(){
try{
if(this.is_init){
if(this.sp_status==YOBO_SP_STATUS_PAUSE){
clearTimeout(this.sp_looptimer);
this.sp_status=YOBO_SP_STATUS_PLAY;
try{
this.ext_flash.resume();
}
catch(e){
traceError("Error yobo_songPlayer::resumeSong(EXT) -> "+e);
}
if(this.dom_pagebtn&&this.is_pagebtn){
this.dom_pagebtn.className="framepause";
}
if(this.dom_songouter&&this.dom_songctrl){
this.dom_songctrl.className="ybscontrolpause";
}
if(this.dom_listouter&&this.dom_listplay&&this.is_songlist){
this.dom_listplay.className="ctrlstop";
}
var _223=this;
this.sp_looptimer=setTimeout(function(){
_223.loopSong();
},700);
}
}
}
catch(e){
traceError("Error yobo_songPlayer::resumeSong -> "+e);
}
},getNextIndex:function(_224){
try{
if(this.sp_songlist&&this.sp_songlist.length>0){
switch(this.sp_listmethod){
case YOBO_SL_LOOP_BACK:
if(_224){
this.sp_listcuridx--;
}else{
this.sp_listcuridx++;
}
break;
case YOBO_SL_LOOP_RND:
this.sp_listcuridx=Math.floor(Math.random()*this.sp_songlist.length);
break;
default:
if(_224){
this.sp_listcuridx++;
}else{
this.sp_listcuridx--;
}
}
this.sp_listcuridx=(this.sp_listcuridx+this.sp_songlist.length)%this.sp_songlist.length;
return true;
}else{
return false;
}
}
catch(e){
traceError("Error yobo_songPlayer::getNextIndex -> "+e);
return false;
}
},getIndexInList:function(url,sid,rnd){
try{
if(this.sp_songlist&&this.sp_songlist.length>0){
for(var i=0;i<this.sp_songlist.length;i++){
var _229=this.sp_songlist[i];
if(_229.url==url&&_229.sid==sid&&_229.rnd==rnd){
return i;
}
}
}else{
return 0;
}
}
catch(e){
traceError("Error yobo_songPlayer::getIndexInList -> "+e);
return 0;
}
},removeFromList:function(url,sid,rnd){
try{
if(this.sp_songlist&&this.sp_songlist.length>0){
for(var i=0;i<this.sp_songlist.length;i++){
var _22e=this.sp_songlist[i];
if(_22e.url==url&&_22e.sid==sid&&_22e.rnd==rnd){
this.sp_listcuridx.splice(i,1);
if(this.sp_listcuridx>=i){
this.sp_listcuridx--;
}
return true;
}
}
}
return false;
}
catch(e){
traceError("Error yobo_songPlayer::getIndexInList -> "+e);
return false;
}
}};
}
var SONG_PLAYER_ITEM=new yobo_songPlayer();
function yobo_init_pageplayer(){
SONG_PLAYER_ITEM.initPlayer();
}
function yobo_play_song(u,s,r,f,iu){
try{
if(!yb_login){
show_logindlg("normal");
return false;
}
}
catch(e){
alert(e);
}
SONG_PLAYER_ITEM.playSong(u,s,r,f,iu);
try{
pageTracker._trackPageview("/ajax/song_bar/play");
}
catch(e){
}
}
function yobo_play_list(l){
SONG_PLAYER_ITEM.playList(l);
try{
pageTracker._trackPageview("/ajax/song_bar/play_list");
}
catch(e){
}
}
function yobo_init_list(l){
SONG_PLAYER_ITEM.initList(l);
}
function yobo_play_listprev(){
SONG_PLAYER_ITEM.playPrev();
try{
pageTracker._trackPageview("/ajax/song_bar/prev_song");
}
catch(e){
}
}
function yobo_play_listnext(){
SONG_PLAYER_ITEM.playNext();
try{
pageTracker._trackPageview("/ajax/song_bar/next_song");
}
catch(e){
}
}
function yobo_update_listmethod(){
SONG_PLAYER_ITEM.updateListMethod();
}
function yobo_flashcallback_play(){
SONG_PLAYER_ITEM.stopSong(true);
}
function yobo_play_stop(){
SONG_PLAYER_ITEM.stopSong(true);
}
if(typeof (yobo_songPlayerLite)!="function"){
var yobo_songPlayerLite=Class.create();
yobo_songPlayerLite.prototype={initialize:function(){
try{
this.flash=null;
this.status=0;
this.url=null;
this.songid=null;
this.randnum=null;
this.controls=null;
this.songlink=null;
this.is_init=false;
}
catch(e){
traceError("Error yobo_songPlayerLite::initialize -> "+e);
return false;
}
},initPlayer:function(){
try{
this.flash=window["pagesongplayer"]?window["pagesongplayer"]:document["pagesongplayer"];
this.status=0;
this.url=null;
this.songid=null;
this.randnum=null;
this.controls=null;
this.songlink=null;
this.is_init=true;
}
catch(e){
traceError("Error yobo_songPlayerLite::initPlayer -> "+e);
return false;
}
},play:function(url,sid,rnd,ctrl,pbar){
try{
if(this.is_init){
if(this.url==url&&this.songid==sid&&this.randnum==rnd){
switch(this.status){
case 0:
this.loadSong(url,sid,rnd,ctrl,pbar);
break;
case 1:
break;
case 2:
this.pause();
break;
case 3:
this.resume();
break;
default:
alert(ERROR_BAD_STATUS+this.status);
}
}else{
if(this.status>0){
this.controls.innerHTML="Play";
this.stopAll();
}
if(url==""||url=="-1"){
show_oninvaildsongurl(sid);
return false;
}else{
this.loadSong(url,sid,rnd,ctrl,pbar);
}
}
}
}
catch(e){
traceError("Error yobo_songPlayerLite::play -> "+e);
return false;
}
},loadSong:function(url,sid,rnd,ctrl,pbar){
try{
if(this.is_init){
this.status=1;
clearTimeout(this.loadtimer);
clearTimeout(this.looptimer);
this.url=url;
this.songid=sid;
this.randnum=rnd;
this.controls=$(ctrl);
this.songlink=$(pbar);
this.controls.innerHTML="<img src=\"/images/icons/songbar_pause.gif\" align=\"absmiddle\" />";
this.songurl=url;
var _240=this;
setTimeout(function(){
_240.flash.start(_240.songurl);
},0);
this.loadtimer=setTimeout(function(){
clearTimeout(this.loadtimer);
clearTimeout(this.looptimer);
if(_240.status<2){
_240.controls.innerHTML="Play";
printE({title:ERROR_GENERAL_MSG,li:[ERROR_LOADSONG_TIMEOUT],type:"alert",className:"error"});
_240.stopAll();
}
},1000*30);
this.looptimer=setTimeout(function(){
_240.loop();
},100);
show_loading(this.controls);
if(this.songid!=-1){
new Ajax.Request("/player/write_log?song_id="+this.songid+"&flag=1",{method:"get",asynchronous:true,evalScripts:true});
}
}
}
catch(e){
traceError("Error yobo_songPlayerLite::loadSong -> "+e);
return false;
}
},stop:function(){
try{
if(this.is_init){
this.status=0;
clearTimeout(this.loadtimer);
clearTimeout(this.looptimer);
var _241=this;
setTimeout(function(){
_241.flash.close();
},0);
this.loadSong(this.url,this.songid,this.randnum,this.controls,this.songlink);
}
}
catch(e){
traceError("Error yobo_songPlayerLite::stop -> "+e);
return false;
}
},loop:function(){
try{
clearTimeout(this.looptimer);
if(this.status>0&&this.status<3){
var dur=Math.floor(parseInt(this.flash.getDur())/1000);
var pos=Math.floor(parseInt(this.flash.getPosi())/1000);
var off=dur-pos;
if(off>0){
if(this.status==1){
clearTimeout(this.loadtimer);
this.status=2;
hide_loading();
}
var len=this.songlink.offsetWidth*(pos/dur)-614;
this.songlink.style.background="url(/images/progressbar.gif) "+len+"px center no-repeat";
}else{
if(this.status>1){
if(this.songid!=-1){
new Ajax.Request("/player/write_log?song_id="+this.songid+"&flag=0",{method:"get",asynchronous:true,evalScripts:true});
}
this.controls.innerHTML="Play";
this.stop();
}
}
var _246=this;
this.looptimer=setTimeout(function(){
_246.loop();
},200);
}
}
catch(e){
traceError("Error yobo_songPlayerLite::loop -> "+e);
return false;
}
},pause:function(){
try{
if(this.is_init){
if(this.status==2){
clearTimeout(this.looptimer);
this.status=3;
this.controls.innerHTML="<img src=\"/images/icons/songbar_play.gif\" align=\"absmiddle\" />";
var _247=this;
setTimeout(function(){
_247.flash.pause();
},0);
}
}
}
catch(e){
traceError("Error yobo_songPlayerLite::pause -> "+e);
return false;
}
},resume:function(){
try{
if(this.is_init){
if(this.status==3){
clearTimeout(this.looptimer);
this.status=2;
this.controls.innerHTML="<img src=\"/images/icons/songbar_pause.gif\" align=\"absmiddle\" />";
var _248=this;
setTimeout(function(){
_248.flash.resume();
},0);
this.looptimer=setTimeout(function(){
_248.loop();
},200);
}
}
}
catch(e){
traceError("Error yobo_songPlayerLite::resume -> "+e);
return false;
}
},stopAll:function(){
try{
if(this.is_init){
this.status=0;
clearTimeout(this.loadtimer);
clearTimeout(this.looptimer);
if(this.songlink&&this.controls){
this.songlink.style.background="url(/images/progressbar.gif) "+(this.songlink.offsetWidth-614)+"px center no-repeat";
}
var _249=this;
setTimeout(function(){
_249.flash.close();
},0);
this.url=null;
this.songid=null;
this.randnum=null;
this.controls=null;
this.songlink=null;
}
}
catch(e){
traceError("Error yobo_songPlayerLite::stopAll -> "+e);
return false;
}
}};
}
var SONG_PLAYER_LITE=new yobo_songPlayerLite();
function yobo_init_liteplayer(){
SONG_PLAYER_LITE.initPlayer();
}
function yobo_play_lite(u,s,r,c,b){
SONG_PLAYER_LITE.play(u,s,r,c,b);
}
