
/* *******************************************************************************************
 *         POPUP - Centrerad p� sidan                                                        *
 ******************************************************************************************* */

function popWinOpen(winW,winH,sUrl,sName,iResize,iScroll,iStatus) {
	if (screen) {
		if ((screen.height - winH) < 150) {
			var winX = (screen.width - winW) / 2;
			var winY = 0;
		} else {
			var winX = (screen.width - winW) / 2;
			var winY = (screen.height - winH) / 2;
		}
		var popWindow = window.open(sUrl,sName,"resizable=" + iResize + ",menubar=0,scrollbars=" + iScroll + ",status=" + iStatus + ",width=" + winW + ",height=" + winH + ",top=" + winY + ",left=" + winX + "");
		if (popWindow) popWindow.focus();
	} else {
		window.open(sUrl,sName,"resizable=" + iResize + ",menubar=0,scrollbars=" + iScroll + ",status=" + iStatus + ",width=" + winW + ",height=" + winH);
	}
}

/* EX CODE:
<a href="/1001" target="_blank" title="Öppna i nytt fönster" onClick="popWinOpen(600,560,'/1001','popup1001',1,0,1); return false">Linktext</a>
*/

function openTextReader(path) {
	var theUrl = "http://isi.phoneticom.com/cgi-bin/webbforallarsone?customerid=95&url=" + path ;
	popWinOpen(330,60,theUrl,"textReaderWin",1,0,1) ;
}


function viewImage(path, w, h) {
	if (w > 10 && h > 10) {
		popWinOpen(w+20,h+20,path,"",1,0,1) ;
	} else {
		window.open(path) ;
	}
}
