$(document).ready(function() {


    $("#header ul.links-header li:last").addClass("last");
    $("#flight-arrivals table tr:even").addClass("odd");
    $("#flight-arrivals ul li:last").addClass("last");
    $("#content .spotlight:first").addClass("first");
    $("#arrivals-and-spotlights .home-spotlight:last").addClass("last");


    $('.faqs dd').hide(); // Hide all DDs inside .faqs
    $('.faqs dt').hover(function() { $(this).addClass('hover') }, function() { $(this).removeClass('hover') }).click(function() { // Add class "hover" on dt when hover
        $(this).next().slideToggle('normal');
        $(this).toggleClass('open'); // Toggle dd when the respective dt is clicked
    });
    $('.expand a').click(function() {
        $('.faqs dd').slideToggle('normal');
        $('.faqs dt').toggleClass('open');
    });

    $(".faqs dt:first-child").addClass("first");

    if ($("#gallery li a").length != 0) {
        $("#gallery li a").lightBox()
    }


    if (querySt()) {
        $('a').each(function() {
        if (this.href.indexOf("Innovata-llc") == -1 && this.href.indexOf("javascript") == -1 && this.href.indexOf("ork.innosked.com") == -1 && this.href!="") {
        
                var a = new RegExp('/' + window.location.host + '/');
                if (!a.test(this.href)) {
                    $(this).click(function(event) {
                        event.preventDefault();
                        event.stopPropagation();
                        window.open(this.href, '_blank');
                    });
                }
            }
		if (this.href.indexOf("book-a-space") > -1) {
                    $(this).click(function(event) {
                        event.preventDefault();
                        event.stopPropagation();
                        window.open(this.href, '_blank');
                    });
                }
        });
	
    }




});

function querySt() {
    var hu = window.location.href;


    if (hu.indexOf("cmspagemode") > -1) {

        return false;

    }


    return true;
}
