﻿$j(document).ready(function(){
	hero.init();
	twitter.init();
});
hero = function(){
	var config = {
		hero: $j('#SlideShow'),
		scrollPane: $j('#SlideShowContent'),
		previousButton: $j('#Previous'),
		nextButton: $j('#Next'),
		previousTab: $j('#Previous .tab'),
		nextTab: $j('#Next .tab'),
		signup: $j('#SignUp'),
		header: $j('#SignUpHeader'),
		button: $j('#SignUpWobbler')
	}
	function init(){
		render();
		events();
	};
	function events(){
		//Scroll
		config.scrollPane.serialScroll({
			items:'li.slide',
			axis: 'x',
			prev: config.previousButton,
			next: config.nextButton,
			offset:0, //1
			start:0, //as we are centering it, start at the 2nd
			step: 1,
			duration:400,
			force:true,
			stop:true,
			lock:false,
			cycle:true, //don't pull back once you reach the end
			jump: false //click on the images to scroll to them
		});
	};
	function render(){
		config.previousTab.animate({right: '0px'},1200);
		config.nextTab.animate({left: '0px'},1200,function(){
				//animate sign up
				config.header.animate({top: '3px'},1000).animate({top: '0'},"fast",function(){
				//animate button
				config.button.animate({top: '3px'},"fast").animate({top: '0'},"fast");
			});
		});
		
	};
	function validation(){};
	function databaseTest(a){
		return false
	};
	return {
		init:init,
		config:config
	}
}();
twitter = function(){
	var config = { };
	function init(){
		$j("#TwitterFeed").tweet({
		 avatar_size: 16,
		 count: 4,
		 query: "asimplemeasure",
		 loading_text: "searching twitter..."
		});
		
	};
	function render(){};
	return { config: config, init: init };
}();