﻿/// <reference path="jquery-1.3.2.js" />

function abrir(url) {
    var maskHeight = $(document).height();
    var maskWidth = $(window).width();
    var ContentHeight = 0;
    var ContentWidth = 440;
    var id = '#dialog';

    $('#iContent').attr('src', url);

    $('#iContent').load(function() {
        ContentHeight = this.contentWindow.document.body.offsetHeight;
        $(this).attr("height", ContentHeight);

        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();

        $(id).css('top', (winH / 2 - ContentHeight / 2) + $(document).scrollTop());
        $(id).css('left', winW / 2 - ContentWidth / 2);
    });
    

    $('#mask').css({ 'width': maskWidth, 'height': maskHeight });

    $('#mask').fadeIn(1000);
    $('#mask').fadeTo("slow", 0.8);


    

    $(id).fadeIn(2000);
    
}

function fechar() {
    $('#mask').hide();
    $('.window').hide();
}