// Horizontal Slider
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('m 15=r B({3:{5:{e:"1x",N:"18",J:1,l:10.12.1R.1e,o:1D,h:{e:"1E",P:1F,1q:"G"}},9:{13:"9",z:1G},V:"1H",M:"1I",L:"1J",1h:B.I,1i:B.I,1w:B.I,1f:B.I,1u:B.I},1K:6(j,3){2.1L(3);2.j=$(j);2.f=$A($$(\'.\'+2.3.9.13));2.w=O;7(2.3.V!="Y"&&$(2.3.V))$(2.3.V).W("Z",6(t){r 11(t).G();2.1v();2.K("1h",2,D)}.i(2));7(2.3.M!="Y"&&$(2.3.M))$(2.3.M).W("Z",6(t){r 11(t).G();2.16();2.K("1i",2,D)}.i(2));7(2.3.L!="Y"&&$(2.3.L))$(2.3.L).W("Z",6(t){r 11(t).G();2.1t()}.i(2));m v=2.3.5;H(2.3.5.e.R()){q"E":2.f.1A(6(9){9.c=9.X("x",{o:v.o,l:v.l});9.1s("x",0);9.1l({"1m":6(){2.w=1n;7(2.3.5.h.e=="F")2.p=$1o(2.p)}.i(2),"1p":6(){2.w=O;7(2.3.5.h.e=="F")2.p=2.Q.17(2.3.5.h.P,2)}.i(2)})}.i(2));2.s=2.j.1B("s").1g();2.4=0;2.k(2.4);g;S:2.f=$A($$(\'.\'+2.3.9.13));2.f.1A(6(9){9.1l({"1m":6(){2.w=1n;7(2.3.5.h.e=="F")2.p=$1o(2.p)}.i(2),"1p":6(){2.w=O;7(2.3.5.h.e=="F")2.p=2.Q.17(2.3.5.h.P,2)}.i(2)})}.i(2));7(2.j!=1N){2.c=2.j.1O({o:v.o,l:v.l,1P:O});2.4=0;2.j.1s(v.N,-2.4*2.3.9.z)}g}7(2.3.5.h.e=="F")2.p=2.Q.17(2.3.5.h.P,2)},1Q:6(n){H(2.3.5.e.R()){q"E":m u=2.4;2.4=n;2.k(2.4,u);g;S:2.4=n;2.k(2.4);g}$$("#19-1a a").1b(\'y\');$("1c-"+2.4).1d(\'y\');2.K("1u",2,D)},1v:6(){H(2.3.5.e.R()){q"E":m u=2.4;2.4-=2.3.5.J;7(2.4<0)2.4=(2.f.U-1);2.k(2.4,u);g;S:2.4-=2.3.5.J;7(2.4<0){2.4=(2.f.U-1)}2.k(2.4);g}$$("#19-1a a").1b(\'y\');$("1c-"+2.4).1d(\'y\');2.K("1w",2,D)},16:6(){H(2.3.5.e.R()){q"E":m u=2.4;2.4+=2.3.5.J;7(2.4>=2.f.U)2.4=0;2.k(2.4,u);g;S:2.4+=2.3.5.J;7((2.4+1)>2.f.U){2.4=0}2.k(2.4);g}$$("#19-1a a").1b(\'y\');$("1c-"+2.4).1d(\'y\');2.K("1f",2,D)},1t:6(){(2.j.1B("s").1g()==0)?2.j.X("s",{o:1j,l:10.12.1k.1e}).d(2.s):2.j.X("s",{o:1j,l:10.12.1k.1e}).d(0)},Q:6(){7(2.3.5.h.1q=="G"&&!2.w)2.16()},k:6(a,b){H(2.3.5.e){q"E":7($1S(b)){2.f[b].c.d(0).C(6(){2.f[a].c.d(1)}.i(2))}14{2.f[a].c.d(1)}g;q"1C":m 8=2;7(8.3.5.N=="T"){8.c.d({"T":-a*8.3.9.z})}14{8.c.d({"18":-a*8.3.9.z})}g;q"1x":m 8=2;7(8.3.5.N=="T"){8.c.d({"x":0.1r}).C(6(){8.c.d({"T":-a*8.3.9.z}).C(6(){8.c.d({"x":0.1z})})})}14{8.c.d({"x":0.1r}).C(6(){8.c.d({"18":-a*8.3.9.z}).C(6(){8.c.d({"x":0.1z})})})}g}}});15.1y(r 1M);15.1y(r 1T);',62,118,'||this|options|atScreen|animation|function|if|that|item|||fx|start|type|aItems|break|rotate|bind|container|_animate|transition|var||duration|timer|case|new|height|event|lastIndex|oAn|isMouseOver|opacity|on|size||Class|chain|20|fade|auto|stop|switch|empty|amount|fireEvent|idToggle|idNext|direction|false|interval|_autoRotate|toLowerCase|default|top|length|idPrevious|addEvent|effect|undefined|click|Fx|Event|Transitions|klass|else|iCarousel|_next|periodical|left|slider|nav|removeClass|slLink|addClass|easeInOut|onNext|toInt|onClickPrevious|onClickNext|1000|Sine|addEvents|mouseenter|true|clear|mouseleave|onMouseOver|75|setStyle|_toggle|onGoTo|_previous|onPrevious|fadeNscroll|implement|99|each|getStyle|scroll|500|manual|5000|810|previous|next|toggle|initialize|setOptions|Events|null|effects|wait|goTo|Cubic|defined|Options'.split('|'),0,{}))

// initialize MooTools toggles
function initToggles() {	
	var a = new Accordion('.toggler', '.stretcher', {
		show: -1
		,alwaysHide: true
		,opacity: false
		,onActive: function(toggler, element){
			toggler.addClass('open');
			}
		,onBackground: function(toggler, element){
			toggler.removeClass('open');
			}				
	});
}
window.addEvent('domready', initToggles);

// configure sIFR
var avantBook = { 
	src: '/swf/AvantGarde-Book.swf'
	,ratios: [8,1.06,18,1.05,27,1.08,34,1.09,35,1.1,44,1.09,45,1.1,54,1.09,57,1.1,59,1.09,68,1.1,69,1.09,78,1.1,79,1.09,1.1]
	};
var avantMedium = { 
	src: '/swf/AvantGarde-Demi.swf'
	,ratios: [8,1.06,18,1.05,27,1.08,34,1.09,35,1.1,44,1.09,45,1.1,54,1.09,57,1.1,59,1.09,68,1.1,69,1.09,78,1.1,79,1.09,1.1]
	};

sIFR.delayCSS  = true;
sIFR.activate(avantBook, avantMedium);

sIFR.replace(avantBook, {
	selector: 'h1'
    ,css: [
      '.sIFR-root { color: #339911; leading: 0; }'
      ,'a { text-decoration: none; }'
      ,'a:link { color: #339911; }'
      ,'a:hover { color: #339911; text-decoration: underline; }'
    ]	
});
sIFR.replace(avantMedium, {
	selector: '.philosophy .sub2 h2'
    ,css: [
      '.sIFR-root { color: #666666; leading: 0; }'
      ,'a { text-decoration: none; }'
      ,'a:link { color: #666666; }'
      ,'a:hover { color: #666666; text-decoration: underline; }'
    ]	
});
sIFR.replace(avantMedium, {
	selector: '#products h2'
    ,css: [
      '.sIFR-root { color: #339911; leading: 0; }'
      ,'a { text-decoration: none; }'
      ,'a:link { color: #339911; }'
      ,'a:hover { color: #339911; text-decoration: underline; }'
    ]	
});
sIFR.replace(avantMedium, {
	selector: 'h2.alt'
    ,css: [
      '.sIFR-root { color: #666666; leading: 0; }'
      ,'a { text-decoration: none; }'
      ,'a:link { color: #666666; }'
      ,'a:hover { color: #666666; text-decoration: underline; }'
    ]	
});
sIFR.replace(avantBook, {
	selector: 'h2'
    ,css: [
      '.sIFR-root { color: #339911; leading: 0; }'
      ,'a { text-decoration: none; }'
      ,'a:link { color: #339911; }'
      ,'a:hover { color: #339911; text-decoration: underline; }'
    ]
    ,wmode: 'transparent'	
});
sIFR.replace(avantMedium, {
	selector: 'h3'
    ,css: [
      '.sIFR-root { color: #339911; leading: 0; }'
      ,'a { text-decoration: none; }'
      ,'a:link { color: #339911; }'
      ,'a:hover { color: #339911; text-decoration: underline; }'
    ]	
});
sIFR.replace(avantMedium, {
	selector: 'h4'
    ,css: [
      '.sIFR-root { color: #339911; leading: 0; }'
      ,'a { text-decoration: none; }'
      ,'a:link { color: #339911; }'
      ,'a:hover { color: #339911; text-decoration: underline; }'
    ]	
});
sIFR.replace(avantMedium, {
	selector: '.date'
    ,css: [
      '.sIFR-root { color: #666666; leading: 0; text-transform: uppercase; }'
      ,'a { text-decoration: none; }'
      ,'a:link { color: #339911; }'
      ,'a:hover { color: #339911; text-decoration: underline; }'
    ]	
});

//protector class
var dwProtector = new Class({

	//implements
	Implements: [Options],

	//options
	options: {
		image: 'blank.gif',
		elements: $$('img'),
		zIndex: 10
	},
	
	//initialization
	initialize: function(options) {
		//set options
		this.setOptions(options);
		
		//make it happen
		this.protect();
	},
	
	//a method that does whatever you want
	protect: function() {
		//for each image that needs be protected...
		this.options.elements.each(function(el) {
			//get the element's position, width, and height
			var size = el.getCoordinates();
			
			leftOffset = size.left;
			topOffset = size.top;
			
			// logic to position horizontal slider images correctly
			if (size.width == '810' || leftOffset > '810') {
				leftOffset = '1';
			}
			
			//create the protector
			var p = new Element('img', {
				src: this.options.image,
				width: size.width,
				height: size.height,
				styles: {
					'z-index': this.options.zIndex,
					'left': leftOffset + 'px',
					'top': topOffset + 'px',
					'position': 'absolute'
				}
			}).inject($(document.body),'bottom');
		},this);
		
	}
});
window.addEvent('domready', function() {;
	var protector = new dwProtector({
		image: '/img/blank.gif',
		elements: $$('#slider-content img')
	});
});