function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

		
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('mainwrapper').offsetHeight + document.getElementById('mainwrapper').offsetTop;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'absolute';
				footerElement.style.top = (windowHeight - footerHeight) + 'px';
			} else {
				footerElement.style.position = 'absolute';
				footerElement.style.top = (contentHeight) + 'px';
			}
		}
	}
}
window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}
        
        
function interstitialPages(varLinkToURL,varLinkTarget) {
	varMessage = "You are now leaving www.celgene.asia, a web site provided by Celgene. ";
	varMessage += "This link may take you to a Website to which this Privacy Policy does not apply.";
	varMessage += "We encourage you to read the Privacy Policy of every Website you visit.";
	alert(unescape(varMessage));
	if (varLinkTarget == "_blank") {
		newWindow = window.open(varLinkToURL, "Celgene", "");
		newWindow.focus();
	}
	else {
		document.location = varLinkToURL;
	}
}


function openExternalURL(varLinkToURL,varLinkTarget) {
         varMessage =  "Esta p%E1gina web se ofrece como recurso. Las organizaciones listadas ";
         varMessage += "no est%E1n necesariamente aprobadas por Celgene. Celgene no tiene ";
         varMessage += "influencia sobre estas webs.";
         alert(unescape(varMessage));
         if (varLinkTarget == "_blank") {
            newWindow = window.open(varLinkToURL, varLinkTarget);
            newWindow.focus();
         }
         else {
            document.location = varLinkToURL;
         }

}

