function amWindow(loc,LCR,TCB,winw,winh,S,R,NOTOOL,ESCAPE){
/************************************************************************************************************
* 	amWindow Parameters: amWindow('url location', [-1 || 0 || 1] , [-1 || 0 || 1] , [width || 1 || 0] , [height || 1 || 0] , 0 || 1, 0 || 1)
*	> LCR  ~ number: -1 (left) or 0 (center) or 1 (right)
*	> TCB  ~ number: -1 (top) or 0 (center) or 1 (bottom)
*	> winw ~ width or 1 or 0 ( 1 is width of screen, 0 is 1/2 width of screen)
*	> winh ~ height or 1 or 0 ( 1 is height of screen, 0 is 1/2 height of screen)
*	> S    ~ boolean (1 or 0) scrollbars yes or no
*   > R    ~ boolean (1 or 0) resizable yes or no
*************************************************************************************************************/
//alert("loc= " + loc + " : LCR= " + LCR + " : TCB= " + TCB + " : winw= " + winw + " : winh= " + winh + " : S= " + S + " : R= " + R);

	var sbar = 5; // offset of scrollbars (width and height);
	var tbar = 54; // offset of taskbar (height)
	var swidth    = screen.availWidth - sbar;
	var sheight   = screen.availHeight - tbar; // compensate for taskbar
	var halfw = swidth / 2; var halfh = sheight / 2;
	if (R > 0){ R = "resizable," } else { R = "" }
	if (winw == 0){ winw = (halfw - sbar); } else if (winw == 1) { winw = (swidth - sbar); }
	if (winh == 0){ winh = (halfh - sbar); } else if (winh == 1) { winh = (sheight - sbar); }
	var centx = (swidth  - winw) / 2 ; var centy = (sheight - winh) / 2 ;
	switch (LCR){ case -1: LCR = 0; break; case 1: if (S == 1){ LCR = (swidth - winw) - sbar; }else{ LCR = (swidth - winw); } break; case 0: LCR = centx; break; }
	switch (TCB){ case -1: TCB = 0; break; case 1: if (S == 1){ TCB = (sheight - winh) - sbar; }else{ TCB = (sheight - winh); } break; case 0: TCB = centy; break; }
	
	if(NOTOOL){ T = "no" }else{ T = "yes" }
	
	if(!ESCAPE){
	
		if (self.amWin){
		amWin.close();
		amWin = null;
		bmWin = eval('window.open(loc,"bmwin","location=no,toolbar=' + T +',scrollbars=' + S + ',' + R + ' width=' + winw + ',height=' + winh + ',left=' + LCR + ',top=' + TCB + '")');
		bmWin.focus();
		return false;
		}else if (self.bmWin){
		bmWin.close();
		bmWin = null;
		amWin = eval('window.open(loc,"amwin","location=no,toolbar=' + T +',scrollbars=' + S + ',' + R + ' width=' + winw + ',height=' + winh + ',left=' + LCR + ',top=' + TCB + '")');
		amWin.focus();
		return false;
		}else{
		amWin = eval('window.open(loc,"amwin","location=no,toolbar=' + T +',scrollbars=' + S + '," + R + " width=' + winw + ',height=' + winh + ',left=' + LCR + ',top=' + TCB + '")');
		amWin.focus();
		return false;
		}
		
	}else{
	escWin = eval('window.open(loc,"escwin","location=no,toolbar=' + T +',scrollbars=' + S + '," + R + " width=' + winw + ',height=' + winh + ',left=' + LCR + ',top=' + TCB + '")');
	}
}


function openLgPic(page,x,y){
var lgpicWin = amWindow(page,0,0,x,y,0,0,'no');
}


function showExternal(extloc){
var extWin = amWindow(extloc,1,-1,0,1,1,1);
}