jQuery('document').ready(function () {
    $('#slides').cycle({
        fx: 'scrollUp',
        speed: 900,
        easing: 'backout',
        timeout: 10000,
        next: '.next-slide'
    });
    jQuery('.tweets').tweet({
        count: 3,
        query: 'from:themeforest',
        loading_text: 'Loading Tweets...'
    });
    Cufon.replace('h1, h2, h3, h4, h5, h6, #slides .subtitle, .box .title', {
        'hover': true
    });
    Cufon.replace('#slides h3', {
        'hover': true,
        'textShadow': '0 2px 0 #186aa4'
    });
    Cufon.replace('#slides .button', {
        'textShadow': '-1px 1px 0 #1a4159'
    });
    
    $('#contactform').submit(function(){
	
		var action = $(this).attr('action');
		
		$('#contactform #submit').attr('disabled','disabled').after('<img src="assets/ajax-loader.gif" class="loader" />');
		
		$("#message").slideUp(750,function() {
		$('#message').hide();			
		
		$.post(action, { 
			name: $('#name').val(),
			email: $('#email').val(),
			phone: $('#phone').val(),
			subject: $('#subject').val(),
			comments: $('#comments').val(),
			verify: $('#verify').val()
		},
			function(data){
				document.getElementById('message').innerHTML = data;
				$('#message').slideDown('slow');
				$('#contactform img.loader').fadeOut('fast',function(){$(this).remove()});
				$('#contactform #submit').attr('disabled',''); 
				if(data.match('success') != null) $('#contactform').slideUp('slow');
				
			}
		);
		
		});
		
		return false; 
	
	});
});


