var closewindow = true;
var openwindow = '';
var imgalt = '';
var bgfon = 60;
var imgfono = 95;
var timeout=null;

function show_bar(ev, id) {

objmapwin = document.getElementById("fon");

if (openwindow != ''){stopclosebar();hide_bar();}

openwindow = "win[" + id + "]";
objmap = document.getElementById(openwindow);

objmap.style.width=(350+'px');
	
DocmapX = ev.clientX + (document.body.scrollLeft || document.documentElement.scrollLeft) - 25;
DocmapY = ev.clientY + (document.body.scrollTop || document.documentElement.scrollTop) + 15 ;

if(document.body.clientWidth < (DocmapX+370)){DocmapX=DocmapX-350;}

objmap.style.top = DocmapY+'px';
objmap.style.left = DocmapX+'px';
objmap.style.display = "block";
document.body.style.backgroundColor = '#200307';
objmapwin.style.opacity = bgfon/100;
objmapwin.style.filter="alpha(opacity="+bgfon+")";
}

function hide_bar() {
document.getElementById(openwindow).style.display="none";
document.body.style.backgroundColor = '#32151C';
objmapwin.style.opacity = 100/100;
objmapwin.style.filter="alpha(opacity="+100+")";
openwindow= '';
}

function closebar() {
timeout=setTimeout("hide_bar();", 300);
}

function stopclosebar() {
clearTimeout(timeout);
timeout=null;
}

function show_barimg(ev, id) {
	
if( imgalt != ''){hide_barimg();}

MouseX = (ev.clientX + (document.body.scrollLeft || document.documentElement.scrollLeft) + 25);
MouseY = (ev.clientY + (document.body.scrollTop || document.documentElement.scrollTop) + 18);

imgoww = "imgalt[" + id + "]";
imgalt = document.getElementById(imgoww);

imgalt.style.width=(350+'px');

if(document.body.clientWidth < (MouseX+370)){MouseX=MouseX-350;}

imgalt.style.top = MouseY + 'px';
imgalt.style.left = MouseX + 'px';
imgalt.style.display = "block";

imgalt.style.opacity = imgfono/100;
imgalt.style.filter="alpha(opacity="+imgfono+")";
}
	
function hide_barimg(id) {
imgalt.style.display = "none";
if(imgalt.style.display == 'none'){}
else {
	imgalt.style.display = "none";
hide_barimg();
}
}
