$(document).ready(function() {
 
	// Video hover animation
	
	$("#videoContainer p").append('<img class="shadow" src="/templates/worldnumbersv2/media/video_shadow.png" alt="" width="230" height="14" />');
	
	$("#videoContainer p").hover(function() {
		var e = this;
		$(e).find("a").stop().animate({ marginTop: "-7px" }, 150, function() {
			$(e).find("a").animate({ marginTop: "-5px" }, 150);
		});
		$(e).find("img.shadow").stop().animate({ width: "80%", height: "14px", marginLeft: "20px", opacity: 0.50 }, 150);
	},function(){
		var e = this;
		$(e).find("a").stop().animate({ marginTop: "2px" }, 150, function() {
			$(e).find("a").animate({ marginTop: "0px" }, 150);
		});
		$(e).find("img.shadow").stop().animate({ width: "100%", height: "14px", marginLeft: "0px", opacity: 1 }, 150);
	});
	
	// Video colorbox frame

	$("#video").colorbox({fastIframe:true,iframe:true, innerWidth:480, innerHeight:390, opacity: 0.7 });
	
	// Form validation
	
	$("#contactForm").validationEngine({scroll: false});
	
	// Accordion for pricing page

	$('.info').hide(); 
	
	$('#featureList .header').click(function() {

		if($(this).parent().hasClass('current')) {
			
			$("a", this).fadeIn();
			
			$(this).siblings('.info').slideUp('slow',function() {
				$(this).parent().removeClass('current');
			});
			
		} else {
			
			$('#featureList li.current .info').slideUp('slow',function() {
				$(this).parent().removeClass('current');
			});
			
			$(this).siblings('.info').slideToggle('slow',function() {
				$(this).parent().toggleClass('current');
			});

		}
		
		return false;
	});

	// Fading text on homepage
		
	$('.container #bannerText').cycle({ 
	    fx:      'fade', 
	    speed:    1000, 
	    timeout:  3000 
	});

});
