// JavaScript Document

	//Cufon.replace('h2');
	//Cufon.replace('h3');
	Cufon.replace('#topnav', {hover: 'true'});
	Cufon.replace('#rightNav', {hover: 'true'});
	Cufon.replace('.topSliderHeader', {hover: 'true'});
	Cufon.replace('.footerNumber', {hover: 'true'});
	Cufon.replace('.contactInfoIcon', {hover: 'true'});
	
	
	    $(document).ready(function(){
  	 
				 
		 $("#footerContactform").validate();
		 
		$(".meettheteamimg").click(function() {
		
				var page = $(this).attr('rel');
			    //alert(page);
				$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'easingIn' 		: 'swing',
				'transitionOut'	: 'none',
				'width'			: 805,
				'height'		: 640,
				'href'			: "tpl/meetteaminfo.php?who=" + page, //this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'ajax'
				});
				return false;
		});  	
		
	
		$("a.groupweb").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
		});
		
		$(".natprbox").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
		});
		
		
		$(function() {
    		$('img[data-hover]').hover(function() {
        		$(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover', $(this).attr('tmp')).removeAttr('tmp');
   				}).each(function() {
  	    		$('<img />').attr('src', $(this).attr('data-hover'));
 			});;
		});	
		
		
		$(".studio1imgbox").hover(function() {
		$(this).attr("src","images/studiobox/studiobox1_hover.png");
			}, function() {
		$(this).attr("src","images/studiobox/studiobox1.png");
		});
		
		$(".studio2imgbox").hover(function() {
		$(this).attr("src","images/studiobox/studiobox2_hover.png");
			}, function() {
		$(this).attr("src","images/studiobox/studiobox2.png");
		});
		
		$(".studio3imgbox").hover(function() {
		$(this).attr("src","images/studiobox/studiobox3_hover.png");
			}, function() {
		$(this).attr("src","images/studiobox/studiobox3.png");
		});
		
		$(".studio4imgbox").hover(function() {
		$(this).attr("src","images/studiobox/studiobox4_hover.png");
			}, function() {
		$(this).attr("src","images/studiobox/studiobox4.png");
		});


		jQuery.validator.messages.required = "";
   		 $("#footerContactform").validate({
		errorPlacement: function(error, element) {}
		});
		 
		 
		 /* For Our Work */
		 
		 	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
		//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
		//Vertical Sliding
		$('.boxgrid.slidedown').hover(function(){
			$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
		});
		//Horizontal Sliding
		$('.boxgrid.slideright').hover(function(){
			$(".cover", this).stop().animate({left:'325px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
		});
		//Diagnal Sliding
		$('.boxgrid.thecombo').hover(function(){
			$(".cover", this).stop().animate({top:'260px', left:'325px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
		});
		//Partial Sliding (Only show some of background)
		$('.boxgrid.peek').hover(function(){
			$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
		});
		//Full Caption Sliding (Hidden to Visible)
		$('.boxgrid.captionfull').hover(function(){
			$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'260px'},{queue:false,duration:160});
		});
		//Caption Sliding (Partially Hidden to Visible)
		$('.boxgrid.caption').hover(function(){
			$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'220px'},{queue:false,duration:160});
		});
		/* For Our Work Done*/
		
		
		// Testimonials Fader //
		$("#testimonialsText").show();	// And only show if JS enabled...//	
		$('#testimonialsText').innerfade({ 
		animationtype: 'fade', 
		speed:1000, 
		timeout: 7000, 
		type: 'random', 
		containerheight: '1em' 
		});
		// Testimonials Fader Done//
		
		//Clients Logo Scroller //
		$(".logoScroll").show();	// And only show if JS enabled...//	
		 $(".logoScroll").jCarouselLite({
		    auto: 800,
    		speed: 1000,
			visible: 6
    	});
		 // Logo Scroller Done //
		 
		 		 
		 //Current Page Jquery
		  $("a").currentPage({
    		  defaultClass: "selected",
      		anyPath: false
      	   });
    });
		
		
	jQuery(window).load(function(){
        $('#slider').nivoSlider({
		 effect: 'fade',
		 directionNav:false, // Next and Prev navigation
		 controlNav: false,
		 animSpeed: 1000, // Slide transition speed
         pauseTime: 4000, // How long each slide will show
		  pauseOnHover:false
		 });
		
	$('#slider').css('display','block'); 
		
     });
