$(document).ready(function() {

	$('#content_wrap').corner();
	$('.code').corner();
	$('.download').corner();
	$('#download_111').click(function() {
		window.location = "JQVibrator_1.1.1.zip";
		$('#download_111').vibrate("ud","10");
	});
	
	$('#demo_ud').click(function(){
		$('#box_ud').vibrate("ud","5");
	});
	$('#demo_lr').click(function(){
		$('#box_lr').vibrate("lr","5");
	});
	
	$('#home_nav').click(function() {
		fadeNewIn('#home');
	});
	
	$('#demo_nav').click(function() {
		fadeNewIn('#demo');
	});
	
	$('#howto_nav').click(function() {
		fadeHowTo();
		
	});
	
	$('#download_nav').click(function() {
		fadeNewIn('#download');
	});
	
	function fadeHowTo() {
		$('.current').fadeOut();
		$('.current').removeClass('current');
		$('#howto').addClass('current');
		$('#content_wrap').animate({"height": "670px"}, { queue:false, duration:300 });
		$('#footer').animate({"marginTop": "690px"}, 300);
		setTimeout("$('.current').fadeIn();", 500);
	}
	
	function fadeNewIn(div) {
		$('.current').fadeOut();
		$('.current').removeClass('current');
		$(div).addClass('current');
		$('#content_wrap').animate({"height": "320px"}, { queue:false, duration:300 });
		$('#footer').animate({"marginTop": "350px"}, 300);
		setTimeout("$('.current').fadeIn();", 500);
	}
	
	function download111() {
		alert('hmm');
	}
	
});