$(document).ready(function(){
	if ($('#rhstestimonial')) {				   
 		$('#rhstestimonial').cycle({timeout:  8000});
	}
	
	if ($('#leadCS')) {				   
 		$('#leadCS').cycle({timeout:  10000, fx:'scrollVert', speed:800, next:'#leadNext'});
		$('#leadCSIMG').cycle({timeout:  10000, fx:'scrollHorz', speed:800, next:'#leadNext'});
	}
	
	if ($('.leadScroll')) {
		$('.leadScroll').cycle({timeout:  5000, fx:'scrollHorz', speed:800, next:'#leadNext', prev:'#leadPrev'});
	}
	
	$('.client-login a').click(function() {
		$('.client-login-open').css('display', 'block');
		$('.client-login-open').animate({
   		 top: '0'
  		}, 1000);
		$('.client-login').animate({top:'76'}, 1000);
	});
	
	$('.client-login-open').hover(function(){
		//$('.client-login-open').removeClass('closed');
	},
	function () {
		$('.client-login-open').animate({
   		 top: '-76'
  		}, 1000, function(){ $('.client-login-open').css('display', 'none'); });
		$('.client-login').animate({top:'0'}, 1000);
	});
	
	$("form#newsletter_form").submit(function() {  
 		// we want to store the values from the form input box, then send via ajax below  
		var fname     = $('#newsletter_name').attr('value');  
		var lname     = $('#newsletter_email').attr('value');  
		$.ajax({
			type: "POST",  
			url: "/ajax/subscribe.php",  
			data: "newsletter_name="+ fname +"&newsletter_email="+ lname,  
			success: function(data){  
				$('#newsletter_container').html(data);
			}  
		});  
		return false;  
	});  
	
});
