/*
**
**
**
*/

window.addEvent('domready', function(){
	//OnLoad Effects
	$('content').setStyle('display', 'none')
	$('content').set('reveal', {
		duration:			1500,
		transition:			Fx.Transitions.Expo.easeInOut
	})
	$('content').get('reveal').reveal()
	
	//
	//Setup tooltips
	var tips = new Tips('.tooltip', {text:''});
	tips.addEvents({
		'show':		function(tip, el){
			tip.fade('in')
		},
		'hide':		function(tip, el){
			tip.fade('out')
		}
	})
	//
	
	//Setup partners slideshow
	$$('#partners img').each(function(el){
		el.setStyles({
			'height':	80
		})
		el.set('morph', {duration:'short', transition:Fx.Transitions.Expo.easeInOut})
		el.addEvents({
			'mouseover':	function(){
				el.morph({
					'height':	100
				})
			},
			'mouseout':		function(){
				el.morph({
					'height':	80
				})
			}
		})
	})
	
	//Tabbed pannels
	new TabSwapper({
		selectedClass:		'on',
		deselectedClass: 	'off',
		tabs: 				$$('#tabBoxIndex ul.tabSet li'),
		clickers: 			$$('#tabBoxIndex ul.tabSet li'),
		sections: 			$$('div.panelSet div.panel'),
		smooth: 			true,
		smoothSize: 		true,
		onActive:			function(index, section, tab){
			
		},
		onBackground:		function(index, section, tab){
		}
	});
	//
	
	//Setup Newz Slideshow
	var nSlideShow = new SimpleSlideShow.Carousel($('newzCarousel'), {
		rotateAction: 		'click',
		startIndex:			0,
		slides:				$$('#newzCarousel div.event'),
		nextLink:			'ssNewzNxt',
		prevLink:			'ssNewzPrv'
	});
	
	function nAutoplay(){
		nSlideShow.forward()
	}
	var nAutoplayer = nAutoplay.periodical(10000)
	$$('#ssNewzNxt, #ssNewzPrv').each(function(el){
		el.addEvent('click', function(){
			$clear.delay(0, null, nAutoplayer)
		})
	})
	//
})
