function amWindow(loc,LCR,TCB,winw,winh,S,R,NOTOOL){
/************************************************************************************************************
* 	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 (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;
	}
}

function picWin(loc,winw,winh){
winw = winw + 20;
winh = winh + 26;
amWindow(loc,0,0,winw,winh,0,0,1)
}


function vidPlayer(loc,winw,winh){
amWindow(loc,0,0,winw,winh,0,0,1)
}