var modalWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		jQuery(".modal-window").remove();
		jQuery(".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>";	

		jQuery(this.parent).append(modal);

		jQuery(".modal-window").append("<a class=\"close-window\"></a>");
		jQuery(".close-window").click(function(){modalWindow.close();});
		//$(".modal-overlay").click(function(){modalWindow.close();});
	}
};

var pageTracker = _gat._getTrackerByName();
var loadingWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	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 += "<div id=\"divideo\">";
		modal += "<div id=\"popcontainerv1\">";
		modal += "<div class=\"closebtnv2\"><a class=\"closebtnv2\" href=\"javascript:return false;\">Click here to close this window</a></div>";
		modal += "<div id=\"popcontentv1\">";
		modal += "<table class=\"contenttable\" cellpadding=\"0\" cellspacing=\"0\">";

		modal += "<tbody>";
		modal += "<tr>";
		modal += "<td>";
		modal += "<div id=\"navid\"><iframe id=\"ivid\" width=\"690\" height=\"400\" frameborder=\"0\" allowfullscreen></iframe></div>";
		modal += "</td>";
		modal += "</tr>";
		modal += "</tbody>";
		modal += "</table>";
		modal += "</div>";
		modal += "</div>";
		modal += "</div>";	

		modal += "</div>";	

		jQuery(this.parent).append(modal);

		//$(".modal-window").append("<a class=\"close-window\"></a>");
		jQuery(".closebtnv2").click(function(){modalWindow.close();});
		jQuery(".modal-overlay").click(function(){modalWindow.close();});
		document.getElementById('ivid').src = pageTracker._getLinkerUrl('http://www.neuroaid.com/videointro.html');

	}
};


var openMyModal = function(source)
{
	modalWindow.windowId = "myModal";
	modalWindow.width = 480;
	modalWindow.height = 405;
	modalWindow.content = source;
	modalWindow.open();
};


var openloadingModal = function(source)
{
	loadingWindow.windowId = "loadingWindow";
	loadingWindow.width = 480;
	loadingWindow.height = 405;
	loadingWindow.content = source;
	loadingWindow.open();
};
 

function closeandaddcookie(){
var today = new Date();
var expire = new Date();

 expire.setTime(today.getTime() + 3600000);
 document.cookie = "na_mp=1;expires="+expire.toGMTString();

	modalWindow.close();
}

function viewmyvideopopup(){
		

		openloadingModal("");
		
}




