﻿

/***********************************************
* Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
* Copyright 2002-2007 by Sharon Paine
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

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;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 185;
var offX= 20;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#ffffff";
var tipBgColor= "#B11B34"; 
var tipBorderColor= "#000080";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge";
var tipPadding= 0;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing: 
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('images/ajtokicsi/0.gif','Avas',"");
messages[1] = new Array('images/ajtokicsi/1.gif','Avas',"");
messages[2] = new Array('images/ajtokicsi/2.gif','Balla',"");
messages[3] = new Array('images/ajtokicsi/3.gif','Bánkút',"");
messages[4] = new Array('images/ajtokicsi/4.gif','Berek',"");
messages[5] = new Array('images/ajtokicsi/5.gif','Bordás',"");
messages[6] = new Array('images/ajtokicsi/6.gif','Bükk',"");
messages[7] = new Array('images/ajtokicsi/7.gif','Csopak',"");
messages[8] = new Array('images/ajtokicsi/8.gif','Delta 1',"");
messages[9] = new Array('images/ajtokicsi/9.gif','Delta 2',"");
messages[10] = new Array('images/ajtokicsi/10.gif','Delta 3',"");
messages[11] = new Array('images/ajtokicsi/11.gif','Eger',"");
messages[12] = new Array('images/ajtokicsi/12.gif','Füred',"");
messages[13] = new Array('images/ajtokicsi/13.gif','Füzér',"");
messages[14] = new Array('images/ajtokicsi/14.gif','Körmend',"");
messages[15] = new Array('images/ajtokicsi/15.gif','Kőrös',"");
messages[16] = new Array('images/ajtokicsi/16.gif','Őrhalom',"");
messages[17] = new Array('images/ajtokicsi/17.gif','Örkény',"");
messages[18] = new Array('images/ajtokicsi/18.gif','Polgár',"");
messages[19] = new Array('images/ajtokicsi/19.gif','Salgó',"");
messages[20] = new Array('images/ajtokicsi/20.gif','Siklós',"");
messages[21] = new Array('images/ajtokicsi/21.gif','Sümeg',"");
messages[22] = new Array('images/ajtokicsi/22.gif','Szeghalom',"");
messages[23] = new Array('images/ajtokicsi/23.gif','Széphalom',"");
messages[24] = new Array('images/ajtokicsi/24.gif','Széphalom 4',"");
messages[25] = new Array('images/ajtokicsi/25.gif','Szerencs',"");
messages[26] = new Array('images/ajtokicsi/26.gif','Senyő',"");
messages[27] = new Array('images/ajtokicsi/27.gif','Szolnok',"");
messages[28] = new Array('images/ajtokicsi/28.gif','Téglás',"");
messages[29] = new Array('images/ajtokicsi/29.gif','Tokaj',"");
messages[30] = new Array('images/ajtokicsi/30.gif','Trapéz 3',"");
messages[31] = new Array('images/ajtokicsi/31.gif','Trapéz 4',"");
messages[32] = new Array('images/ajtokicsi/32.gif','Trapéz 5',"");
messages[33] = new Array('images/ajtokicsi/33.gif','Velence',"");
messages[34] = new Array('images/ajtokicsi/34.gif','Vizsoly',"");

messages[35] = new Array('images/ajtokicsi/csincsilla.gif','Csincsilla',"");
messages[36] = new Array('images/ajtokicsi/deltamatt.gif','Delta Matt',"");
messages[37] = new Array('images/ajtokicsi/diamond.gif','Diamond',"");
messages[38] = new Array('images/ajtokicsi/felho.gif','Felhő',"");
messages[39] = new Array('images/ajtokicsi/flutismatt.gif','Flutis Matt',"");
messages[40] = new Array('images/ajtokicsi/mastercare.gif','Master Care',"");
messages[41] = new Array('images/ajtokicsi/T-010.gif','T-010',"");
messages[42] = new Array('images/ajtokicsi/T-020.gif','T-020',"");
messages[43] = new Array('images/ajtokicsi/T-030.gif','T-030',"");
messages[44] = new Array('images/ajtokicsi/T-040.gif','T-040',"");
messages[45] = new Array('images/ajtokicsi/T-050.gif','T-050',"");
messages[46] = new Array('images/ajtokicsi/T-060.gif','T-060',"");
messages[47] = new Array('images/ajtokicsi/T-070.gif','T-070',"");
messages[48] = new Array('images/ajtokicsi/T-080.gif','T-080',"");
messages[49] = new Array('images/ajtokicsi/T-090.gif','T-090',"");
messages[50] = new Array('images/ajtokicsi/T-100.gif','T-100',"");
messages[51] = new Array('images/ajtokicsi/T-110.gif','T-110',"");
messages[52] = new Array('images/ajtokicsi/T-120.gif','T-120',"");
messages[53] = new Array('images/ajtokicsi/T-130.gif','T-130',"");
messages[54] = new Array('images/ajtokicsi/T-140.gif','T-140',"");
messages[55] = new Array('images/ajtokicsi/T-150.gif','T-150',"");
messages[56] = new Array('images/ajtokicsi/T-160.gif','T-160',"");
messages[57] = new Array('images/ajtokicsi/T-170.gif','T-170',"");
messages[58] = new Array('images/ajtokicsi/T-180.gif','T-180',"");
messages[59] = new Array('images/ajtokicsi/T-190.gif','T-190',"");
messages[60] = new Array('images/ajtokicsi/T-200.gif','T-200',"");
messages[61] = new Array('images/ajtokicsi/T-510.gif','T-510',"");
messages[62] = new Array('images/ajtokicsi/T-520.gif','T-520',"");
messages[63] = new Array('images/ajtokicsi/T-530.gif','T-530',"");
messages[64] = new Array('images/ajtokicsi/T-540.gif','T-540',"");
messages[65] = new Array('images/ajtokicsi/T-550.gif','T-550',"");
messages[66] = new Array('images/ajtokicsi/T-560.gif','T-560',"");
messages[67] = new Array('images/ajtokicsi/T-570.gif','T-570',"");
messages[68] = new Array('images/ajtokicsi/T-580.gif','T-580',"");
messages[69] = new Array('images/ajtokicsi/T-590.gif','T-590',"");
messages[70] = new Array('images/ajtokicsi/T-210.gif','T-210',"");

messages[71] = new Array('images/bukonyiloerkelyajtofixoldal.jpg','Bukó-toló erkélyajtó fix oldalvilágítóval',"");
messages[72] = new Array('images/ketszkozepfelnyilonyilo-bukonyiloerkelyajto.jpg','Kétszárnyú középfelnyíló nyíló + bukó-nyíló erkélyajtó',"");
messages[73] = new Array('images/bukonyiloerkelyajto.jpg','Bukó-nyíló erkélyajtó',"");
messages[74] = new Array('images/nyiloerkelyajto.jpg','Nyíló erkélyajtó',"");
messages[75] = new Array('images/haromsztokosztottnyilo-bukonyilo-nyilo.jpg','Háromszárnyú nyíló + bukó-nyíló + nyíló tokosztott ablak',"");
messages[76] = new Array('images/ketszkozepfelnyilonyilo-bukonyilo.jpg','Kétszárnyú középfelnyíló nyíló + bukó-nyíló ablak',"");
messages[77] = new Array('images/ketsztokosztottbukonyilo-nyilo.jpg','Kétszárnyú tokosztott nyíló+ bukó-nyíló ablak',"");
messages[78] = new Array('images/egyszbukonyilo.jpg','Egyszárnyú bukó-nyíló ablak',"");
messages[79] = new Array('images/egyszbuko.jpg','Egyszárnyú bukó ablak',"");
messages[80] = new Array('images/egysznyilo.jpg','Egyszárnyú nyíló ablak',"");
messages[81] = new Array('images/fix.jpg','Fix szerkezet',"");

messages[82] = new Array('images/sline/basel.gif','Basel',"");
messages[83] = new Array('images/sline/berlin.gif','Berlin',"");
messages[84] = new Array('images/sline/boden.gif','Boden',"");
messages[85] = new Array('images/sline/bonn.gif','Bonn',"");
messages[86] = new Array('images/sline/bremen.gif','Bremen',"");
messages[87] = new Array('images/sline/dortmund.gif','Dortmund',"");
messages[88] = new Array('images/sline/dresden.gif','Dresden',"");
messages[89] = new Array('images/sline/dusseldorf.gif','Dusseldorf',"");
messages[90] = new Array('images/sline/erfurt.gif','Erfurt',"");
messages[91] = new Array('images/sline/frankfurt.gif','Frankfurt',"");
messages[92] = new Array('images/sline/hamburg.gif','Hamburg',"");
messages[93] = new Array('images/sline/hannover.gif','Hannover',"");
messages[94] = new Array('images/sline/hof.gif','Hof',"");
messages[95] = new Array('images/sline/kiel.gif','Kiel',"");
messages[96] = new Array('images/sline/koln.gif','Koln',"");
messages[97] = new Array('images/sline/lubeck.gif','Lubeck',"");
messages[98] = new Array('images/sline/passau.gif','Passau',"");
messages[99] = new Array('images/sline/potsdam.gif','Potsdam',"");
messages[100] = new Array('images/sline/rostock.gif','Rostock',"");
messages[101] = new Array('images/sline/stuttgart.gif','Stuttgart',"");
messages[102] = new Array('images/sline/ulm.gif','Ulm',"");
messages[103] = new Array('images/sline/wurzburg.gif','Wurzburg',"");
messages[104] = new Array('images/sline/munchen.gif','München',"");
////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
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];
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td align="center" valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
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) {	// ns4 would lose all this on rewrites
		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;

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	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);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
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;
	}
	// tooltip width and height
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	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>')

