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

	
	if(document.getElementById("slider")){
			
		//slider variables for making things easier below
		var itemsHolder = $('container');
		var myItems = $$(itemsHolder.getElements('.item'));
		
		//controls for slider
		var theControls = $('controls1');
		var numNavHolder = $(theControls.getElement('div'));
	//	var thePlayBtn = $(theControls.getElement('.play_btn'));
	//	var thePrevBtn = $(theControls.getElement('.prev_btn'));
	//	var theNextBtn = $(theControls.getElement('.next_btn'));
	    var thePrevBtn = $('sback');
        var theNextBtn = $('snext'); 
		
		
		//create instance of the slider, and start it up		
		var mySlider = new SL_Slider({
			slideTimer: 6000,
			orientation: 'none',      //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,
			container: itemsHolder,
			items: myItems,
			numNavActive: true,
			numNavHolder: numNavHolder,
			//playBtn: null,
           // prevBtn: thePrevBtn,
            //nextBtn: theNextBtn 
			
		});
		mySlider.start();

	}
	
	
	
	//product tabs
	
	$$('.tab').addEvent('mouseover',function(){
			    $$('.tab').each(function(argument, index){
					argument.removeClass('active');
			    });
				this.addClass('active');
				$("showproducts").erase("class");
				$("showproducts").addClass(this.get('href'));
	});
	$$('.tab').addEvent('click',function(){
		return false;
	});
	
	$$('#anav a').addEvent('mouseover',function(){
		$$('#anav a').each(function(argument, index){
			argument.removeClass('active');
		});
		this.addClass('active');
		$("showproducts").erase("class");
		$("showproducts").addClass('cont '+this.get('href').replace("/",""));
		return false;
	});
	
	
	
	
	//comments form
	var formStatus = false;
	if ($('comments_form'))
	{
		$('comments_form').setStyle('display', 'none');
		$('add_comment').addEvent('click', function(e){
			e.stop();
			if (formStatus == false)
			{
				$('comments_form').setStyle('display', 'block');
				formStatus = true;
			}
			else
			{
				$('comments_form').setStyle('display', 'none');
				formStatus = false;
			}
		});	
	}


	if($('addcomment'))
	{
		$('addcomment').addEvent('click', function(e){
			e.stop();
			
			$('comments_form').setStyle('display', 'block');

			var myFx = new Fx.Scroll(window).toElement($('req'));
		
		});	
	}


	
});


