$(document).ready(function () {

    //########### Package Modal Popup ################
    //select all the a tag with name equal to modal
    $('.Hilight').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();

        //Get the A tag
        var id = "#" + $(this).attr('lang');

        //Get the screen height and width
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();

        //Set heigth and width to mask to fill up the whole screen
        $('#Mask').css({ 'width': maskWidth, 'height': maskHeight });
        $('#Mask').css('over-flow', 'hidden');


        //transition effect		
        $('#Mask').fadeIn(100);
        $('#Mask').fadeTo("fast", 0.6);

        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();

        //Set the popup window to center
        $(id).css('top', winH / 2 - $(id).height() / 2);
        if ($(id).attr('id') == 'Popup1') {
            $(id).css('left', winW / 2 - $(id).width() / 2 - 270);
        };
        if ($(id).attr('id') == 'Popup2') {
            $(id).css('left', winW / 2 - $(id).width() / 2);
        };

        if ($(id).attr('id') == 'Popup3') {
            $(id).css('left', winW / 2 - $(id).width() / 2 + 270);
        };

        //transition effect
        $(id).fadeIn('slow');

    });

    //if close button is clicked
    $('.window .Close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();

        $('#Mask').hide();
        $('.window').hide();
    });

    //if mask is clicked
    $('#Mask').click(function () {
        $(this).hide();
        $('.window').hide();
    });
});




