window.onerror = null;
var Win;

function openWin( page, classNum, mNr, mISO, mD, mL)
{
    var Diam = '&Oslash;';
	var width;
	var height;
	var mUddef = ' - ';
    var WidthFirstColumn = 90;
	var imgStr = '<div align=center><img src="img/fr/';
	var imgStr2 = 'b.jpg" width=120 height=350 hspace=10 vspace=10></div>';
	var CaptTip = 'Тип нарезки';
	
    var fname=location.pathname;
	
	if (fname.indexOf('eng.html')>0) {
		CaptTip = 'Type of toothing';
	}
	
	if(!width) width=230;
	if(!height) height=470;
	if(!classNum) classNum = '1';
	if(!mNr)  mNr = mUddef;
	if(!mISO) mISO= mUddef;
	if(!mD)   mD  = mUddef;
	if(!mL)   mL  = mUddef;

    Swidth = screen.width
	Stop = 20;
//    Sheight = screen.height
	Swidth = Swidth - width - 30;
	Win=this.open('', 'Wins',	'toolbar=no,scrollbars=no,resize=no,status=no,top='+Stop+',left='+Swidth+',height='+height+',width='+width);
	
    Win.document.clear();
    Win.document.close();	
//	alert(Win);
	Win.document.writeln('<HTML>');
	Win.document.writeln('<HEAD>');
	Win.document.writeln('</HEAD>');
	Win.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">');
	Win.document.writeln('	<link rel="STYLESHEET" type="text/css" href="img/style.css">');
	Win.document.writeln('<BODY bgcolor=#ffffff leftmargin=0 bottommargin=0 topmargin=0 marginwidth=0 marginheight=0">');	

	Win.document.writeln( imgStr + page + imgStr2);
	
	Win.document.writeln('<center>');	
	
	var Kwidth = width - 20;
	Win.document.write('<table width='+Kwidth+' border=0 cellpadding=0 cellspacing=0>');
	
	Kwidth = Kwidth - WidthFirstColumn;

	Win.document.write('<tr>');	
	Win.document.write('<td width='+WidthFirstColumn+'><img src="img/1.gif" width='+WidthFirstColumn+' height=1></td>');
	Win.document.write('<td width='+Kwidth+'><img src="img/1.gif" width='+Kwidth+' height=1></td>');
	Win.document.write('</tr>');
	
	
	Win.document.write('<tr>');
	
	if (page=='pika') {
	   page='Пика';
	   if (CaptTip != 'Тип нарезки') {
	   	  page='Lance';	   
	   }
	}
	else	
	if (page=='1_6') {
	   page=Diam+' 1.6';
	}
	else	
	if (page=='2_3') {
	   page=Diam+' 2.3';
	}
	if (page=='4_0') {
	   page=Diam+' 4.0';
	}
	else	
	if (page=='5_0') {
	   page=Diam+' 5.0';
	}
	else	
	if (page=='6_0') {
	   page=Diam+' 6.0';
	}
	
	Win.document.write('<td class=hd'+classNum+'>'+page+'</td>');
	Win.document.write('<td>&nbsp;</td>');
	Win.document.write('</tr>');
	
	Win.document.write('<tr><td colspan=2 bgcolor="#000000"><img src="img/1.gif" width="'+Kwidth+'" height="1" border="0"></td></tr>');

	Win.document.write('<tr>');
	Win.document.write('<td class=jsHead>'+CaptTip+'</td>');
	Win.document.write('<td class=jsData><b>'+mNr+'</b></td>');
	Win.document.write('</tr>');

	Win.document.write('<tr><td colspan=2 bgcolor="#000000"><img src="img/1.gif" width="'+Kwidth+'" height="1" border="0"></td></tr>');

	Win.document.write('<tr>');
	Win.document.write('<td class=jsHead>ISO No.</td>');
	Win.document.write('<td class=jsData>'+mISO+'</td>');
	Win.document.write('</tr>');

	Win.document.write('<tr><td colspan=2 bgcolor="#000000"><img src="img/1.gif" width="'+Kwidth+'" height="1" border="0"></td></tr>');

    Win.document.write('<tr>');
	Win.document.write('<td class=jsHead>'+Diam+' 1/10 mm</td>');
	Win.document.write('<td class=jsData><b>'+mD+'</b></td>');
	Win.document.write('</tr>');

	Win.document.write('<tr><td colspan=2 bgcolor="#000000"><img src="img/1.gif" width="'+Kwidth+'" height="1" border="0"></td></tr>');

    Win.document.write('<tr>');
	Win.document.write('<td class=jsHead>L mm</td>');
	Win.document.write('<td class=jsData><b>'+mL+'</b></td>');
	Win.document.write('</tr>');

	Win.document.write('<tr><td colspan=2 bgcolor="#000000"><img src="img/1.gif" width="'+Kwidth+'" height="1" border="0"></td></tr>');
	
	Win.document.write('</table>');
	
	Win.document.writeln('</center>');	
	Win.document.writeln('</BODY>');	
	Win.document.writeln('</HTML>');	
	Win.focus();
}
