
function change(get) {

	var point = document.getElementById("top_img");
	var side = document.getElementById("side_menu");

	if(get=='p1_hv')	{ point.getElementsByTagName("IMG")[0].src = "/inc/img/point1_hv.gif"; }
	if(get=='p2_hv')	{ point.getElementsByTagName("IMG")[1].src = "/inc/img/point2_hv.gif"; }
	if(get=='p3_hv')	{ point.getElementsByTagName("IMG")[2].src = "/inc/img/point3_hv.gif"; }
	if(get=='p1')		{ point.getElementsByTagName("IMG")[0].src = "/inc/img/point1.gif"; }
	if(get=='p2')		{ point.getElementsByTagName("IMG")[1].src = "/inc/img/point2.gif"; }
	if(get=='p3')		{ point.getElementsByTagName("IMG")[2].src = "/inc/img/point3.gif"; }
	if(get=='sp1_hv')	{ document.getElementsByName("sp1")[0].src = "/inc/img/sales_point-here_hover.gif"; }
	if(get=='sp2_hv')	{ document.getElementsByName("sp2")[0].src = "/inc/img/sales_point-here_hover.gif"; }
	if(get=='sp3_hv')	{ document.getElementsByName("sp3")[0].src = "/inc/img/sales_point-here_hover.gif"; }
	if(get=='sp1')		{ document.getElementsByName("sp1")[0].src = "/inc/img/sales_point-here.gif"; }
	if(get=='sp2')		{ document.getElementsByName("sp2")[0].src = "/inc/img/sales_point-here.gif"; }
	if(get=='sp3')		{ document.getElementsByName("sp3")[0].src = "/inc/img/sales_point-here.gif"; }
	if(get=='sub1_hv')	{ side.getElementsByTagName("IMG")[0].src = "/inc/img/sub1_hv.jpg"; }
	if(get=='sub2_hv')	{ side.getElementsByTagName("IMG")[1].src = "/inc/img/sub2_hv.jpg"; }
	if(get=='sub3_hv')	{ side.getElementsByTagName("IMG")[2].src = "/inc/img/sub3_hv.jpg"; }
	if(get=='sub1')		{ side.getElementsByTagName("IMG")[0].src = "/inc/img/sub1.jpg"; }
	if(get=='sub2')		{ side.getElementsByTagName("IMG")[1].src = "/inc/img/sub2.jpg"; }
	if(get=='sub3')		{ side.getElementsByTagName("IMG")[2].src = "/inc/img/sub3.jpg"; }
	return;

}

Hmenu = function (oo) {
	oo.style.position = 'relative';
	oo.style.zIndex   = 100;
	var lis = oo.getElementsByTagName('li');
	var n = 0;
	while (n < lis.length) {
		var tab = lis[n].getElementsByTagName('div')[0];
		if (!tab) { n++; continue;}
		tab.style.position = 'absolute';
		tab.style.top      = lis[n].offsetTop  + lis[n].clientHeight - 3 + 'px';
		tab.style.left     = lis[n].offsetLeft + 'px';
		tab.style.zIndex   = 101;
		lis[n].tab = tab;
		lis[n].onmouseover = function () { this.tab.style.display = 'block'; }
		lis[n].onmouseout  = function () { this.tab.style.display = 'none';  }
		var td = tab.getElementsByTagName('td');
		var m = 0;
		while (m < td.length) {
			td[m].a = td[m].getElementsByTagName('a')[0];
			td[m].onmouseover = function () { this.className = 'td_hov'; this.a.className = 'a_hov';}
			td[m].onmouseout  = function () { this.className = ''; this.a.className = ''; }		
			if (!td[m].getAttribute('link')) { m ++; continue; }
			td[m].linkTo      = td[m].getAttribute('link');
			td[m].onclick     = function () { location = this.linkTo; }
			m ++;
		}
		n ++;
	}
}

ExtCont = function (oo) {
	var contents = Object();
	var b = oo.getElementsByTagName('div');
	var n = 0;
	while (n < b.length) {
		var p = b[n].getAttribute('cont');
		if (!p) { n++; continue; }
		contents[p] = b[n];
		var c = b[n].getElementsByTagName('div');
		var l = 0;
		while (l < c.length) {
			var i = c[l].getAttribute('parts');
			if (!i) { l++; continue; }
			if (i == 'title') { contents[p].ti = c[l]; contents[p].ti.ix = p; }
			if (i == 'body')  { contents[p].bd = c[l]; contents[p].bd.ix = p; }
			l++;
		}
		if (!contents[p].ti || !contents[p].bd) { n++; continue; }
		contents[p].bd.view = function () {
			if (this.style.display == 'block') {
				this.style.display = 'none';
			}else{
				for (var m in contents) {
					if (m == this.cont) { continue; }
					contents[m].bd.style.display = 'none';
				}
				this.style.display = 'block';
				location = '#cont' + this.ix;
			}
		}
		contents[p].ti.onclick = function () { contents[this.ix].bd.view(); }
		n ++;
	}
	cntOpen = function (ix) { contents[ix].bd.view(); }
}
window.onload = function () { 

	new Hmenu(document.getElementById('menu'));

}
