/*
 * Modal 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),
		"marginTop" : 0,
		"top" : 15,
        "marginLeft" : -(width/2)
    }, 1000);
    
    divModal.addClass("modalOpened");
};
 
function closeBetModal(width, height)
{
    $(".modalOpened")
    .animate(
    {
        "width" : width,
        "height" : height,
        //"marginTop" : -(height/2),
		"marginTop" : 0,
		"top" : 15,
        "marginLeft" : -(width/2)
    }, 500,
    function() {$(this).hide();})
 
    $("#modalShadow")
    .animate({"opacity" : 0}, 1000,
    function() {$(this).hide();});
};

function openproduct(product)
{
	
	$(".modalContent").load("/na/wp-content/themes/natural_art/product_view.php?p=" + product);
	showBetModal($('#userControlPanel'), 900, 550);
	
}









