var brVer     = "Unknown";
var curButton = new Array();
var bigbook   = new Array();

document.write('<STYLE TYPE="text/css">');
document.write('<!--');
document.write('.pic_border1, .pic_border2   {background-color: #1E2E1D}');
document.write('.img_comment {font: 9pt "tahoma"; color: #FFFFCC}');
document.write('.pic_back1, .pic_back2   {background-color: #3F4153}');
document.write('.photo   {background-color: #5F3E34; border-width: 0px; margin=5px; }');
document.write('-->');
document.write('</STYLE>');

document.write('<DIV ID="bigImDiv" z-index=98 class=pic_border2 STYLE="position:absolute;left:-1000px;top:-1000px;width:0px;height:0px;visibility:hidden;cursor:hand;" onClick="hideBigImInDiv();">');
document.write('<TABLE  ID="bigImTab" WIDTH=100% HEIGHT=100% BORDER=0 CELLPADDING=0 CELLSPACING=2>');
document.write('<TR><TD CLASS=pic_border2>');
document.write('<TABLE WIDTH=100% HEIGHT=100% BORDER=0 CELLPADDING=10 CELLSPACING=0>');
document.write('<TR><TD class=pic_back2><IMG ID="bigImImg" NAME="bigImImg" src="/images/pixel.gif" alt="Нажмите на изображение, чтобы его закрыть." BORDER="0" VSPACE=2 HSPACE=2 onLoad="showBigImDiv(this.src);"><BR>');
document.write('</TABLE>');
document.write('</TD></TR>');
document.write('</TABLE>');
document.write('</DIV>');

document.write('<DIV ID="waitdiv"  z-index=99 class=pic_border2 STYLE="position:absolute;width:200px;height:50px;left:-1000;top:-1000;visibility:hidden;">');
document.write('<TABLE WIDTH=200 HEIGHT=100% BORDER=0 CELLPADDING=0 CELLSPACING=1>');
document.write('<TR><TD CLASS=pic_border2>');
document.write('<TABLE WIDTH=100% HEIGHT=100% BORDER=0 CELLPADDING=10 CELLSPACING=0>');
document.write('<TR><TD align=center class=pic_back2><DIV class=img_comment><B>Иллюстрация&nbsp;загружается...</B><BR>Пожалуйста,&nbsp;подождите.</DIV></TD></TR>');
document.write('</TABLE>');
document.write('</TD></TR>');
document.write('</TABLE>');
document.write('</DIV>');


function detVer() {
var detVer="Unknown";
detVer="IENew";
if (document.layers) {
detVer="NSOld";
} else if ((!document.all)&&(window.scrollY||(window.scrollY==0))) {
detVer="NSNew";
} else if (document.all&&(document.body.scrollTop||(document.body.scrollTop==0))) {
detVer="IENew";
} else if (document.all) {
detVer="Opera";
}
return detVer;
}

function onSmImClick(strImSrc) {
brVer=detVer();
if ((brVer=="Unknown")||(brVer=="NSOld")||(brVer=="Opera")) {
if (screen.availWidth&&screen.availHeight) {
showBigImInDivOrWin(strImSrc, Math.floor(screen.availWidth*3/4), Math.floor(screen.availHeight*3/4));
} else {
showBigImInDivOrWin(strImSrc, 640, 480);
}
} else {

if (document.images["bigImImg"]) {
	preShow();
	document.images["bigImImg"].src=strImSrc;
} else {
	showBigImInDivOrWin(strImSrc, 640, 480);
}
}
}

function showBigImDiv(strImSrc) {
brVer=detVer();
if ((brVer=="NSNew")||(brVer=="IENew")) {
var theImSrc2=document.images["bigImImg"].src;
var theImSrc2su=theImSrc2.substr(theImSrc2.length-9, 9);
theImSrc2su=theImSrc2su.toUpperCase();
if ((strImSrc!="/images/pixel.gif")&&(strImSrc!="/images/pixel.gif")&&(theImSrc2!="/images/pixel.gif")&&(theImSrc2!="/images/pixel.gif")&&(theImSrc2su!="PIXEL.GIF")) {
var doMark=false;
if (document.images["bigImImg"]) {
var intImWidth=document.images["bigImImg"].width;
var intImHeight=document.images["bigImImg"].height;
doMark=true;
} else {
var intImWidth=640;
var intImHeight=480;
doMark=true;
}
if (doMark) {
showBigImInDivOrWin(strImSrc, intImWidth, intImHeight);
}
}
}
}

function showBigImInDivOrWin(strImSrc, intImWidth, intImHeight) {
brVer=detVer();
var theScrollY=0;
var theScrollX=0;
if (brVer=="NSNew") {
theScrollY=parseInt(window.scrollY);
theScrollX=parseInt(window.scrollX);
} else if (brVer=="IENew") {
theScrollY=parseInt(document.body.scrollTop);
theScrollX=parseInt(document.body.scrollLeft);
}
var avWidth=640;
if (brVer=="NSOld"||brVer=="NSNew"||brVer=="Opera") {
avWidth=window.innerWidth;
} else if (brVer=="IENew") {
avWidth=document.body.clientWidth;
}
var avHeight=480;
if (brVer=="NSOld"||brVer=="Opera") {
avHeight=screen.availHeight;
} else if (brVer=="NSNew") {
avHeight=window.innerHeight;
} else if (brVer=="IENew") {
avHeight=document.body.clientHeight;
}
var posX=(avWidth-(intImWidth))/2+theScrollX;
if (posX<theScrollX) {posX=theScrollX}
var posY=(avHeight-(intImHeight))/2+theScrollY;
if (posY<theScrollY) {posY=theScrollY}
if (brVer=="NSNew"||brVer=="IENew") {
document.getElementById("waitdiv").style.left="-1000";
document.getElementById("waitdiv").style.top="-1000";
document.getElementById("waitdiv").style.visibility="hidden";
var imDiv=document.getElementById("bigImDiv");
imDiv.style.left=posX;
imDiv.style.top=posY;
if (document.getElementById("searchsort")) {document.getElementById("searchsort").style.visibility="hidden";}
imDiv.style.visibility="visible";
} else if (brVer=="NSOld") {
var imNeoVin=window.open("", "ourBigImWin", "left="+posX+",top="+posY+",width="+(intImWidth+28)+",height="+(intImHeight+28)+",directories=no,location=no,menubar=no,resizable=yes,status=no,titlebar=no,toolbar=no,scrollbars=yes");
imNeoVin.document.open();
imNeoVin.document.writeln("<HTML><BODY MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 onClick='self.close();'>");
imNeoVin.document.writeln("<TABLE WIDTH='100%' HEIGHT='100%' BORDER='0' CELLPADDING='10' CELLSPACING='0' BORDERCOLOR='#d19640' BGCOLOR='#063322' ALIGN='center' VALIGN='middle' STYLE='border-style:double;border-width:6px;border-color:#d19640;'><TR><TD WIDTH='100%' HEIGHT='100%' ALIGN='center' VALIGN='middle'><A HREF='' onClick='self.close(); return false;'><IMG ID='bigImImg' BORDER='0' SRC='"+strImSrc+"' alt=''></A></TD></TR></TABLE>");
imNeoVin.document.writeln("</BODY></HTML>");
imNeoVin.document.close();
} else if (brVer=="Opera") {
var tmpImg=new Image;
tmpImg.src=strImSrc;
var imNeoVin=window.open("", "ourBigImWin", "left="+posX+",top="+posY+",width="+(intImWidth+28)+",height="+(intImHeight+28)+",directories=no,location=no,menubar=no,resizable=yes,status=no,titlebar=no,toolbar=no,scrollbars=yes");
imNeoVin.document.open();
imNeoVin.document.writeln("<HTML><BODY MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 BGCOLOR='#063322' onClick='self.close();'>");
imNeoVin.document.writeln("<IMG ID='bigImImg' BORDER='0' SRC='"+tmpImg.src+"'>");
imNeoVin.document.writeln("</BODY></HTML>");
imNeoVin.document.close();
imNeoWin.title=" ";
} else {
alert("Sorry, but we can't detect your browser version and/or capabilities to display image.");
}
}

function hideBigImInDiv() {
var imDiv=document.getElementById("bigImDiv").style;
imDiv.visibility="hidden";
imDiv.left=-1000;
imDiv.top=-1000;
        if (document.getElementById("searchsort")) {document.getElementById("searchsort").style.visibility="inherit";}
}

function preShow() {
var brVer="Unknown";
brVer="IENew";
if (document.layers) {
brVer="NSOld";
} else if ((!document.all)&&(window.scrollY||(window.scrollY==0))) {
brVer="NSNew";
} else if (document.all&&(document.body.scrollTop||(document.body.scrollTop==0))) {
brVer="IENew";
} else if (document.all) {
brVer="Opera";
}

var theScrollY=0;
var theScrollX=0;
if (brVer=="NSNew") {
theScrollY=parseInt(window.scrollY);
theScrollX=parseInt(window.scrollX);
} else if (brVer=="IENew") {
theScrollY=parseInt(document.body.scrollTop);
theScrollX=parseInt(document.body.scrollLeft);
}
if ((brVer=="NSNew")||(brVer=="IENew")) {
var avWidth=640;
var avHeight=480;
if (brVer=="NSOld"||brVer=="Opera") {
avHeight=screen.availHeight;
avWidth=screen.availWidth;
} else if (brVer=="NSNew") {
avHeight=window.innerHeight;
avWidth=window.innerWidth;
} else if (brVer=="IENew") {
avHeight=document.body.clientHeight;
avWidth=document.body.clientWidth;
}
var posX=Math.floor((avWidth/2)+theScrollX)-100;
if (posX<theScrollX) {posX=theScrollX}
var posY=Math.floor((avHeight/2)+theScrollY);
if (posY<theScrollY) {posY=theScrollY}
document.getElementById("waitdiv").style.left=posX;
document.getElementById("waitdiv").style.top=posY;
document.getElementById("waitdiv").style.visibility="visible";
}
}
