$(document).ready(function(){
	$('#box').bounceBox();
	
	$('#sliderWrap').toggle(function() {
  	$('#sliderWrap').animate({
    top: '+=110px'
  }, 'slow', function() {
    // Animation complete.
  });
}, function() {
  $('#sliderWrap').animate({
    top: '-=110px'
  }, 'slow', function() {
    // Animation complete.
  });
});

	/* When the box is clicked, hide it: */
	$('#box').click(function(){
		$('#box').bounceBoxHide();
	});
	$('#submit').click(function(){
		$('#box').bounceBoxShow();
	});
	var use_ajax=true;

	$("#contactform").submit(function(e){
	
			if(use_ajax)
			{
				$.post('submit.php',$(this).serialize()+'&ajax=1',
				/* using jQuery's post method to send data */

				function(data){
					
					if(parseInt(data)==-1)
					{
						$('#box').bounceBoxShow();
						$("#error").css('display','block');
						/* if there is an error, build a custom error tooltip for the captcha */
					}
					else
					{
						$('#box').bounceBoxShow();
						$("#sent").css('display','block');
						/* show the confirmation message */
					}

					$('#box').delay(5000).queue(function () {$('#box').bounceBoxHide();$("#box div").css({"display": "none"});$(this).dequeue();});
					/* hide the rotating gif */
				});
			}

e.preventDefault();	/* stop the default form submit */
})

$('#s5').cycle({ 
    fx:      'scrollLeft', 
    delay: -3000 
});
});
