window.addEvent("domready", function(){
	//var links = $$("a");
	new SmoothScroll();
	new Lightbox();

	$$(".volatile").each(function(el){
		$(el).addEvent("focus", function(){
			if(this.getValue() == this.getProperty("title")) {
				this.value = "";
			}
		});
	});
	
	$$("a[rel*='external']").each(function(a){ 
		$(a).setProperty("target", "_blank");
	});
	
	$$("#subnav li li a").each(function(el){
		if(!el.hasClass("selected")){
			var oColor = el.getStyle("color");
			var fx = new Fx.Style(el, "color", {"duration":300, "wait": false}).set("#8fa6b4");
			el.addEvents({
				"mouseover": function(){
					fx.start(oColor);
				},
				"mouseout": function(){
					fx.start("#8fa6b4");
				}			
			});
		}
	});

		$$("#content ul#category li a").each(function(el){
			new ListItemSelector($(el),{ "fxMin": 1, "fxMax": 0.5 });
		});
		
		$$("#content ul.subcategory li a").each(function(el){
			new ListItemSelector($(el),{ "fxMin": 1, "fxMax": 0.5 });
		});
		
	var myCarousel = new Carousel($("galleryCarousel"), { 
		autoStyle:true,
		idPrevious:$("previousImage"),
		idNext:$("nextImage"),
		visibleItems: 3, //amount that fits in the container
		scrollAmount: 100, //how wide each item is
		scrollInterval: 500, //how quick it should scroll in ms
		fxTransition: Fx.Transitions.quadOut //http://docs.mootools.net/Effects/Fx-Transitions.js <- pick one
	});

	$$("#galleryCarousel").each(function(el){
		new ListItemSelector($(el),{ "fxMin": 1, "fxMax": 0.5 });
	});

	new Accordion($$(".formopen"), $$(".addressforms li"), { "alwaysHide":true, "show":-1 });

	new Accordion($$("#faqlist li h2"), $$("#faqlist li div"), { "alwaysHide":true, "show":-1 });


	new Tips($$(".tooltip"), {
		"initialize": function(){
			this.fx = new Fx.Style(this.toolTip, "opacity", {"wait": false});
		},
		"onHide": function(){
			this.fx.start(0);
		},
		"onShow": function(){
			this.fx.start(1);
		},
		"offsets":{
			"x":-20,
			"y":-130
		}
	});




















});

window.addEvent("load", function(){



});