// JavaScript Document
	var mHeight = 0;
	var dimensions = function()
	{
		var winSize = window.getSize();
		mHeight =  Math.floor(winSize.y/ 2)
		return mHeight;
	}
	var positionMe = function() {
	dimensions();
	if ((mHeight - 400) > 0){
		$('header').setStyle('margin-top', mHeight-400)
		}
	else{
		$('header').setStyle('margin-top', 0)
		}
	}

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

	$('prev').addEvent('mouseenter', function(){
			this.set('src', 'images/tl-prev-on.gif');
	});
	$('prev').addEvent('mouseleave', function(){
			this.set('src', 'images/tl-prev.gif');
	});
	$('next').addEvent('mouseenter', function(){
			this.set('src', 'images/tl-next-on.gif');
	});
	$('next').addEvent('mouseleave', function(){
			this.set('src', 'images/tl-next.gif');
	});

	
	if(typeof walkTo == "number") {var moreHandles = $$('#hlinks span')}
    var equusSlider = new noobSlide({
        box: $('slider'),
        items: $$('div .panes'),
        size: 640,
        handles: $$('#homelinkbar span'),
        addButtons: {previous: $('prev'), next: $('next') },
			onWalk: function(currentItem,currentHandle){
				//style for handles
				$$(this.handles).removeClass('active');
				$$(currentHandle[this.currentIndex]).addClass('active');
        },
        fxOptions: {duration: 2000, transition: Fx.Transitions.Quart.easeInOut, wait: false}
    });
	//more handle buttons
	if(typeof walkTo == "number") {
		equusSlider.addHandleButtons(moreHandles);
		equusSlider.walk(walkTo, false, false);
		}

	$$('.back').addEvent('click', function(){
		equusSlider.walk(0, true, false)
	});
});

window.addEvent('resize', positionMe);
