var uAgent;
navAgent=navigator.userAgent.toLowerCase();
if(navAgent.indexOf("msie")>0){
	uAgent="ie";
}else if(navAgent.indexOf("gecko")>0){
	uAgent="ff";
}else{
	uAgent="";
}

function xId(id){return document.getElementById(id);}
function addEvent(elm, evType, fnc, useCapture){if(elm.addEventListener){elm.addEventListener(evType, fnc, useCapture);return true;}else if(elm.attachEvent){var r=elm.attachEvent('on'+evType, fnc);return r;}else{elm['on'+evType]=fnc;}}

function showMsg(val){
	alert(val);
}

var newWin="";
function openImg(img){
	if(newWin.closed==false) {
		newWin.close();
	}
	w=200;
	h=120;
	var left = Math.floor((screen.width-w)/2);
	var top = Math.floor((screen.height-h)/2);
	var setting="location=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no,width="+w+",height="+h+",top="+top+",left="+left;
	newWin=window.open("/openimg.php?img="+img, 'popUp', setting);
	newWin.focus();
}