function OpenWin(theURL,winName,features) {
	win = window.open(theURL,winName,features);
	win.focus();
}

function checkEnter(event, fld) {
    if (event.keyCode==13) fld.form.submit();
}

function OpenWinCenter(theURL, winName, features, theWidth, theHeight) {
	var leftf=Math.round(((screen.width) / 2)-theWidth/2);
	var topf=Math.round(((screen.height) / 2)-theHeight/2);
	var feats = 'width='+theWidth+',height='+theHeight+',left='+leftf+',top='+topf;
	if  (features != '') feats = feats + ',' + features;
	OpenWin(theURL, winName, feats);
}

function getXY(obj) {
	if ( document.layers ) return obj;
	var p = { x:0 ,y:0 };
	do {
		p.x += parseInt( obj.offsetLeft );
		p.y += parseInt( obj.offsetTop );
        obj = obj.offsetParent;
   	} while ( obj );
	return p
}

// bugfix: correct position of layer
function CorrectPos() {
    var cor = 0, a = CorrectPos.arguments;
    if (a.length == 3) cor = a[2];
    if (navigator.userAgent.indexOf("Firefox") > -1) cor = 2;
    var obj = MM_findObj(a[0]);
    obj.style.top = getXY(a[1]).y - 100 + cor + 'px';
}

function openPDF(theURL) { OpenWinCenter(theURL,'folder', 'resizable=1', 353, 500); }