var popup_close_timer;
var _link;
var _popup;
function initPopup(){
	_link = document.getElementById("question");
	_popup = document.getElementById("popup");
	if(_popup && _link) {
		_link.onmouseover = function () {
			_popup.style.visibility = "visible";
		}
		_link.onmouseout = function () {
			popup_close_timer = setTimeout("closePopUp()", 700);
		}
		_popup.onmouseover = function(){
			if (popup_close_timer) clearTimeout(popup_close_timer);
			_popup.style.visibility = "visible";
		}
		_popup.onmouseout = function () {
			popup_close_timer = setTimeout("closePopUp()", 100);
		}		
	}
}
function closePopUp(){
	_popup.style.visibility = "hidden";
}
if (window.addEventListener) {window.addEventListener("load", initPopup, false);}
else if (window.attachEvent) {window.attachEvent("onload", initPopup);}

/* JQUERY! */
$(document).ready(function(){

	/*
	$('ID/Class').innerfade({ 
		animationtype: Type of animation 'fade' or 'slide' (Default: 'fade'), 
		speed: Fadingspeed in milliseconds or keywords - slow, normal or fast (Default: 'normal'), 
		timeout: Time between the fades in milliseconds (Default: '2000'), 
		type: 'sequence', 'random' or 'random_start' (Default: 'sequence'), 
		containerheight: Height of the containing element in any css-height-value (Default: 'auto')  
		runningclass: CSS-Class which the container get’s applied (Default: 'innerfade') }); 
	*/
	$('.main-slides').attr("display", "none");
	$('.main-slides').innerfade({
		animationtype: 'fade',
		speed: 2000, 
		timeout: 7000, 
		type: 'random_start',
		containerheight: '295px'
	}); 
	/*
	$(".top-list li").hover(
		  function () {
			$(this).append($("<span> exclusive!</span>"));
		  }, 
		  function () {
			$(this).find("span:last").remove();
		  }
		);
	*/
	
	/* HIGHLIGHTS NAVIGATION */
	var navigationToHighlight = $("#what-page").html();
	$("#nav").children("#"+navigationToHighlight).addClass("active");
	$("body").addClass(navigationToHighlight);
	
}); 