function popup(pic,wi,hi,tit) {
wi=wi+20;
hi=hi+30;
oppo = window.open("", "oppo", "width="+wi+",height="+hi+",left=100,top=10,resizable=no");
oppo.document.write('<html><head><title>'+tit+'</title><script language="JavaScript" src="/pk.js"></script></head><body bgcolor=white onLoad="posIt()"><script language=JavaScript>\n<!--\nvar message="ups...";function clickIE() {if (document.all) {(message);return false;}}function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) {if (e.which==2||e.which==3) {(message);return false;}}}if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}document.oncontextmenu=new Function("return false")\n// -->\n<'+'/script><a href="#" onclick="window.close();" title="click for close"><img src='+pic+' border=0></a></body></html>');
oppo.focus();
}
function posIt() {
	if (self.innerWidth) {
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}else if (document.documentElement && document.documentElement.clientWidth) {
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}else if (document.body) {
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}else return;
	if (self.screen.width < frameWidth *2 || self.screen.height < frameHeight *2) {
		newWidth = self.screen.width/2;
		newHeight = self.screen.height/2;
		if (document.layers) {
			tmp1 = parent.outerWidth - parent.innerWidth;
			tmp2 = parent.outerHeight - parent.innerHeight;
			newWidth -= tmp1;
			newHeight -= tmp2;
		}
		parent.window.resizeTo(640,newHeight);
		parent.window.moveTo((self.screen.width-640)/2,self.screen.height/6);
	}
}

function check(obj){
var k=0
if (obj.name.value.length<3 && (k==0))
{ alert('Пожалуйста, заполните поле "Ваше имя и фамилия:"'); 
  k++; }
if (obj.email.value.length<4 && (k==0))
{ alert('Пожалуйста, заполните поле "Ваш e-mail адрес:"'); 
  k++; }

if (obj.text.value.length<5 && (k==0))
{ alert('Пожалуйста, заполните поле "Текст сообщения:"'); 
  k++; }

  if (k==0) {
		    obj.submit(); 
		}	
}
