﻿$().ready(function() {

    var p1 = $("#p1");
    var p2 = $("#p2");
    var sBox = $("#selectionBox");
    var Logo = $("#ImgLogo");

    Logo.animate({ width: "1px", height: "1px" }, 1);
    sBox.animate({ height: "1px" }, 1);

    p1.animate({ opacity: 0 }, 1);
    p2.animate({ opacity: 0 }, 1);

    if (jQuery.browser.msie) {
        p1.get(0).style.removeAttribute('filter');
        p2.get(0).style.removeAttribute('filter');
    }

    setTimeout(function() {
        $('#frame').css('visibility', 'visible');

        sBox.animate({ height: "67" }, 400, function() {
            Logo.animate({ width: "290", height: "80px" }, 600, function() {
                p1.animate({ opacity: 0.3, paddingLeft: "0px", paddingTop: "3px" }, 50);
                p1.animate({ opacity: 1, paddingLeft: "0px", paddingTop: "0px" }, 250, function() {
                    p2.animate({ opacity: 0.3, paddingLeft: "0px", paddingTop: "3px" }, 50);
                    p2.animate({ opacity: 1, paddingLeft: "0px", paddingTop: "0px" }, 250);
                });
            });
        });

        p1.hover(function() { p1.animate({ paddingLeft: "5px" }, 200); },
                        function() { p1.animate({ paddingLeft: "0px" }, 200); });

        p2.hover(function() { p2.animate({ paddingLeft: "5px" }, 200); },
                        function() { p2.animate({ paddingLeft: "0px" }, 200); });

    }, 300);

    p1.click(function() {
        var href = document.location.href;
        if (href.indexOf('index.htm') > 0)
            href = href.substr(0, href.indexOf('index.htm')) + "Francais.htm";
        else
            href = href + "Francais.htm";
        document.location = (href);
    });
    p2.click(function() {
        var href = document.location.href;
        if (href.indexOf('index.htm') > 0)
            href = href.substr(0, href.indexOf('index.htm')) + "English.htm";
        else
            href = href + "English.htm";

        document.location = (href);
    });
});