﻿$(document).ready(function () {

	if (top.location!= self.location) {
			top.location = self.location.href;
		}

	
	//Language drop down
	$("#currentLanguage").click(function () {
		$("#languages").slideToggle("fast");
		this.blur();
		$("#currentLanguage").toggleClass("on");
		return false;
	});

	//Add alternate styles to table rows
	$("tr:even").addClass("even");

	//Add alternate styles to accordion rows
	$("#accordion li:even").addClass("even");

	//Add two more borders around table
	$("#rightCol table").wrap('<div class="tableWrap" />');

	//News ticker    
	$('#ticker01 li:gt(1)').hide();
	setInterval("NewsTicker()", 5000);

	//Back button
	$(".back").click(function () {
		history.go(-1);
		return false;
	});
	
	// IE7 is the new IE6 - Fixes
    $(function () {
        // Stagger zindex on all divs
        var zIndexNumber = 1000;
        $('div').each(function () {
            $(this).css('zIndex', zIndexNumber);
            zIndexNumber -= 10;
        });
    });

    $("#topAd").css("zIndex", "-1");
    $("#mainMenu").css("zIndex", "-1");
	$("#footer").css("zIndex", "100");
	$("#controls").css("zIndex", "1001");
	//

});

var articleindex = 0;

function NewsTicker() {
    $("#ticker01 li:eq(" + articleindex + ")").fadeOut("slow");
    if (articleindex < $("#ticker01 li").length -1)
        articleindex++;
    else
        articleindex = 0;
    $("#ticker01 li:eq(" + articleindex + ")").fadeIn("slow");
}


Cufon.replace('#drawerTitle', { fontFamily: 'BosisMedium', textShadow: '1px 1px 1px #2e80af' });
Cufon.replace('#breakingNewsTitle', { fontFamily: 'BosisSemiBold' });
Cufon.replace('h1,.flightInfoTitle,.promoCaption', { fontFamily: 'BosisMedium' }); 
Cufon.replace('.promoTitle', { fontFamily: 'BosisLight' });
