﻿/*******jsModelPOPUP******/
var modalWindow = {
    parent: "body",
    windowId: null,
    content: null,
    width: null,
    height: null,
    close: function () {
        $(".modal-window").remove();
        $(".modal-overlay").remove();
    },
    open: function () {
        var modal = "";
       // modal += "<script type= javascript>document.getElementById('light1').style.display='none';document.getElementById('fade').style.display='none'</script>";
        modal += "<div  class=\"modal-overlay\"></div>";
        //modal += "<div id=\"" + this.windowId + "\" class=\"modal-window\" style=\"width:" + this.width + "px; height:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px;\">";
        modal += "<div id=\"" + this.windowId + "\" class=\"modal-window\" style=\"width:" + this.width + "px; height:" + this.height + "px; margin-top:-20px; margin-left:-30px;\">";
        modal += this.content;
        modal += "</div>";

        $(this.parent).append(modal);

        $(".modal-window").append("<a class=\"close-window\"></a>");
        $(".close-window").click(function () { modalWindow.close(); });
    }
};

var openModal = function(source,height,width)
{
modalWindow.windowId = "myModal";
modalWindow.width = width;
modalWindow.height = height;
modalWindow.content = "<iframe width='"+width+"' height='"+height+"' frameborder='0' scrolling='No' allowtransparency='true' src='" + source + "'></iframe>";
modalWindow.open();
};	
var closeModal = function()
{
$(".modal-window").remove();
$(".modal-overlay").remove();
};
