function validation() {

if (document.mainform.name.value.length<1) {
		alert("Введите, пожалуйста, фамилию"); 
		return false;
		}
		
	if (document.mainform.in1.value.length<1) {
		alert("Введите, пожалуйста, инициалы"); 
		return false;
		}
		
	if (document.mainform.in2.value.length<1) {
		alert("Введите, пожалуйста, инициалы"); 
		return false;
		}
	if (document.mainform.index.value.length!=6) {
		alert("Введите, пожалуйста, индекс (шесть цифр)"); 
		return false;
		}
	if (document.mainform.city.value.length<3) {
		alert("Введите, пожалуйста, город"); 
		return false;
		}
	if (document.mainform.target.value.length<3) {
		alert("Введите, пожалуйста, адрес"); 
		return false;
		}
		
		display()
		}	
		
function display() {
var name=document.mainform.name.value;
var index=document.mainform.index.value;
var count=document.mainform.count.value;
var city=document.mainform.city.value;
var target=document.mainform.target.value;
var in1=document.mainform.in1.value+".";
var in2=document.mainform.in2.value+".";

if (document.mainform.C1.checked==true) { var n1='X';} else { var n1=' ';}
if (document.mainform.C2.checked==true) { var n2='X';} else { var n2=' ';}
if (document.mainform.C3.checked==true) { var n3='X';} else { var n3=' ';}
if (document.mainform.C4.checked==true) { var n4='X';} else { var n4=' ';}
if (document.mainform.C5.checked==true) { var n5='X';} else { var n5=' ';}
if (document.mainform.C6.checked==true) { var n6='X';} else { var n6=' ';}
if (document.mainform.C7.checked==true) { var n7='X';} else { var n7=' ';}
if (document.mainform.C8.checked==true) { var n8='X';} else { var n8=' ';}
if (document.mainform.C9.checked==true) { var n9='X';} else { var n9=' ';}
if (document.mainform.C10.checked==true) { var n10='X';}  else { var n10=' ';}
if (document.mainform.C11.checked==true) { var n11='X';} else { var n11=' ';}
if (document.mainform.C12.checked==true) { var n12='X';} else { var n12=' ';}

kupon=window.open('', 'kupon', 'toolbar=no, status=no, width=465, height=500');

kupon.document.write("<head><title>Купон подписки</title><style>")
kupon.document.write(".indexup {position: absolute; left: 232px; top: 143px; font size: 12px}")
kupon.document.write(".indexdown {position: absolute; left: 62px; top: 387px; font size: 12px}")
kupon.document.write(".adressup {position: absolute; left: 293px; top: 139px; font size: 8px}")
kupon.document.write(".adressdown {position: absolute; left: 180px; top: 390px; font size: 9px}")
kupon.document.write(".whomup {position: absolute; left: 230px; top: 180px; font size: 10px}")
kupon.document.write(".whomdown {position: absolute; left: 60px; top: 422px; font size: 10px}")
kupon.document.write(".countup {position: absolute; left: 418px; top: 50px; font size: 12px}")
kupon.document.write(".countdown {position: absolute; left: 418px; top: 305px; font size: 12px}")
kupon.document.write(".alert {position: absolute;  top: 450px; font size: 12px; width: 450}")
kupon.document.write(".n1 {position: absolute;  left: 180px; top: 105px; font size: 12px; }")
kupon.document.write(".n2 {position: absolute;  left: 202px; top: 105px; font size: 12px; }")
kupon.document.write(".n3 {position: absolute;  left: 225px; top: 105px; font size: 12px; }")
kupon.document.write(".n4 {position: absolute;  left: 245px; top: 105px; font size: 12px; }")
kupon.document.write(".n5 {position: absolute;  left: 268px; top: 105px; font size: 12px; }")
kupon.document.write(".n6 {position: absolute;  left: 290px; top: 105px; font size: 12px; }")
kupon.document.write(".n7 {position: absolute;  left: 312px; top: 105px; font size: 12px; }")
kupon.document.write(".n8 {position: absolute;  left: 333px; top: 105px; font size: 12px; }")
kupon.document.write(".n9 {position: absolute;  left: 355px; top: 105px; font size: 12px; }")
kupon.document.write(".n10 {position: absolute;  left: 377px; top: 105px; font size: 12px; }")
kupon.document.write(".n11 {position: absolute;  left: 400px; top: 105px; font size: 12px; }")
kupon.document.write(".n12 {position: absolute;  left: 420px; top: 105px; font size: 12px; }")
kupon.document.write(".n1d {position: absolute;  left: 180px; top: 370px; font size: 12px; }")
kupon.document.write(".n2d {position: absolute;  left: 202px; top: 370px; font size: 12px; }")
kupon.document.write(".n3d {position: absolute;  left: 225px; top: 370px; font size: 12px; }")
kupon.document.write(".n4d {position: absolute;  left: 245px; top: 370px; font size: 12px; }")
kupon.document.write(".n5d {position: absolute;  left: 268px; top: 370px; font size: 12px; }")
kupon.document.write(".n6d {position: absolute;  left: 290px; top: 370px; font size: 12px; }")
kupon.document.write(".n7d {position: absolute;  left: 312px; top: 370px; font size: 12px; }")
kupon.document.write(".n8d {position: absolute;  left: 333px; top: 370px; font size: 12px; }")
kupon.document.write(".n9d {position: absolute;  left: 355px; top: 370px; font size: 12px; }")
kupon.document.write(".n10d {position: absolute;  left: 377px; top: 370px; font size: 12px; }")
kupon.document.write(".n11d {position: absolute;  left: 400px; top: 370px; font size: 12px; }")
kupon.document.write(".n12d {position: absolute;  left: 420px; top: 370px; font size: 12px; }")
kupon.document.write("</style>")
kupon.document.write("</head>")
kupon.document.write("<body background='../images/design/coupon4.gif'><p class='indexup'>" + index+"</p>");
kupon.document.write("<p class='indexdown'>" + index + "</p>");
kupon.document.write("<p class='adressup'>" + city +  '&nbsp;' + ',' + '&nbsp;' + target+"</p>");
kupon.document.write("<p class='adressdown'>" + city + '&nbsp;' +  ',' + '&nbsp;'  + target +"</p>");
kupon.document.write("<p class='whomup'>" + name + '&nbsp;' + in1 + '&nbsp;' + in2 + "</p>");
kupon.document.write("<p class='whomdown'>" + name + '&nbsp;' + in1 + '&nbsp;' + in2 + "</p>");
kupon.document.write("<p class='countup'>" + count + "</p>");
kupon.document.write("<p class='countdown'>" + count+"</p>");
kupon.document.write("<p class='alert'><b>Внимание!</b> Перед печатью абонемента необходимо включить печать цвета и рисунков фона. Для этого выберите: Сервис -&gt; Свойства обозревателя -&gt; Дополнительно - &gt; Печать и отметьте пункт &quot;Печать цвета и рисунков фона&quot;</p>");
kupon.document.write("<!--begin of Top100-->");
kupon.document.write("<a href='http://top100.rambler.ru/top100/'><img src='http://counter.rambler.ru/top100.cnt?378785' alt='Rambler's Top100' width=1 height=1 border=0></a>");
kupon.document.write("<!--end of Top100 code-->");
kupon.document.write("<p class='n1'>" + n1+"</p>");
kupon.document.write("<p class='n2'>" + n2+"</p>");
kupon.document.write("<p class='n3'>" + n3+"</p>");
kupon.document.write("<p class='n4'>" + n4+"</p>");
kupon.document.write("<p class='n5'>" + n5+"</p>");
kupon.document.write("<p class='n6'>" + n6+"</p>");
kupon.document.write("<p class='n7'>" + n7+"</p>");
kupon.document.write("<p class='n8'>" + n8+"</p>");
kupon.document.write("<p class='n9'>" + n9+"</p>");
kupon.document.write("<p class='n10'>" + n10+"</p>");
kupon.document.write("<p class='n11'>" + n11+"</p>");
kupon.document.write("<p class='n12'>" + n12+"</p>");
kupon.document.write("<p class='n1d'>" + n1+"</p>");
kupon.document.write("<p class='n2d'>" + n2+"</p>");
kupon.document.write("<p class='n3d'>" + n3+"</p>");
kupon.document.write("<p class='n4d'>" + n4+"</p>");
kupon.document.write("<p class='n5d'>" + n5+"</p>");
kupon.document.write("<p class='n6d'>" + n6+"</p>");
kupon.document.write("<p class='n7d'>" + n7+"</p>");
kupon.document.write("<p class='n8d'>" + n8+"</p>");
kupon.document.write("<p class='n9d'>" + n9+"</p>");
kupon.document.write("<p class='n10d'>" + n10+"</p>");
kupon.document.write("<p class='n11d'>" + n11+"</p>");
kupon.document.write("<p class='n12d'>" + n12+"</p>");
kupon.document.write("<p>&nbsp;</p></body></html>");

	}

