﻿function zoom(img,w,h,info){
var spacer,X,Y,popupw,popuph;

//X=screen.width/2-(w/2);
//Y=screen.height/2-(h/2)-20;

if (w==324) {diff=0;}
else {diff=w-324;}

if (location.href.indexOf("/english/") != -1) {
	text_close="Close window"
	text_print="Print"
	}
	else {
	text_close="Закрыть окно"
	text_print="Печать"
	}

X=455-diff;
Y=50;

sp1=350+diff;
sp2=304+diff;
sp3=350+diff;
sp4=280+diff;

// Abstand bei sehr viel Text
spacer=32;
// weniger als 160 Zeichen usw.
if ((info.length)<160) {
spacer=22;
}
if ((info.length)<110) {
spacer=12;
}
if ((info.length)<57) {
spacer=0;
}

popupw=w+52;
popuph=h+80+spacer;

// NS 4 ?
if (document.layers) {
popuph=popuph-30;
}

popzoom = open("","zoom1","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes,height=" + popuph + ",width=" + popupw +",left="+X+",top="+Y+'"');
ndoc = popzoom.document;
ndoc.open();
ndoc.write("<html>\n<head>\n<title>BMW Russia: "+info+"</title>\n");

ndoc.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/russian/css/generic.css\" /></head>\n<body bgcolor=\""+pp_bgcolor+"\" marginheight=\"0\" marginwidth=\"0\" topmargin=\"0\" leftmargin=\"0\" onload=\"self.focus();\">\n");

ndoc.write('<table width="');
ndoc.write(sp1);
ndoc.write('" cellspacing="0" cellpadding="0" border="0">');
ndoc.write("\n");
ndoc.write("<tr>");
ndoc.write("<td height=\"38\"><img src=\"/images/blank.gif\" width=\"26\" height=\"38\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td width=\"");
ndoc.write(sp2);
ndoc.write("\" align=\"right\"><a href=\"javascript:window.close()\" style=\"font-size:11px;\" class=\"color666666-003399\">"+text_close+"</a></td>");
ndoc.write("<td width=\"20\" align=\"right\"><a href=\"javascript:window.close()\"><img src=\"/images/close.gif\" width=\"15\" height=\"14\" border=\"0\" alt=\"\"></a></td>");
ndoc.write("</tr>\n");
ndoc.write("</table>\n");

ndoc.write("<table width=\"");
ndoc.write(sp3);
ndoc.write("\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n");
ndoc.write("<tr>");
ndoc.write("<td width=\"26\"><img src=\"/images/blank.gif\" width=\"26\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td>");
ndoc.write("<img src=\"");
ndoc.write(img);
ndoc.write('" width="');
ndoc.write(w);
ndoc.write('" height="');
ndoc.write(h);
ndoc.write('" alt="">');
ndoc.write("</td>");
ndoc.write("</tr>\n");
ndoc.write("</table>\n");

ndoc.write("<table width=\"");
ndoc.write(sp3);
ndoc.write("\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n");
ndoc.write("<tr>");
ndoc.write("<td><img src=\"/images/blank.gif\" width=\"26\" height=\"6\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td bgcolor=\"#e5e5e5\"><img src=\"/images/blank.gif\" width=\"6\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td bgcolor=\"#e5e5e5\"><img src=\"/images/blank.gif\" width=\"");
ndoc.write(sp4);
ndoc.write("\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td bgcolor=\"#e5e5e5\"><img src=\"/images/blank.gif\" width=\"6\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td><img src=\"/images/blank.gif\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td bgcolor=\"#e5e5e5\"><img src=\"/images/blank.gif\" width=\"31\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("</tr>");
ndoc.write("<tr>");
ndoc.write("<td><img src=\"/images/blank.gif\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td bgcolor=\"#e5e5e5\"><img src=\"/images/blank.gif\" width=\"6\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td bgcolor=\"#e5e5e5\" style=\"font-size:11px;\">");
ndoc.write(info);
ndoc.write("</td>");
ndoc.write("<td bgcolor=\"#e5e5e5\"><img src=\"/images/blank.gif\" width=\"6\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td><img src=\"/images/blank.gif\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td bgcolor=\"#e5e5e5\" align=\"center\"><a href=\"javascript:window.print();\"><img src=\"/images/print.gif\" width=\"19\" height=\"18\" border=\"0\" alt=\""+text_print+"\"></a></td>");
ndoc.write("</tr>");
ndoc.write("<tr>");
ndoc.write("<td><img src=\"/images/blank.gif\" width=\"1\" height=\"4\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td bgcolor=\"#e5e5e5\" colspan=\"3\"><img src=\"/images/blank.gif\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td><img src=\"/images/blank.gif\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("<td bgcolor=\"#e5e5e5\"><img src=\"/images/blank.gif\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" /></td>");
ndoc.write("</tr>");
ndoc.write("</table>\n");


ndoc.write("</body>\n</html>");
ndoc.close();
}