// JavaScript Document

// cufon font replacement class/id
Cufon.replace('h1,h2,h3,h4,h5,#header_top p,.button_1 a,.sub_header a,form.contact_form label,form#loginform label',{textShadow: '0px 1px 0px #ffffff'});   
Cufon.replace('#footer h4');    
  
$(document).ready(function(){

//Nivo slider
$('#slider').nivoSlider({
        effect:'random', // Specify sets like: 'fold,fade,sliceDown' or choose 'random' for mixed effects
        slices:15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed:500, // Slide transition speed
        pauseTime:5000, // 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
	
});

//Contact form

$(function(){
	$('#form').validate({
	    submitHandler: function(form) {
			    $(form).ajaxSubmit({
				    url: '/php_bin/submit-form.php',
					clearForm: true,
				    success: function() {
				    	$('.contact_inner').hide();
				    	$('.contact').append("<h2>Thank You...!</h2><p>You have successfully submitted your bid for this domain.</p>Should you have any immediate questions, please contact us at <a href='mailto:connect@exsom.com'>connect@exsom.com</a></p>")
				    }
			    });
		    }
	});         
});
$('#form #message').val('');
$('#form #email').val('');

//Fancybox for feature image / gallery
$("a[rel=next]").fancybox({
		'opacity'		: true,
		'overlayShow'	       : true,
		'overlayColor': '#000000',
		'overlayOpacity'     : 0.9,
		'titleShow':true,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic'
});

//On Hover Event for gallery / feature image
$('ul.features li img').hover(function(){
			$(this).animate({opacity: 0.6}, 300);
		}, function () {
			$(this).animate({opacity: 1}, 300);
});

//Slideshow for testimonial
$('.testimonial').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, scrollLeft etc... 
   		speed: 1000,
		timeout: 4000,  // milliseconds between slide transitions (0 to disable auto advance)
		cleartypeNoBg:   true, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
		pause:  1
});

}); // close document.ready

getTwitters('tweet', { 
  id: 'exsom', 
  count: 4, 
  enableLinks: true, 
  ignoreReplies: true, 
  clearContents: true,
  template: '%text%<br /><a href="http://twitter.com/%user_screen_name%/statuses/%id_str%/">%time%</a>'
});

