/* 
	Site: Trafigura Graduates
	Date: October 2009 
	Description: Global javascript
	Version: 1.0 
	Author: Pete Luffman
	Author URI: http://www.merchantmarketinggroup.com 
*/ 

function isIE()
{
	return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}
      
$(function(){     
   // Create drop tab    
	$('#header').append('<a href="#" id="tab">Apply now</a>');
	
	// Hide and animate 
	var quickLinks = $("#quickLinks");
	var quickLinksH =- quickLinks.outerHeight();
	
	if (!isIE()) quickLinks.css("margin-top", quickLinksH + "px").hide();
	else quickLinks.hide();
	
	$("#tab").click(function() {
		if (!isIE()) {
			if(quickLinks.is(":animated"))return false; 			
			if(quickLinks.is(":visible")) {
				quickLinks.stop(true).animate({marginTop : quickLinksH + "px"}, 500, "swing", function() {
					 $(this).hide()
				}); 
			} else { 
				quickLinks.show().stop(true).animate({marginTop : "0px"}, 500, "swing"); 
			}
		} else {
			quickLinks.toggle();
		}
		return false;
	});
	
	// Load ticker
	swfobject.embedSWF("/images/template/ticker/ticker.swf", "ticker", "940", "20", "9.0.0");
});