function popupVisible(vis) {
	var obj1=document.getElementById("popup");
	var obj2=document.getElementById("popup_shadow");
	if (vis) {
		popupScrollSync();
		obj2.style.visibility="visible"; 
		obj1.style.visibility="visible"; 
		}
	else {
		obj2.style.visibility="hidden"; 
		obj1.style.visibility="hidden"; 
		}
	}

function popupToCenter(objId, wh, o) {
	var dx=0, dy=0;
	var obj=document.getElementById(objId);
	var w=240; //toNumeric(obj.style.width);
	var h=180; //toNumeric(obj.style.height);
	// ----
	var sp=getScrollXY();
	dx=Math.floor(sp[0]+(wh[0]-w)/2)+o;
	dy=Math.floor(sp[1]+(wh[1]-h)/2)+o;
	obj.style.left=dx+"px";
	obj.style.top=dy+"px";
	// ----
	var wh2=[];
	wh2[0]=Math.floor(wh[0]/2);
	wh2[1]=Math.floor(wh[1]/2);
	}
	
function popupScrollSync(){
	if (document.getElementById("popup").style.visible!="hidden") {
		var wh=getWindowSize();
		popupToCenter("popup", wh, 0);
		popupToCenter("popup_shadow", wh, 8);
		}
	}
	
function alertPopup(str) {
	document.getElementById("popup_text").innerHTML=str;
	popupVisible(true);
	}
	
function moreinfo(event, str, vis) {
	var scr=getScrollXY();
	var x=event.clientX+scr[0]+20;
	var y=event.clientY+scr[1];
	var obj=document.getElementById("moreinfo");
	obj.innerHTML=str;
	if (vis) {
		obj.style.left=x+"px";
		obj.style.top=y+"px";
		obj.style.display="block"; 
		obj.style.visibility="visible";
		} 
	else {
		obj.style.display="none"; 
		obj.style.visibility="hidden"; 
		}
	}

