function preloadImg(file) {
 img = new Image();
img.src = file;
}

function NewWindow(w,v,s,d)
{
eval("window.open('"+v+"','"+w+"','height="+d+",width="+s+",scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,directories=no,menubar=no');");
}

//изменение состояния блока div с видимого на невидимый
function findObj(id)
{
	if(document.all)
		return document.all[id];
	else
		return document.getElementById(id);
}

function openclose(sd)
{
	e = findObj(sd);

	if(!e) return;
	if (e.style.display == "block")
	{
		e.style.display = "none";
	}
	else {
		e.style.display = "block";
	}
}

function div_open(sd)
{
	e = findObj(sd);
	if(!e) return;
	e.style.display = "block";
    return true;
}

function div_close(sd)
{
	e = findObj(sd);
	if(!e) return;
	e.style.display = "none";
    return true;
}

function include_select (start_id, dictionaries)
 	{
			//var txt = document.getElementById(start_id+'_id').value;
			NewWindow(start_id,'/select/select.php?stid='+start_id+'&dictionaries='+dictionaries,450,600);		
	}
	
 // Издатели
 function select_publ (start_id)
 	{
			//var txt = document.getElementById(start_id+'_id').value;
			NewWindow('publ','/select/publ_select.php?stid='+start_id,450,600);
	}

 // Изготовители
 function select_manufact (start_id)
 	{
			//var txt = document.getElementById(start_id+'_id').value;
			NewWindow('manufact','/select/manufact_select.php?stid='+start_id,450,600);
	}
	
 // учебные предметы по Госстандарту
 function select_subj_standart (start_id)
 	{
			//var txt = document.getElementById(start_id+'_id').value;
			NewWindow('subj_standart','/select/subj_standart_select.php?stid='+start_id,450,600)	
	}
 // нажатие на кнопку "Вход"
 function login_go (id)
 	{
		var frm =  document.getElementById(id);
		frm.submit();
	}