$(document).ready(function(){
	
// --- COMMON ---
$('nav a').mouseenter(function() {
	var span = $(this).find('span');
	span.stop();
	span.animate({
		width: '100%'
	}, 250);
	
	
});

$('nav a').click(function() {
	$('nav a').removeClass('selected');
	$(this).addClass('selected');
});

$('nav a').mouseleave(function() {
	var span = $(this).find('span');
	span.stop();
	span.animate({
		width: 0
	}, 250);
});

$('#logo a').click(function() {
	$('nav a').removeClass('selected');
	$('#btn_about').addClass('selected');
});

jQuery(function(){		
	$("#slider").chopSlider({
			/* Slide Element */
		slide : ".slide",
		/* Controlers */
		nextTrigger : "a#slide-next",
		prevTrigger : "a#slide-prev",
		hideTriggers : true,
		sliderPagination : ".slider-pagination",
		/* Captions */
		useCaptions : true,
		everyCaptionIn : ".sl-descr",
		showCaptionIn : ".caption",
		captionTransform : "scale(0) translate(-600px,0px) rotate(45deg)",
		/* Autoplay */
		autoplay : true,
		autoplayDelay : 5000,
		/* Default Parameters */
		t2D : csTransitions['sexy'][6],
		t3D : false,
		/* For Mobile Devices */
		mobile: csTransitions['mobile']['random'],
		/* For Old and IE Browsers */
		noCSS3:csTransitions['noCSS3']['random'],
		onStart: function(){ /* Do Something*/ },
		onEnd: function(){ /* Do Something*/ }
	});
});

Cufon.replace('#about, #rm_container h2', {
	hover: true	
});



$(window).resize(function(){
	$('#contact').css({
		'margin-bottom' : $(window).height()-$('#contact').height()-145	
	});
});

$('#contact').css({
	'margin-bottom' : $(window).height()-$('#contact').height()-145	
});


});
