﻿/*
 * Betmodal Script
 * Framework for modal windows
 * Author: Willian Duarte
 * Date: 06/09/2010
 */
function showBetModal(divModal, width, height)
{
    $("#modalShadow")
    .css({"height" : $(window).height(), "display" : "block"})
    .animate({"opacity" : 0.7}, 700);
    
    divModal.css("display","block")
    .animate(
    {
        "width" : width,
        "height" : height,
        "marginTop" : -(height/2),
        "marginLeft" : -(width/2)
    }, 1000);
    
    divModal.addClass("modalOpened");
};

function closeBetModal(width, height)
{
    $(".modalOpened")
    .animate(
    {
        "width" : width,
        "height" : height,
        "marginTop" : -(height/2),
        "marginLeft" : -(width/2)
    }, 500,
    function() {$(this).hide();})

    $("#modalShadow")
    .animate({"opacity" : 0}, 1000,
    function() {$(this).hide();});
};
