window.addEvent('domready', function() {



new Autocompleter.Request.JSON('ac_keywords2','ajax.php?req_script=ac_auto_completer&hook=searchindex&searchmodid=2',{minLength:3,indicatorClass:'autocompleter-loading'});





$("nav_logos").getElements("a").each( function(item, index) {
		var fx = new Fx.Morph(item, {duration: '300', link: 'cancel', transition: Fx.Transitions.Sine.easeOut});
		item.addEvents({
			"mouseenter" : function() { 
				fx.start({"margin-top" : "3px", "margin-bottom" : "-3px"});
			},
			"mouseleave" : function() { 
				fx.start({"margin-top" : "0px", "margin-bottom" : "0px"});
			}
		});




		



	});








new Accordion($$('div.toggler'), $$('div.accordion'),
	{
		opacity: false
	});


      new Sprites2({mode: 'fade', item_selector: '#nav_main ul li a'});
      new Sprites2({mode: 'slide', item_selector: '#nav_main1 ul li a'});
      new Sprites2({mode: 'animate', item_selector: '#nav_main1 ul li a'});
    
      Sprites2.implement({
        effects: {
          slide_x: function(fx_element) {
            fx_element.store('width', fx_element.getSize().x).setStyles({'width': 0});
            
            this.show_fn = function(fx_element) { fx_element.tween('width', fx_element.retrieve('width')); };
            this.hide_fn = function(fx_element) { fx_element.tween('width', 0); };
          }
        }
      });



      
      new Sprites2({mode: 'slide_x', item_selector: '#nav_main1 ul li a'});

	
	
			//slider variables for making things easier below
		var itemsHolder = $('slidecontainer');
		var myItems = $$(itemsHolder.getElements('.slideitem'));
		
		//controls for slider
		var theControls = $('controls1');
		var numNavHolder = $(theControls.getElement('ul'));
		var thePlayBtn = $(theControls.getElement('.play_btn'));
		var thePrevBtn = $(theControls.getElement('.prev_btn'));
		var theNextBtn = $(theControls.getElement('.next_btn'));
		
		
		//create instance of the slider, and start it up		
		var mySlider = new SL_Slider({
			slideTimer: 7000,
			orientation: 'horizontal',      //vertical, horizontal, or none: None will create a fading in/out transition.
			fade: false,                    //if true will fade the outgoing slide - only used if orientation is != None
			isPaused: false,
			slidecontainer: itemsHolder,
			items: myItems,
			numNavActive: true,
			numNavHolder: numNavHolder,
			playBtn: thePlayBtn,
			prevBtn: thePrevBtn,
			nextBtn: theNextBtn
		});
		mySlider.start();
		
		
		//adding a little animated rollover highlight to the play and prev/next buttons
		var origBkgdColor = thePlayBtn.getStyle('color');
		var newBkgdColor = "#80301D";
		var btnArray = new Array(thePlayBtn, thePrevBtn, theNextBtn);
		
		btnArray.each(function(e, i){
			e.set('tween', {duration: 350, transition: 'cubic:out', link: 'cancel'});
			e.addEvents({ 
				'mouseenter' : function() {
					this.tween('background-color', newBkgdColor);
				},
				'mouseleave' : function() {
					this.tween('background-color', origBkgdColor);
				}
			});
		



});




});

