// JavaScript Document



document.write("<script language='javascript' type='text/javascript' src='/includes/js/pngFix.js'></script>");

$(document).ready(function() {
    $(document).pngFix();
    $("body").append("<div class='fade' id='ieDiv'></div>");
    $("div.fade").css({ "opacity": "0.7" });
    if ($.browser.msie && $.browser.version == "6.0") { $("div#ieDiv").removeClass('fade').addClass('fadeIE'); }

    //Defining the position of popup box
    var pos = $("#aboutlink").parent("li").position();
    $("div.tabcontent").css({ top: pos.top + 23, left: pos.left });

    //For about us

    $("#aboutlink").click(function() {
        $("#servicesData,#insightsData,#careersData").hide(0);
        if ($("#aboutusData").is(":hidden")) {
            $("#aboutusData").show(800, function() { $("#servicesData,#insightsData,#careersData").hide(0); });
            $("div#ieDiv").fadeIn(1000);
            if ($.browser.msie && $.browser.version == 6) {
                $("select").hide(0);
            }
        }
        else {
            $("#aboutusData").hide(800);
            $("div#ieDiv").fadeOut(1000);
            if ($.browser.msie && $.browser.version == 6) {
                $("select").show(0);
            }
        }

        $("#aboutlink").parent("li").toggleClass("active");
        $("#serviceslink,#insightslink,#careerslink").parent("li").removeClass("active")

        return false;

    });

    //For Services
    $("#serviceslink").click(function() {
        $("#aboutusData,#insightsData,#careersData").hide(0);
        if ($("#servicesData").is(":hidden")) {
            $("#servicesData").show(800, function() { $("#aboutusData,#insightsData,#careersData").hide(0); });
            $("div#ieDiv").fadeIn(1000);
            if ($.browser.msie && $.browser.version == 6) {
                $("select").hide(0);
            }
        }
        else {
            $("#servicesData").hide(800);
            $("div#ieDiv").fadeOut(1000);
            if ($.browser.msie && $.browser.version == 6) {
                $("select").show(0);
            }
        }


        $("#serviceslink").parent("li").toggleClass("active");
        $("#aboutlink,#insightslink,#careerslink").parent("li").removeClass("active");
        return false;
    });

    //For Insights
    $("#insightslink").click(function() {
        $("#aboutusData,#servicesData,#careersData").hide(0);
        if ($("#insightsData").is(":hidden")) {
            $("#insightsData").show(800, function() { $("#aboutusData,#servicesData,#careersData").hide(0); });
            $("div#ieDiv").fadeIn(1000);
            if ($.browser.msie && $.browser.version == 6) {
                $("select").hide(0);

            }
        }
        else {
            $("#insightsData").hide(800);
            $("div#ieDiv").fadeOut(1000);
            if ($.browser.msie && $.browser.version == 6) {
                $("select").show(0);

            }
        }


        $("#insightslink").parent("li").toggleClass("active");
        $("#aboutlink,#serviceslink,#careerslink").parent("li").removeClass("active");
        return false;

    });

    //For Careers
    $("#careerslink").click(function() {
        $("#aboutusData,#servicesData,#insightsData").hide(0);
        if ($("#careersData").is(":hidden")) {
            $("#careersData").show(800, function() { $("#aboutusData,#servicesData,#insightsData").hide(0); });
            $("div#ieDiv").fadeIn(1000);
            if ($.browser.msie && $.browser.version == 6) {
                $("select").hide(0);

            }
        }
        else {
            $("#careersData").hide(800);
            $("div#ieDiv").fadeOut(1000);
            if ($.browser.msie && $.browser.version == 6) {
                $("select").show(0);

            }
        }

        $("#careerslink").parent("li").toggleClass("active");
        $("#aboutlink,#serviceslink,#insightslink").parent("li").removeClass("active");

        return false;
    });

    //popup box close
    $("div.head span").click(function() {
        $("div.tabcontent").hide(500);
        $("div#ieDiv").fadeOut(500);
        $("div.menus a").parent("li").removeClass("active");
        if ($.browser.msie && $.browser.version == 6) {
            $("select").show(0);
        }

    });





    $("div.tabcontent").click(function() {
        $("div.tabcontent").hide(500);
        $("div#ieDiv").fadeOut(500);
        $("div.menus a").parent("li").removeClass("active");
        if ($.browser.msie && $.browser.version == 6) {
            $("select").show(0);
        }
    })


    $("div.menus li, div.tabcontent").mouseover(function() {
        return false;
    });




    //inner page overview box navigation

    $("#data2,#data3,#data4").hide(0);

    $("#tab1").click(function() {
        $(this).addClass("active");
        $("#tab2,#tab3,#tab4").removeClass("active");
        $("#data1").fadeIn(500);
        $("#data2,#data3,#data4").fadeOut(500);
    })

    $("#tab2").click(function() {
        $(this).addClass("active");
        $("#tab1,#tab3,#tab4").removeClass("active");
        $("#data2").fadeIn(500);
        $("#data1,#data3,#data4").fadeOut(500);
    })

    $("#tab3").click(function() {
        $(this).addClass("active");
        $("#tab1,#tab2,#tab4").removeClass("active");
        $("#data3").fadeIn(500);
        $("#data1,#data2,#data4").fadeOut(500);
    })

    $("#tab4").click(function() {
        $(this).addClass("active");
        $("#tab1,#tab2,#tab3").removeClass("active");
        $("#data4").fadeIn(500);
        $("#data1,#data2,#data3").fadeOut(500);
    })



    //Leadership page accordin effect
    $("div.accordinSlot div.teamMembers:first").show(0);
    $("div.accordinSlot h3:first").toggleClass("active");
    $("div.accordinSlot h3").click(function() {
        $(this).next("div.teamMembers").slideToggle(500);
        $(this).parent().nextAll("div.accordinSlot").children("div").slideUp(500);
        $(this).parent().prevAll("div.accordinSlot").children("div").slideUp(500);
        $(this).toggleClass("active");
        $(this).parent().nextAll("div.accordinSlot").children("h3").removeClass("active")
        $(this).parent().prevAll("div.accordinSlot").children("h3").removeClass("active")
    });

    //Leadership innner page right side accordin effect

    $("div.teamSlideSection h3").click(function() {
        $(this).next("div.teamList").slideToggle(500);
        $(this).parent().nextAll("div.teamSlideSection").children("div.teamList").slideUp(500);
        $(this).parent().prevAll("div.teamSlideSection").children("div.teamList").slideUp(500);
    });



    //Login section services
    $("#loginImg").click(function() {
        $("#loginShow").slideToggle(800);
    })

    $(document).click(function() {
        $("#loginShow").slideUp(800);
    })

    $("#loginImg").click(function() {
        return false;
    })




    //Scrolling photo gallery 
    $("div.scrollable").scrollable({ speed: 2000, size: 3, disabledClass: "disabled"/*enabled or disabled*/, loop: false })//.mousewheel(1000)//.circular();
});
