MG.namespace("MG.widget.Splash");
MG.widget.Splash = (function() {
	var slides = [{
		title	: 'Identify',
		content	: 'Our experienced recruiting team at <b>Mice Groups</b> will meet with you to determine your organization&quot;s requirements and conduct in-depth interviews with you and your teams so that we truly understand your corporate leadership, culture and desired skill sets for the positions you wish to fill. We will then design a very tailored strategy to map those requirements to our large candidate network and, or seek out premier candidates through community-based outreach.'
	},{
		title	: 'Recruit',
		content	: 'We carefully review a pool of highly-qualified candidates and work with you to arrange candidate interviews. We also utilize a number of screening tools, some of which may include: background investigations, pre-employment screening, drug testing, insurance or credit history reviews. Our methods of finding skilled, professional contractors and full-time employees are extremely successful at saving you time and money. We will find the best talent for you to evaluate based on your unique needs.'
	},{
		title	: 'Deliver',
		content	: '<b>Mice Groups</b> will consistently deliver premier candidates to you for your consideration. And, we are in constant contact with you to help manage your selected candidate&quot;s assimilation into your organization. Our team is unique in our committment to staying in tune with your staffing challenges at all times. We pride ourselves on our consistent, personalized service for the entire placement process, from screening to interviewing and after placement on the job.'
	}];
	
	var t = $("#index_title").html(slides[0].title);
	var c = $("#index_content").html(slides[0].content);
	var d = $("#splash_0").find(".splash_dot").css("display", "block");
	var i = 1, x, n, interval;

	/**
	 * Shows one frame of the slide
	 */
	function _showSlide() {
		for(x=0, n=slides.length; x<n; x++) {
			$("#splash_" + x).find(".splash_dot").css("display", "none");
		}

		t.fadeOut(500, function() {
			t.html(slides[i].title);
			t.fadeIn(500);
		});
		
		c.fadeOut(500, function() {
			c.html(slides[i].content);
			c.fadeIn(500);
		});

		$("#splash_" + i).find(".splash_dot").css("display", "block");
	}
	
	/**
	 * Starts the carousel for the taglines
	 */
	function initSplash() {
		interval = setInterval(function() {
			_showSlide();
			
			i++;
			i = (i >= slides.length) ? 0 : i;
		}, 10000);
	}
	
	$(".splash_dot_frame").bind("click", function() {
		clearInterval(interval);
		i = parseInt(this.id.substr(7));
		_showSlide();
	});
	
	if(window.location.search == '') {
		MG.registerBoot(initSplash);
	}
})();
