/*preventexecutionofjQueryifincludedmorethenonce*/
if(typeofwindow.jQuery=="undefined"){
/*
*jQuery1.0.4-NewWaveJavascript
*
*Copyright(c)2006JohnResig(jquery.com)
*DuallicensedundertheMIT(MIT-LICENSE.txt)
*andGPL(GPL-LICENSE.txt)licenses.
*
*$Date:2006-12-1215:33:10-0500(Tue,12Dec2006)$
*$Rev:696$
*/
//Globalundefinedvariable
window.undefined=window.undefined;
varjQuery=function(a,c){
//Shortcutfordocumentready
if(a&&typeofa=="function"&&jQuery.fn.ready&&!a.nodeType&&a[0]==undefined)//SafarireportstypeofonDOMNodeListsasafunction
returnjQuery(document).ready(a);
//Makesurethataselectionwasprovided
a=a||document;
//WatchforwhenajQueryobjectispassedastheselector
if(a.jquery)
returnjQuery(jQuery.merge(a,[]));
//WatchforwhenajQueryobjectispassedatthecontext
if(c&&c.jquery)
returnjQuery(c).find(a);
//Ifthecontextisglobal,returnanewobject
if(window==this)
returnnewjQuery(a,c);
//HandleHTMLstrings
if(typeofa=="string"){
varm=/^[^<]*(<.+>)[^>]*$/.exec(a);
if(m)a=jQuery.clean([m[1]]);
}
//Watchforwhenanarrayispassedin
this.set(a.constructor==Array||a.length&&a!=window&&!a.nodeType&&a[0]!=undefined&&a[0].nodeType?
//AssumethatitisanarrayofDOMElements
jQuery.merge(a,[]):
//Findthematchingelementsandsavethemforlater
jQuery.find(a,c));
//Seeifanextrafunctionwasprovided
varfn=arguments[arguments.length-1];
//Ifso,executeitincontext
if(fn&&typeoffn=="function")
this.each(fn);
returnthis;
};
//Mapoverthe$incaseofoverwrite
if(typeof$!="undefined")
jQuery._$=$;
//MapthejQuerynamespacetothe'$'one
var$=jQuery;
jQuery.fn=jQuery.prototype={
jquery:"1.0.4",
size:function(){
returnthis.length;
},
get:function(num){
returnnum==undefined?
//Returna'clean'array
jQuery.merge(this,[]):
//Returnjusttheobject
this[num];
},
set:function(array){
//UseatrickyhacktomakethejQueryobject
//lookandfeellikeanarray
this.length=0;
[].push.apply(this,array);
returnthis;
},
each:function(fn,args){
returnjQuery.each(this,fn,args);
},
index:function(obj){
varpos=-1;
this.each(function(i){
if(this==obj)pos=i;
});
returnpos;
},
attr:function(key,value,type){
//Checktoseeifwe'resettingstylevalues
returnkey.constructor!=String||value!=undefined?
this.each(function(){
//Seeifwe'resettingahashofstyles
if(value==undefined)
//Setallthestyles
for(varpropinkey)
jQuery.attr(
type?this.style:this,
prop,key[prop]
);
//Seeifwe'resettingasinglekey/valuestyle
else
jQuery.attr(
type?this.style:this,
key,value
);
}):
//Lookforthecasewherewe'reaccessingastylevalue
jQuery[type||"attr"](this[0],key);
},
css:function(key,value){
returnthis.attr(key,value,"curCSS");
},
text:function(e){
e=e||this;
vart="";
for(varj=0;j
for(vari=0;i
t+=r[i].nodeType!=1?
r[i].nodeValue:jQuery.fn.text([r[i]]);
}
returnt;
},
wrap:function(){
//Theelementstowrapthetargetaround
vara=jQuery.clean(arguments);
//Wrapeachofthematchedelementsindividually
returnthis.each(function(){
//Clonethestructurethatwe'reusingtowrap
varb=a[0].cloneNode(true);
//Insertitbeforetheelementtobewrapped
this.parentNode.insertBefore(b,this);
//Findthedeepestpointinthewrapstructure
while(b.firstChild)
b=b.firstChild;
//Movethematchedelementtowithinthewrapstructure
b.appendChild(this);
});
},
append:function(){
returnthis.domManip(arguments,true,1,function(a){
this.appendChild(a);
});
},
prepend:function(){
returnthis.domManip(arguments,true,-1,function(a){
this.insertBefore(a,this.firstChild);
});
},
before:function(){
returnthis.domManip(arguments,false,1,function(a){
this.parentNode.insertBefore(a,this);
});
},
after:function(){
returnthis.domManip(arguments,false,-1,function(a){
this.parentNode.insertBefore(a,this.nextSibling);
});
},
end:function(){
if(!(this.stack&&this.stack.length))
returnthis;
returnthis.set(this.stack.pop());
},
find:function(t){
returnthis.pushStack(jQuery.map(this,function(a){
returnjQuery.find(t,a);
}),arguments);
},
clone:function(deep){
returnthis.pushStack(jQuery.map(this,function(a){
returna.cloneNode(deep!=undefined?deep:true);
}),arguments);
},
filter:function(t){
returnthis.pushStack(
t.constructor==Array&&
jQuery.map(this,function(a){
for(vari=0;i
returna;
returnnull;
})||
t.constructor==Boolean&&
(t?this.get():[])||
typeoft=="function"&&
jQuery.grep(this,t)||
jQuery.filter(t,this).r,arguments);
},
not:function(t){
returnthis.pushStack(typeoft=="string"?
jQuery.filter(t,this,false).r:
jQuery.grep(this,function(a){returna!=t;}),arguments);
},
add:function(t){
returnthis.pushStack(jQuery.merge(this,typeoft=="string"?
jQuery.find(t):t.constructor==Array?t:[t]),arguments);
},
is:function(expr){
returnexpr?jQuery.filter(expr,this).r.length>0:false;
},
domManip:function(args,table,dir,fn){
varclone=this.size()>1;
vara=jQuery.clean(args);
returnthis.each(function(){
varobj=this;
if(table&&this.nodeName.toUpperCase()=="TABLE"&&a[0].nodeName.toUpperCase()!="THEAD"){
vartbody=this.getElementsByTagName("tbody");
if(!tbody.length){
obj=document.createElement("tbody");
this.appendChild(obj);
}else
obj=tbody[0];
}
for(vari=(dir<0?a.length-1:0);
i!=(dir<0?dir:a.length);i+=dir){
fn.apply(obj,[clone?a[i].cloneNode(true):a[i]]);
}
});
},
pushStack:function(a,args){
varfn=args&&args[args.length-1];
varfn2=args&&args[args.length-2];
if(fn&&fn.constructor!=Function)fn=null;
if(fn2&&fn2.constructor!=Function)fn2=null;
if(!fn){
if(!this.stack)this.stack=[];
this.stack.push(this.get());
this.set(a);
}else{
varold=this.get();
this.set(a);
if(fn2&&a.length||!fn2)
this.each(fn2||fn).set(old);
else
this.set(old).each(fn);
}
returnthis;
}
};
jQuery.extend=jQuery.fn.extend=function(){
//copyreferencetotargetobject
vartarget=arguments[0],
a=1;
//extendjQueryitselfifonlyoneargumentispassed
if(arguments.length==1){
target=this;
a=0;
}
varprop;
while(prop=arguments[a++])
//Extendthebaseobject
for(variinprop)target[i]=prop[i];
//Returnthemodifiedobject
returntarget;
};
jQuery.extend({
init:function(){
jQuery.initDone=true;
jQuery.each(jQuery.macros.axis,function(i,n){
jQuery.fn[i]=function(a){
varret=jQuery.map(this,n);
if(a&&typeofa=="string")
ret=jQuery.filter(a,ret).r;
returnthis.pushStack(ret,arguments);
};
});
jQuery.each(jQuery.macros.to,function(i,n){
jQuery.fn[i]=function(){
vara=arguments;
returnthis.each(function(){
for(varj=0;j
});
};
});
jQuery.each(jQuery.macros.each,function(i,n){
jQuery.fn[i]=function(){
returnthis.each(n,arguments);
};
});
jQuery.each(jQuery.macros.filter,function(i,n){
jQuery.fn[n]=function(num,fn){
returnthis.filter(":"+n+"("+num+")",fn);
};
});
jQuery.each(jQuery.macros.attr,function(i,n){
n=n||i;
jQuery.fn[i]=function(h){
returnh==undefined?
this.length?this[0][n]:null:
this.attr(n,h);
};
});
jQuery.each(jQuery.macros.css,function(i,n){
jQuery.fn[n]=function(h){
returnh==undefined?
(this.length?jQuery.css(this[0],n):null):
this.css(n,h);
};
});
},
//argsisforinternalusageonly
each:function(obj,fn,args){
if(obj.length==undefined)
for(variinobj)
fn.apply(obj[i],args||[i,obj[i]]);
else
for(vari=0;i
returnobj;
},
className:{
add:function(o,c){
if(jQuery.className.has(o,c))return;
o.className+=(o.className?"":"")+c;
},
remove:function(o,c){
if(!c){
o.className="";
}else{
varclasses=o.className.split("");
for(vari=0;i
classes.splice(i,1);
break;
}
}
o.className=classes.join('');
}
},
has:function(e,a){
if(e.className!=undefined)
e=e.className;
returnnewRegExp("(^|s)"+a+"(s|$)").test(e);
}
},
swap:function(e,o,f){
for(variino){
e.style["old"+i]=e.style[i];
e.style[i]=o[i];
}
f.apply(e,[]);
for(variino)
e.style[i]=e.style["old"+i];
},
css:function(e,p){
if(p=="height"||p=="width"){
varold={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];
for(vari=0;i
old["border"+d[i]+"Width"]=0;
}
jQuery.swap(e,old,function(){
if(jQuery.css(e,"display")!="none"){
oHeight=e.offsetHeight;
oWidth=e.offsetWidth;
}else{
e=jQuery(e.cloneNode(true))
.find(":radio").removeAttr("checked").end()
.css({
visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"
}).appendTo(e.parentNode)[0];
varparPos=jQuery.css(e.parentNode,"position");
if(parPos==""||parPos=="static")
e.parentNode.style.position="relative";
oHeight=e.clientHeight;
oWidth=e.clientWidth;
if(parPos==""||parPos=="static")
e.parentNode.style.position="static";
e.parentNode.removeChild(e);
}
});
returnp=="height"?oHeight:oWidth;
}
returnjQuery.curCSS(e,p);
},
curCSS:function(elem,prop,force){
varret;
if(prop=='opacity'&&jQuery.browser.msie)
returnjQuery.attr(elem.style,'opacity');
if(prop=="float"||prop=="cssFloat")
prop=jQuery.browser.msie?"styleFloat":"cssFloat";
if(!force&&elem.style[prop]){
ret=elem.style[prop];
}elseif(document.defaultView&&document.defaultView.getComputedStyle){
if(prop=="cssFloat"||prop=="styleFloat")
prop="float";
prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();
varcur=document.defaultView.getComputedStyle(elem,null);
if(cur)
ret=cur.getPropertyValue(prop);
elseif(prop=='display')
ret='none';
else
jQuery.swap(elem,{display:'block'},function(){
varc=document.defaultView.getComputedStyle(this,'');
ret=c&&c.getPropertyValue(prop)||'';
});
}elseif(elem.currentStyle){
varnewProp=prop.replace(/-(w)/g,function(m,c){returnc.toUpperCase();});
ret=elem.currentStyle[prop]||elem.currentStyle[newProp];
}
returnret;
},
clean:function(a){
varr=[];
for(vari=0;i
if(typeofarg=="string"){//ConverthtmlstringintoDOMnodes
//Trimwhitespace,otherwiseindexOfwon'tworkasexpected
vars=jQuery.trim(arg),div=document.createElement("div"),wrap=[0,"",""];
if(!s.indexOf(" //Gotohtmlandback,thenpeeloffextrawrappers returnr; expr:{ //ChildChecks //ParentChecks //TextCheck //Visibility //Formattributes //Formelements token:[ find:function(t,context){ //Setthecorrectcontext(ifnoneisprovided) if(t.constructor!=String)return[t]; if(!t.indexOf("//")){ varret=[context]; while(t.length>0&&last!=t){ t=jQuery.trim(t).replace(/^///i,""); varfoundToken=false; for(vari=0;i varre=newRegExp("^("+jQuery.token[i]+")"); if(m){ if(!foundToken){ if(m[1]=="#"){ for(vari=0;i } if(t){ if(ret&&ret[0]==context)ret.shift(); returndone; getAll:function(o,r){ attr:function(elem,name,value){ //IEactuallyusesfiltersforopacity...elemisactuallyelem.style //Mozilladoesn'tplaywellwithopacity1 if(fix[name]){ //Theregularexpressionsthatpowertheparsingengine //Match:[div],[divp] //Match::contains('foo') //Match::even,:last-chlid filter:function(t,r,not){ while(t&&/^[a-z[({<*:.#]/i.test(t)){ varp=jQuery.parse; for(vari=0;i //Lookfor,andreplace,string-likesequences varm=re.exec(t); if(m){ //Removewhatwejustmatched break; //:not()isaspecialcasethatcanbeoptimizedby //Otherwise,findtheexpressiontoexecute //Buildacustommacrotoencloseit //Executeitagainstthecurrentfilter //Returnanarrayoffilteredelements(r) trim:function(t){ parents:function(elem){ sibling:function(elem,pos,not){ if(elem){ if(siblings[i].nodeType==1) returnjQuery.extend(elems,{ merge:function(first,second){ //Movebovertothenewarray(thishelpstoavoid //Nowcheckforduplicatesbetweenaandbandonly //Thecollision-checkingprocess //Iftheitemisunique,addit returnresult; grep:function(elems,fn,inv){ varresult=[]; //Gothroughthearray,onlysavingtheitems returnresult; map:function(elems,fn){ varresult=[]; //Gothroughthearray,translatingeachoftheitemstotheir if(val!==null&&val!=undefined){ returnresult; /* //Bindaneventtoanelement //MakesurethatthefunctionbeingexecutedhasauniqueID //Inittheelement'seventstructure //Getthecurrentlistoffunctionsboundtothisevent //Ifithasn'tbeeninitializedyet //Rememberanexistinghandler,ifit'salreadythere //Addthefunctiontotheelement'shandlerlist //Andbindtheglobaleventhandlertotheelement //Rememberthefunctioninagloballist(fortriggering) guid:1, //Detachaneventorsetofeventsfromanelement trigger:function(type,data,element){ //Handleaglobaltrigger //Handletriggeringasingleelement //Triggertheevent handle:function(event){ event=jQuery.event.fix(event||window.event||{});//Emptyobjectisfortriggeredeventswithnodata //Ifnocorrecteventwasfound,fail varreturnValue=true; varc=this.events[event.type]; varargs=[].slice.call(arguments,1); for(varjinc){ //CleanupaddedpropertiesinIEtopreventmemoryleak returnreturnValue; fix:function(event){ //calculatepageX/Y //checksafariandiftargetisatextnode //fixpreventDefaultandstopPropagation if(!event.stopPropagation) returnevent; //Figureoutwhatbrowserisbeingused //ChecktoseeiftheW3Cboxmodelisbeingused jQuery.macros={ appendTo:"append", prependTo:"prepend", insertBefore:"before", insertAfter:"after" css:"width,height,top,left,position,float,overflow,color,background".split(","), filter:["eq","lt","gt","contains"], attr:{ axis:{ each:{ removeAttr:function(key){ show:function(){ hide:function(){ toggle:function(){ addClass:function(c){ removeClass:function(c){ toggleClass:function(c){ empty:function(){ bind:function(type,fn){ trigger:function(type,data){ jQuery.init(); //We'reoverridingtheoldtogglefunction,so //Makesurethatclicksstop //andexecutethefunction //Otherwise,executetheoldtogglefunction //Aprivatefunctionforhaandlingmouse'hovering' //Traverseupthetree //Ifweactuallyjustmousedontoasub-element,ignoreit //Executetherightfunction //Bindthefunctiontothetwoeventlisteners //Otherwise,rememberthefunctionforlater returnthis; jQuery.extend({ //HandlewhentheDOMisready //Iftherearefunctionsbound,toexecute //Resetthelistoffunctions newfunction(){ vare=("blur,focus,load,resize,scroll,unload,click,dblclick,"+ //Gothroughalltheeventnames,butmakesurethat varo=e[i]; //Handleeventbinding //Handleeventunbinding //Finally,handleeventsthatonlyfireonce }; //IfMozillaisused //IfIEisused,usetheexcellenthackbyMatthiasMiller //Onlyworksifyoudocument.write()it //Usethedeferscripthack //Clearfrommemory //IfSafariisused //Ifeitheronearefound,removethetimer //andexecuteanywaitingfunctions //Afallbacktowindow.onload,thatwillalwayswork }; //CleanupafterIEtoavoidmemoryleaks //overwritetheoldshowmethod show:function(speed,callback){ //Overwritetheoldhidemethod hide:function(speed,callback){ slideDown:function(speed,callback){ slideUp:function(speed,callback){ slideToggle:function(speed,callback){ fadeIn:function(speed,callback){ fadeOut:function(speed,callback){ fadeTo:function(speed,to,callback){ this.curAnim=jQuery.extend({},prop); for(varpinprop){ }); returnthis.each(function(){ if(!this.queue[type]) this.queue[type].push(fn); if(this.queue[type].length==1) }); jQuery.extend({ speed:function(s,o){ if(o.constructor==Function) varss={slow:600,fast:200}; //Queueing returno; queue:{}, dequeue:function(elem,type){ if(elem.queue&&elem.queue[type]){ //Getnextfunction if(f)f.apply(elem); /* fx:function(elem,options,prop){ varz=this; //Theusersoptions //Theelement //Thestyles //Storedisplayproperty //Simplefunctionforsettingastylevalue if(prop=="opacity") //Figureoutthemaximumnumbertorunto //Getthecurrentsize //Startananimationfromonenumbertoanother z.timer=setInterval(function(){ //Simple'show'function //Rememberwherewestarted,sothatwecangobacktoitlater z.o.show=true; //Begintheanimation //StupidIE,lookwhatyoumademedo //Simple'hide'function //Rememberwherewestarted,sothatwecangobacktoitlater z.o.hide=true; //Begintheanimation //Simple'toggle'function //Rememberwherewestarted,sothatwecangobacktoitlater if(oldDisplay=='none'){ //StupidIE,lookwhatyoumademedo //Begintheanimation //Begintheanimation //Eachstepofananimation if(t>z.o.duration+z.startTime){ z.now=lastNum; z.el.curAnim[prop]=true; vardone=true; if(done){ //Resetthedisplay //Hidetheelementifthe"hide"operationwasdone //Resettheproperties,iftheitemhasbeenhiddenorshown //Ifacallbackwasprovided,executeit //Performthenextstepoftheanimation } }); callback=callback||function(){}; //DefaulttoaGETrequest //Ifthesecondparameterwasprovided //Otherwise,buildaparamstring varself=this; //Requesttheremotedocument }); //IfIEisused,createawrapperfortheXMLHttpRequestobject //AttachabunchoffunctionsforhandlingcommonAJAXevents newfunction(){ for(vari=0;i jQuery.extend({ //Delegate //timeout(ms) //Last-Modifiedheadercachefornextrequest //ifdataavailable //Watchforanewsetofrequests varrequestDone=false; //Createtherequestobject //Openthesocket //Setthecorrectheader,ifdataisbeingsent //SettheIf-Modified-Sinceheader,ififModifiedmode. //Setheadersothecalledscriptknowsthatit'sanXMLHttpRequest
elseif(!s.indexOf("wrap=[1,"","
"];
elseif(!s.indexOf("wrap=[2," ","
"];//tbodyauto-inserted
elseif(!s.indexOf("wrap=[3,"
"]; ","
div.innerHTML=wrap[1]+s+wrap[2];
while(wrap[0]--)div=div.firstChild;
arg=div.childNodes;
}
if(arg.length!=undefined&&((jQuery.browser.safari&&typeofarg=='function')||!arg.nodeType))//SafarireportstypeofonaDOMNodeListtobeafunction
for(varn=0;n
else
r.push(arg.nodeType?arg:document.createTextNode(arg.toString()));
}
},
"":"m[2]=='*'||a.nodeName.toUpperCase()==m[2].toUpperCase()",
"#":"a.getAttribute('id')&&a.getAttribute('id')==m[2]",
":":{
//PositionChecks
lt:"i
nth:"m[3]-0==i",
eq:"m[3]-0==i",
first:"i==0",
last:"i==r.length-1",
even:"i%2==0",
odd:"i%2",
"nth-child":"jQuery.sibling(a,m[3]).cur",
"first-child":"jQuery.sibling(a,0).cur",
"last-child":"jQuery.sibling(a,0).last",
"only-child":"jQuery.sibling(a).length==1",
parent:"a.childNodes.length",
empty:"!a.childNodes.length",
contains:"jQuery.fn.text.apply([a]).indexOf(m[3])>=0",
visible:"a.type!='hidden'&&jQuery.css(a,'display')!='none'&&jQuery.css(a,'visibility')!='hidden'",
hidden:"a.type=='hidden'||jQuery.css(a,'display')=='none'||jQuery.css(a,'visibility')=='hidden'",
enabled:"!a.disabled",
disabled:"a.disabled",
checked:"a.checked",
selected:"a.selected||jQuery.attr(a,'selected')",
text:"a.type=='text'",
radio:"a.type=='radio'",
checkbox:"a.type=='checkbox'",
file:"a.type=='file'",
password:"a.type=='password'",
submit:"a.type=='submit'",
image:"a.type=='image'",
reset:"a.type=='reset'",
button:"a.type=='button'",
input:"/input|select|textarea|button/i.test(a.nodeName)"
},
".":"jQuery.className.has(a,m[2])",
"@":{
"=":"z==m[4]",
"!=":"z!=m[4]",
"^=":"z&&!z.indexOf(m[4])",
"$=":"z&&z.substr(z.length-m[4].length,m[4].length)==m[4]",
"*=":"z&&z.indexOf(m[4])>=0",
"":"z"
},
"[":"jQuery.find(m[2],a).length"
},
"..|/..","a.parentNode",
">|/","jQuery.sibling(a.firstChild)",
"+","jQuery.sibling(a).next",
"~",function(a){
vars=jQuery.sibling(a);
returns.n>=0?s.slice(s.n+1):[];
}
],
//MakesurethatthecontextisaDOMElement
if(context&&context.nodeType==undefined)
context=null;
context=context||document;
context=context.documentElement;
t=t.substr(2,t.length);
}elseif(!t.indexOf("/")){
context=context.documentElement;
t=t.substr(1,t.length);
//FIXAssumetherootelementisright:(
if(t.indexOf("/")>=1)
t=t.substr(t.indexOf("/"),t.length);
}
vardone=[];
varlast=null;
varr=[];
last=t;
varm=re.exec(t);
r=ret=jQuery.map(ret,jQuery.token[i+1]);
t=jQuery.trim(t.replace(re,""));
foundToken=true;
}
}
if(!t.indexOf(",")||!t.indexOf("|")){
if(ret[0]==context)ret.shift();
done=jQuery.merge(done,ret);
r=ret=[context];
t=""+t.substr(1,t.length);
}else{
varre2=/^([#.]?)([a-z0-9*_-]*)/i;
varm=re2.exec(t);
//Ummm,shouldmakethisworkinallXMLdocs
varoid=document.getElementById(m[2]);
r=ret=oid?[oid]:[];
t=t.replace(re2,"");
}else{
if(!m[2]||m[1]==".")m[2]="*";
m[2]=="*"?
jQuery.getAll(ret[i]):
ret[i].getElementsByTagName(m[2])
);
}
}
varval=jQuery.filter(t,r);
ret=r=val.r;
t=jQuery.trim(val.t);
}
}
done=jQuery.merge(done,ret);
},
r=r||[];
vars=o.childNodes;
for(vari=0;i
r.push(s[i]);
jQuery.getAll(s[i],r);
}
returnr;
},
varfix={
"for":"htmlFor",
"class":"className",
"float":jQuery.browser.msie?"styleFloat":"cssFloat",
cssFloat:jQuery.browser.msie?"styleFloat":"cssFloat",
innerHTML:"innerHTML",
className:"className",
value:"value",
disabled:"disabled",
checked:"checked",
readonly:"readOnly"
};
if(name=="opacity"&&jQuery.browser.msie&&value!=undefined){
//IEhastroublewithopacityifitdoesnothavelayout
//Wouldprefertocheckelement.hasLayoutfirstbutdon'thaveaccesstotheelementhere
elem['zoom']=1;
if(value==1)//RemovefiltertoavoidmoreIEweirdness
returnelem["filter"]=elem["filter"].replace(/alpha([^)]*)/gi,"");
else
returnelem["filter"]=elem["filter"].replace(/alpha([^)]*)/gi,"")+"alpha(opacity="+value*100+")";
}elseif(name=="opacity"&&jQuery.browser.msie){
returnelem["filter"]?parseFloat(elem["filter"].match(/alpha(opacity=(.*))/)[1])/100:1;
}
if(name=="opacity"&&jQuery.browser.mozilla&&value==1)value=0.9999;
if(value!=undefined)elem[fix[name]]=value;
returnelem[fix[name]];
}elseif(value==undefined&&jQuery.browser.msie&&elem.nodeName&&elem.nodeName.toUpperCase()=='FORM'&&(name=='action'||name=='method')){
returnelem.getAttributeNode(name).nodeValue;
}elseif(elem.tagName){//IEelem.getAttributepassesevenforstyle
if(value!=undefined)elem.setAttribute(name,value);
returnelem.getAttribute(name);
}else{
name=name.replace(/-([a-z])/ig,function(z,b){returnb.toUpperCase();});
if(value!=undefined)elem[name]=value;
returnelem[name];
}
},
parse:[
//Match:[@value='test'],[@foo]
"[*(@)S*([!*$^=]*)*('?"?)(.*?)4*]",
"([)s*(.*?)s*]",
"(:)S("?'?([^)]*?)"?'?)",
"([:.#]*)S"
],
//Figureoutifwe'redoingregular,orinverse,filtering
varg=not!==false?jQuery.grep:
function(a,f){returnjQuery.grep(a,f,true);};
//andfinallybuildaregexpoutofit
varre=newRegExp(
"^"+p[i].replace("S","([a-z*_-][a-z0-9_-]*)"),"i");
//Re-organizethefirstmatch
if(!i)
m=["",m[1],m[3],m[2],m[5]];
t=t.replace(re,"");
}
}
//keepingitoutoftheexpressionlist
if(m[1]==":"&&m[2]=="not")
r=jQuery.filter(m[3],r,false).r;
else{
varf=jQuery.expr[m[1]];
if(f.constructor!=String)
f=jQuery.expr[m[1]][m[2]];
eval("f=function(a,i){"+
(m[1]=="@"?"z=jQuery.attr(a,m[3]);":"")+
"return"+f+"}");
r=g(r,f);
}
}
//andthemodifiedexpressionstring(t)
return{r:r,t:t};
},
returnt.replace(/^s+|s+$/g,"");
},
varmatched=[];
varcur=elem.parentNode;
while(cur&&cur!=document){
matched.push(cur);
cur=cur.parentNode;
}
returnmatched;
},
varelems=[];
varsiblings=elem.parentNode.childNodes;
for(vari=0;i
elems.push(siblings[i]);
if(siblings[i]==elem)
elems.n=elems.length-1;
}
}
last:elems.n==elems.length-1,
cur:pos=="even"&&elems.n%2==0||pos=="odd"&&elems.n%2||elems[pos]==elem,
prev:elems[elems.n-1],
next:elems[elems.n+1]
});
},
varresult=[];
//StaticNodeListinstances)
for(vark=0;k
//addtheuniqueitems
for(vari=0;i
for(varj=0;j
noCollision=false;
if(noCollision)
result.push(second[i]);
}
},
//Ifastringispassedinforthefunction,makeafunction
//forit(ahandyshortcut)
if(typeoffn=="string")
fn=newFunction("a","i","return"+fn);
//thatpassthevalidatorfunction
for(vari=0;i
result.push(elems[i]);
},
//Ifastringispassedinforthefunction,makeafunction
//forit(ahandyshortcut)
if(typeoffn=="string")
fn=newFunction("a","return"+fn);
//newvalue(orvalues).
for(vari=0;i
if(val.constructor!=Array)val=[val];
result=jQuery.merge(result,val);
}
}
},
*Anumberofhelperfunctionsusedformanagingevents.
*ManyoftheideasbehindthiscodeorignatedfromDeanEdwards'addEventlibrary.
*/
event:{
//OriginalbyDeanEdwards
add:function(element,type,handler){
//Forwhateverreason,IEhastroublepassingthewindowobject
//around,causingittobeclonedintheprocess
if(jQuery.browser.msie&&element.setInterval!=undefined)
element=window;
if(!handler.guid)
handler.guid=this.guid++;
if(!element.events)
element.events={};
varhandlers=element.events[type];
if(!handlers){
//Inittheeventhandlerqueue
handlers=element.events[type]={};
if(element["on"+type])
handlers[0]=element["on"+type];
}
handlers[handler.guid]=handler;
element["on"+type]=this.handle;
if(!this.global[type])
this.global[type]=[];
this.global[type].push(element);
},
global:{},
remove:function(element,type,handler){
if(element.events)
if(type&&element.events[type])
if(handler)
deleteelement.events[type][handler.guid];
else
for(variinelement.events[type])
deleteelement.events[type][i];
else
for(varjinelement.events)
this.remove(element,j);
},
//Clonetheincomingdata,ifany
data=$.merge([],data||[]);
if(!element){
varg=this.global[type];
if(g)
for(vari=0;i
}elseif(element["on"+type]){
//Passalongafakeevent
data.unshift(this.fix({type:type,target:element}));
element["on"+type].apply(element,data);
}
},
if(typeofjQuery=="undefined")returnfalse;
if(!event)returnfalse;
args.unshift(event);
if(c[j].apply(this,args)===false){
event.preventDefault();
event.stopPropagation();
returnValue=false;
}
}
if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=null;
},
//checkIE
if(jQuery.browser.msie){
//fixtargetproperty,ifavailable
//checkpreventsoverwritingoffaketargetcomingfromtrigger
if(event.srcElement)
event.target=event.srcElement;
vare=document.documentElement,b=document.body;
event.pageX=event.clientX+(e.scrollLeft||b.scrollLeft);
event.pageY=event.clientY+(e.scrollTop||b.scrollTop);
}elseif(jQuery.browser.safari&&event.target.nodeType==3){
//targetisreadonly,clonetheeventobject
event=jQuery.extend({},event);
//getparentnodefromtextnode
event.target=event.target.parentNode;
}
if(!event.preventDefault)
event.preventDefault=function(){
this.returnValue=false;
};
event.stopPropagation=function(){
this.cancelBubble=true;
};
}
}
});
/*
*WheathertheW3Ccompliantboxmodelisbeingused.
*
*@property
*@name$.boxModel
*@typeBoolean
*@catJavascript
*/
newfunction(){
varb=navigator.userAgent.toLowerCase();
jQuery.browser={
safari:/webkit/.test(b),
opera:/opera/.test(b),
msie:/msie/.test(b)&&!/opera/.test(b),
mozilla:/mozilla/.test(b)&&!/(compatible|webkit)/.test(b)
};
jQuery.boxModel=!jQuery.browser.msie||document.compatMode=="CSS1Compat";
};
to:{
},
val:"value",
html:"innerHTML",
id:null,
title:null,
name:null,
href:null,
src:null,
rel:null
},
parent:"a.parentNode",
ancestors:jQuery.parents,
parents:jQuery.parents,
next:"jQuery.sibling(a).next",
prev:"jQuery.sibling(a).prev",
siblings:"jQuery.sibling(a,null,true)",
children:"jQuery.sibling(a.firstChild)"
},
jQuery.attr(this,key,"");
this.removeAttribute(key);
},
this.style.display=this.oldblock?this.oldblock:"";
if(jQuery.css(this,"display")=="none")
this.style.display="block";
},
this.oldblock=this.oldblock||jQuery.css(this,"display");
if(this.oldblock=="none")
this.oldblock="block";
this.style.display="none";
},
jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"].apply(jQuery(this),arguments);
},
jQuery.className.add(this,c);
},
jQuery.className.remove(this,c);
},
jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c);
},
remove:function(a){
if(!a||jQuery.filter(a,[this]).r)
this.parentNode.removeChild(this);
},
while(this.firstChild)
this.removeChild(this.firstChild);
},
jQuery.event.add(this,type,fn);
},
unbind:function(type,fn){
jQuery.event.remove(this,type,fn);
},
jQuery.event.trigger(type,data,this);
}
}
};
jQuery.fn.extend({
//rememberitforlater
_toggle:jQuery.fn.toggle,
toggle:function(a,b){
//Iftwofunctionsarepassedin,we're
//togglingonaclick
returna&&b&&a.constructor==Function&&b.constructor==Function?this.click(function(e){
//Figureoutwhichfunctiontoexecute
this.last=this.last==a?b:a;
e.preventDefault();
returnthis.last.apply(this,[e])||false;
}):
this._toggle.apply(this,arguments);
},
hover:function(f,g){
functionhandleHover(e){
//Checkifmouse(over|out)arestillwithinthesameparentelement
varp=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;
while(p&&p!=this)try{p=p.parentNode}catch(e){p=this;};
if(p==this)returnfalse;
return(e.type=="mouseover"?f:g).apply(this,[e]);
}
returnthis.mouseover(handleHover).mouseout(handleHover);
},
ready:function(f){
//IftheDOMisalreadyready
if(jQuery.isReady)
//Executethefunctionimmediately
f.apply(document);
else{
//Addthefunctiontothewaitlist
jQuery.readyList.push(f);
}
}
});
/*
*AllthecodethatmakesDOMReadyworknicely.
*/
isReady:false,
readyList:[],
ready:function(){
//MakesurethattheDOMisnotalreadyloaded
if(!jQuery.isReady){
//RememberthattheDOMisready
jQuery.isReady=true;
if(jQuery.readyList){
//Executeallofthem
for(vari=0;i
jQuery.readyList=null;
}
//Removeeventlisentertoavoidmemoryleak
if(jQuery.browser.mozilla||jQuery.browser.opera)
document.removeEventListener("DOMContentLoaded",jQuery.ready,false);
}
}
});
"mousedown,mouseup,mousemove,mouseover,mouseout,change,reset,select,"+
"submit,keydown,keypress,keyup,error").split(",");
//itisenclosedproperly
for(vari=0;i
jQuery.fn[o]=function(f){
returnf?this.bind(o,f):this.trigger(o);
};
jQuery.fn["un"+o]=function(f){returnthis.unbind(o,f);};
jQuery.fn["one"+o]=function(f){
//saveclonedreferencetothis
varelement=jQuery(this);
varhandler=function(){
//unbinditselfwhenexecuted
element.unbind(o,handler);
element=null;
//applyoriginalhandlerwiththesamearguments
returnf.apply(this,arguments);
};
returnthis.bind(o,handler);
};
if(jQuery.browser.mozilla||jQuery.browser.opera){
//Usethehandyeventcallback
document.addEventListener("DOMContentLoaded",jQuery.ready,false);
//http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
}elseif(jQuery.browser.msie){
document.write("
varscript=document.getElementById("__ie_init");
if(script)//scriptdoesnotexistifjQueryisloadeddynamically
script.onreadystatechange=function(){
if(this.readyState!="complete")return;
this.parentNode.removeChild(this);
jQuery.ready();
};
script=null;
}elseif(jQuery.browser.safari){
//Continuallychecktoseeifthedocument.readyStateisvalid
jQuery.safariTimer=setInterval(function(){
//loadedandcompletearebothvalidstates
if(document.readyState=="loaded"||
document.readyState=="complete"){
clearInterval(jQuery.safariTimer);
jQuery.safariTimer=null;
jQuery.ready();
}
},10);
}
jQuery.event.add(window,"load",jQuery.ready);
if(jQuery.browser.msie)jQuery(window).unload(function(){
varevent=jQuery.event,global=event.global;
for(vartypeinglobal){
varels=global[type],i=els.length;
if(i>0)doif(type!='unload')event.remove(els[i-1],type);while(--i);
}
});
jQuery.fn.extend({
_show:jQuery.fn.show,
returnspeed?this.animate({
height:"show",width:"show",opacity:"show"
},speed,callback):this._show();
},
_hide:jQuery.fn.hide,
returnspeed?this.animate({
height:"hide",width:"hide",opacity:"hide"
},speed,callback):this._hide();
},
returnthis.animate({height:"show"},speed,callback);
},
returnthis.animate({height:"hide"},speed,callback);
},
returnthis.each(function(){
varstate=jQuery(this).is(":hidden")?"show":"hide";
jQuery(this).animate({height:state},speed,callback);
});
},
returnthis.animate({opacity:"show"},speed,callback);
},
returnthis.animate({opacity:"hide"},speed,callback);
},
returnthis.animate({opacity:to},speed,callback);
},
animate:function(prop,speed,callback){
returnthis.queue(function(){
vare=newjQuery.fx(this,jQuery.speed(speed,callback),p);
if(prop[p].constructor==Number)
e.custom(e.cur(),prop[p]);
else
e[prop[p]](prop);
}
},
queue:function(type,fn){
if(!fn){
fn=type;
type="fx";
}
if(!this.queue)
this.queue={};
this.queue[type]=[];
fn.apply(this);
});
}
o=o||{};
o={complete:o};
o.duration=(s&&s.constructor==Number?s:ss[s])||400;
o.oldComplete=o.complete;
o.complete=function(){
jQuery.dequeue(this,"fx");
if(o.oldComplete&&o.oldComplete.constructor==Function)
o.oldComplete.apply(this);
};
},
type=type||"fx";
//Removeself
elem.queue[type].shift();
varf=elem.queue[type][0];
}
},
*Ioriginallywrotefx()asacloneofmoo.fxandintheprocess
*ofmakingitsmallinsizethecodebecameillegibletosane
*people.You'vebeenwarned.
*/
z.o={
duration:options.duration||400,
complete:options.complete,
step:options.step
};
z.el=elem;
vary=z.el.style;
varoldDisplay=jQuery.css(z.el,'display');
//Setdisplaypropertytoblockforanimation
y.display="block";
//Makesurethatnothingsneaksout
y.overflow="hidden";
z.a=function(){
if(options.step)
options.step.apply(elem,[z.now]);
jQuery.attr(y,"opacity",z.now);//Letattrhandleopacity
elseif(parseInt(z.now))//MyhateforIEwillneverdie
y[prop]=parseInt(z.now)+"px";
};
z.max=function(){
returnparseFloat(jQuery.css(z.el,prop));
};
z.cur=function(){
varr=parseFloat(jQuery.curCSS(z.el,prop));
returnr&&r>-10000?r:z.max();
};
z.custom=function(from,to){
z.startTime=(newDate()).getTime();
z.now=from;
z.a();
z.step(from,to);
},13);
};
z.show=function(){
if(!z.el.orig)z.el.orig={};
z.el.orig[prop]=this.cur();
z.custom(0,z.el.orig[prop]);
if(prop!="opacity")
y[prop]="1px";
};
z.hide=function(){
if(!z.el.orig)z.el.orig={};
z.el.orig[prop]=this.cur();
z.custom(z.el.orig[prop],0);
};
z.toggle=function(){
if(!z.el.orig)z.el.orig={};
z.el.orig[prop]=this.cur();
z.o.show=true;
if(prop!="opacity")
y[prop]="1px";
z.custom(0,z.el.orig[prop]);
}else{
z.o.hide=true;
z.custom(z.el.orig[prop],0);
}
};
z.step=function(firstNum,lastNum){
vart=(newDate()).getTime();
//Stopthetimer
clearInterval(z.timer);
z.timer=null;
z.a();
for(variinz.el.curAnim)
if(z.el.curAnim[i]!==true)
done=false;
//Resettheoverflow
y.overflow='';
y.display=oldDisplay;
if(jQuery.css(z.el,'display')=='none')
y.display='block';
if(z.o.hide)
y.display='none';
if(z.o.hide||z.o.show)
for(varpinz.el.curAnim)
if(p=="opacity")
jQuery.attr(y,p,z.el.orig[p]);
else
y[p]='';
}
if(done&&z.o.complete&&z.o.complete.constructor==Function)
//Executethecompletefunction
z.o.complete.apply(z.el);
}else{
//Figureoutwhereintheanimationweareandsetthenumber
varp=(t-this.startTime)/z.o.duration;
z.now=((-Math.cos(p*Math.PI)/2)+0.5)*(lastNum-firstNum)+firstNum;
z.a();
}
};
jQuery.fn.extend({
loadIfModified:function(url,params,callback){
this.load(url,params,callback,1);
},
load:function(url,params,callback,ifModified){
if(url.constructor==Function)
returnthis.bind("load",url);
vartype="GET";
if(params){
//Ifit'safunction
if(params.constructor==Function){
//Weassumethatit'sthecallback
callback=params;
params=null;
}else{
params=jQuery.param(params);
type="POST";
}
}
jQuery.ajax({
url:url,
type:type,
data:params,
ifModified:ifModified,
complete:function(res,status){
if(status=="success"||!ifModified&&status=="notmodified"){
//InjecttheHTMLintoallthematchedelements
self.html(res.responseText)
//Executeallthescriptsinsideofthenewly-injectedHTML
.evalScripts()
//Executecallback
.each(callback,[res.responseText,status,res]);
}else
callback.apply(self,[res.responseText,status,res]);
}
});
returnthis;
},
serialize:function(){
returnjQuery.param(this);
},
evalScripts:function(){
returnthis.find('script').each(function(){
if(this.src)
//forsomeweirdreason,itdoesn'tworkifthecallbackisommited
jQuery.getScript(this.src);
else{
jQuery.globalEval(this.text||this.textContent||this.innerHTML||"");
}
}).end();
}
if(jQuery.browser.msie&&typeofXMLHttpRequest=="undefined")
XMLHttpRequest=function(){
returnnewActiveXObject("Microsoft.XMLHTTP");
};
vare="ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(",");
jQuery.fn[o]=function(f){
returnthis.bind(o,f);
};
};
};
get:function(url,data,callback,type,ifModified){
//shiftargumentsifdataargumentwasommited
if(data&&data.constructor==Function){
callback=data;
data=null;
}
jQuery.ajax({
url:url,
data:data,
success:callback,
dataType:type,
ifModified:ifModified
});
},
getIfModified:function(url,data,callback,type){
jQuery.get(url,data,callback,type,1);
},
getScript:function(url,callback){
if(callback)
jQuery.get(url,null,callback,"script");
else{
jQuery.get(url,null,null,"script");
}
},
getJSON:function(url,data,callback){
jQuery.get(url,data,callback,"json");
},
post:function(url,data,callback,type){
//Delegate
jQuery.ajax({
type:"POST",
url:url,
data:data,
success:callback,
dataType:type
});
},
timeout:0,
ajaxTimeout:function(timeout){
jQuery.timeout=timeout;
},
lastModified:{},
ajax:function(s){
//TODOintroduceglobalsettings,allowingtheclienttomodifythemforallrequests,notonlytimeout
s=jQuery.extend({
global:true,
ifModified:false,
type:"GET",
timeout:jQuery.timeout,
complete:null,
success:null,
error:null,
dataType:null,
url:null,
data:null,
contentType:"application/x-www-form-urlencoded",
processData:true,
async:true,
beforeSend:null
},s);
if(s.data){
//convertdataifnotalreadyastring
if(s.processData&&typeofs.data!='string')
s.data=jQuery.param(s.data);
//appenddatatourlforgetrequests
if(s.type.toLowerCase()=="get")
//"?"+dataor"&"+data(incasetherearealreadyparams)
s.url+=((s.url.indexOf("?")>-1)?"&":"?")+s.data;
}
if(s.global&&!jQuery.active++)
jQuery.event.trigger("ajaxStart");
varxml=newXMLHttpRequest();
xml.open(s.type,s.url,s.async);
if(s.data)
xml.setRequestHeader("Content-Type",s.contentType);
if(s.ifModified)
xml.setRequestHeader("If-Modified-Since",
jQuery.lastModified[s.url]||"Thu,01Jan197000:00:00GMT");
xml.setRequestHeader("X-Requested-With","XMLHttpRequest");相关推荐