nn4 = (document.layers)? true : false;
ie4 = (document.all)? true : false;
nn6 = (document.getElementById && !ie4)? true : false;

function popupWin(cardName, winW, winH, winTitle, text) {

	offW=60;
	offH=60;
if(screen.width<(winW+offW)){
	xW=screen.width-offW;
	winH=xW*winH/winW;
	winW=xW;
}
if(screen.height<(winH+offH)){
	xH=screen.height-offH;
	winW=xH*winW/winH;
	winH=xH;
}



var W=offW+winW
H=offH+winH

if (nn4 || ie4 || nn6) {
posX = Math.round((screen.width - winW) / 2);
posY = Math.round((screen.height - winH) / 2);
posCode = (nn4 || nn6)? 'screenX='+posX+',screenY='+posY : 'left='+posX+',top='+posY;
} else { posCode = ''; }
cardWindow = window.open('','_blank','menubar=no,toolbar=no,scrollbars=no,status=no,width='+W+',height='+H+','+posCode);
cardWindow.document.open();

cardWindow.document.write('<HTML><HEAD><TITLE>'+winTitle+'</TITLE>');
cardWindow.document.write('<META content="text/html; charset=windows-1251" http-equiv=Content-Type></HEAD>');
cardWindow.document.write('<body leftmargin=18 topmargin=18 marginwidth=0 marginheight=0 bgcolor=#6e6555>');
cardWindow.document.write('<Table border=0 cellpadding=0 cellspacing=0>');
cardWindow.document.write('<tr><td><Img Src="img/pic1_1.gif" width=11 height=11></td><td style="background:url(img/pic_bg_top.gif) #6e6555 repeat-x left top;"></td><td><Img Src="img/pic1_2.gif" width=11 height=11></td></tr>');
cardWindow.document.write('<tr><td style="background:url(img/pic_bg_left.gif) #6e6555 repeat-y left top;"></td><td>');
cardWindow.document.write('<A href="" onClick="window.close()"><Img Src='+cardName+' width='+winW+' height='+winH+' border=0></A>');
cardWindow.document.write('</td><td style="background:url(img/pic_bg_right.gif) #6e6555 repeat-y left top;"></td></tr>');
cardWindow.document.write('<tr><td><Img Src="img/pic1_3.gif" width=11 height=11></td><td style="background:url(img/pic_bg_bottom.gif) #6e6555 repeat-x left top;"></td><td><Img Src="img/pic1_4.gif" width=11 height=11></td></tr>');
cardWindow.document.write('</Table></Body></Html>');
cardWindow.document.close();
cardWindow.focus();
}

