jquery 图片轮询

代码

#mantle
{width:710px;height:220px; border:1px #ccc solid;vertical-align:top; }

#mantle img
{clear:both;vertical-align:middle;width:470px;}
#yslider .yslider-stage
{padding:0;clear:both;float:left;width:475px;height:220px;padding-right:2px;overflow:hidden;}
#yslider .yslider-stage p
{display:none;}
#yslider .yslider-stage p.selected
{display:block;}
#yslider .yslider-stick
{ float:left;width:230px;font-size:14px; overflow:visible;}
#yslider .yslider-stick ul
{margin-left:-15px;padding:0;border:1px #ededed solid;}
#yslider .yslider-stick li
{border-top:1px solid #ededed; list-style:none; text-align:left; overflow:visible; }
#yslider .yslider-stick li a
{ text-decoration:none;overflow:visible; }
#yslider .yslider-stick span
{display: block;padding:6px 15px;text-align:left;font-size:12px; }
#yslider .yslider-stick li.first
{border-top:0;}

#yslider .yslider-stick li a
{display:block;padding:8px 0px;*padding:9px 0px 7px 0px;text-indent:15px;zoom:1;}
#yslider .yslider-stick li.selected
{background:url(images/sprites_hp.png) 8px -488px no-repeat #f6f6f6;_background-position:8px -487px;color:#000;border-left:3px solid #619d19;font-weight:bold;}
#yslider .yslider-stick li.selected a:hover
{text-decoration:none;}

 

代码

<script type="text/javascript">//<![CDATA[
var container=G("yslider");var slider=new PicSlide({container:container,pics:container.getElementsByTagName("p"),pages:container.getElementsByTagName("li"),interval:5000,eventType:"mouseover",effect:"fade"});slider.run();var container1=$("pasale");var slider1=new PicSlide({container:container1,pics:Dom.getElementsByClassName("bbp-content",container1)[0].getElementsByTagName("div"),pages:Dom.getElementsByClassName("bbp-nav",container1)[0].getElementsByTagName("li"),interval:5000,eventType:"mouseover"});slider1.run();var tabview2=new TabView({"TAB_DEACTIVE_CN":"","eventDelay":0});var nav=Dom.getElementsByClassName("hd",G("instantcard"))[0],bd=Dom.getElementsByClassName("bd",G("instantcard"))[0];var tabnodes2=nav.getElementsByTagName("li"),tabcontent2=Dom.getElementsByClassName("cls", bd);tabview2.onactive=function(C,A){var B=["lottery-selected","mobile-selected","game-selected"];if(A==0){}else{if(A==1){Recharge.initMobile("recharge-mobile");}else{Recharge.initGame("recharge-game");}}nav.className="hd "+B[A];};for(var i=0,l=tabnodes2.length;i<l;i++){tabview2.addTab({tabNode:tabnodes2[i],contentNode:tabcontent2[i]});}tabview2.setActiveTab(1);function LineMarquee(C,A,B){this.container=C;this.dur=A||3000;this.num=B||1;BBEvent.observe(window,"beforeunload",function(){this.container.scrollTop=0;}.$bind(this));BBEvent.observe(this.container,"mouseout",this.run.$bind(this));BBEvent.observe(this.container,"mouseover",function(){if(this.intId){clearInterval(this.intId);this.intId=null;}}.$bind(this));}LineMarquee.prototype=(function(){return{move:function(F){F=F||"up";var C=this.container.getElementsByTagName("li");var A=this.container.offsetHeight,E=[],B=C.length;if(B<=this.num){return ;}for(var D=0;D<this.num;D++){E.push(C[F=="up"?D:B-D-1]);}if(F=="down"||this.container.getAttribute("f")){Array.toArray(E).each(function(I){var H=this.container;if(H.tagName!="UL"){H=H.getElementsByTagName("ul")[0];}F=="up"?H.appendChild(I):H.insertBefore(I,C[0]);}.$bind(this));}new BBEffect(null,function(H){this.container.scrollTop=parseInt((F=="up"?H:(1-H))*A);}.$bind(this),300).play();this.container.setAttribute("f",1);},run:function(){if(this.intId){return ;}this.intId=setInterval(function(){this.move("up");}.$bind(this),this.dur);}};})();new LineMarquee(G("news"),3000).run();var tabview3=new TabView({"TAB_DEACTIVE_CN":"","TAB_ACTIVE_CN":"selected","events":["mouseover"],"preventDefault":true});var tabnodes3=G("popular").getElementsByTagName("li");for(var i=0;i<tabnodes3.length;i++){tabview3.addTab({tabNode:tabnodes3[i],contentNode:null});}tabview3.onactive=function(D,A){var C=D.tabNode;if(C.getElementsByTagName("img").length<1){var B=C.getElementsByTagName("a")[0];B.innerHTML='<img src="'+popularImgs[A].replace('c/s','c/t')+'" width="60" height="60">'+B.innerHTML;}};var tabview4=new TabView({"TAB_DEACTIVE_CN":"","TAB_ACTIVE_CN":"selected","events":["mouseover"],"preventDefault":true});var tabnodes4=G("recommend").getElementsByTagName("li");for(var i=0;i<tabnodes4.length;i++){tabview4.addTab({tabNode:tabnodes4[i],contentNode:null});}tabview4.onactive=function(D,A){var C=D.tabNode;if(C.getElementsByTagName("img").length<1){var B=C.getElementsByTagName("a")[0];B.innerHTML='<img src="'+recommendImgs[A].replace('c/s','c/t')+'" width="60" height="60">'+B.innerHTML;}};if(BB.Browser.ie){var catItems=Dom.getElementsByClassName("item",G("catItems"));for(i=0,j=catItems.length;i<j;i++){catItems[i].onmouseover=new Function("overItem("+i+")");catItems[i].onmouseout=new Function("outItem("+i+")");}function overItem(A){Dom.addClassName(catItems[A],"selected");}function outItem(A){Dom.removeClassName(catItems[A],"selected");}}setTimeout(function(){G("searchTextbox").focus();},0);
//]]></script>

 

代码
var BB={
VERSION:
"core-mini.2008.11.10",JSPATH:(function(){
var A=document.getElementsByTagName("script");
return A[A.length-1].src.replace(/\/[^\/]+$/,"/")+"../";
})(),Browser:(
function(){
var ua=window.navigator.userAgent.toLowerCase();
var b={
platform:window.navigator.platform,msie:
/msie/.test(ua)&&!/opera/.test(ua),opera:/opera/.test(ua),safari:/webkit/.test(ua)&&!/chrome/.test(ua),firefox:/firefox/.test(ua),chrome:/chrome/.test(ua)
};

var vMark="";
for(var i in b){
if(b[i]){
vMark
=i;
}
}
if(b.safari){
vMark
="version";
}
b.version
=(ua.match(eval("/(?:"+vMark+")[\\/: ]([\\d.]+)/"))||[])[1];
b.ie
=b.msie;
b.ie6
=b.msie&&parseInt(b.version)==6;
try{
b.maxthon
=b.msie&&!!external.max_version;
}
catch(e){
b.maxthon
=false;
}
return b;
})()
};

if(BB.Browser.ie){
try{
document.execCommand(
"BackgroundImageCache",false,true);
}
catch(e){}
}
window.Browser
=BB.Browser;
Function.prototype.$ban
=function(A,C,B,F){
F
=F||1000;
var E=this;
var D=0;
return function(){
var H=0;
switch(D){
case 0:D=1;
if(A){
A.apply(
this,arguments);
}
H
=E.apply(this,arguments);
setTimeout(
function(){
D
=0;
if(B){
B.apply(
this,arguments);
}
},F);
break;
case 1:if(C){
H
=C.apply(this,arguments);
}
break;
}
return H;
};

};

Function.prototype.$bind
=function(B){
var C=this;
var A=function(){
C.apply(B,arguments);
};

A.$unbind
=function(){
return C;
};

return A;
};

Function.prototype.$extends
=function(D){
var C=this;
var B=function(){
var E=this;
this.$super=function(){
return D.apply(E,arguments);
};

var F=C.apply(this,arguments);
this.constructor=C;
this.$class=B;
this.$super=null;
return F;
};

B.$superClass
=D;
var A=function(){};

A.prototype
=D.prototype;
B.prototype
=new A;
return B;
};

Function.K
=function(){};

Object.extendJson
=function(B,D,A){
(A
!=null)||(A=true);
for(var C in D){
if(A||typeof (B[C])=="undefined"){
B[C]
=D[C];
}
}
return B;
};

Object.keys
=function(C){
var A=[];
for(var B in C){
A.push(B);
}
return A;
};

Object.values
=function(C){
var A=[];
for(var B in C){
A.push(C[B]);
}
return A;
};

var G=$=function(A){
if("string"==typeof (A)){
return document.getElementById(A);
}
else{
return A;
}
};

Object.extendJson(Array.prototype,{
any:
function(C){
C
=C||Function.K;
var A=Array.prototype.slice.call(arguments,1);
for(var B=0;
B
<this.length;
B
++){
if(C.apply(this,[this[B],B].concat(A))){
return true;
}
}
return false;
},each:
function(E){
E
=E||Function.K;
var A=[];
var B=Array.prototype.slice.call(arguments,1);
for(var D=0;
D
<this.length;
D
++){
var C=E.apply(this,[this[D],D].concat(B));
if(C!=null){
A.push(C);
}
}
return A;
},all:
function(C){
C
=C||Function.K;
var A=Array.prototype.slice.call(arguments,1);
for(var B=0;
B
<this.length;
B
++){
if(!C.apply(this,[this[B],B].concat(A))){
return false;
}
}
return true;
},indexOf:
function(C){
var A=-1;
for(var B=0;
B
<this.length;
B
++){
if(this[B]===C){
A
=B;
break;
}
}
return A;
},contains:
function(A){
return(this.indexOf(A)>=0);
},insertAt:
function(A,B){
return this.splice(A,0,B);
},removeAt:
function(A){
return this.splice(A,1);
},remove:
function(B){
var A=this.indexOf(B);
A
>=0&&this.removeAt(A);
return A;
}
},
false);
Object.toArray
=Array.toArray=function(D){
if(!D){
return[];
}
if(D.toArray){
return D.toArray();
}
else{
var B=[];
for(var A=0,C=D.length;
A
<C;
A
++){
B.push(D[A]);
}
return B;
}
};

Array.map
=function(C,B){
var D={};

for(var E=0,A=C.length;
E
<A;
E
++){
D[C[E]]
=B[E];
}
return D;
};

Date.prototype.format
=function(B){
B
=B||"yyyy-MM-dd";
var C={
"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),"S":this.getMilliseconds()
};

if(/(y+)/.test(B)){
B
=B.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length));
}
for(var A in C){
if(new RegExp("("+A+")").test(B)){
B
=B.replace(RegExp.$1,RegExp.$1.length==1?C[A]:("00"+C[A]).substr((""+C[A]).length));
}
}
return B;
};

Object.extendJson(String.prototype,{
trim:
function(){
return this.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g,"");
},format:
function(){
if(arguments.length==0){
return this;
}
for(var B=this,A=0;
A
<arguments.length;
A
++){
B
=B.replace(new RegExp("\\{"+A+"\\}","g"),arguments[A]);
}
return B;
},camelize:
function(){
return this.replace(/\-(\w)/ig,function(B,A){
return A.toUpperCase();
});
}
},
false);
window.Node
||(window.Node={});
var Dom={
getArray:
function(D){
D
=$(D);
if(!D){
return[];
}
if(D.constructor==Array){
return D;
}
if((D.length!=undefined&&Dom.isElement(D))||Dom.isElement(D)){
return[D];
}
var B=[];
for(var C=0,A=D.length;
C
<A;
C
++){
B.push(D[C]);
}
return B;
},isElement:
function(A){
return !!(A&&A.nodeType==1);
},outerHTML:
function(A){
A
=$(A);
if(!Dom.isElement(A)){
throw new Error("Arguments el is not a Element");
}
return A.outerHTML?A.outerHTML:document.createElement("div").appendChild(A.cloneNode(true)).parentNode.innerHTML;
},getStyle:
function(C,A){
C
=$(C);
if(!Dom.isElement(C)){
throw new Error("Arguments is not a Element");
}
var D=C.style[A];
if(!D){
if(document.defaultView&&document.defaultView.getComputedStyle){
var B=document.defaultView.getComputedStyle(C,null);
D
=B?B.getPropertyValue(A):null;
}
else{
if(C.currentStyle){
D
=C.currentStyle[A.camelize()];
}
}
}
if((D=="auto")&&["width","height"].contains(A)&&(Dom.getStyle(C,"display")!="none")){
D
=C["offset"+A.capitalize()]+"px";
}
if(window.opera&&["left","top","right","bottom"].contains(A)){
if(Dom.getStyle(C,"position")=="static"){
D
="auto";
}
}
if(A=="opacity"){
if(D){
return parseInt(D);
}
if(D=(Dom.getStyle(C,"filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(D[1]){
return parseInt(D[1])/100;
}
}
return 1;
}
return D=="auto"?null:D;
},borderWidth:
function(A){
A
=$(A);
return[parseInt(Dom.getStyle(A,"border-top-width"),10)||0,parseInt(Dom.getStyle(A,"border-right-width"),10)||0,parseInt(Dom.getStyle(A,"border-bottom-width"),10)||0,parseInt(Dom.getStyle(A,"border-left-width"),10)||0];
},paddingWidth:
function(A){
A
=$(A);
return[parseInt(Dom.getStyle(A,"padding-top"),10)||0,parseInt(Dom.getStyle(A,"padding-right"),10)||0,parseInt(Dom.getStyle(A,"padding-bottom"),10)||0,parseInt(Dom.getStyle(A,"padding-left"),10)||0];
},marginWidth:
function(A){
A
=$(A);
return[parseInt(Dom.getStyle(A,"margin-top"),10)||0,parseInt(Dom.getStyle(A,"margin-right"),10)||0,parseInt(Dom.getStyle(A,"margin-bottom"),10)||0,parseInt(Dom.getStyle(A,"margin-left"),10)||0];
},setStyle:
function(A,C,B){
if(typeof C=="string"){
C
=Array.map([C],[B]);
}
Dom.getArray(A).each(
function(D){
if(!Dom.isElement(D)){
return ;
}
for(var E in C){
if("opacity"==E&&!!window.ActiveXObject){
D.style[
"filter"]="alpha(opacity="+(C[E]*100)+")";
}
else{
D.style[E.camelize()]
=C[E];
}
}
});
},setFullscreen:
function(D,F){
var E=Dom.getDocRect(F);
var A,H,B,C;
A
=H=0;
B
=E.scrollWidth;
C
=E.scrollHeight;
Dom.getArray(D).each(
function(I){
Dom.setRect(I,A,H,B,C);
});
},setCenter:
function(D,B,C){
var E=Dom.getDocRect();
var A=parseInt((E.width-B)/2)+E.scrollX;
var F=parseInt((E.height-C)/2)+E.scrollY;
if(A<=E.scrollX){
A
=E.scrollX;
}
if(F<=E.scrollY){
F
=E.scrollY;
}
Dom.getArray(D).each(
function(H){
Dom.setRect(H,A,F);
});
},setXY:
function(C,B,D,A){
B
=parseInt(B,10);
D
=parseInt(D,10);
Dom.getArray(C).each(
function(H){
if(!Dom.isElement(H)){
return ;
}
var E=Dom.getXY(H);
if(!E){
return ;
}
var F=Dom.getStyle(H,"display");
var J=Dom.getStyle(H,"position");
Dom.setStyle(H,
"display","block");
var I=[parseInt(Dom.getStyle(H,"left"),10),parseInt(Dom.getStyle(H,"top"),10)];
if(isNaN(I[0])){
I[
0]=(J=="relative")?0:H.offsetLeft;
}
if(isNaN(I[1])){
I[
1]=(J=="relative")?0:H.offsetTop;
}
if(!isNaN(B)){
H.style.left
=B+"px";
}
if(!isNaN(D)){
H.style.top
=D+"px";
}
Dom.setStyle(H,
"display",F);
});
},setSize:
function(C,A,B){
A
=parseInt(A,10);
B
=parseInt(B,10);
if(isNaN(A)&&isNaN(B)){
return ;
}
Dom.getArray(C).each(
function(E){
if(!E){
return ;
}
var D=Dom.getStyle(E,"display");
Dom.setStyle(E,{
"display":"block"
});
if(!isNaN(A)){
Dom.setStyle(E,{
"width":A+"px"
});
}
if(!isNaN(B)){
Dom.setStyle(E,{
"height":B+"px"
});
}
Dom.setStyle(E,{
"display":D
});
});
},setRect:
function(D,A,E,B,C){
A
=parseInt(A,10);
E
=parseInt(E,10);
B
=parseInt(B,10);
C
=parseInt(C,10);
if(!isNaN(A)||!isNaN(E)){
Dom.setXY(D,A,E);
}
if(!isNaN(B)||!isNaN(C)){
Dom.setSize(D,B,C);
}
},createElement:
function(B,E,C){
if(typeof E=="string"){
E
=Array.map([E],[C]);
}
if(BB.Browser.ie&&!!E["name"]){
B
="<"+B+' name="'+E["name"]+'">';
}
var A=document.createElement(B);
for(var D in E){
A[D]
=E[D];
}
return A;
},appendElement:
function(A,B){
B
=$(B);
A
=$(A);
Dom.getArray(B).each(
function(C){
A.appendChild(C);
});
},nextSibling:
function(A){
A
=$(A);
while(A&&(A=A.nextSibling)){
if(Dom.isElement(A)){
return A;
}
}
return null;
},previousSibling:
function(A){
A
=$(A);
while(A&&(A=A.previousSibling)){
if(Dom.isElement(A)){
return A;
}
}
return null;
},getElementsByClassName:
function(D,C){
C
=$(C)||document;
var B=C.getElementsByTagName("*");
var A=[];
B
=Dom.getArray(B);
B.each(
function(E){
if(Dom.hasClassName(E,D)){
A.push(E);
}
});
return A;
},contains:
function(A,B){
return A.contains?A!=B&&A.contains(B):!!(A.compareDocumentPosition(B)&16);
},getDocRect:
function(I){
var I=I||window.document;
var B=function(J){
return parseInt(J)||0;
};

var H=window.pageXOffset||Math.max(B(I.documentElement.scrollLeft),B(I.body.scrollLeft));
var F=window.pageYOffset||Math.max(B(I.documentElement.scrollTop),0);
var E=Math.max(B(I.documentElement.clientWidth),0);
var A=Math.max(B(I.documentElement.clientHeight),0);
var D=Math.max(B(I.documentElement.scrollHeight),B(I.body.offsetHeight));
var C=Math.max(B(I.documentElement.scrollWidth),B(I.body.offsetWidth));
if((!I.compatMode||I.compatMode=="CSS1Compat")&&!/opera/i.test(window.navigator.userAgent)&&I.documentElement&&I.documentElement.clientHeight){
A
=I.documentElement.clientHeight;
widht
=I.documentElement.clientWidth;
}
else{
if(I.body&&I.body.clientHeight){
A
=I.body.clientHeight;
E
=I.body.clientWidth;
}
else{
if(wnd.innerWidth&&wnd.innerHeight&&I.width){
A
=wnd.innerHeight;
E
=wnd.innerWidth;
if(I.height>A){
A
-=16;
}
if(I.width>E){
E
-=16;
}
}
}
}
if(/webkit/i.test(window.navigator.userAgent)){
D
=Math.max(D,B(I.body.scrollHeight));
}
D
=A>D?A:D;
C
=E>C?E:C;
return{
"scrollX":H,"scrollY":F,"width":E,"height":A,"scrollHeight":D,"scrollWidth":C
};

},getXY:(
function(){
if(document.documentElement.getBoundingClientRect&&!!window.ActiveXObject){
return function(C){
var E=C.getBoundingClientRect();
var D=Dom.getDocRect(C.ownerDocument);
var A=E.left-2+D.scrollX,I=E.top-2+D.scrollY;
try{
var F=C.ownerDocument.parentWindow.frameElement||null;
if(F){
var H=2-(F.frameBorder||1)*2;
A
+=H;
I
+=H;
}
}
catch(B){}
return[A,I];
};

}
else{
return function(E){
var F=[E.offsetLeft,E.offsetTop];
var B=E.offsetParent;
var D={
HYPHEN:
/(-[a-z])/i,ROOT_TAG:/^body|html$/i
};

var C=/safari/i.test(window.navigator.userAgent);
var A=(C&&Dom.getStyle(E,"position")=="absolute"&&E.offsetParent==E.ownerDocument.body);
if(B!=E){
while(B){
F[
0]+=B.offsetLeft;
F[
1]+=B.offsetTop;
if(!A&&C&&Dom.getStyle(B,"position")=="absolute"){
A
=true;
}
B
=B.offsetParent;
}
}
if(A){
F[
0]-=E.ownerDocument.body.offsetLeft;
F[
1]-=E.ownerDocument.body.offsetTop;
}
B
=E.parentNode;
while(B.tagName&&!D.ROOT_TAG.test(B.tagName)){
if(B.scrollTop||B.scrollLeft){
if(!D.OP_SCROLL.test(Dom.getStyle(B,"display"))){
if(!isOpera||Dom.getStyle(B,"overflow")!=="visible"){
F[
0]-=B.scrollLeft;
F[
1]-=B.scrollTop;
}
}
}
B
=B.parentNode;
}
return F;
};

}
})(),parentNode:
function(B,A){
B
=$(B);
A
=A.toLowerCase();
if(!A){
return B.parentNode;
}
while(B&&(B=B.parentNode)){
if(A==(B.tagName.toLowerCase())){
return B;
}
}
return null;
},getFirstChild:
function(A){
var B=A.firstChild;
return Dom.isElement(B)?B:Dom.nextSibling(B);
},getAbsolutePosition:
function(D){
D
=$(D);
var E=Dom.getXY(D);
var A=E[0];
var F=E[1];
var B=D.offsetWidth;
var C=D.offsetHeight;
return{
"width":B,"height":C,"left":A,"top":F,"bottom":F+C,"right":A+B
};

},getAbsoluteRect:
function(A){
return Dom.getAbsolutePosition(A);
},rectContains:
function(B,A){
return(B.left<=A.left&&B.right>=A.right&&B.top<=A.top&&B.bottom>=A.bottom);
},rectIntersect:
function(F,E){
var C=Math.max(F.top,E.top);
var D=Math.min(F.right,E.right);
var A=Math.min(F.bottom,E.bottom);
var B=Math.max(F.left,E.left);
if(A>=C&&D>=B){
return new Math.Rectangle(C,D,A,B);
}
else{
return null;
}
},clearPosition:
function(A){
Dom.getArray(A).each(
function(B){
B.style.top
=B.style.left=B.style.bottom=B.style.right="";
});
},recursivelyCollect:
function(A,C){
A
=$(A);
var B=[];
while(A=A[C]){
if(Dom.isElement(A)){
B.push(A);
}
}
return B;
},pluckWhiteNode:
function(B){
var A=[];
Dom.getArray(B).each(
function(C){
if(Dom.isElement(C)){
A.push(C);
}
});
return A;
},insertAdjacentHTML:
function(A,D,C){
if(A.insertAdjacentHTML){
A.insertAdjacentHTML(D,C);
}
else{
var E;
var B=A.ownerDocument.createRange();
switch(String(D).toLowerCase()){
case"beforebegin":B.setStartBefore(A);
E
=B.createContextualFragment(C);
A.parentNode.insertBefore(E,A);
break;
case"afterbegin":B.selectNodeContents(A);
B.collapse(
true);
E
=B.createContextualFragment(C);
A.insertBefore(E,A.firstChild);
break;
case"beforeend":B.selectNodeContents(A);
B.collapse(
false);
E
=B.createContextualFragment(C);
A.appendChild(E);
break;
case"afterend":B.setStartAfter(A);
E
=B.createContextualFragment(C);
A.parentNode.insertBefore(E,A.nextSibling);
break;
}
}
},show:
function(A,B){
Dom.getArray(A).each(
function(C){
C.style.display
=B||"";
});
},hide:
function(A){
Dom.getArray(A).each(
function(B){
B.style.display
="none";
});
},isVisible:
function(A){
return $(A).style.display!="none";
},removeNode:
function(A){
Dom.getArray(A).each(
function(B){
if(B&&B.parentNode){
B.parentNode.removeChild(B);
}
});
},hasClassName:
function(A,B){
return new RegExp("(?:^|\\s)"+B+"(?:\\s|$)","i").test(A.className);
},addClassName:
function(A,B){
Dom.getArray(A).each(
function(C){
if(!C){
return ;
}
if(Dom.hasClassName(C,B)){
return C;
}
C.className
=(C.className+" "+B).trim();
});
},removeClassName:
function(A,B){
Dom.getArray(A).each(
function(C){
if(!Dom.hasClassName(C,B)){
return C;
}
C.className
=C.className.replace(new RegExp("(?:\\s|^)"+B+"(?:\\s|$)","i")," ").trim();
});
},replaceClassName:
function(C,B,A){
Dom.getArray(C).each(
function(D){
if(B.trim()!=""){
Dom.removeClassName(D,B);
}
if(A.trim()!=""){
Dom.addClassName(D,A);
}
});
},formURIEncode:
function(I,J){
var F=I.elements;
var C=","+(J||"")+",";
var K=[];
for(var H=0;
H
<F.length;
H
++){
var D=F[H];
var B=D.name;
if(D.disabled||!B||C.indexOf(","+B+",")>-1){
continue;
}
switch(D.type){
case"text":case"hidden":case"password":case"textarea":K.push(B+"="+encodeURIComponent(D.value));
break;
case"radio":case"checkbox":if(D.checked){
K.push(B
+"="+encodeURIComponent(D.value));
}
break;
case"select-one":if(D.selectedIndex>-1){
K.push(B
+"="+encodeURIComponent(D.value));
}
break;
case"select-multiple":var A=D.options;
for(var E=0;
E
<A.length;
E
++){
if(A[E].selected){
K.push(B
+"="+encodeURIComponent(A[E].value));
}
}
break;
}
}
return K.join("&");
}
};

Math.Rectangle
=function(B,C,D,A){
this.top=C;
this.right=D;
this.bottom=A;
this.left=B;
return this;
};

Math.Rectangle.prototype
={
contains:
function(A){
return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);
},intersect:
function(E){
var C=Math.max(this.top,E.top);
var D=Math.min(this.right,E.right);
var A=Math.min(this.bottom,E.bottom);
var B=Math.max(this.left,E.left);
if(A>=C&&D>=B){
return new Math.Rectangle(C,D,A,B);
}
else{
return null;
}
},getRegion:
function(E){
var F=Dom.getXY(E);
var C=F[1];
var B=F[0];
var A=E.offsetWidth+B;
var D=E.offsetHeight+C;
return new Dom.Region(B,C,A,D);
}
};

if(!document.DOMLoaded){
document.DOMLoaded
=function(C){
var D,B=false;
function A(){
if(!B){
B
=true;
if(D){
clearInterval(D);
}
if(C){
C();
}
}
}
if(document.addEventListener){
if(/webkit/i.test(window.navigator.userAgent)){
D
=window.setInterval(function(){
if(/loaded|complete/.test(document.readyState)){
A();
}
},
10);
BBEvent.observe(window,
"load",A);
}
else{
document.addEventListener(
"DOMContentLoaded",A,false);
}
}
else{
D
=window.setInterval(function(){
try{
document.body.doScroll(
"left");
A();
}
catch(E){}
},
10);
}
};

}
if(!window.BBEvent){
var BBEvent={};

}
BBEvent.target
=function(A){
A
=A||window.event;
return A.target||A.srcElement;
};

BBEvent.isLeftClick
=function(A){
A
=A||window.event;
return(((A.which)&&(A.which==1))||((A.button)&&(A.button==1)));
};

BBEvent.pageX
=function(A){
A
=A||window.event;
return A.pageX||(A.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
};

BBEvent.pageY
=function(A){
A
=A||window.event;
return A.pageY||(A.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
};

BBEvent.pagePosition
=function(A){
A
=A||window.event;
return{
x:BBEvent.pageX(A),y:BBEvent.pageY(A)
};

};

BBEvent.layerX
=function(A){
A
=A||window.event;
return A.layerX||A.offsetX;
};

BBEvent.layerY
=function(A){
A
=A||window.event;
return A.layerY||A.offsetY;
};

BBEvent.layerPosition
=function(A){
A
=A||window.event;
return{
x:BBEvent.layerX(A),y:BBEvent.layerY(A)
};

};

BBEvent.preventDefault
=function(A){
A
=A||window.event;
if(A.preventDefault){
A.preventDefault();
}
else{
A.returnValue
=false;
}
};

BBEvent.stopPropagation
=function(A){
A
=A||window.event;
if(A.stopPropagation){
A.stopPropagation();
}
else{
A.cancelBubble
=true;
}
};

BBEvent.observe
=function(D,C,B,E,A){
C
=C.replace(/^on/g,"");
var D=$(D);
A
=A||false;
if(E){
B
=B.$ban(null,function(F){
BBEvent.preventDefault(F);
},
null,E);
}
if(C=="keypress"&&(Browser.gecko||Browser.safari)){
C
="keydown";
}
if(D.addEventListener){
D.addEventListener(C,B,A);
}
else{
if(D.attachEvent){
D.attachEvent(
"on"+C,B);
}
}
};

BBEvent.stopObserving
=function(D,C,B,A){
C
=C.replace(/^on/g,"");
var D=$(D);
A
=A||false;
if(C=="keypress"&&(Browser.gecko||Browser.safari)){
C
="keydown";
}
if(D.removeEventListener){
D.removeEventListener(C,B,A);
}
else{
if(D.detachEvent){
D.detachEvent(
"on"+C,B);
}
}
};

BBEvent.fireEvent
=function(B,C){
C
=C.replace(/^on/g,"");
B
=$(B);
if(B.fireEvent){
B.fireEvent(
"on"+C);
}
else{
if(C=="keypress"&&(Browser.gecko||Browser.safari)){
C
="keydown";
}
if(C.indexOf("mouse")>-1||",click,dblclick".indexOf(","+C)>-1){
var A=B.ownerDocument.createEvent("MouseEvents");
A.initMouseEvent(C,
true,true,B.ownerDocument.defaultView,1,0,0,0,0,false,false,false,false,0,null);
}
else{
var A=B.ownerDocument.createEvent("Events");
A.initEvent(C,
true,true,B.ownerDocument.defaultView);
}
B.dispatchEvent(A);
}
};

if(!window.CustEvent){
var CustEvent={};

}
CustEvent._srcObjs
=[];
CustEvent._registeredEvents
=[];
CustEvent.observe
=function(D,F,C){
F
=F.toLowerCase().replace(/^on/g,"");
var A=CustEvent._srcObjs.indexOf(D);
if(A>-1){
var B=CustEvent._registeredEvents[A];
var E=B[F];
if(E){
E.remove(C);
E.push(C);
}
else{
B[F]
=[C];
}
}
else{
CustEvent._srcObjs.push(D);
var B={};

B[F]
=[C];
CustEvent._registeredEvents.push(B);
}
};

CustEvent.stopObserving
=function(F,H,C){
H
=H.toLowerCase().replace(/^on/g,"");
var A=CustEvent._srcObjs.indexOf(F);
if(A<0){
return ;
}
var B=CustEvent._registeredEvents[A];
if(B[H]){
if(C){
B[H].remove(C);
}
else{
B[H].length
=0;
}
}
var E=false;
for(var D in B){
if(B[D]&&B[D].length>0){
E
=true;
break;
}
}
if(!E){
CustEvent._srcObjs.removeAt(A);
CustEvent._registeredEvents.removeAt(A);
}
};

CustEvent.fireEvent
=function(F,H){
var D=Array.toArray(arguments);
D.splice(
0,2);
D.push(H);
H
=H.toLowerCase().replace(/^on/g,"");
if(F["on"+H]){
F[
"on"+H].apply(F,D);
}
var A=CustEvent._srcObjs.indexOf(F);
if(A<0){
return ;
}
var C=CustEvent._registeredEvents[A];
var B=C[H];
if(B){
for(var E=0;
E
<B.length;
E
++){
B[E].apply(F,D);
}
}
};

var BBEffect=function(A,D,B,C){
this.srcObj=A;
this.eftFun=D;
this.dur=B;
this.opts=C||{};

this.status=0;
this._startDate=0;
this._costDur=0;
};
(
function(){
var A=BBEffect;
var E=CustEvent;
A.VERSION
="0.0.1";
A.EVENTS
=["onbeforeplay","onplay","onstep","onpause","onresume","onstop","onsuspend","onreset"];
A.STEP_TIME
=28;
var B=0;
var C=[];
var F=function(){
for(var I=0;
I
<C.length;
I
++){
var H=C[I];
if(H.status!=1){
C.remove(H);
I
--;
continue;
}
H.step();
}
if(!C.length){
window.clearInterval(B);
B
=0;
}
};

var D=function(H){
if(H){
H.step();
if(!C.contains(H)){
C.push(H);
}
}
if(!B){
B
=window.setInterval(F,A.STEP_TIME);
}
};

A.prototype
={
play:
function(){
var I=this;
var H=C.indexOf(I);
if(H>-1){
I.stop();
}
CustEvent.fireEvent(I,
"onbeforeplay");
I._startDate
=new Date();
if(I.opts.byStep){
I._currentStep
=0;
I._totalStep
=this.dur/A.STEP_TIME;
}
I.status
=1;
CustEvent.fireEvent(I,
"onplay");
D(I);
return true;
},step:
function(){
var I=this;
if(I.opts.byStep){
var H=I._currentStep++/I._totalStep;
}else{
H
=(new Date()-I._startDate)/I.dur;
}
if(H>=1){
this.suspend();
}
else{
I.eftFun(H);
CustEvent.fireEvent(I,
"onstep");
}
},stop:
function(){
this._startDate=0;
this._costDur=0;
this.status=8;
CustEvent.fireEvent(
this,"onstop");
},suspend:
function(){
this.eftFun(1);
this.status=2;
CustEvent.fireEvent(
this,"onsuspend");
},pause:
function(){
this._costDur=new Date()-this._startDate;
this.status=4;
CustEvent.fireEvent(
this,"onpause");
},resume:
function(){
if(this.status==4){
this._startDate=new Date()-this._costDur;
this.status=1;
CustEvent.fireEvent(
this,"onresume");
}
D(
this);
},reset:
function(){
this._startDate=new Date();
this._costDur=0;
this._currentStep=0;
this.eftFun(0);
CustEvent.fireEvent(
this,"onreset");
}
};

})();
function CssEffect(A,B,C){
var D=this.efObj=new BBEffect(A,CssEffect.simpleEftFun,B,C);
D.onbeforeplay
=CssEffect.onbeforeplay;
D.onsuspend
=CssEffect.onsuspend;
return D;
}
CssEffect.simpleEftFun
=function(A){
var D=this.opts.alterableCss;
if(D){
for(var C in D){
var F=D[C];
if(F[2]==null){
F[
2]=0;
}
if(F[3]==null){
F[
3]=1;
}
if(A<F[2]){
continue;
}
var K=Math.min(1,(A-F[2])/(F[3]-F[2]));
if(F[0].constructor==Number){
Dom.setStyle(
this.srcObj,C,F[0]+K*(F[1]-F[0]));
}
else{
if(F[0].indexOf("px")>-1){
if(F[1]==null){
if(C=="top"||C=="left"||C=="width"||C=="height"){
F[
1]=Dom.getAbsoluteRect(this.srcObj)[C]+"px";
}
}
Dom.setStyle(
this.srcObj,C,(parseInt(F[1])+K*(parseInt(F[0])-parseInt(F[1]))).toFixed(0)+"px");
}
else{
if(F[0].indexOf("#")>-1){
var J=F[1].match(/\w\w/g);
var I=F[0].match(/\w\w/g);
var E=[];
for(var B=0;
B
<3;
B
++){
var H=Math.round(parseInt(J[B],16)+K*(parseInt(I[B],16)-parseInt(J[B],16)));
E[B]
=H>15?H.toString(16):"0"+H.toString(16);
}
Dom.setStyle(
this.srcObj,C,"#"+E.join(""));
}
}
}
}
}
};

CssEffect.onbeforeplay
=function(){
var B=this.opts.initialCss;
if(B){
for(var A in B){
Dom.setStyle(
this.srcObj,A,B[A]);
}
}
};

CssEffect.onsuspend
=function(){
var B=this.opts.finalCss;
if(B){
for(var A in B){
Dom.setStyle(
this.srcObj,A,B[A]);
}
}
};

BBEffect.changeDisplay
=function(B,K,J,A,N){
var F=B.style;
if(K==null){
K
=(F.display=="none");
}
if(!J){
F.display
=K?"":"none";
return ;
}
var E=B._changeDisplayEf;
if(E&&E.isPlaying){
E.suspend();
}
if(K==(F.display!="none")){
return ;
}
if(K&&F.display=="none"){
F.display
="";
}
var H=Dom.borderWidth(B);
var C=Dom.paddingWidth(B);
var L={
display:
"block"
};

var I={};

var D={
display:(K
?"block":"none")
};

if(J&1){
if(K){
L.width
="2px";
}
var O=B.offsetWidth-H[1]-H[3]-C[1]-C[3];
I.width
=K?[O+"px","2px"]:["2px",O+"px"];
D.width
=F.width;
}
if(J&2){
if(K){
L.height
="2px";
}
var M=B.offsetHeight-H[0]-H[0]-C[0]-C[2];
I.height
=K?[M+"px","2px"]:["2px",M+"px"];
D.height
=F.height;
}
if(J&4){
I.opacity
=K?[0,1]:[1,0];
D.filter
=null;
}
if(J&8){
var M=B.offsetHeight-H[0]-H[0]-C[0]-C[2];
if(K){
L.height
="2px";
L.opacity
=0;
}
I.height
=K?[M+"px","2px",0,0.6]:["2px",M+"px",0.4,1];
I.opacity
=K?[0,1,0.4,1]:[1,0,0,0.6];
D.height
=F.height;
D.filter
=null;
}
if(K){
F.display
="none";
}
E
=new CssEffect(B,A||500,{
initialCss:L,alterableCss:I,finalCss:D
});
if(N){
CustEvent.observe(E,
"onsuspend",function(){
N.call(B,K);
CustEvent.stopObserving(
this,"onsuspend");
});
}
B._changeDisplayEf
=E;
E.play();
};

BBEffect.toggleDisplay
=function(C,B,A,D){
BBEffect.changeDisplay(C,
null,B,A,D);
};

BBEffect.shine4Error
=function(C,B){
var A=new CssEffect(C,B||500,{
initialCss:{
backgroundColor:
"#FFF"
},alterableCss:{
backgroundColor:[
"#FF6666","#FFFFFF"]
},finalCss:{
backgroundColor:
""
}
});
A.play();
};

function Panel(D,C){
if(!document.body){
throw new Error(["Panel","create error","Document body not found or not loaded!"]);
}
return this._initPanel.apply(this,arguments);
}
Panel.prototype
=(function(){
var D=100;
var C=0;
return{
useIframe:
null,draggable:false,resizable:false,panelRect:{},PANEL_CLASS:"panel",IFRAME_CLASS:"panel-iframe",INNER_CLASS:"panel-content",_panel:null,_visible:false,_inner:null,_iframe:null,_initialized:false,_initPanel:function(A,B){
if(this._initialized){
return this;
}
if(Dom.isElement(A)){
this.renderPanel(A);
Object.extendJson(
this,B||{});
}
else{
Object.extendJson(
this,A||{});
this._createPanel();
}
this.setPanelVisible(false);
this._initialized=true;
if(!this._panel.id){
this._panel.id="BAIDU_PANEL_"+(C++);
}
return this;
},_createPanel:
function(){
this._panel=Dom.createElement("div","className",this.PANEL_CLASS);
this._inner=Dom.createElement("div","className",this.INNER_CLASS);
this._panel.appendChild(this._inner);
if(this.useIframe){
this._createIframe();
}
document.body.appendChild(
this._panel);
},setStyle:
function(A,B){
Dom.setStyle(
this._panel,A,B);
return this;
},addClassName:
function(A){
Dom.addClassName([
this._panel,this._iframe],A);
},resetClassName:
function(){
this._panel.className=this.PANEL_CLASS;
},getPanel:
function(){
return this._panel;
},getIframe:
function(){
return this._iframe;
},_createIframe:
function(){
this._iframe=Dom.createElement("iframe",{
className:
this.IFRAME_CLASS,frameBorder:0,src:(window.location.protocol.toLowerCase()=='http:'?'about:blank':BB.JSPATH+'util/panel/blank.html')
});
this._panel.appendChild(this._iframe);
},saveRect:
function(I,A,H,B){
I
=parseInt(I,10);
A
=parseInt(A,10);
H
=parseInt(H,10);
B
=parseInt(B,10);
if(!isNaN(I)){
this.panelRect.left=I;
}
if(!isNaN(A)){
this.panelRect.top=A;
}
if(!isNaN(H)){
this.panelRect.width=H;
}
if(!isNaN(B)){
this.panelRect.height=B;
}
return this.panelRect;
},setPanelRect:
function(I,A,H,B){
Dom.setRect(
this._panel,I,A,H,B);
if(B==null&&H!=null){
B
=this.getPanelAutoHeight(H);
}
this.saveRect(I,A,H,B);
return this;
},setPanelSize:
function(B,A){
this.saveRect(null,null,B,A);
Dom.setSize([
this._panel],B,A);
return this;
},setPanelXY:
function(B,A){
this.saveRect(B,A);
Dom.setXY(
this._panel,B,A);
return this;
},setPanelFullscreen:
function(){
Dom.setFullscreen(
this._panel);
return this;
},getPanelAutoHeight:
function(M){
var N=this._panel;
var K=Dom.getStyle(N,"display");
Dom.setStyle(N,
"width",M+"px");
if(K=="none"){
Dom.setStyle(N,
"display","block");
}
var A=Dom.paddingWidth(N);
var J=Dom.borderWidth(N);
var L=A[0]+A[2]+J[0]+J[2];
var B=N.offsetHeight-L;
Dom.setStyle(N,
"display",K);
return B;
},setPanelCenter:
function(B,A){
if(!isNaN(parseInt(B))){
A
=this.getPanelAutoHeight(B);
}
this.saveRect(null,null,B,A);
Dom.setCenter([
this._panel],B,A);
return this;
},appendToPanel:
function(A){
this._panel.appendChild(A);
},appendToContent:
function(A){
this._inner.appendChild(A);
},showPanel:
function(J,A,I,B,H){
H
=$(H);
if(Dom.isElement(H)){
J
=parseInt(J,10)||0;
A
=parseInt(A,10)||0;
p
=Dom.getAbsolutePosition(H);
J
+=p.left;
A
+=p.top;
}
this.setPanelRect.apply(this,arguments);
this.setPanelVisible(true);
},autoAdjustPanelPosition:
function(){
var A=Dom.getAbsolutePosition(this._panel);
var F=Dom.borderWidth(this._panel);
var B=Dom.getDocRect();
if(A.left<B.scrollX){
this.setStyle({
left:B.scrollX
+"px"
});
}
if(A.top<B.scrollY){
this.setStyle({
top:B.scrollY
+"px"
});
}
if(A.right>B.width+B.scrollX){
this.setStyle({
left:(B.width
+B.scrollX-A.width-F[1]-F[3])+"px"
});
}
if(A.bottom>B.height+B.scrollY){
this.setStyle({
top:(B.height
+B.scrollY-A.height-F[0]-F[2])+"px"
});
}
},setPanelVisible:
function(B,A){
B
=(B===false?"none":"block");
if("block"===B&&!A){
Dom.setStyle(
this._panel,"zIndex",D++);
}
Dom.setStyle(
this._panel,"display",B);
},hidePanel:
function(){
this.setPanelVisible(false);
},renderPanel:
function(B){
var A=Dom.getElementsByClassName(this.INNER_CLASS,B);
if(!A||!Dom.isElement(A[0])){
throw new Error(["Panel","render error","Panel inner is not a HTMLElement!"]);
}
this._panel=B;
this._inner=A[0];
return this;
},detectPanel:
function(){
if(!this._panel||!!!$(this._panel.id)){
alert(
'�ܱ�Ǹ���������޷���ʹ�á�\n���������������������"����������ع���"���볢�Թرոù��ܺ����ԡ�\n\n��ιر�"����������ع���"����İ�������FAQ��');
this.dispose();
return false;
}
return true;
},disposePanel:
function(){
Dom.removeNode(
this._iframe);
Dom.removeNode(
this._inner);
Dom.removeNode(
this._panel);
this._iframe=this._inner=this._panel=null;
if("function"==typeof CollectGarbage){
CollectGarbage();
}
},detect:
function(){
return this.detectPanel();
},show:
function(){
if(!this.detect()){
return ;
}
this.showPanel();
if(!this.detect()){
return ;
}
},render:
function(){
this.renderPanel.apply(this,arguments);
},contains:
function(A){
return Dom.contains(this._panel,A);
},hide:
function(){
return this.hidePanel();
},dispose:
function(){
return this.disposePanel();
},isVisible:
function(){
return this._visible;
}
};

})();
function BasePopup(D,C){
this.initPopup.apply(this,arguments);
return this;
}
BasePopup.prototype
=(function(){
return{
center:
false,shadow:false,cue:false,corner:false,resizable:false,draggable:false,buttons:null,header:true,body:true,footer:true,className:"panel-t2",width:null,height:null,left:null,top:null,useIframe:null,close:false,useEscKey:false,autoPosition:true,caption:"",content:"",_popup:null,_header:null,_body:null,_footer:null,_close:null,_resize:null,_shadow:null,_cue:null,_oDD:null,_corners:[],_initialized:false,_timer:null,_delay:300,_visible:false,BD_CLASS:"bd",FT_CLASS:"ft",HD_CLASS:"hd",SHADOW_CLASS:"shadow",CLOSE_CLASS:"close",RESIZE_CLASS:"resize",initPopup:function(D,C){
if(Dom.isElement(D)){
this.render(D);
Object.extendJson(
this,C||{});
}
else{
this.applyConfig(D);
}
this._addPopupEvent();
this._initialized=true;
return this;
},getPopup:
function(){
return this._popup._panel;
},_addPopupEvent:
function(){
var I=this;
var E=function(){
I._timer
=setTimeout(function(){
clearTimeout(I._timer);
if(!I.isVisible()){
return ;
}
CustEvent.fireEvent(I,
"windowresize");
},I._delay);
};

var H=function(A){
A
=window.event||A;
keycode
=A.keyCode||A.which;
if(keycode==27&&I.useEscKey){
I.hide();
}
};

var F=function(A){
I.dispose();
};

if(!BB.Browser.mozilla){
BBEvent.observe(window,
"unload",F);
}
BBEvent.observe(window,
"resize",E);
BBEvent.observe(document,
"keydown",H);
},removeElements:
function(){
Dom.removeNode([
this._corners[0],this._corners[1],this._resize,this._shadow,this._cue,this._close]);
if(this._footer){
this._footer.innerHTML="";
}
},createContainer:
function(){
if(this._initialized==false){
if(this.useIframe!=null){
useIframe
=this.useIframe;
}
else{
useIframe
=BB.Browser.ie&&BB.Browser.version<7;
}
this._popup=new Panel({
useIframe:useIframe
});
this._popup.setStyle("position","absolute");
if(this.header){
this._header=Dom.createElement("div","className",this.HD_CLASS);
this._popup.appendToContent(this._header);
}
if(this.body){
this._body=Dom.createElement("div","className",this.BD_CLASS);
this._popup.appendToContent(this._body);
}
if(this.footer){
this._footer=Dom.createElement("div","className",this.FT_CLASS);
this._popup.appendToContent(this._footer);
}
}
this._popup.resetClassName();
this._popup.addClassName(this.className);
},appendToBody:
function(B){
this._body.appendChild(B);
},appendToHeader:
function(B){
this._header.appendChild(B);
},appendToFooter:
function(B){
this._footer.appendChild(B);
},initDraggable:
function(){},applyConfig:function(D){
this.removeElements();
Object.extendJson(
this,D);
this.createContainer();
this.createButtons();
this.createCorners();
this.createDirArrow();
this.createShadow();
this.createCloseBtn();
if(this.caption){
this.setCaption(this.caption);
}
if(this.content){
this.setContent(this.content);
}
try{
this.createResizable();
this.initDraggable();
}
catch(C){
CustEvent.fireEvent(
this,"exception",{
message:
"BasePopup",description:C.message+"\n DragDrop.js not loaded"
});
}
return this;
},createButtons:
function(){
if(this.buttons&&this._footer){
var E=this.buttons;
var D=E.length;
for(var F=0;
F
<D;
F
++){
Dom.appendElement(
this._footer,Dom.createElement("button",E[F]));
}
}
},createResizable:
function(){
if(this.resizable){
var B=this;
this._resize=Dom.createElement("span","className",this.RESIZE_CLASS);
this._popup.appendToPanel(this._resize);
this._resize.onmouseover=function(){
this.style.cursor="se-resize";
};

this._rsz=new DDProxy({
sourceEl:
this._popup.getPanel(),handleEl:this._resize
});
this._rsz.resizeSize=true;
CustEvent.observe(
this._rsz,"dragStart",function(){
B._rsz.minWdith
=B._popup.panelRect.width;
});
CustEvent.observe(
this._rsz,"dragEnd",function(){});
}
},createCloseBtn:
function(){
if(this.close){
var C=this;
this._close=Dom.createElement("span","className",this.CLOSE_CLASS);
var D=function(){
C.hide();
};

BBEvent.observe(
this._close,"click",D);
this._popup.appendToPanel(this._close);
}
},createShadow:
function(){
if(this.shadow){
this._shadow=Dom.createElement("span","className","sd");
this._popup.appendToPanel(this._shadow);
}
},createCorners:
function(){
if(this.corner){
this._corners[0]=Dom.createElement("span","className","co1");
this._corners[1]=Dom.createElement("span","className","co2");
this._corners[0].innerHTML=this._corners[1].innerHTML="<span></span>";
this._popup.appendToPanel(this._corners[0]);
this._popup.appendToPanel(this._corners[1]);
}
},createDirArrow:
function(){
if(this.cue){
this._cue=Dom.createElement("span","className","cue");
this._popup.appendToPanel(this._cue);
}
},setContent:
function(B){
if(typeof B=="object"){
this._body.innerHTML="";
this.appendToBody(B);
}
else{
this._body.innerHTML=B;
}
return this._body;
},setCaption:
function(B){
if(this._header){
this._header.innerHTML="<h3>"+B+"</h3>";
}
},setHeader:
function(B){
this.setCaption(B);
},setFooter:
function(B){
if(this._footer){
this._footer.innerHTML=B;
}
},setPopupCenter:
function(C,D){
this._popup.setPanelCenter(C,D);
return this._popup;
},showPopup:
function(F,H,K,I,J){
F
=F||this.left;
H
=H||this.top;
K
=K||this.width;
I
=I||this.height;
this._popup.showPanel(F,H,K,I,J);
if(this.center&&!Dom.isElement(J)){
F
=F||K||this._popup.panelRect.width;
H
=H||I||this._popup.panelRect.height;
this.setPopupCenter(F,H);
}
if(!this.center&&this.autoPosition){
this.adjustPosition();
}
if(isNaN(parseInt(K,10))){
K
=this._popup._panel.offsetWidth;
Dom.setStyle(
this._shadow,"width",K);
}
return this._popup;
},renderPopup:
function(L){
this._popup=new Panel(L);
this._popup.setStyle("position","absolute");
var Q=this;
var M=parseInt(Dom.getStyle(L,"width"),10)||0;
if(M){
this.width=M;
}
var P=Dom.getElementsByClassName(this.SHADOW_CLASS,L);
var K=Dom.getElementsByClassName(this.HD_CLASS,L);
var J=Dom.getElementsByClassName(this.BD_CLASS,L);
var O=Dom.getElementsByClassName(this.FT_CLASS,L);
var N=Dom.getElementsByClassName(this.CLOSE_CLASS,L);
if(!J){
throw new Error(["Popup","render error","Panel body HTMLElement can not be rendered!"]);
}
this._shadow=P?P[0]:null;
this._header=K?K[0]:null;
this._body=J?J[0]:null;
this._footer=O?O[0]:null;
this._close=N?N[0]:null;
if(this._close){
var R=function(){
Q.hide();
};

BBEvent.observe(
this._close,"click",R);
}
return this;
},hidePopup:
function(){
this._popup.hidePanel();
return this._popup;
},getRect:
function(){
return this._popup.panelRect;
},getBounds:
function(){
return this.getRect();
},setPopupRect:
function(){
return this._popup.setPanelRect.apply(this._popup,arguments);
},adjustPosition:
function(){
this._popup.autoAdjustPanelPosition();
},disposePopup:
function(){
Dom.removeNode([
this._header,this._body,this._footer,this._cue,this._shadow,this._resize,this._close,this._corners[0],this._corners[1]]);
if(this._popup){
this._popup.disposePanel();
}
this._header=this._body=this._footer=null;
this._cue=this._shadow=this._resize=this._close=null;
if("function"==typeof CollectGarbage){
CollectGarbage();
}
},detectPopup:
function(){
var B=this._popup.detectPanel();
if(!B){
this.dispose();
}
return B;
},show:
function(){
if(!this.detect()){
return ;
}
CustEvent.fireEvent(
this,"beforeshow");
this.showPopup.apply(this,arguments);
this._visible=true;
CustEvent.fireEvent(
this,"aftershow");
if(!this.detect()){
return ;
}
},detect:
function(){
return this.detectPopup();
},hide:
function(){
if(!this.detect()){
return ;
}
CustEvent.fireEvent(
this,"beforehide");
this.hidePopup();
this._visible=false;
CustEvent.fireEvent(
this,"afterhide");
if(!this.detect()){
return ;
}
},contains:
function(B){
return this._popup.contains(B);
},isVisible:
function(){
return this._visible;
},render:
function(){
return this.renderPopup.apply(this,arguments);
},dispose:
function(){
this.disposePopup();
}
};

})();
var LayerPopup=function(B){
this.$super.apply(this,arguments);
this._addLayerPopupListener();
if(this.timeoutListener){
this._initTimeoutListener();
}
return this;
}.$extends(BasePopup);
Object.extendJson(LayerPopup.prototype,(
function(){
return{
hideTimeout:
500,showTimeout:500,hideTimer:null,timeoutListener:false,_isInitTimeoutLsr:false,showTimer:null,_addLayerPopupListener:function(){
var C=this;
var D=function(A){
A
=window.event||A;
var B=BBEvent.target(A);
if(!C._popup.contains(B)&&C.isVisible()){
if(C.isVisible()){
CustEvent.fireEvent(C,
"blur");
C.hide();
}
}
};

CustEvent.observe(
this,"aftershow",function(){
BBEvent.stopObserving(document,
"mousedown",D);
BBEvent.stopObserving(document,
"keyup",D);
BBEvent.observe(document,
"mousedown",D);
BBEvent.observe(document,
"keyup",D);
});
},_initTimeoutListener:
function(){
if(!this._isInitTimeoutLsr){
var B=this;
BBEvent.observe(
this.getPopup(),"mouseover",function(){
CustEvent.fireEvent(B,
"aftermouseover");
B.clearAllTimeout();
});
BBEvent.observe(
this.getPopup(),"mouseout",function(){
CustEvent.fireEvent(B,
"aftermouseout");
B.delayHide();
});
this._isInitTimeoutLsr=true;
}
},delayHide:
function(D){
this._initTimeoutListener();
this.hideTimeout=parseInt(D,10)||this.hideTimeout;
this.clearAllTimeout();
var C=this;
this.hideTimer=setTimeout(function(){
C.hide();
},
this.hideTimeout);
},delayShow:
function(){
this._initTimeoutListener();
var C=this;
var D=arguments;
this.clearAllTimeout();
this.showTimer=setTimeout(function(){
C.show.apply(C,D);
},
this.showTimeout);
},clearAllTimeout:
function(){
clearTimeout(
this.hideTimer);
clearTimeout(
this.showTimer);
},show:
function(){
if(!this.detect()){
return ;
}
this.clearAllTimeout();
CustEvent.fireEvent(
this,"beforeshow");
this.showPopup.apply(this,arguments);
this._visible=true;
CustEvent.fireEvent(
this,"aftershow");
if(!this.detect()){
return ;
}
},hide:
function(){
this.clearAllTimeout();
CustEvent.fireEvent(
this,"beforehide");
this.hidePopup();
this._visible=false;
CustEvent.fireEvent(
this,"afterhide");
}
};

})());
var Dialog=function(B){
B
=B||{};

this._initDialog(B);
return this;
}.$extends(BasePopup);
Object.extendJson(Dialog.prototype,{
close:
true,modal:true,fixedMaskFs:true,center:true,shadow:true,useEscKey:true,header:true,body:true,footer:true,content:"",caption:"",_mask:null,MASK_CLASS:"mask",_initDialog:function(E){
var F=false;
this._mask=new Panel({
useIframe:
!!window.ActiveXObject
});
this._mask.addClassName(this.MASK_CLASS);
this._mask.setStyle("position","absolute");
E.className
=E.className||"panel-t1";
E.useIframe
=E.useIframe||false;
this.$super(E);
this._addPopupEvent();
var D=this;
CustEvent.observe(
this,"windowresize",function(){
if(D.fixedMaskFs){
D.setMaskFullscreen();
}
});
return this;
},setMaskFullscreen:
function(){
this._mask.setPanelFullscreen();
},setDialogCenter:
function(F,H,K,I,J){
this.setPopupCenter.apply(this,arguments);
},showDialog:
function(F,H,K,I,J){
if(this.modal){
this._mask.showPanel();
}
else{
this._mask.hidePanel();
}
this.showPopup(F,H,K,I,J);
if(this.fixedMaskFs){
this._mask.setPanelFullscreen();
}
return this;
},setDialogRect:
function(){
return this.setPopupRect.apply(this,arguments);
},showMask:
function(){
this._mask.showPanel.apply(this._mask,arguments);
return this._mask;
},hideMask:
function(){
this._mask.hidePanel();
return this._mask;
},hideDialog:
function(){
this.hidePopup();
this.hideMask();
},show:
function(){
if(!this.detect()){
return ;
}
CustEvent.fireEvent(
this,"beforeshow");
this.showDialog.apply(this,arguments);
this._visible=true;
CustEvent.fireEvent(
this,"aftershow");
if(!this.detect()){
return ;
}
},hide:
function(){
CustEvent.fireEvent(
this,"beforehide");
this.hideDialog();
this._visible=false;
CustEvent.fireEvent(
this,"afterhide");
},dispose:
function(){
this.disposePopup();
this._mask.dispose();
}
});
function TabViewGroup(A){
if(!A.tabNode){
throw new Error(["TabViewGroup","constructor","tabNode must be a HTMLElement"]);
}
this.tabNode=A.tabNode;
this.disabled=A.disabled||false;
this.contentNode=A.contentNode;
return this;
}
TabViewGroup.castGroup
=function(A){
try{
if(A.constructor!=TabViewGroup){
A
=new TabViewGroup(A);
}
return A;
}
catch(B){
throw new Error(["TabViewGroup","cast","Cast arguments to TabViewGroup error, check your arguments before cast"]);
}
};

var TABVIEW_EVENT={
DEACTIVE:
"deactive",ACTIVE:"active",BEFORE_ADD:"beforeadd",AFTER_ADD:"afteradd",BEFORE_REMOVE:"beforeremove",AFTER_REMOVE:"afterremove"
};

var TABVIEW_SELECTOR={};

TABVIEW_SELECTOR.DEFAULT
=TABVIEW_SELECTOR.VERTICAL={
tab:
"*:first-child > *",content:"*:first-child+* > *"
};

TABVIEW_SELECTOR.HORIZONTAL
={};

function TabView(){
return this._constructor.apply(this,arguments);
}
TabView.prototype
=(function(){
var A=CustEvent;
return{
aGroups:[],container:
null,length:0,eventDelayType:["mouseout","keydown"],eventDelay:0,selector:TABVIEW_SELECTOR.DEFAULT,TAB_ACTIVE_CN:"selected",TAB_DEACTIVE_CN:"unselected",CONTENT_ACTIVE_CN:"selected",CONTENT_DEACTIVE_CN:"unselected",events:["click"],current:{
"oGroup":null,"n":null
},maxTabLength:
10,preventDefault:true,stopPropagation:true,_timer:null,_constructor:function(B,C){
if(Dom.isElement(B)){
this.container=B;
Object.extendJson(
this,C||{});
this.renderTabView();
}
else{
Object.extendJson(
this,B||{});
}
return this;
},_setActive:
function(D){
var F=this.aGroups;
var C=F.length;
if(F[D].disabled){
return false;
}
var H=F[D].tabNode;
var B=F[D].contentNode;
for(var E=0;
E
<C;
E
++){
H
=F[E].tabNode;
B
=F[E].contentNode;
if(E==D){
if(this.current.oGroup!=F[E]){
if(this.current.oGroup){
this._dispatchEvent(TABVIEW_EVENT.DEACTIVE,this.current.oGroup,this.current.n);
}
this._dispatchEvent(TABVIEW_EVENT.ACTIVE,F[E],E);
}
this.current={};

this.current.oGroup=F[E];
this.current.n=D;
Dom.replaceClassName(H,
this.TAB_DEACTIVE_CN,this.TAB_ACTIVE_CN);
Dom.replaceClassName(B,
this.CONTENT_DEACTIVE_CN,this.CONTENT_ACTIVE_CN);
}
else{
Dom.replaceClassName(H,
this.TAB_ACTIVE_CN,this.TAB_DEACTIVE_CN);
Dom.replaceClassName(B,
this.CONTENT_ACTIVE_CN,this.CONTENT_DEACTIVE_CN);
}
}
},_dispatchEvent:
function(D,C,B){
A.fireEvent(
this,D,C,B);
},_insertGroup:
function(B,C){
var D=this.aGroups;
if(B<=0){
return[C].concat(D);
}
return D.slice(0,B+1).concat(C,D.slice(B+1));
},addTabNodeListener:
function(H){
if(this.events.constructor==String){
this.events=[this.events];
}
var F=this.events;
var B=this;
var C=F.length;
var I=H.tabNode;
for(var E=0;
E
<C;
E
++){
BBEvent.observe(I,F[E],
function(J){
if(B.preventDefault){
BBEvent.preventDefault(J);
}
if(B.stopPropagation){
BBEvent.stopPropagation(J);
}
clearTimeout(B._timer);
B._timer
=setTimeout(function(){
var K=B.queryTabNodeIndex(I);
if(null!=K){
B.setActiveTab(K);
}
},B.eventDelay);
});
if(0!=this.eventDelay){
for(var D=0;
D
<this.eventDelayType.length;
D
++){
BBEvent.observe(I,
this.eventDelayType[D],function(J){
clearTimeout(B._timer);
});
}
}
}
},queryTabNodeIndex:
function(E){
if(!E){
return null;
}
var D=this.aGroups;
var B=D.length;
for(var C=0;
C
<B;
C
++){
if(D[C].tabNode==E){
return C;
}
}
return null;
},renderTabView:
function(){
var E=Dom.getFirstChild(this.container).childNodes;
var F=Dom.nextSibling(Dom.getFirstChild(this.container)).childNodes;
var H=0;
var D=null;
E
=Dom.pluckWhiteNode(E);
F
=Dom.pluckWhiteNode(F);
var B=E.length;
for(var C=0;
C
<B;
C
++){
D
={
"tabNode":E[C],"contentNode":F[C]
};

if(Dom.hasClassName(E[C],this.TAB_ACTIVE_CN)){
H
=C;
}
this.addTab(D);
}
this.setActiveTab(H);
return this;
},insertTab:
function(B,C){
B
=parseInt(B)||0;
if(this.length>=this.maxTabLength){
return false;
}
C
=TabViewGroup.castGroup(C);
this._dispatchEvent(TABVIEW_EVENT.BEFORE_ADD,C,B);
this.aGroups=this._insertGroup(B,C);
this.addTabNodeListener(C);
this.length++;
this._dispatchEvent(TABVIEW_EVENT.AFTER_ADD,C,B);
return this;
},removeTab:
function(B){
if(!this.aGroups[B]){
return null;
}
var C=this.aGroups[B];
this._dispatchEvent(TABVIEW_EVENT.BEFORE_REMOVE,C,B);
Dom.removeNode(C.tabNode);
Dom.removeNode(C.contentNode);
C.tabNode
=C.contentNode=null;
this.aGroups.splice(B,1);
this.length--;
this._dispatchEvent(TABVIEW_EVENT.AFTER_REMOVE,C,B);
if(this.current.n==B){
this.setActiveTab(B-1<0?0:B-1);
}
return this;
},addTab:
function(B){
this.insertTab(this.length,B);
return this;
},addTabList:
function(){},setActiveTab:function(B){
if(B>this.length-1){
return false;
}
this._setActive(B);
return this;
},disabledTab:
function(B){
if(this.aGroups&&this.aGroups[B]){
this.aGroups[B].disabled=true;
}
},dispose:
function(){
clearTimeout(
this._timer);
}
};

})();
var addClass=Dom.addClassName;
var delClass=Dom.removeClassName;
var repClass=Dom.replaceClassName;
var getElsByClass=Dom.getElementsByClassName;
var Slide=function(){
return this.init.apply(this,arguments);
};

Slide.prototype
=(function(){
var play=function(){
if(!this.autoPlay||this.playIntervalId){
return ;
}
var me=this;
(
function f(){
me.playIntervalId
=setTimeout(function(){
var t=me.picSelIndex+1;
t
=t>me.itemSum-1?0:t;
me.setSel(t);
f();
},me.playInterval);
})();
};

var stop=function(){
if(!this.autoPlay){
return ;
}
if(this.playIntervalId){
clearTimeout(
this.playIntervalId);
this.playIntervalId=null;
}
};

return{
init:
function(op){
op
=op||{};

this.slideContainer=op.container||Dom.getElsByClass("slider",document.body)[0];
this.pics=Dom.getArray(op.pics||Dom.getElsByClass("img",this.slideContainer));
this.pages=Dom.getArray(op.pages||this.slideContainer.getElementsByTagName("li"));
this.itemSum=this.pics.length;
this.eventType=op.eventType||"click";
this.autoPlay=op.autoPlay==false?false:true;
this.playInterval=op.interval||3000;
this.picSelIndex=0;
this.playIntervalId=null;
this.isrun=false;
},initSlide:
function(){
this.pics.each(function(el){
Dom.hide(el);
});
Dom.show(
this.pics[this.picSelIndex]);
},run:
function(){
if(this.pages.length<1){
return ;
}
this.initSlide();
var me=this;
for(var i=0;
i
<this.itemSum;
i
++){
with({
ii:i
}){
BBEvent.observe(
this.pages[i],this.eventType,function(){
var change=function(){
stop.call(me);
me.setSel(ii);
};

var tempid=null;
if("mouseover"==me.eventType){
tempid
=setTimeout(change,me.isrun?400:100);
BBEvent.observe(me.pages[ii],
"mouseout",function(){
clearTimeout(tempid);
});
}
else{
change();
}
});
}
}
addClass(
this.pages[0],"selected");
play.call(
this);
BBEvent.observe(
this.slideContainer,"mouseover",function(e,el){
e
=e||window.event;
var relateEl=e.relatedTarget||e.fromElement||document.body;
if(!Dom.contains(me.slideContainer,relateEl)){
stop.call(me);
}
});
BBEvent.observe(
this.slideContainer,"mouseout",function(e,el){
e
=e||window.event;
var relateEl=e.relatedTarget||e.toElement||document.body;
if(!Dom.contains(me.slideContainer,relateEl)){
play.call(me);
}
});
},setSel:
function(i){
var sel=this.picSelIndex;
if(sel==i){
return ;
}
this.isrun=true;
CustEvent.fireEvent(
this,"picBeforeChange",i);
repClass(
this.pics[sel],"selected","unselected");
delClass(
this.pages[sel],"selected");
Dom.hide(
this.pics[sel]);
sel
=this.picSelIndex=i;
Dom.show(
this.pics[sel]);
CustEvent.fireEvent(
this,"picChange",i);
repClass(
this.pics[sel],"unselected","selected");
addClass(
this.pages[sel],"selected");
this.isrun=false;
}
};

})();
var FadeSlide=function(A){
this.$super(A);
}.$extends(Slide);
Object.extendJson(FadeSlide.prototype,{
initSlide:
function(){
for(var A=0;
A
<this.pics.length;
A
++){
var B=this.pics[A];
if(B.tagName=="IMG"){
B
=B.parentNode;
}
Dom.setStyle(B,{
position:
"absolute",top:0,left:0
});
this.pics[A]=B;
if(A){
Dom.hide(B);
}
}
Dom.setStyle(
this.pics[0].parentNode,"position","relative");
},setSel:
function(C){
var F=this.picSelIndex;
if(F==C){
return ;
}
this.isrun=true;
CustEvent.fireEvent(
this,"picBeforeChange",C);
Dom.setStyle(
this.pics[F],"opacity","1");
delClass(
this.pages[F],"selected");
F
=this.picSelIndex=C;
var D=this.pics[F].parentNode;
D.appendChild(
this.pics[F]);
Dom.show(
this.pics[F]);
repClass(
this.pics[F],"unselected","selected");
addClass(
this.pages[F],"selected");
CustEvent.fireEvent(
this,"picChange",C);
var E=this;
var B=this.pics[F];
if(B.tagName!="IMG"){
B
=B.getElementsByTagName("img")[0];
}
var A=new CssEffect(B,500,{
initialCss:{
opacity:
0.3,display:"block"
},alterableCss:{
opacity:[
0.3,1]
}
});
A.onsuspend
=function(){
Dom.setStyle(E.pics[C],
"opacity","1");
E.isrun
=false;
};

A.play();
}
});
var ScrollSlide=function(A){
this.$super(A);
}.$extends(Slide);
Object.extendJson(ScrollSlide.prototype,{
initSlide:
function(){
this.pics.each(function(B){
Dom.setStyle(B,
"display","block");
});
this.picContainer=Dom.parentNode(this.pics[0],"div");
this.picContainer.scrollTop=0;
var A=this;
BBEvent.observe(window,
"beforeunload",function(){
A.pics.each(
function(C,B){
A.picSelIndex
!=B&&Dom.setStyle(C,"display","none");
});
A.picContainer.scrollTop
=0;
});
},setSel:
function(D){
var F=this.picSelIndex;
if(F==D){
return ;
}
this.isrun=true;
repClass(
this.pics[F],"selected","unselected");
delClass(
this.pages[F],"selected");
var C=this.picContainer.offsetHeight*(F);
var A=this.picContainer.offsetHeight*(D-F);
F
=this.picSelIndex=D;
repClass(
this.pics[F],"unselected","selected");
addClass(
this.pages[F],"selected");
CustEvent.fireEvent(
this,"picChange",D);
var E=this;
var B=new BBEffect(null,function(G){
E.picContainer.scrollTop
=Math.floor(C+(-A*((t=G-1)*t*t*t)+A));
},
500);
B.onsuspend
=function(){
E.isrun
=false;
};

B.play();
}
});
var PicSlide=function(A){
if(!BBEffect){
A.effect
="";
}
switch(A.effect){
case"fade":return new FadeSlide(A);
case"scroll":return new ScrollSlide(A);
default:return new Slide(A);
}
};

var BBoard={
render:
function(J,K,L,P,M){
var N=$(J);
var K=$(K);
var L=$(L);
if(!N){
return ;
}
if(typeof (P)=="undefined"||!P){
P
=3000;
}
this.effect=M||"fade";
var I=this;
this.pairs=[];
this.curIndex=0;
var O=Dom.pluckWhiteNode(N.childNodes);
this.total=O.length;
if(this.total<2){
return ;
}
Array.toArray(O).each(
function(B,A){
I.pairs.push({
b:B
});
});
Dom.getArray([N,K,L]).each(
function(A){
BBEvent.observe(A,
"mouseover",function(){
if(I.itv){
clearInterval(I.itv);
}
});
BBEvent.observe(A,
"mouseout",function(){
I.itv
=setInterval(function(){
I.roll();
},P);
});
});
BBEvent.observe(K,
"click",function(A){
I.roll(I.curIndex
-1);
BBEvent.preventDefault(A
||event);
});
BBEvent.observe(L,
"click",function(A){
I.roll();
BBEvent.preventDefault(A
||event);
});
this.itv=setInterval(function(){
I.roll();
},P);
},roll:
function(D){
if(typeof (D)=="undefined"){
D
=this.curIndex+1;
}
D
=D<0?this.total-1:D;
D
=D>this.total-1?0:D;
var F=this.pairs[this.curIndex];
this.curIndex=D;
var E=this.pairs[this.curIndex];
this.hide(F.b,E.b);
},hide:
function(E,F){
switch(this.effect){
case"fade":var D=this;
BBEffect.changeDisplay(E,
false,4,350,function(){
Dom.hide(E);
D.show(F);
});
break;
default:Dom.hide(E);
this.show(F);
}
},show:
function(B){
switch(this.effect){
case"fade":BBEffect.changeDisplay(B,true,4,150);
break;
default:Dom.show(B);
}
}
};

var FirstSight=(function(){
return{
triggerPool:[],observers:[],autoManage:
true,removeListener:function(A){
FirstSight.triggerPool.splice(A,
1);
},trigger:
function(B){
var C=FirstSight.triggerPool[B];
var D=Dom.getAbsolutePosition(C.element);
var A=Dom.getDocRect();
var E=A.height+A.scrollY;
if(E>=D.top){
C.fn
&&C.fn.call(this,C);
FirstSight.removeListener(B);
return true;
}
return false;
},triggerAll:
function(){
var A=FirstSight.triggerPool.length;
while(FirstSight.autoManage&&A--){
FirstSight.trigger(A);
}
},observe:
function(B,D){
if(typeof B!="string"&&!Dom.isElement(B)){
throw new Error(["FirstSight","observe","The first argument must be a HTMLElement"]);
}
var A=this;
var C=function(){
var E={
element:B,fn:D
};

FirstSight.triggerPool.push(E);
A.triggerAll();
};

typeof B=="string"?ContentReady.observe(B,C):C();
},registerEvent:
function(A,B,C){
if(!A){
throw new Error(["FirstSight","registerEvent","The first argument must be a Element"]);
}
FirstSight.observers.push({
element:A,type:B,fn:C
});
BBEvent.observe(A,B,FirstSight.triggerAll);
},removeAllEvents:
function(){
var B=FirstSight.observers;
var A=B.length;
while(A--){
try{
BBEvent.stopObserving(B[A][
"element"],B[A]["type"],FirstSight.triggerAll);
B[A][
"callback"]&&B[A]["callback"].call(null);
}
catch(C){}
}
}
};

})();
FirstSight.registerEvent(window,
"scroll");
FirstSight.registerEvent(window,
"resize");
var ContentReady=(function(){
var B=0,D=[],A=10;
BBEvent.observe(window,
"load",function(){
window._loaded
=true;
});
function E(F){
if(window._loaded||!F.canHaveChildren){
return true;
}
while(F&&!F.nextSibling){
F
=F.parentNode;
}
return !!F;
}
function C(){
var F=D.length,H=null;
while(F--){
H
=$(D[F].id);
if(H&&E(H)){
if(D[F].fn){
D[F].fn.call(
null,H);
}
if(1==D.length){
clearInterval(B);
}
D.splice(F,
1);
}
}
}
return{
observe:
function(F,I){
var H=new Object();
H.id
=F;
H.fn
=I;
D.push(H);
if(B){
clearInterval(B);
}
B
=setInterval(C,A);
}
};

})();
var LazyLoad=(function(){
var A=[];
return{
observe:
function(D,C,B){
ContentReady.observe(D,
function(K){
var F=K.getElementsByTagName("IMG");
var E=F.length;
var H,I;
for(var J=0;
J
<E;
J
++){
H
=F[J];
I
=H.src;
A.push(I);
if(!H.complete){
H.src
=B||"";
FirstSight.observe(H,(
function(L,M){
return function(){
var N=true;
if(C){
N
=C.call(null,L);
if(N===false){
return ;
}
}
L.src
=A[M];
};

})(H,A.length
-1));
}
}
});
}
};

})();
String.prototype.encode4Html
=function(){
var B=document.createElement("div");
var A=document.createTextNode(this);
B.appendChild(A);
return B.innerHTML.replace(/"/g,"&quot;").replace(/'/g,"&#039;");
};

String.prototype.byteLen
=function(){
return this.replace(/[^\x00-\xff]/g,"--").length;
};

var subByte=function(C,A,B){
B
=B||"";
if(C.byteLen()<=A){
return C;
}
else{
A
-=(B||"").length;
}
return C=C.substr(0,A).replace(/([\u0100-\uffff])/g,"$1 ").substr(0,A).replace(/[\u0100-\uffff]$/,"").replace(/([\u0100-\uffff]) /g,"$1")+B;
};

 

posted @ 2010-04-19 19:46  azhai  阅读(2493)  评论(0编辑  收藏  举报