/* Text changer - light version.
Let your text's font size customizable.
by Marco Rosella - http://www.centralscrutinizer.it/en/design/js-php/text-changer
v0.2 - May 18, 2006
*/
function initFontResize() {
	textChanger.init();
}
var textChanger = {
	defaultFS : 1.2,
	init: function() {
		var el = document.getElementsByTagName("body")[0];
		var sz = textChanger.getCookie();
		el.style.fontSize = sz ? sz + 'em' : textChanger.defaultFS + 'em';
		var incr = document.getElementById('increase');
		if(incr)
			incr.onclick = function(){textChanger.changeSize(1); return false;};
		var decr = document.getElementById('decrease');
		if(decr)
			decr.onclick = function(){textChanger.changeSize(-1); return false;};
		var reset = document.getElementById('reset');
		if(reset)
			reset.onclick = function(){textChanger.changeSize(0); return false;};
	},
	changeSize: function(val) {
		var el = document.getElementsByTagName("body")[0];
		var size = el.style.fontSize.substring(0, 4);
		var fSize = parseFloat(size, 10);
		if (val == 1)	{
			fSize += 0.1;
			if (fSize > textChanger.defaultFS*1.5) fSize = textChanger.defaultFS*1.5;
		} 
		if (val == -1) {
			fSize -= 0.1;
			if (fSize < textChanger.defaultFS/1.5) fSize = textChanger.defaultFS/1.5;
		}       
		if (val == 0) fSize = textChanger.defaultFS;
		el.style.fontSize = fSize.toFixed(2) + 'em';
		textChanger.updateCookie(fSize);
	},
	updateCookie: function(vl)	{
		var today = new Date();
		var exp = new Date(today.getTime() + (365*24*60*60*1000));
		document.cookie = 'textChangerL=size=' + vl + ';' +'expires=' + exp.toGMTString() + ';' +'path=/';
	},
	getCookie: function()	{ 
		var cname = 'textChangerL=size=';   
		var start = document.cookie.indexOf(cname);
		var len = start + cname.length;
		if ((!start) && (cname != document.cookie.substring(0,cname.length))) {return null;}
		if (start == -1) return null;
		var end = document.cookie.indexOf(";",len);
		if (end == -1) end = document.cookie.length;
		return unescape(document.cookie.substring(len, end));
	}
}
if (window.addEventListener)
	window.addEventListener("load", initFontResize, false);
else if (window.attachEvent && !window.opera)
    window.attachEvent("onload", initFontResize);


function PopupCenter(pageURL, title, w, h) {
    var left = (screen.width / 2) - (w / 2);
    var top = (screen.height / 2) - (h / 2);
    var mytitle = "_blank";
    var myoptions = 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left;
    window.open(pageURL, mytitle, myoptions);
}

$(function () {
    
    $("a").click(function () {

        if ($(this).attr("target") == '_blank'
        && $(this).attr("href").indexOf("astellas") < 0
        && $(this).attr("href").indexOf("adenoscan.com") < 0
        && $(this).attr("href").indexOf("ambisome.com") < 0
        && $(this).attr("href").indexOf("lexiscan.com") < 0
        && $(this).attr("href").indexOf("mycamine.com") < 0
        && $(this).attr("href").indexOf("prograf.com") < 0
        && $(this).attr("href").indexOf("protopic.com") < 0
        && $(this).attr("href").indexOf("vaprisol.com") < 0
        && $(this).attr("href").indexOf("vesicare.com") < 0
        && $(this).attr("href").indexOf("vibativ.com") < 0
        && $(this).attr("href").indexOf("transplantexperience.com") < 0 
        && $(this).attr("href").indexOf("http") > -1) {

            return confirm("You are now leaving www.astellasreimbursement.com. The website you are linking to is neither owned nor controlled by Astellas. Astellas is not responsible for the content or services on this site.");
        }
    });
});
