/*var tb_pathToImage = "http://www.abstract5.com/wp-content/themes/a5/js/loadingAnimation.gif";
//on page load call tb_init
$(document).ready(function(){   
	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
	imgLoader = new Image();// preload image
	imgLoader.src = tb_pathToImage;
});*/

var modalWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		$(".modal-window").remove();
		$(".modal-overlay").remove();
			$("#load").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 class=\"close-window\"></a>");
		$(".modal-window").append("<div class=\"corner\"></div>");
		$(".close-window").click(function(){modalWindow.close();});
		$(".modal-overlay").click(function(){modalWindow.close();});
		$(".post_container a").click(function(){modalWindow.close();});
	
			
	}
};


var openMyModal = function(source)
{	
	
	modalWindow.windowId = "myModal";
	modalWindow.width = 595;
	modalWindow.height = 500;
	modalWindow.content = "<iframe width='595' height='500' style='overflow-x: hidden;' frameborder='0' scrolling='auto' allowtransparency='true' src='" + source + "'></iframe>";
	modalWindow.open();
	
};
