/*------------------------------------------------------------------
[JQuery Basics]
Copyright:		Chillingo 2009
Client:			Chillingo
Project:		Chillingo Website
Created By: 	Daniel Cork - Corking Design 
URL:			http://corkingdesign.co.uk
-------------------------------------------------------------------*/
jQuery.noConflict();
var $j = jQuery;
$j(document).ready(function() {
	//Fomr Submit Links
	$j("form a.submit").click(function() {
		$j(this).parents().filter("form").trigger("submit");
		return false;
	});
	
	//External links
	$j('a[href^=http]').click( function() {
		window.open(this.href);
		return false;
	});
	//Cufon text replacement
	Cufon.replace('h2');
	// Supersleight png fix
	$j('body').supersleight({shim: '_includes/Images/Global/x.gif'});
	
	//Twitter feed
	try{
		$j('#Tweets').tweetable({username: 'chillingo', time: false, limit: 1});
	} catch(e){}
	
	$j('.button, .previous, .next').children('span').css({opacity: '0', display: 'block'});
	$j('.button, .previous, .next').hover(
		function(){$j(this).children('span').stop().animate({opacity:"1"}, 100, "easeInOutQuad");},
		function(){$j(this).children('span').stop().animate({opacity:"0"}, 200, "easeInOutQuad");}
	);
	
	// Navigation
	var navLinks = $j("#NavGlobal li a:not('#Selected')");
	navLinks.hoverIntent({sensitivity: 1, interval: 1, over:navOver, timeout: 50, out:navOut});
	navLinks.children('span').css({opacity: '0', display: 'block'});
	function navOver (){
		$j(this).children('span').stop().animate({opacity:"1"}, 100, "easeInOutQuad")
		return false;
	};
	function navOut (){
		$j(this).children('span').stop().animate({opacity:"0"}, 500, "easeInOutQuad")
		return false;
	};
});

	





















