// JavaScript Document

if(document.createStyleSheet) {
	document.createStyleSheet('http://www.lifespan-network.org/affiliates/style.css');
	var i = document.getElementsByTagName("head").length;
}
else {
	var newSS=document.createElement('link');
	newSS.rel='stylesheet';
	newSS.href='http://www.lifespan-network.org/affiliates/style.css';
	newSS.type='text/css';
	var i = document.getElementsByTagName("head")[0].appendChild(newSS);
	i = i.childNodes.length;
}

var parent = document.getElementById("lifespanScript").parentNode;

var linkdiv = document.createElement("div");
linkdiv.id = "lifespanLink";

var link = document.createElement("a");
link.href = "http://www.lifespan-network.org/?utm_source=affiliatelinks&utm_medium=webbanner&utm_campaign=proudmember";
link.target = "_blank";
link.title = "Please Click Here to go to the LifeSpan Website";

var linkimg = new Image();
linkimg.src = "http://www.lifespan-network.org/images/affiliates/LifeSpan-150x75.gif";
linkimg.alt = "Please Click Here to go to the LifeSpan Website";
linkimg.width = 150;
linkimg.height = 75;
linkimg.border = 0;

link.appendChild(linkimg);

linkdiv.appendChild(link);

var linkpopup = document.createElement("div");
linkpopup.id = "lifespanPopUp";
linkpopup.innerHTML = "<p>LifeSpan is the largest senior care provider organization serving the state of Maryland and the District of Columbia, consisting of roughly 300 facilities providing a range of services to seniors. LifeSpan offers continuing education opportunities, networking activities and updates on the latest clinical and managerial information so that our members are positioned to deliver the highest quality of care.</p>";
linkdiv.appendChild(linkpopup);

parent.appendChild(linkdiv);

var x = 0;

var obj = linkdiv;

do {
	if (!isNaN(obj.offsetLeft))
		x += obj.offsetLeft;
}
while (obj = obj.parentNode);

var t_w = document.width / 2;
var left;

if (x > t_w)
	left = "-400px";
else
	left = "150px";
	
linkpopup.style.left = left;
	
function override() {
	linkpopup.style.left = "-400px";
}
