var addOnload = function(o, strFunc, isReturn)
{
	var oldOnload;

	oldOnload = o.onload;

	o.onload = function()
	{
		if (oldOnload) oldOnload();
		if(isReturn)
		{
			return eval(strFunc);
		}
		else
		{
			eval(strFunc);
		}
	}
}


var addExternals = function()
{
	var a;
	var i;

	a = document.getElementsByTagName("a");

	try
	{
		for(i = 0; i < a.length; i++)
		{
			if(a[i].attributes["rel"])
			{
				if(a[i].getAttribute("rel") == "external")
				{
					a[i].setAttribute("target", "_blank");
				}
			}
		}
	}
	catch(e)
	{ }
}

var replaceIf = function()
{
	var el;
	var a;
	var i;
	var type;
	
	type = "";

	el = document.getElementById("if");
	if(el)
	{
		a = el.className.split(" ");
		for(i = 0; i < a.length; i++)
		{
			if(a[i] != "panel-alt")
			{
				type = a[i];
			}
		}
		var FO = {movie:"./Content/Flash/if.swf?type=" + type, width:200, height:242, majorversion:"7", build:"40", wmode:"transparent", menu:false};
		UFO.create(FO, el.id);
	}
}

var replaceHeader = function()
{
	var el;

	el = document.getElementById("header");

	if(el)
	{
		var FO = {movie:"./Content/Flash/Flash-header.swf", width:950, height:170, majorversion:"7", build:"40", wmode:"transparent", menu:false};
		UFO.create(FO, el.id);
	}
}

var init = function()
{
	if(typeof customInit == "function")
	{
		customInit();
	};

	addExternals();
	replaceIf();
	replaceHeader();
	if(typeof ProClinical.Ticker == "object")
	{
		ProClinical.Ticker.init();
	}

};

addOnload(window, "init();", false);
