// JavaScript Document
Cufon.replace('h1,h2,h3,#header span,.button_1 a, .button_2 a,.contactform label,.testimonial span,.subscribe label');    

$(document).ready(function(){

//Contact form
$(function() {
		var v = $("#form").validate({
			submitHandler: function(form) {
				$(form).ajaxSubmit({
					target: "#result",
					clearForm: true
				});
			}
		});
		
});	
$('#form #telephone').val('');
$('#form #age').val('');

//Subscribe form
$(function() {
		var v = $("#subform").validate({
			submitHandler: function(form) {
				$(form).ajaxSubmit({
					target: "#result_sub",
					clearForm: true
				});
			}
		});
		
});	
$('#subform #email').val('');

	
//Fancybox for image gallery
$("a.simple_image").fancybox({
		'opacity'		: true,
		'overlayShow'	       : true,
		'overlayColor': '#000000',
		'overlayOpacity'     : 0.9,
		'titleShow':true,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic'
});

//fancybox for content to displayed on click
$(".various").fancybox({
			'hideOnOverlayClick': true, 
			'transitionIn'		:'elastic',
			'overlayShow'		:false,
			'speedIn'			:600,
			'titleShow':false,
			'overlayShow': true,
			'overlayOpacity': 0.8,
			'overlayColor': '#000000'
});

//Nivo slider
$('#slider').nivoSlider({
        effect:'random', // Specify sets like: 'fold,fade,sliceDown'
        slices:15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed:500, // Slide transition speed
        pauseTime:3000, // How long each slide will show
		pauseOnHover:true,
       directionNav:true, // Next & Prev navigation
        directionNavHide:true, // Only show on hover
        controlNav:false // 1,2,3... navigation
});

//Gallery - On Hover Event 
	$('ul.gallery li a').mouseenter(function(e) {
            $(this).children('img').animate(300);
            $(this).children('span').fadeIn(400);
        }).mouseleave(function(e) {
            $(this).children('img').animate(300);
            $(this).children('span').fadeOut(400);
});

//On Hover Event for social 
	$('#social li a img').hover(function(){
			$(this).animate({opacity: 0.6}, 300);
		}, function () {
			$(this).animate({opacity: 1}, 300);
		});

}); // close document.ready


