<!--
//окно 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=<center>Пожалуйста, заполните поля:</center><br>'+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='<li>';
var br='';
	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++)
{
	var item = eval('document.'+fname+'.'+temp_f[i]);
  re1 = new RegExp("^ +$","g");
	if (item.value=='' || re1.test(item.value))
 {
		al_post=al;
		al+=li+temp_a[i]+br;
		j++;
	}
}

if (al != '')
{
	FormAlert(al, fname, j);
	return false;
	exit;
}

form_name.submit();
return true;
};

function findPosX(id)
{
  var curleft = 0;
  obj=document.all[id];
  while (obj.offsetParent)
  {
   curleft += obj.offsetLeft
   obj = obj.offsetParent;
  }
 return curleft;
}

function findPosY(id)
{
 var curtop = 0;
 obj=document.all[id];
  while (obj.offsetParent)
  {
   curtop += obj.offsetTop
   obj = obj.offsetParent;
  }
 return curtop;
}

var openId=0;
var ready=0;
addr=new Array();

function openMenu(id){
//alert(addr[4]);
if(openId){
	a=eval("document.all.item"+openId+".innerHTML");
	eval("document.all.lay"+openId+".innerHTML='"+a+"'");
	openId=0;
	}
if(id!=openId){
	a=eval("document.all.lay"+id+".innerHTML");
//	a+=eval("document.all.subitem"+id+".innerHTML");
	a+=addr[id];
	eval("document.all.lay"+id+".innerHTML='"+a+"'");
	openId=id;
	}
}

function show_pic(num){
	if(!ready) return;
	eval("document.all.pic"+num+".style.left=findPosX('anch')+213");
	eval("document.all.pic"+num+".style.top=findPosY('anch')-282");
	eval("document.all.pic"+num+".style.visibility='visible'");
}

function hide_pic(num){
	if(!ready) return;
	eval("document.all.pic"+num+".style.visibility='hidden'");
}
//-->

