/* $dom library (v0.9.1b) copyright 2009, Keith Clark Licensed under the MIT License. http://www.keithclark.co.uk/$dom/ */(function(){function H(a,b,c){b=B(b);var f=C[b];return f&&f.i?f.i(a,c):(a.style[b]=c)}function B(a){return I[a]||(I[a]=a.replace(/\-(.)/g,function(b,c){return c.toUpperCase()}))}function D(a,b,c){if(c===x){if(typeof b=="string")return y(a,b)||0;for(var f in b)H(a,f,b[f])}else H(a,b,c)}function E(a){var b,c=[];if(typeof a=="string")for(;a!="";){b=a.match(M);if(b[0]=="")return null;c.push({rel:b[1],f:b[2],j:(b[2]||"").toUpperCase(),id:b[3],b:b[4]?b[4].split("."):x});a=a.substring(b[0].length)}return c} function N(a,b){for(;(a=a.parentNode)&&a!=b;);return a!==null}function O(a,b){function c(e,k){var l;e=k.id?(l=(e&&e.ownerDocument||q).getElementById(k.id))&&N(l,e)?[l]:[]:f(e.getElementsByTagName(k.f?k.j:"*"));l=e.length;if(l>0&&(k.id||k.b))for(;l--;)u(e[l],k)||e.splice(l,1);return e}function f(e){try{return Array.prototype.slice.call(e)}catch(k){for(var l=[],F=0;F<e.length;F++)l.push(e[F]);return l}}function m(e){for(var k=h.length;k--;)if(h[k]===e)return v;return t}var h=[];a=[a];b=E(b);var i,n, p,r,d,g,o,j;if(b.length==0)b=[{}];i=0;for(n=b.length;i<n;i++){o=b[i];p=0;for(r=a.length;p<r;p++){d=a[p];switch(o.rel){case ">":j=d.childNodes;d=0;for(g=j.length;d<g;d++)u(j[d],o)&&h.push(j[d]);break;case "~":for(;d=d.nextSibling;)if(u(d,o)){if(m(d))break;h.push(d)}break;case "+":for(;(d=d.nextSibling)&&d.nodeType!=1;);d&&u(d,o)&&h.push(d);break;default:j=c(d,o);if(i>0){d=0;for(g=j.length;d<g;d++)m(j[d])||h.push(j[d])}else h=h.concat(j);break}}if(h.length===0)return[];a=h.splice(0,h.length)}return a} function u(a,b){return a.nodeType==1&&b&&!(b.f&&b.j!=a.tagName)&&!(b.id&&b.id!=a.id)&&!(b.b&&!P(a,b.b))}function w(a,b,c){c=E(c);for(c=c.length>0?c[0]:null;a&&(a=a[b])&&(c?!u(a,c):a.nodeType!=1););return a}function P(a,b){if(a.className=="")return t;for(var c=0;c<b.length;c++)if(!$dom.hasClass(a,b[c]))return t;return v}function J(a,b){a=s.splice(a,1)[0];typeof a.g=="function"&&a.g(b,a.e)}function Q(a,b,c,f){var m,h=[],i,n;i=-1;for(n=s.length-1;n>=0;n--)if(s[n].e==a){i=n;break}if(b===x)return i>-1; i>-1&&J(i,t);if(c===x)c=500;for(m in b){i=K.exec(D(a,m));n=K.exec(b[m]);h[m]={d:parseFloat(i[1]),c:parseFloat(n[1]),l:i[2]||n[2]||""}}s.push({e:a,k:new Date,h:h,g:f});if(z==null)z=setInterval(function(){for(var p=s.length-1;p>=0;p--){var r={},d,g,o=s[p],j=new Date-o.k,e=1-(0.5-Math.cos(j/c*Math.PI)/2);for(d in o.h){g=o.h[d];r[d]=Number(j>=c?g.c:g.d>g.c?g.c+(g.d-g.c)*e:g.d+(g.c-g.d)*(1-e)).toFixed(2)+g.l;if(r[d]=="NaNpx")r[d]="0"}D(o.e,r);j>=c&&J(p,v)}if(s.length==0)z=clearInterval(z)},10)}function L(){var a, b,c;function f(){if(!a){a=true;if(b)b=clearTimeout(b);for(c in G)G[c]()}}window.onload=f;q.addEventListener&&q.addEventListener("DOMContentLoaded",f,t);(function(){var m=/loaded|complete/.test(q.readyState);if(!m&&A)try{q.documentElement.doScroll("left");m=v}catch(h){}m?f({type:"timer"}):setTimeout(arguments.callee,50)})()}var q=document,v=true,t=false,x=undefined,z,s=[],K=/^(.*?)(px|deg)?$/,M=/^\s*([>+~])?\s*([*a-z0-9\-_]+)?(?:#([a-z0-9\-_]+))?(?:\.([a-z0-9\.\-_]+))?\s*/i,A=/*@cc_on!@*/t,G=[],I={"float":A?"styleFloat": "cssFloat"},C=A?{opacity:{i:function(a,b){var c=a.filters.alpha;if(c)c.opacity=b*100;else a.style.filter+=" Alpha(opacity="+b*100+")"},a:function(a){return(a=a.filters.alpha)?a.opacity/100:1}},width:{a:function(a){return a.style.width||a.clientWidth||a.offsetWidth}},height:{a:function(a){return a.style.height||a.clientHeight||a.offsetHeight}}}:{borderWidth:{a:function(a){return y(a,"border-left-width")}},padding:{a:function(a){return y(a,"padding-left")}},margin:{a:function(a){return y(a,"margin-left")}}}, y=A?function(a,b){b=B(b);var c=C[b];return c&&c.a?c.a(a):a.currentStyle[b]}:function(a,b){var c=B(b);return(c=C[c])&&c.a?c.a(a):a.ownerDocument.defaultView.getComputedStyle(a,null).getPropertyValue(b)};L.prototype={create:function(a,b){a=E(a)[0];b=(b||q).createElement(a.f);if(a.id)b.id=a.id;if(a.b)b.className=a.b.join(" ");return b},onready:function(a){G.push(a)},get:function(a,b){return this.descendants(b||q,a)},descendants:function(a,b){return O(a,b)},ancestor:function(a,b){return w(a,"parentNode", b)},next:function(a,b){return w(a,"nextSibling",b)},previous:function(a,b){return w(a,"previousSibling",b)},first:function(a,b){a=a.parentNode;return w(a,"firstChild",b)||this.next(a.firstChild,b)},last:function(a,b){a=a.parentNode;return w(a,"lastChild",b)||this.previous(a.lastChild,b)},hasClass:function(a,b){return(" "+a.className+" ").indexOf(b)>-1},addClass:function(a,b){this.hasClass(a,b)||(a.className+=(a.className!=""?" ":"")+b)},removeClass:function(a,b){if(this.hasClass(a,b))a.className= a.className.replace(new RegExp("(^|\\s)"+b+"(\\s|$)")," ").replace(/\s$/,"")},toggleClass:function(a,b,c){this[c===v?"addClass":"removeClass"](a,b)},style:function(a,b,c){return D(a,b,c)},transform:function(a,b,c,f){return Q(a,b,c,f)}};window.$dom=new L})();		$dom.onready( function()		{						createSlider($dom.get("#slider1")[0], 5000, true, true );						function createSlider( elm, pauseTime, buttons, autoPlay )			{				function createButtons()				{					var next = $dom.create("a.next");					var prev = $dom.create("a.prev");										elm.appendChild( next );					elm.appendChild( prev );										next.onmousedown = function() { moveTo(index+1); return false }					prev.onmousedown = function() { moveTo(index-1); return false }										if (autoPlay)					{						elm.onmouseover = stop						elm.onmouseout = play					}				}								var index = 0;				var list = $dom.descendants( elm, ">ul")[0];				var items = $dom.descendants( list, ">li");				var width = parseFloat( $dom.style( elm, "width" ) )								var timer;												$dom.style( list, "width", (width * items.length) + "px" );				function moveTo( newIndex )				{					index = newIndex >=0 ? (newIndex % items.length) : items.length+newIndex; 					$dom.transform( list, {"margin-left": -(width*index) + "px"}, 350 )				}				function play()				{					timer = setTimeout( function() { moveTo(index+1); play() }, pauseTime )				}				function stop()				{					clearTimeout(timer)				}				if (buttons)				{					createButtons()				}								if (autoPlay)				{					play()				}			}		})		//]]>
