<!-- 
function CheckFormSpec()
{
if (user_agent) var ie=0;  else var ie=1;

var it=document.form0;
var al='';

if (it.word.value.length<2){
		al='Слово для поиска должно содержать не менее 2-х символов';
}

if (al != '')
{
 if (ie) {
width=250;
height=150;
	window.open('win_new.htm?text='+al, "form1",'width='+width+', height='+height+',resizable=0,scrollbars=0,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2));
	}
	else {
	alert(al);
	}
	return false;
	exit;
}

it.submit();
return true;
};


function FormSubmit(fname){
Winopen('win_new.htm');
	eval ("document."+fname+".submit()");
return true;
}

function FormAlertEmpty(al)
{
	var width, height;
	width=250;
	height=200;

	if (ie) {
	window.open('win_new.htm?text=<center>'+al+'</center>', 'alert','width='+width+', height='+height+',resizable=0,scrollbars=0,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2));
	}
	else {alert(al);}
}

function CheckSpecForm()
{
var temp=document.search.word;
var re=new RegExp("[^ ][^ ]","g")
	if (!re.test(temp.value))
	{
 	FormAlertEmpty('Ключевое слово должно содержать не менее 2-х символов');
  return false; exit;
  }

document.search.submit();
return true;
}

var loc;
var ie = 0;
ie=(navigator.appName == 'Microsoft Internet Explorer') ?1:0

function Winopen(url)
	{
	var	width=250;
	var	height=150;
	new_win = window.open(url, "new_win", 'width = '+width+' , height = '+height+',resizable=0,scrollbars=0,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2));
	}

  function Winopen2(url)
	{
	var	width=250;
	var	height=250;
	new_win = window.open(url, "new_win", 'width = '+width+' , height = '+height+',resizable=0,scrollbars=0,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2));
	}

//изображения в новом окне	
function newWindow(url,id,width,height)
{
if (loc!=id)
{
	zoom=window.open(url, id, 'width = '+width+' , height = '+height+',resizable=0,scrollbars=0,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2))
	loc=id;
} else {
	if(document.all) zoom.close();
		else if(zoom.document) zoom.close();
	zoom=window.open(url, id, 'width = '+width+' , height = '+height+',resizable=0,scrollbars=0,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2))
	}
}

function newWindowBar(url,id,width,height)
{
if (loc!=id)
{
	zoom=window.open(url, id, 'width = '+width+' , height = '+height+',resizable=0,scrollbars=0,menubar=1,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2))
	loc=id;
} else {
	if(document.all) zoom.close();
		else if(zoom.document) zoom.close();
	zoom=window.open(url, id, 'width = '+width+' , height = '+height+',resizable=0,scrollbars=0,menubar=1,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2))
	}
}

//окно alert
function FormAlert(al,name,j)
{
var width, height;
if (j<7)
{width=250; height=250;}
else
{width=250; height=350;}

	window.open('win_new.htm?text=<div align="left"><center>Пожалуйста, заполните поля:</center><br><ul>'+al+'</ul></div>', name,'width='+width+', height='+height+',resizable=0,scrollbars=0,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2));
}

//окно alert
function FormAlert2(al,name,j)
{
var width, height;
if (j<7)
{width=250; height=250;}
else
{width=250; height=350;}
	window.open('win_new.htm?text='+al, name,'width='+width+', height='+height+',resizable=0,scrollbars=0,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2));
}


//проверка форм
function CheckFields(fname,form_num)
{
var form_name=eval('document.'+fname);
var li=(ie) ?'<li>':''
var br=(ie) ?'':'\n'
	var al='';
	var j='';
	var al_post='';
temp_f=eval('f'+form_num+'_Fld');	
temp_a=eval('f'+form_num+'_Alrt');	

for (i=0; i<temp_f.length; i++)
{
//для select
if (temp_f[i]=='type' && (fname=='subscr' || fname=='form_send_main'))
{
	var it = eval('document.'+fname+'.'+temp_f[i]);
	var item=it.options[it.selectedIndex];
}
else
{
	var item = eval('document.'+fname+'.'+temp_f[i]);
}

  re1 = new RegExp("^ +$","g");
	if (item.value=='' || re1.test(item.value) || item.value==-1)
 {
		al_post=al;
		al+=li+temp_a[i]+br;
		j++;
	}
}

if (fname=='s_form') {
  if (document.s_form.producer_search.value!=0)
  al=0;
  }

if (al != '')
{
 if (ie) {
	FormAlert('<div align=left>'+al+'</div>', fname, j);
	}
	else {
	alert('Заполните следующие поля:\n\n' + al);
	}
	return false;
	exit;
}

form_name.submit();
return true;
};

//-->
