function popup(name)
{ alert(name);
	document.getElementById(name).style.display='block';
	document.getElementById(name).style.pixelTop=document.body.scrollTop + document.body.clientHeight;
}

function views(url,name)
{
	foto=window.open('/images/view.php?foto='+url+'&name='+name,'foto','width=300,height=300');
	foto.focus();
}
function view(url,name)
{
	foto=window.open('/images/view.php?foto='+url+'&name='+name,'foto','width=300,height=300');
	foto.focus();
}
function view_hist(url,name)
{
	foto=window.open('/images/view2.php?foto='+url+'&name='+name,'foto','width=800,height=600, scrollbars=yes');
	foto.focus();
}
function sub(){
  if (confirm("Вы уверены?")) { document.F.submit; return true; } else { return false;  }
}

function del(ref){
  if (confirm("Вы действительно хотите удалить?")) 
  { 
    document.F.submit; 
    return true; 
  } 
  else
   { return false;  }
}



function off(mode)
{   if (mode!=1)
    {document.getElementById('inv1').style.display='none';}
	if (mode!=2)
    {document.getElementById('inv2').style.display='none';}
	if (mode!=3)
    {document.getElementById('inv3').style.display='none';}
	if (mode!=4)
    {document.getElementById('inv4').style.display='none';}
	if (mode!=5)
    {document.getElementById('inv5').style.display='none';}
	if (mode!=6)
    {document.getElementById('inv6').style.display='none';}
}


function on(id)
{   if (id!=1)
    {document.getElementById('inv1').style.display='none';}
	if (id!=2)
    {document.getElementById('inv2').style.display='none';}
	if (id!=3)
    {document.getElementById('inv3').style.display='none';}
	if (id!=4)
    {document.getElementById('inv4').style.display='none';}
	if (id!=5)
    {document.getElementById('inv5').style.display='none';}
	if (id!=6)
    {document.getElementById('inv6').style.display='none';}
	document.getElementById(id).style.display='block';
}

function windowOpener(windowHeight, windowWidth, windowName, windowUri)
{
var centerWidth=(window.screen.width-windowWidth)/2;
var centerHeight=(window.screen.height-windowHeight)/2;

newWindow=window.open(windowUri, windowName,'fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,width='+windowWidth+',height='+windowHeight);
newWindow.blur();
newWindow.moveTo(centerWidth, centerHeight);
newWindow.focus();
return newWindow.name;
}

function openwin(string,w,h)
 {
  param='width='+w+',height='+h;
  foto=window.open(string,'foto',param);
   }
   
//if (document.body.clientWidth < 800) { 
//ЗАКОММЕНТИЛ КАСИМОВ А.Н. 
//document.write('2');
//КОНЕЦ КОММЕНТА
//}
//else if (document.body.clientWidth /*window.screen.width*/ > 1200) {
//ЗАКОММЕНТИЛ КАСИМОВ А.Н. 
//document.write('222222');
//КОНЕЦ КОММЕНТА
//}
   

function getClientWidth()
{
 return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
 return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}

function getbrows()
{
	if (navigator.appName == 'Microsoft Internet Explorer'){
	//ЗАКОММЕНТИЛ КАСИМОВ А.Н. 
	//document.getElementById('flajok').style.marginTop = '-327px';
	//КОНЕЦ КОММЕНТА
	}
}
   
 //мигающий текст
   
  // function flashit()
//{
//if (!document.all)return;
//if (myexample.style.color=="#ff0000")myexample.style.color="#002ba5";
//else myexample.style.color="#ff0000"}setInterval("flashit()", 500)

 //ещё функция для мигающего текста
 
massive_length=2;/*устанавливаешь длинну массива, т.е. сколько цветов будет*/
colors_= new Array(massive_length);
colors_[0] = "#ffffff";
colors_[1] = "#ff0000";
var next_ = 0;
function Changehead()
{
headcolor= colors_[next_];/*headcolor - переменной устанавливаешь новый цвет*/

document.getElementById("head1").style.color=headcolor;/*присваеваешь этот цвет элементу в документе*/
next_++;
if(next_>massive_length-1) next_=0;
window.setTimeout("Changehead()",800); /*спустя 1 секунду, меняешь цвет на новый, если нужно дольше, то ставишь число больше*/
}