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 += "<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 += this.content;
		modal += "</div>";	
		
		
		$(this.parent).append(modal);

		$(".modal-window").append("<a href=# class=\"close-window\"></a>");
		$(".close-window").click(function(){modalWindow.close();});
		
		
	}
};

var getpopupHeight;
var openMyModal = function(source)
	{
		modalWindow.windowId = "myModal";
		modalWindow.width = 880;
		modalWindow.height = document.documentElement.clientHeight-30;
		modalWindow.content = "<iframe width='840' height='100%' frameborder='0' scrolling='auto' allowtransparency='true' src='" + source + "'>&lt/iframe>";
		modalWindow.open();
		
};	

$(document).ready(function(){	
		$("#modalwin1").show();
		$("#modalwin2").show();
		$("#modalwin3").show();
		$("#modalwin4").show();
		$("#modalwin5").show();
		$("#modalwin6").show();
		$("#modalvideowin1").show();
		$("#modalvideowin2").show();
	
});	


var openMyModalVideo = function(source,windowHeight)

	{
		modalWindow.windowId = "myModal";
		modalWindow.width = 695;	
		modalWindow.height = windowHeight;		
		modalWindow.content = "<iframe width='680' height='100%' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'>&lt/iframe>";
		modalWindow.open();
		
};

var openMyModalVideo2 = function(source,windowHeight)

	{
		location.href='#';
		modalWindow.windowId = "myModal";
		modalWindow.width = 778;	
		modalWindow.height = windowHeight;		
		modalWindow.content = "<iframe width='750' height='100%' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'>&lt/iframe>";
		modalWindow.open();
		
};

var openMyModalVideo3 = function(source,windowHeight)

	{
		location.href='#';
		modalWindow.windowId = "myModal";
		modalWindow.width = 925;	
		modalWindow.height = windowHeight;		
		modalWindow.content = "<iframe width='895' height='100%' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'>&lt/iframe>";
		modalWindow.open();
		
};


