document.write('<div id="hover"></div>');
var hover = getObject("hover");

/*
*  Hiire liigutamine
*/
function mouseMoveHover(x, y) {
	
	if (hover.style.visibility == "visible") {
		hover.style.top = y +23;
		hover.style.left = x -100;	
	}
}

/*
*  Üldraamistik hõljuva kasti kuvamiseks/varjamiseks
*/
function showHover(content, width) {
	if (old) return;	
	writeObjectContent(hover, content);

	hover.style.width = width;
	hover.style.height = 200;
	hover.style.visibility = "visible";
}


function hideHover() {	
	if (old) return;	
		
	writeObjectContent(hover, "");	
	
	hover.style.visibility = "hidden";
	hover.style.width = 0;
	hover.style.height = 0;		
	hover.style.top = -1000;
}

/*
*  Tavalise teksti kast
*/
function showTextHover(text) {
	var content = '';
	
	content += '<table cellpadding="2" cellspacing="0" border=0 class="hover">';
	content += '<tr>';
	content += '<td class="tekst">'+text+'</td>';
	content += '</tr>';
	content += '</table>';
	
	showHover(content, 300);
}

function hideTextHover() {
	hideHover();
}

/*
*  Kasutaja info kast
*/
function showflaginfo(lang,tekst_id) {

	header=flagtext[lang+'-'+tekst_id][0];
	tekst=flagtext[lang+'-'+tekst_id][1];
	var content = '';
	content += '<table width=200 cellspacing=0 cellpadding=1 border=0 class=hover>';
    content += '  <tr>';
    content += '    <td valign=top class=pealkiri>'+header+'</td>';
    content += '  </tr>';
    content += '  <tr><td height=2></td></tr>';
    content += '  <tr>';
    content += '    <td valign=top class=tekst>'+tekst+'</td>';
    content += '  </tr>';
    content += '</table>';
    

	
	showHover(content, 200);
}

function hideflag() {
	hideHover();
}

/*
*  Pildi info
*/
function showPictureInfo(heading, comment, info) {	
	var content = '';
	
	content += '<table cellpadding="2" cellspacing="0" class="hover">';
	if (heading != '') {
		content += '<tr>';
		content += '	<td class="pealkiri">'+heading+'</td>';
		content += '</tr>';
	}
	if (comment != '') {
		content += '<tr>';
		content += '	<td class="kommentaar">'+comment+'</td>';
		content += '</tr>';
	}
	content += '<tr>';
	content += '	<td class="tekst" nowrap="nowrap">'+info+'</td>';
	content += '</tr>';
	content += '</table>';
	
	showHover(content, 240);
}

function hidePictureInfo() {
	hideHover();
}
