$(document).ready(function() {
    //The navigation dropdown menu
	$("#topNavigation > li").hover(function() {
        $(this).addClass("hover");
        $('.subNavigation', this).css({
            visibility: 'visible',
            left: ($(this).position().left + 20) + 'px'
        });
    }, function() {
        $(this).removeClass("hover");
        $('.subNavigation', this).css('visibility', 'hidden');
    });
	
	//The wee car in the banner
	$(".skylinecar").animate({
		"margin-left":"-500px"
	},6000);

    //Lightbox for all the externals links
	$("a.external").fancybox({
        'width': 900,
        'height': '75%',
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'type': 'iframe',
        'padding': 2,
		onComplete: function() {
			$("#fancybox-close").css({
				"background-position-x": "30px",
				"background-position-y": "0px",
				"background-image": "url(/scripts/jquery.fancybox-1.3.1/fancybox/fancybox.png)"
			});
		}
    });
	
	$("#widget .exchange li").each(function() {
		if ($(this).html() != $("#widget ul.exchange li:first").html()) {
			$(this).addClass("notFirst");
		}
	});
	$("#widget .timezones li:first").addClass("first");


    //Accordions used throughout the site, such as FAQ.
	$(".accordion").accordion({ autoHeight: false, active: false, header: ".accHeader,h3", collapsible: true });
	$(".accordion h3,.accordion .accHeader").click(function() {
		$(".accElement").removeClass("selected");
		$(this).parent().addClass("selected");
	});
	
	//Tabs (used only in Banking section)
	$(".tabs").tabs();	
	
	if ($.browser.msie && $.browser.version < 8) {
		$(".accordion h3").each(function() {
			$(this).html("<span class=\"currentBefore\">&#187;</span>" + $(this).html());
		});
	}	
	if ($.browser.webkit) {
		$("#nav ul li a").css("padding-bottom","6px");
	}
    

});
