var lhvno = null;
var hvheight = 240;
var hvwidth = 570;
var hvimgheight = 240;
var hvimgwidth = 320;
var hvsubjectlength = 35;
var hvexplainlength = 100;
function hvo(obj, hvno) {
	if (obj != null) {
		obj.className = 'hvo';
	}
	if (lhvno != hvno) {
		hvmenuyaz(hvno);
		lhvno = hvno;
	}	
}

function hvn(obj) { obj.className = 'hvn'; }

function hvl(hvx) { document.location.href=hvmenu[hvx][3]; }

function hvmenuyaz(hvx) {
	hvtext = '<table width=' + hvimgwidth + ' height=' + hvimgheight + ' border=0 cellspacing=0 cellpadding=0 background="' + hvmenu[hvx][0]+ '">';
	hvtext += '<tr><td height=' + (hvimgheight*3/4) + ' valign=bottom align=center>';
	hvtext += '<div style="position:relative; top:' + (hvimgheight/4) + '; z-index:10;"><a href="' + hvmenu[hvx][3] + '" class=hva>';
	// hvtext += '<font style="font-weight:bold; font-size:11pt;">' + hvmenu[hvx][1] + '</font><br>' + hvmenu[hvx][2];
	// hvtext += '</font></a></div>';
	hvtext += '</td></tr>';
	hvtext += '<tr><td height=' + (hvimgheight/4) + ' class=hvab>&nbsp;</td></tr>';
	hvtext += '</table>';
document.getElementById('hvitrin').innerHTML = hvtext;
}

function makehvmenu(hvmenudiv) {

	tt = '<table border=0 width=' + hvwidth + ' height=' + hvheight + ' cellspacing=0 cellpadding=0>';
	tt += '<tr><td id=hvitrin width=' + (hvwidth-hvimgwidth) + ' height=' + hvheight + '>&nbsp;</td>';
	tt += '<td width=' + hvimgwidth + ' height=' + hvimgheight + ' valign=top class=hvn>';
	tt += '<table width=100% border=0 cellspacing=0 cellpadding=0>';
	var hvmenu_len = hvmenu.length;
	for (var x = 0; x < hvmenu_len; x++) {
		if (hvmenu[x][1].length > 35) {
			hvmenu[x][1] = hvmenu[x][1].substring(0, hvsubjectlength) + '...';
	
		}
		if (hvmenu[x][2].length > 100) {
			hvmenu[x][2] = hvmenu[x][2].substring(0, hvexplainlength) + '...';
		}
		tt += '<tr><td height=' + (hvheight/10) + ' class=hvn onmouseover="hvo(this, ' + x + ');" onmouseout="hvn(this);" onclick="hvl(' + x + ');"><li>' + hvmenu[x][1] + '</li></td></tr>'; 
	}
	tt += '</table>';
	tt += '</td></tr></table>';

	document.getElementById(hvmenudiv).innerHTML = tt;
	hvo(null,0);
}
