/* * jQuery 1.2.1 - New Wave Javascript * * Copyright (c) 2007 John Resig (jquery.com) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $ * $Rev: 3353 $ */ (function(){if(typeof jQuery!="undefined")var _jQuery=jQuery;var jQuery=window.jQuery=function(selector,context){return this instanceof jQuery?this.init(selector,context):new jQuery(selector,context);};if(typeof $!="undefined")var _$=$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(typeof selector=="string"){var m=quickExpr.exec(selector);if(m&&(m[1]||!context)){if(m[1])selector=jQuery.clean([m[1]],context);else{var tmp=document.getElementById(m[3]);if(tmp)if(tmp.id!=m[3])return jQuery().find(selector);else{this[0]=tmp;this.length=1;return this;}else selector=[];}}else return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.1",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(a){var ret=jQuery(a);ret.prevObject=this;return ret;},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this;},each:function(fn,args){return jQuery.each(this,fn,args);},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i;});return pos;},attr:function(key,value,type){var obj=key;if(key.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value;}return this.each(function(index){for(var prop in obj)jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop));});},css:function(key,value){return this.attr(key,value,"curCSS");},text:function(e){if(typeof e!="object"&&e!=null)return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return t;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,1,function(a){this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild);});},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this);});},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(t){var data=jQuery.map(this,function(a){return jQuery.find(t,a);});return this.pushStack(/[^+>] [^+>]/.test(t)||t.indexOf("..")>-1?jQuery.unique(data):data);},clone:function(events){var ret=this.map(function(){return this.outerHTML?jQuery(this.outerHTML)[0]:this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index]);})||jQuery.multiFilter(t,this));},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){return(t.constructor==Array||t.jquery)?jQuery.inArray(a,t)<0:a!=t;}));},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&(!t.nodeName||jQuery.nodeName(t,"form"))?t:[t]));},is:function(expr){return expr?jQuery.multiFilter(expr,this).length>0:false;},hasClass:function(expr){return this.is("."+expr);},val:function(val){if(val==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,a=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0);});if(!tmp.length)this.selectedIndex=-1;}else this.value=val;});},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},replaceWith:function(val){return this.after(val).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem);});});}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"script");if(script){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a-1;}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){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];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")=="";}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(prop.match(/float/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+">";});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("",""]||!s.indexOf("",""]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!s.indexOf("",""]||(!s.indexOf("",""]||!s.indexOf("",""]||jQuery.browser.msie&&[1,"div
","
"]||[0,"",""];div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf(""&&s.indexOf("=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild);}arg=jQuery.makeArray(div.childNodes);}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else r=jQuery.merge(r,arg);});return r;},attr:function(elem,name,value){var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(t){return(t||"").replace(/^\s+|\s+$/g,"");},makeArray:function(a){var r=[];if(typeof a!="array")for(var i=0,al=a.length;i\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"im[3]-0",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","first-child":"a.parentNode.getElementsByTagName('*')[0]==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",parent:"a.firstChild",empty:"!a.firstChild",contains:"(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",visible:'"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'"hidden"==a.type||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:"'text'==a.type",radio:"'radio'==a.type",checkbox:"'checkbox'==a.type",file:"'file'==a.type",password:"'password'==a.type",submit:"'submit'==a.type",image:"'image'==a.type",reset:"'reset'==a.type",button:'"button"==a.type||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)",has:"jQuery.find(m[3],a).length",header:"/h\\d/i.test(a.nodeName)",animated:"jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&!context.nodeType)context=null;context=context||document;var ret=[context],done=[],last;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){var nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName.toUpperCase()))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var nodeName=m[2],merge={};m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQuery.filter(m[3],r,true).r;else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQuery.ready();};script=null;}else if(jQuery.browser.safari)jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready();}},10);jQuery.event.add(window,"load",jQuery.ready);}jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
").append(res.responseText.replace(//g,"")).find(selector):res.responseText);setTimeout(function(){self.each(callback,[res.responseText,status,res]);},13);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){var jsonp,jsre=/=(\?|%3F)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=s.data.replace(jsre,"="+jsonp);s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get")s.url+=(s.url.match(/\?/)?"&":"?")+"_="+(new Date()).getTime();if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(!s.url.indexOf("http")&&s.dataType=="script"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(!jsonp&&(s.success||s.complete)){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();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, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();return xml;function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")this.style.display="block";}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")this.oldblock="block";this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var opt=jQuery.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQuery.extend({},opt);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(){var timers=jQuery.timers;return this.each(function(){for(var i=0;i-10000?r:parseFloat(jQuery.css(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step();}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timers.length==1){var timer=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var absolute=jQuery.css(elem,"position")=="absolute",parent=elem.parentNode,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522;if(elem.getBoundingClientRect){box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));if(msie){var border=jQuery("html").css("borderWidth");border=(border=="medium"||jQuery.boxModel&&parseInt(version)>=7)&&2||border;add(-border,-border);}}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&/^t[d|h]$/i.test(parent.tagName)||!safari2)border(offsetParent);if(safari2&&!absolute&&jQuery.css(offsetParent,"position")=="absolute")absolute=true;offsetParent=offsetParent.offsetParent;}while(parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table-row.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if(safari2&&absolute)add(-doc.body.offsetLeft,-doc.body.offsetTop);}results={top:top,left:left};}return results;function border(elem){add(jQuery.css(elem,"borderLeftWidth"),jQuery.css(elem,"borderTopWidth"));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}};})();; /** * Checks/unchecks all tables * * @param string the form name * @param boolean whether to check or to uncheck the element * * @return boolean always true */ function setCheckboxes(the_form, the_field, do_check) { var elts = document.forms[the_form].elements[the_field]; if( typeof(elts) == 'undefined' ) { return false; } var elts_cnt = (typeof(elts.length) != 'undefined') ? elts.length : 0; if (elts_cnt) { for (var i = 0; i < elts_cnt; i++) { elts[i].checked = do_check; } // end for } else { elts.checked = do_check; } // end if... else return true; } // end of the 'setCheckboxes()' function function anchorPop( anchor, width, height, name ) { return popup( anchor.href, width, height, name ); } function popup( url, width, height, name ) { var mylink = url; var windowname = name == null ? 'Popup_Window' : name; var result = null; if (! window.focus) return true; var href; if (typeof(mylink) == "string") href = mylink; else href = mylink.href; var newWin = window.open(href, windowname, "width="+width+",height="+height+",scrollbars=yes,resize=yes"); if (!newWin || !newWin.top) { alert('popup window blocked'); } return false; } function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "=") if (c_start!=-1) { c_start=c_start + c_name.length+1 c_end=document.cookie.indexOf(";",c_start) if (c_end==-1) c_end=document.cookie.length return unescape(document.cookie.substring(c_start,c_end)) } } return null } function setCookie(c_name,value, path, expiredays) { var exdate=new Date() exdate.setDate(expiredays) document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : "; expires="+exdate) + ((path==null) ? "" : "; path="+path) } function in_array(needle, haystack) { var n = haystack.length; for (var i=0; i ul > li', this).remove(); var ul = $('
    '); var t = MENU_COUNTER + 10; for (; MENU_COUNTER < t; MENU_COUNTER++) { $('> ul', this).append('
  • Item ' + MENU_COUNTER + '
  • '); } } } function unloadMenu() { if (MENU_COUNTER >= 30) { MENU_COUNTER = 1; } } // We're passed a UL function onHideCheckMenu() { return !$(this).parent().is('.LOCKED'); } // We're passed a LI function onClickMenu() { $(this).toggleClass('LOCKED'); return true; } ; /* * jdMenu 1.3.beta2 (2007-03-06) * * Copyright (c) 2006,2007 Jonathan Sharp (http://jdsharp.us) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://jdsharp.us/ * * Built upon jQuery 1.1.1 (http://jquery.com) * This also requires the jQuery dimensions plugin */ (function($){ // This will store an element list of all our menu objects var jdMenu = []; // Public methods $.fn.jdMenu = function(inSettings) { var settings = $.extend({}, arguments.callee.defaults, inSettings); return this.each(function() { jdMenu.push(this); $(this).addClass('jd_menu_flag_root'); this.$settings = $.extend({}, settings, {isVerticalMenu: $(this).is('.jd_menu_vertical')}); addEvents(this); }); }; $.fn.jdMenuShow = function() { return this.each(function() { showMenuLI.apply(this); }); }; $.fn.jdMenuHide = function() { return this.each(function() { hideMenuUL.apply(this); }); }; // Private methods and logic $(window) // Bind a click event to hide all visible menus when the document is clicked .bind('click', function(){ $(jdMenu).find('ul:visible').jdMenuHide(); }) // Cleanup after ourself by nulling the $settings object .bind('unload', function() { $(jdMenu).each(function() { this.$settings = null; }); }); // These are our default settings for this plugin $.fn.jdMenu.defaults = { activateDelay: 150, showDelay: 150, hideDelay: 550, onShow: null, onHideCheck: null, onHide: null, onAnimate: null, onClick: null, offsetX: 4, offsetY: 2, iframe: $.browser.msie }; // Our special parentsUntil method to get all parents up to and including the matched element $.fn.parentsUntil = function(match) { var a = []; $(this[0]).parents().each(function() { a.push(this); return !$(this).is(match); }); return this.pushStack(a, arguments); }; // Returns our settings object for this menu function getSettings(el) { return $(el).parents('ul.jd_menu_flag_root')[0].$settings; } // Unbind any events and then rebind them function addEvents(ul) { removeEvents(ul); $('> li', ul) .hover(hoverOverLI, hoverOutLI) .bind('click', itemClick) .find('> a.accessible') .bind('click', accessibleClick); }; // Remove all events for this menu function removeEvents(ul) { $('> li', ul) .unbind('mouseover').unbind('mouseout') .unbind('click') .find('> a.accessible') .unbind('click'); }; function hoverOverLI() { var cls = 'jd_menu_hover' + ($(this).parent().is('.jd_menu_flag_root') ? '_menubar' : ''); $(this).addClass(cls).find('> a').addClass(cls); if (this.$timer) { clearTimeout(this.$timer); } // Do we have a sub menu? if ($('> ul', this).size() > 0) { var settings = getSettings(this); // Which delay to use, the longer activate one or the shorter show delay if a menu is already visible var delay = ($(this).parents('ul.jd_menu_flag_root').find('ul:visible').size() == 0) ? settings.activateDelay : settings.showDelay; var t = this; this.$timer = setTimeout(function() { showMenuLI.apply(t); }, delay); } }; function hoverOutLI() { // Remove both classes so we do not have to test which one we are $(this) .removeClass('jd_menu_hover').removeClass('jd_menu_hover_menubar') .find('> a') .removeClass('jd_menu_hover').removeClass('jd_menu_hover_menubar'); if (this.$timer) { clearTimeout(this.$timer); } // TODO: Possible bug with our test for visibility in that parent menus are hidden child menus are not // If we have a visible menu, hide it if ($(this).is(':visible') && $('> ul', this).size() > 0) { var settings = getSettings(this); var ul = $('> ul', this)[0]; this.$timer = setTimeout(function() { hideMenuUL.apply(ul); }, settings.hideDelay); } }; // "this" is a reference to the LI element that contains // the UL that will be shown function showMenuLI() { var ul = $('> ul', this).get(0); // We are already visible, just return if ($(ul).is(':visible')) { return false; } // Clear our timer if it exists if (this.$timer) { clearTimeout(this.$timer); } // Get our settings object var settings = getSettings(this); // Call our callback if (settings.onShow != null && settings.onShow.apply(this) == false) { return false; } // Add hover classes, needed for accessible functionality var isRoot = $(this).parent().is('.jd_menu_flag_root'); var c = 'jd_menu_active' + (isRoot ? '_menubar' : ''); $(this).addClass(c).find('> a').addClass(c); if (!isRoot) { // Add the active class to the parent list item which maybe our menubar var c = 'jd_menu_active' + ($(this).parent().parent().parent().is('.jd_menu_flag_root') ? '_menubar' : ''); $(this).parent().parent().addClass(c).find('> a').addClass(c); } // Hide any existing menues at the same level $(this).parent().find('> li > ul:visible').not(ul).each(function() { hideMenuUL.apply(this); }); addEvents(ul); // Our range object is used in calculating menu positions var Range = function(x1, x2, y1, y2) { this.x1 = x1; this.x2 = x2; this.y1 = y1; this.y2 = y2; } Range.prototype.contains = function(range) { return (this.x1 <= range.x1 && range.x2 <= this.x2) && (this.y1 <= range.y1 && range.y2 <= this.y2); } Range.prototype.transform = function(x, y) { return new Range(this.x1 + x, this.x2 + x, this.y1 + y, this.y2 + y); } Range.prototype.nudgeX = function(range) { if (this.x1 < range.x1) { return new Range(range.x1, range.x1 + (this.x2 - this.x1), this.y1, this.y2); } else if (this.x2 > range.x2) { return new Range(range.x2 - (this.x2 - this.x1), range.x2, this.y1, this.y2); } return this; } Range.prototype.nudgeY = function(range) { if (this.y1 < range.y1) { return new Range(this.x1, this.x2, range.y1, range.y1 + (this.y2 - this.y1)); } else if (this.y2 > range.y2) { return new Range(this.x1, this.x2, range.y2 - (this.y2 - this.y1), range.y2); } return this; } // window width & scroll offset var sx = $(window).scrollLeft() var sy = $(window).scrollTop(); var ww = $(window).innerWidth(); var wh = $(window).innerHeight(); var viewport = new Range( sx, sx + ww, sy, sy + wh); // "Show" our menu so we can calculate its width, set left and top so that it does not accidentally // go offscreen and trigger browser scroll bars $(ul).css({visibility: 'hidden', left: 0, top: 0}).show(); var menuWidth = $(ul).outerWidth(); var menuHeight = $(ul).outerHeight(); // Get the LI parent UL outerwidth in case borders are applied to it var tp = $(this).parent(); var thisWidth = tp.outerWidth(); var thisBorderWidth = parseInt(tp.css('borderLeftWidth')) + parseInt(tp.css('borderRightWidth')); //var thisBorderTop = parseInt(tp.css('borderTopWidth')); var thisHeight = $(this).outerHeight(); var thisOffset = $(this).offset({border: false}); $(ul).hide().css({visibility: ''}); // We define a list of valid positions for our menu and then test against them to find one that works best var position = []; // Bottom Horizontal // Menu is directly below and left edges aligned to parent item position[0] = new Range(thisOffset.left, thisOffset.left + menuWidth, thisOffset.top + thisHeight, thisOffset.top + thisHeight + menuHeight); // Menu is directly below and right edges aligned to parent item position[1] = new Range((thisOffset.left + thisWidth) - menuWidth, thisOffset.left + thisWidth, position[0].y1, position[0].y2); // Menu is "nudged" horizontally below parent item position[2] = position[0].nudgeX(viewport); // Right vertical // Menu is directly right and top edge aligned to parent item position[3] = new Range(thisOffset.left + thisWidth - thisBorderWidth, thisOffset.left + thisWidth - thisBorderWidth + menuWidth, thisOffset.top, thisOffset.top + menuHeight); // Menu is directly right and bottom edges aligned with parent item position[4] = new Range(position[3].x1, position[3].x2, position[0].y1 - menuHeight, position[0].y1); // Menu is "nudged" vertically to right of parent item position[5] = position[3].nudgeY(viewport); // Top Horizontal // Menu is directly top and left edges aligned to parent item position[6] = new Range(thisOffset.left, thisOffset.left + menuWidth, thisOffset.top - menuHeight, thisOffset.top); // Menu is directly top and right edges aligned to parent item position[7] = new Range((thisOffset.left + thisWidth) - menuWidth, thisOffset.left + thisWidth, position[6].y1, position[6].y2); // Menu is "nudged" horizontally to the top of parent item position[8] = position[6].nudgeX(viewport); // Left vertical // Menu is directly left and top edges aligned to parent item position[9] = new Range(thisOffset.left - menuWidth, thisOffset.left, position[3].y1, position[3].y2); // Menu is directly left and bottom edges aligned to parent item position[10]= new Range(position[9].x1, position[9].x2, position[4].y1 + thisHeight - menuHeight, position[4].y1 + thisHeight); // Menu is "nudged" vertically to left of parent item position[11]= position[10].nudgeY(viewport); // This defines the order in which we test our positions var order = []; if ($(this).parent().is('.jd_menu_flag_root') && !settings.isVerticalMenu) { order = [0, 1, 2, 6, 7, 8, 5, 11]; } else { order = [3, 4, 5, 9, 10, 11, 0, 1, 2, 6, 7, 8]; } // Set our default position (first position) if no others can be found var pos = order[0]; for (var i = 0, j = order.length; i < j; i++) { // If this position for our menu is within the viewport of the browser, use this position if (viewport.contains(position[order[i]])) { pos = order[i]; break; } } var menuPosition = position[pos]; // Find if we are absolutely positioned or have an absolutely positioned parent $(this).add($(this).parents()).each(function() { if ($(this).css('position') == 'absolute') { var abs = $(this).offset(); // Transform our coordinates to be relative to the absolute parent menuPosition = menuPosition.transform(-abs.left, -abs.top); return false; } }); switch (pos) { case 3: menuPosition.y1 += settings.offsetY; case 4: menuPosition.x1 -= settings.offsetX; break; case 9: menuPosition.y1 += settings.offsetY; case 10: menuPosition.x1 += settings.offsetX; break; } if (settings.iframe) { $(ul).bgiframe(); } if (settings.onAnimate) { $(ul).css({left: menuPosition.x1, top: menuPosition.y1}); // The onAnimate method is expected to "show" the element it is passed settings.onAnimate.apply(ul, [true]); } else { $(ul).css({left: menuPosition.x1, top: menuPosition.y1}).show(); } return true; } // "this" is a reference to a UL menu to be hidden function hideMenuUL(recurse) { if (!$(this).is(':visible')) { return false; } var settings = getSettings(this); // Test if this menu should get hidden if (settings.onHideCheck != null && settings.onHideCheck.apply(this) == false) { return false; } // Hide all of our child menus first $('> li ul:visible', this).each(function() { hideMenuUL.apply(this, [false]); }); // If we are the root, do not hide ourself if ($(this).is('.jd_menu_flag_root')) { alert('We are root'); return false; } var elms = $('> li', this).add($(this).parent()); elms.removeClass('jd_menu_hover').removeClass('jd_menu_hover_menubar') .removeClass('jd_menu_active').removeClass('jd_menu_active_menubar') .find('> a') .removeClass('jd_menu_hover').removeClass('jd_menu_hover_menubar') .removeClass('jd_menu_active').removeClass('jd_menu_active_menubar'); removeEvents(this); $(this).each(function() { if (settings.onAnimate != null) { settings.onAnimate.apply(this, [false]); } else { $(this).hide(); } }).find('> .bgiframe').remove(); // Our callback for after our menu is hidden if (settings.onHide != null) { settings.onHide.apply(this); } // Recursively hide our parent menus if (recurse == true) { $(this).parentsUntil('ul.jd_menu_flag_root') .removeClass('jd_menu_hover').removeClass('jd_menu_hover_menubar') .not('.jd_menu_flag_root').filter('ul') .each(function() { hideMenuUL.apply(this, [false]); }); } return true; } // Prevent the default (usually following a link) function accessibleClick(e) { if ($(this).is('.accessible')) { // Stop the browser from the default link action allowing the // click event to propagate to propagate to our LI (itemClick function) e.preventDefault(); } } // Trigger a menu click function itemClick(e) { e.stopPropagation(); var settings = getSettings(this); if (settings.onClick != null && settings.onClick.apply(this) == false) { return false; } if ($('> ul', this).size() > 0) { showMenuLI.apply(this); } else { if (e.target == this) { var link = $('> a', e.target).not('.accessible'); if (link.size() > 0) { var a = link.get(0); if (!a.onclick) { window.open(a.href, a.target || '_self'); } else { $(a).click(); } } } hideMenuUL.apply($(this).parent(), [true]); } } })(jQuery); ; /* * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * $LastChangedDate: 2007-03-04 20:15:11 -0600 (Sun, 04 Mar 2007) $ * $Rev: 1485 $ */ jQuery.fn._height = jQuery.fn.height; jQuery.fn._width = jQuery.fn.width; /** * If used on document, returns the document's height (innerHeight) * If used on window, returns the viewport's (window) height * See core docs on height() to see what happens when used on an element. * * @example $("#testdiv").height() * @result 200 * * @example $(document).height() * @result 800 * * @example $(window).height() * @result 400 * * @name height * @type Object * @cat Plugins/Dimensions */ jQuery.fn.height = function() { if ( this[0] == window ) return self.innerHeight || jQuery.boxModel && document.documentElement.clientHeight || document.body.clientHeight; if ( this[0] == document ) return Math.max( document.body.scrollHeight, document.body.offsetHeight ); return this._height(arguments[0]); }; /** * If used on document, returns the document's width (innerWidth) * If used on window, returns the viewport's (window) width * See core docs on height() to see what happens when used on an element. * * @example $("#testdiv").width() * @result 200 * * @example $(document).width() * @result 800 * * @example $(window).width() * @result 400 * * @name width * @type Object * @cat Plugins/Dimensions */ jQuery.fn.width = function() { if ( this[0] == window ) return self.innerWidth || jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth; if ( this[0] == document ) return Math.max( document.body.scrollWidth, document.body.offsetWidth ); return this._width(arguments[0]); }; /** * Returns the inner height value (without border) for the first matched element. * If used on document, returns the document's height (innerHeight) * If used on window, returns the viewport's (window) height * * @example $("#testdiv").innerHeight() * @result 800 * * @name innerHeight * @type Number * @cat Plugins/Dimensions */ jQuery.fn.innerHeight = function() { return this[0] == window || this[0] == document ? this.height() : this.css('display') != 'none' ? this[0].offsetHeight - (parseInt(this.css("borderTopWidth")) || 0) - (parseInt(this.css("borderBottomWidth")) || 0) : this.height() + (parseInt(this.css("paddingTop")) || 0) + (parseInt(this.css("paddingBottom")) || 0); }; /** * Returns the inner width value (without border) for the first matched element. * If used on document, returns the document's Width (innerWidth) * If used on window, returns the viewport's (window) width * * @example $("#testdiv").innerWidth() * @result 1000 * * @name innerWidth * @type Number * @cat Plugins/Dimensions */ jQuery.fn.innerWidth = function() { return this[0] == window || this[0] == document ? this.width() : this.css('display') != 'none' ? this[0].offsetWidth - (parseInt(this.css("borderLeftWidth")) || 0) - (parseInt(this.css("borderRightWidth")) || 0) : this.height() + (parseInt(this.css("paddingLeft")) || 0) + (parseInt(this.css("paddingRight")) || 0); }; /** * Returns the outer height value (including border) for the first matched element. * Cannot be used on document or window. * * @example $("#testdiv").outerHeight() * @result 1000 * * @name outerHeight * @type Number * @cat Plugins/Dimensions */ jQuery.fn.outerHeight = function() { return this[0] == window || this[0] == document ? this.height() : this.css('display') != 'none' ? this[0].offsetHeight : this.height() + (parseInt(this.css("borderTopWidth")) || 0) + (parseInt(this.css("borderBottomWidth")) || 0) + (parseInt(this.css("paddingTop")) || 0) + (parseInt(this.css("paddingBottom")) || 0); }; /** * Returns the outer width value (including border) for the first matched element. * Cannot be used on document or window. * * @example $("#testdiv").outerWidth() * @result 1000 * * @name outerWidth * @type Number * @cat Plugins/Dimensions */ jQuery.fn.outerWidth = function() { return this[0] == window || this[0] == document ? this.width() : this.css('display') != 'none' ? this[0].offsetWidth : this.height() + (parseInt(this.css("borderLeftWidth")) || 0) + (parseInt(this.css("borderRightWidth")) || 0) + (parseInt(this.css("paddingLeft")) || 0) + (parseInt(this.css("paddingRight")) || 0); }; /** * Returns how many pixels the user has scrolled to the right (scrollLeft). * Works on containers with overflow: auto and window/document. * * @example $("#testdiv").scrollLeft() * @result 100 * * @name scrollLeft * @type Number * @cat Plugins/Dimensions */ jQuery.fn.scrollLeft = function() { if ( this[0] == window || this[0] == document ) return self.pageXOffset || jQuery.boxModel && document.documentElement.scrollLeft || document.body.scrollLeft; return this[0].scrollLeft; }; /** * Returns how many pixels the user has scrolled to the bottom (scrollTop). * Works on containers with overflow: auto and window/document. * * @example $("#testdiv").scrollTop() * @result 100 * * @name scrollTop * @type Number * @cat Plugins/Dimensions */ jQuery.fn.scrollTop = function() { if ( this[0] == window || this[0] == document ) return self.pageYOffset || jQuery.boxModel && document.documentElement.scrollTop || document.body.scrollTop; return this[0].scrollTop; }; /** * Returns the location of the element in pixels from the top left corner of the viewport. * * For accurate readings make sure to use pixel values for margins, borders and padding. * * @example $("#testdiv").offset() * @result { top: 100, left: 100, scrollTop: 10, scrollLeft: 10 } * * @example $("#testdiv").offset({ scroll: false }) * @result { top: 90, left: 90 } * * @example var offset = {} * $("#testdiv").offset({ scroll: false }, offset) * @result offset = { top: 90, left: 90 } * * @name offset * @param Object options A hash of options describing what should be included in the final calculations of the offset. * The options include: * margin: Should the margin of the element be included in the calculations? True by default. * If set to false the margin of the element is subtracted from the total offset. * border: Should the border of the element be included in the calculations? True by default. * If set to false the border of the element is subtracted from the total offset. * padding: Should the padding of the element be included in the calculations? False by default. * If set to true the padding of the element is added to the total offset. * scroll: Should the scroll offsets of the parent elements be included in the calculations? * True by default. When true, it adds the total scroll offsets of all parents to the * total offset and also adds two properties to the returned object, scrollTop and * scrollLeft. If set to false the scroll offsets of parent elements are ignored. * If scroll offsets are not needed, set to false to get a performance boost. * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the * chain will not be broken and the result will be assigned to this object. * @type Object * @cat Plugins/Dimensions * @author Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) */ jQuery.fn.offset = function(options, returnObject) { var x = 0, y = 0, elem = this[0], parent = this[0], op, sl = 0, st = 0, options = jQuery.extend({ margin: true, border: true, padding: false, scroll: true }, options || {}); do { x += parent.offsetLeft || 0; y += parent.offsetTop || 0; // Mozilla and IE do not add the border if (jQuery.browser.mozilla || jQuery.browser.msie) { // get borders var bt = parseInt(jQuery.css(parent, 'borderTopWidth')) || 0; var bl = parseInt(jQuery.css(parent, 'borderLeftWidth')) || 0; // add borders to offset x += bl; y += bt; // Mozilla removes the border if the parent has overflow property other than visible if (jQuery.browser.mozilla && parent != elem && jQuery.css(parent, 'overflow') != 'visible') { x += bl; y += bt; } } if (options.scroll) { // Need to get scroll offsets in-between offsetParents op = parent.offsetParent; do { sl += parent.scrollLeft || 0; st += parent.scrollTop || 0; parent = parent.parentNode; // Mozilla removes the border if the parent has overflow property other than visible if (jQuery.browser.mozilla && parent != elem && parent != op && jQuery.css(parent, 'overflow') != 'visible') { y += parseInt(jQuery.css(parent, 'borderTopWidth')) || 0; x += parseInt(jQuery.css(parent, 'borderLeftWidth')) || 0; } } while (parent != op); } else parent = parent.offsetParent; if (parent && (parent.tagName.toLowerCase() == 'body' || parent.tagName.toLowerCase() == 'html')) { // Safari doesn't add the body margin for elments positioned with static or relative if ((jQuery.browser.safari || (jQuery.browser.msie && jQuery.boxModel)) && jQuery.css(parent, 'position') != 'absolute') { x += parseInt(jQuery.css(op, 'marginLeft')) || 0; y += parseInt(jQuery.css(op, 'marginTop')) || 0; } break; // Exit the loop } } while (parent); if ( !options.margin) { x -= parseInt(jQuery.css(elem, 'marginLeft')) || 0; y -= parseInt(jQuery.css(elem, 'marginTop')) || 0; } // Safari and Opera do not add the border for the element if ( options.border && (jQuery.browser.safari || jQuery.browser.opera) ) { x += parseInt(jQuery.css(elem, 'borderLeftWidth')) || 0; y += parseInt(jQuery.css(elem, 'borderTopWidth')) || 0; } else if ( !options.border && !(jQuery.browser.safari || jQuery.browser.opera) ) { x -= parseInt(jQuery.css(elem, 'borderLeftWidth')) || 0; y -= parseInt(jQuery.css(elem, 'borderTopWidth')) || 0; } if ( options.padding ) { x += parseInt(jQuery.css(elem, 'paddingLeft')) || 0; y += parseInt(jQuery.css(elem, 'paddingTop')) || 0; } // Opera thinks offset is scroll offset for display: inline elements if (options.scroll && jQuery.browser.opera && jQuery.css(elem, 'display') == 'inline') { sl -= elem.scrollLeft || 0; st -= elem.scrollTop || 0; } var returnValue = options.scroll ? { top: y - st, left: x - sl, scrollTop: st, scrollLeft: sl } : { top: y, left: x }; if (returnObject) { jQuery.extend(returnObject, returnValue); return this; } else { return returnValue; } };; /* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * $LastChangedDate: 2007-02-18 22:09:54 -0600 (Sun, 18 Feb 2007) $ * $Rev: 1379 $ */ /** * The bgiframe is chainable and applies the iframe hack to get * around zIndex issues in IE6. It will only apply itself in IE * and adds a class to the iframe called 'bgiframe'. * * It does take borders into consideration but all values * need to be in pixels and the element needs to have * position relative or absolute. * * NOTICE: This plugin uses CSS expersions in order to work * with an element's borders, height and with and can result in poor * performance when used on an element that changes properties * like size and position a lot. Two of these expressions can be * removed if border doesn't matter and performance does. * See lines 39 and 40 below and set top: 0 and left: 0 * instead of their current values. * * @example $('div').bgiframe(); * @before

    Paragraph

    * @result