var reEmail = /^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9})$/

function isEmail(s) {
	return reEmail.test(s)
}

function validateCondition() {

	if (!$("conditions").checked)
		{
			alert('You must accept the conditions for continue.');
			return false;
		}
	
	return true;
	
}
var content_slider;

window.addEvent('domready', function() {

	$$('.close').addEvent('click',function(event) {
		event.stop();
		new Fx.Morph(this.getParent(), {duration: 'normal', onComplete : function (el) { el.dispose(); } }).start({
																														'height': 0,
																														'opacity': 0,
																														'padding' : 0
																												});
														 
	});



	var initMultiBox = new multiBox({
		mbClass: '.mb',
		container: $(document.body),
		descClassName: 'multiBoxDesc',
		useOverlay: true,
		addDownload: false,
		addRollover: false,
		addOverlayIcon: false,
		addChain: false,
		recalcTop: false,
		addTips: false,
		showControls : true
	});
	
	var socialmedia_box = new Slider($('socialmedia_scroll'), $('socialmedia_scroll_handle'), {	
										steps: $('socialmedia_content').getScrollSize().y - $('socialmedia_content').getSize().y,
										mode: 'vertical',
										onChange: function(step){
											$('socialmedia_content').scrollTo(0,step);
										}
									}).set(0);
	var ecommerce_box = new Slider($('ecommerce_scroll'), $('ecommerce_scroll_handle'), {	
										steps: $('ecommerce_content').getScrollSize().y - $('ecommerce_content').getSize().y,
										mode: 'vertical',
										onChange: function(step){
											$('ecommerce_content').scrollTo(0,step);
										}
									}).set(0);
	var analytics_box = new Slider($('analytics_scroll'), $('analytics_scroll_handle'), {	
										steps: $('analytics_content').getScrollSize().y - $('analytics_content').getSize().y,
										mode: 'vertical',
										onChange: function(step){
											$('analytics_content').scrollTo(0,step);
										}
									}).set(0);
	var seo_box = new Slider($('seo_scroll'), $('seo_scroll_handle'), {	
										steps: $('seo_content').getScrollSize().y - $('seo_content').getSize().y,
										mode: 'vertical',
										onChange: function(step){
											$('seo_content').scrollTo(0,step);
										}
									}).set(0);
	var financial_reports_box = new Slider($('financial_reports_scroll'), $('financial_reports_scroll_handle'), {	
										steps: $('financial_reports_content').getScrollSize().y - $('financial_reports_content').getSize().y,
										mode: 'vertical',
										onChange: function(step){
											$('financial_reports_content').scrollTo(0,step);
										}
									}).set(0);
	var instant_messaging_box = new Slider($('instant_messaging_scroll'), $('instant_messaging_scroll_handle'), {	
										steps: $('instant_messaging_content').getScrollSize().y - $('instant_messaging_content').getSize().y,
										mode: 'vertical',
										onChange: function(step){
											$('instant_messaging_content').scrollTo(0,step);
										}
									}).set(0);
	var emarketing_box = new Slider($('emarketing_scroll'), $('emarketing_scroll_handle'), {	
										steps: $('emarketing_content').getScrollSize().y - $('emarketing_content').getSize().y,
										mode: 'vertical',
										onChange: function(step){
											$('emarketing_content').scrollTo(0,step);
										}
									}).set(0);
	var touchscreen_box = new Slider($('touchscreen_scroll'), $('touchscreen_scroll_handle'), {	
										steps: $('touchscreen_content').getScrollSize().y - $('touchscreen_content').getSize().y,
										mode: 'vertical',
										onChange: function(step){
											$('touchscreen_content').scrollTo(0,step);
										}
									}).set(0);
	var flowcontrolpanel_box = new Slider($('flowcontrolpanel_scroll'), $('flowcontrolpanel_scroll_handle'), {	
										steps: $('flowcontrolpanel_content').getScrollSize().y - $('flowcontrolpanel_content').getSize().y,
										mode: 'vertical',
										onChange: function(step){
											$('flowcontrolpanel_content').scrollTo(0,step);
										}
									}).set(0);
	
	
 content_slider = new slider({
					slideTimer: 8000,
					transitionTime: 1000,
					isPaused: true,
					container: $('content'),
					items: $$('.item'),
					effect : 'slide'
				});
 
 content_slider.slideIt(0);
 
 $$('.menu').addEvents({
											'click' : function(e) {
												e.stop();
												content_slider.slideIt(this.rel);
											}
											

											 
});
 
var toRight,toLeft; 
var brandsDuration = 45000;
 
toRight = new Fx.Morph('brands', {duration: brandsDuration,
													 onComplete: function() { 
													 			
																toLeft = new Fx.Morph('brands', {duration: brandsDuration,
																													 onComplete: function() { 
																																toRight.start({
																																		'left': -1457
																																});
																													 }	 // toright on complete
																													 
																													 }).start({
																																'left': 0, //Morphs the height from the current to 100px.
																														});
																	
													 		
													 
													 }	 // toright on complete
													 
													 }).start({
    'left': -1469, //Morphs the height from the current to 100px.
});


 
 
	

	

});
