// Copyright © 2009 EyeForYou
// Created by Marco van den Haak

// ------ ROLLOVER ------

if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 3) browser=1;
else if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 3) browser=1;
else browser=0;
preloading = ""
kleur = ""
if (browser==1){

	thumbeen_aan = new Image();
	thumbeen_aan.src = "./images/topv-01.jpg";
	thumbtwee_aan = new Image();
	thumbtwee_aan.src = "./images/topv-02.jpg";
	thumbdrie_aan = new Image();
	thumbdrie_aan.src = "./images/topv-03.jpg";
	thumbvier_aan = new Image();
	thumbvier_aan.src = "./images/topv-04.jpg";
	thumbvijf_aan = new Image();
	thumbvijf_aan.src = "./images/topv-05.jpg";	
	thumbzes_aan = new Image();
	thumbzes_aan.src = "./images/topv-06.jpg";
	thumbzeven_aan = new Image();
	thumbzeven_aan.src = "./images/topv-07.jpg";
	thumbacht_aan = new Image();
	thumbacht_aan.src = "./images/topv-08.jpg";
	
	thumbeen_uit = new Image();
	thumbeen_uit.src = "./images/topv-01-off.jpg";
	thumbtwee_uit = new Image();
	thumbtwee_uit.src = "./images/topv-02-off.jpg";
	thumbdrie_uit = new Image();
	thumbdrie_uit.src = "./images/topv-03-off.jpg";
	thumbvier_uit = new Image();
	thumbvier_uit.src = "./images/topv-04-off.jpg";
	thumbvijf_uit = new Image();
	thumbvijf_uit.src = "./images/topv-05-off.jpg";	
	thumbzes_uit = new Image();
	thumbzes_uit.src = "./images/topv-06-off.jpg";
	thumbzeven_uit = new Image();
	thumbzeven_uit.src = "./images/topv-07-off.jpg";
	thumbacht_uit = new Image();
	thumbacht_uit.src = "./images/topv-08-off.jpg";

	
	preloading = "ready"
}

if (browser==0){
}

function displayon (Name,tekst){
        if (browser==1){
        if (kleur != Name){
        if (preloading == "ready")document [Name].src = eval(tekst + ".src");
        }
        }
}

function displayoff (Name,tekst){
        if (browser==1){
        if (preloading == "ready")document [Name].src = eval(tekst + ".src");
        }
}

function resetset (Name,tekst){
  if (browser==1){
        


        displayoff ('buttwee_uit', 'buttwee_uit');
		displayoff ('butdrie_uit', 'butdrie_uit');
		displayoff ('butvier_uit', 'butvier_uit');
		displayoff ('butvijf_uit', 'butvijf_uit');
  
        if (preloading == "ready")document [Name].src = eval(tekst + ".src");
        kleur = Name
   } 
}   

//-->


// ------ POPUP ------

var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;


if (nodyn) { event = "nope" }

var tipFollowMouse= true;	
var tipWidth= 515;
var offX= 10;	
var offY= 10; 
var tipFontFamily= "Arialf";
var tipFontSize= "8pt";

var tipFontColor= "#000000";
var tipBgColor= "#000000"; 
var tipBorderColor= "#cc0033";
var tipBorderWidth= 2;
var tipBorderStyle= "solid";
var tipPadding= 4;

var messages = new Array();

messages[0] = new Array('./images/topv-01-gr.jpg','',"#ffffff");
messages[1] = new Array('./images/topv-02-gr.jpg','',"#ffffff");
messages[2] = new Array('./images/topv-03-gr.jpg','',"#ffffff");
messages[3] = new Array('./images/topv-04-gr.jpg','',"#ffffff");
messages[4] = new Array('./images/topv-05-gr.jpg','',"#ffffff");
messages[5] = new Array('./images/topv-06-gr.jpg','',"#ffffff");
messages[6] = new Array('./images/topv-07-gr.jpg','',"#ffffff");
messages[7] = new Array('./images/topv-08-gr.jpg','',"#ffffff");

if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}


var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = tooltip.style;
	if (ie4||ie5||ns5) {	
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;

var t1,t2;	
var tipOn = false;	
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ie4||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	if (tipOn) positionTip(evt);
}

function positionTip(evt) {
	if (!tipFollowMouse) {
		standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
		mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
		mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	}
	
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
	
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = mouseX-(tpWd+offX)+"px";
	else tipcss.left = mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = winHt-(tpHt+offY)+"px";
	else tipcss.top = mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

document.write('<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>')


 

