	 var win
function showimage (w, h, path, title) {
		if (win) {
     win.close()
   }
	win=window.open('','','toolbar=no,scrollbar=no, width='+w+',height='+h+', top=100, left=100');
	win.document.open();
	win.document.write('<html><meta http-equiv="Content-Type" content="text/html; 	charset=windows-1251">\n<title>'+title+'</title>\n<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bottommargin="0" rightmargin="0">\n<img src="'+path+'" border="0" alt="'+title+'">\n</html>');

}

function newWindowAnketa() {
 var newWindow;
 var newContent;
    	newWindow = window.open("","","height=600,width=600,scrollbars,resizable");
		newContent='<html><head><title>html</title>';
        newContent+='<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">';
        newContent+='<link rel="stylesheet" href="../style.css" type="text/css"></head><body>';
        
       
        newContent+='<table style="border: 1px solid black;" cellspacing="0" cellpadding="0" width="100%" height="250px">'
newContent+='<tr>';
newContent+='<td rowspan="6" valign="top" width="200px" class="text" style="border-right: 2px solid black;">'

newContent+='<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td valign="top" class="text">ИЗВЕЩЕНИЕ</td></tr><tr><td valign="bottom" class="text"><img src="/img/0.gif" width="1" height="220" border="0" alt="">Кассир<p></td></tr></table></td>'
newContent+='<td align="center" class="text" style="border-bottom: 1px solid black;">ООО &quot;Техносистемс&quot;<br />в Донском ОСБ № 7813/1586 Сбербанка России ОАО г. Москвы <br /> ИНН/КПП 7733154364/771701001, р/с № 40702810238110104380 <br />кор.сч. 30101810400000000225, БИК 044525225</td></tr><tr><td align="left" class="text" style="border-bottom: 1px solid black;">Ф.И.О.плательщика: ';

newContent+='<b>';
newContent+=document.an._ads2.value;
newContent+='</b>';
newContent+='</td></tr>';
newContent+='<tr><td align="left" class="text" style="border-bottom: 1px solid black;">Адрес плательщика: ';
newContent+='<b>';
newContent+=document.an._ads3.value;
newContent+='</b>';
newContent+='</td></tr><tr><td style="border-bottom: 1px solid black;" align="left" class="text">Назначение платежа:';
newContent+=' Оплата за стоматологическую продукцию по счету № ';
newContent+=document.an._dt3.value;
newContent+=' от ';
newContent+=document.an._dt5.value;
newContent+='</td></tr><tr><td style="border-bottom: 1px solid black;" align="left" class="text">&nbsp;';
newContent+='</td></tr><tr><td class="text"><br>Сумма: ';
newContent+='<b>';
newContent+=document.an._sm2.value;
newContent+='</b>';
newContent+=' р.';
newContent+='<p>Подпись:_________________________ &nbsp;&nbsp;Дата: ';
newContent+=document.an._dt4.value;
newContent+=' г.';
newContent+='</td></tr></table><table style="border: 1px solid black;" cellspacing="0" cellpadding="0" width="100%" height="250px"><tr><td rowspan="6" valign="top" width="200px" class="text" style="border-right: 2px solid black;"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td valign="top" class="text">ИЗВЕЩЕНИЕ</td></tr><tr><td valign="bottom" class="text"><img src="/img/0.gif" width="1" height="220" border="0" alt="">Квитанция<br>Кассир<p></td></tr></table></td><td align="center" class="text" style="border-bottom: 1px solid black;">ООО &quot;Техносистемс&quot;<br />в Донском ОСБ № 7813/1586 Сбербанка России ОАО г. Москвы <br /> ИНН/КПП 7733154364/771701001, р/с № 40702810238110104380 <br />кор.сч. 30101810400000000225, БИК 044525225</td></tr><tr><td align="left" class="text" style="border-bottom: 1px solid black;">Ф.И.О.плательщика: ';
newContent+='<b>';
newContent+=document.an._ads2.value;
newContent+='</b>';
newContent+='</td></tr>';
newContent+='<tr><td align="left" class="text" style="border-bottom: 1px solid black;">Адрес плательщика: ';
newContent+='<b>';
newContent+=document.an._ads3.value;
newContent+='</b>';
newContent+='</td></tr><tr><td style="border-bottom: 1px solid black;" align="left" class="text">Назначение платежа:';
newContent+=' Оплата за стоматологическую продукцию по счету № ';
newContent+=document.an._dt3.value;
newContent+=' от ';
newContent+=document.an._dt5.value;
newContent+='</td></tr><tr><td style="border-bottom: 1px solid black;" align="left" class="text">&nbsp;';
newContent+='</td></tr><tr><td class="text"><br>Сумма: ';
newContent+='<b>';
newContent+=document.an._sm2.value;
newContent+='</b>';
newContent+=' р.';
newContent+='<p>Подпись:_________________________ &nbsp;&nbsp;Дата: ';
newContent+=document.an._dt4.value;
newContent+=' г.';
newContent+='</td></tr></table>';
        
        
		newContent+="</body></html>";
		newWindow.document.write(newContent);
		newWindow.print();
		newWindow.document.close();
		
   }

function isValidEmail(email) {
	var pattern = /^[\w\.\-]+\@[\w\.\-]+\.[0-9a-z]{2,}$/;
	return (pattern.test(email) ? true : false);
}


function checkDialerForm() {
	var tf = true;
	var str = "";

	if(document.getElementById("_org").value == "") {
		str += "организация";
		tf = false;
	}
	if(document.getElementById("_town").value == "") {
		str += "\nгород";
		tf = false;
	}
	if(document.getElementById("_fio").value == "") {
		str += "\nфио";
		tf = false;
	}
	if(document.getElementById("_obl").value == "") {
		str += "\nобласть";
		tf = false;
	}
	if(document.getElementById("_phone").value == "") {
		str += "\nтелефон";
		tf = false;
	}
	if(document.getElementById("_fax").value == "") {
		str += "\nфакс";
		tf = false;
	}
	if(!isValidEmail(document.getElementById("_mail").value)) {
		str += "\nполе e-mail заполнено не верно";
		tf = false;
	}
	if (!tf)
		alert("не заполнены следующие обязательные поля :\n"+str)
	return tf;
}