var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all);

var timerID = null;
var opak = 0;
var index = 0;
var mouseX = -20;
var mouseY = -40;

var msg = new Array();
msg[0]="Senator J. William Fulbright (1905-1995)";
msg[1]="U.S. Fulbright Students 2007-08 at the Ball of the Technical University Vienna";
msg[2]="First Austrian Fulbright Students on Board of the USS Constitution";
msg[3]="U.S. Fulbright Group 2007/2008";
msg[4]="Austrian Fulbright Student Group 1951-52 meets again 50 years later";
msg[5]="Senator Fulbright at the signing of the first Austrian Fulbright Agreement in 1950";
msg[6]="help forum";
msg[7]="contact us";
msg[8]="Ed Brzytwa, Fulbright/DAK student 03-04 and Dr. Lonnie Johnson";
msg[9]="Rebecca Babb-Nelsen, Kim Singletary, former Austrian Secretary of State Benita Ferrero-Waldner, Ann Carson, Amanda Oleson, Kathryn Tomko at the Ball of the Technical University, Vienna 2004";
msg[10]="Dr. Johnson, Fulbright Commission; Prof. Wagnleitner, Universität Salzburg; 2004 winner Corinna Dirisamer; William Wanlund, U.S. Embassy Vienna; Prof. Wallinger, Austrian Association for American Studies chair"


function mozOpacity(){
	if(ns6){
		opacity = opak + 7;
		opak = opacity;
		timerID = setTimeout("mozOpacity()", 70);
		obj.style.MozOpacity = opacity + '%';
	}
}

function stopMozOpacity(){
	if(ns6){
		if(timerID!=null){
			clearTimeout(timerID);
			timerID=null;
		}
		obj.style.MozOpacity = '0%';
		opak = 0;
	}
}

function changeMsg(index){
	if(ie5){
		obj.style.filter="blendTrans(Duration=1.2)";
		obj.filters[0].Apply();
		obj.style.visibility = "visible";
		obj.filters[0].Play();
		obj.innerHTML = msg[index];
	}
	else if(ns6){
		obj.style.visibility = "visible";
		obj.innerHTML = msg[index];
		if (opak < 100){
			mozOpacity();
		}
	}
}

function hideMsg(){
	if(ie5){
		obj.style.visibility="hidden";
	}
}

function getMouseMove(e){
	if(ie5){
		obj.style.left = document.body.scrollLeft + event.clientX + mouseX;
		obj.style.top = document.body.scrollTop + event.clientY + mouseY;
	}
	else if(ns6){
		obj.style.left = window.pageXOffset + e.clientX + mouseX;
		obj.style.top = window.pageYOffset + e.clientY + mouseY;
	}
}

function fadingTooltipsInit(){
	if(ie5 || ns6){
		obj = document.getElementById('box');
		lnk = document.links;
		for(var i=0;i<lnk.length;i++){
			if(ie5){
				lnk[i].attachEvent("onmouseout", hideMsg);
			}
			else if(ns6){
				lnk[i].addEventListener("mouseout", stopMozOpacity, false);
			}
		}
	}
}
document.onmousemove=getMouseMove;