Cufon.replace('#navigation a', { fontFamily: 'HelveticaNeue Condensed Bold' , hover:true });
Cufon.replace('#top-bar h3', { fontFamily: 'HelveticaNeue Condensed Bold' });
Cufon.replace('h2.title, h3.title, h4.title, .box h3, h2#slogan ', { fontFamily: 'HelveticaNeue Condensed Bold' });
Cufon.replace('#case-studies .title, #slider h2 ', { fontFamily: 'HelveticaNeue Condensed Black' });


jQuery(document).ready(function($){
	$("#slider ul").jcarousel({
		scroll: 1,
		wrap: 'both',
		auto: 5,
		initCallback: mycarousel_initCallback,
		buttonNextHTML: null,
		buttonPrevHTML: null
    });
    
    $("#case-studies-slider").jcarousel({
		scroll: 1,
		wrap: 'both',
		auto: 100,
		initCallback: caseSlider_initCallback,
		buttonNextHTML: null,
		buttonPrevHTML: null
    });
    
	window.validateForm($('#contact_form'), {
		c_name: { required: true, message: 'Please enter your name!'},
		c_mail: { required: true, email: true, message: 'Please enter valid email!'},
		c_phone: { required: false, message: 'Please enter your phone number' },
		c_comment: { required: true, message: 'Please enter your comment!' }
	}, {
		on_success: function(form) {  form.find('input[type=submit]').show(); form.find('.wait').hide(); alert('Thank you for contacting us!');  },
		on_error: function(form, message) {  form.find('input[type=submit]').show(); form.find('.wait').hide(); alert(message);  },
		on_submit: function(form) { form.find('input[type=submit]').hide(); form.find('.wait').show(); }
	});
    
	Shadowbox.init({
		handleOversize: 'resize'		
	});
	
	var enlarge = 15;
	
	$('#case-studies-slider li a').hover(
		function() {
			var img = $(this).find('img');
			var w = img.attr('width');
			var h = img.attr('height');
			img.attr('width', w+enlarge);
			img.attr('height', h+enlarge);
			$(img).css('margin-top', enlarge/2 * -1 + 'px');
		},
		function() {
			var img = $(this).find('img');
			var w = img.attr('width');
			var h = img.attr('height');
			img.attr('width', w-enlarge);
			img.attr('height', h-enlarge);
			$(img).css('margin-top', 0);
		}	
	);
	
});
function mycarousel_initCallback(carousel) {
	jQuery('#slider .slider-controls .next').bind('click', function() {
		carousel.next();
		return false;
	});
	
	jQuery('#slider .slider-controls .prev').bind('click', function() {
		carousel.prev();
		return false;
	});

};

function caseSlider_initCallback(carousel) {
	jQuery('#case-studies-slider .slider-controls .next').bind('click', function() {
		carousel.next();
		return false;
	});
	
	jQuery('#case-studies-slider .slider-controls .prev').bind('click', function() {
		carousel.prev();
		return false;
	});

};

