function getBrowserInfo() {
 var t,v = undefined;
 if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (window.sidebar) t = 'Netscape';
 return {type:t,version:v};
}

function bookmark(a){
// var id_connection=document.getElementById('code_connection_user').value;
 var url = window.document.location;
 var title = window.document.title;
 var b = getBrowserInfo();
 if (b.type == 'IE') window.external.AddFavorite(url,title);
 else if (b.type == 'Opera') {
  a.href = url;
  a.rel = "sidebar";
  a.title = title;
  return true;
 }
 else if (b.type == "Netscape") window.sidebar.addPanel(title,url,"");
 else alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
// SM1(id_connection,'addfav');
 return false;
}

function ShowDiv(div)
{
if(document.getElementById(div)!=null)
document.getElementById(div).style.display='block';
}
function HideDiv(div)
{
if(document.getElementById(div)!=null)
document.getElementById(div).style.display='none';
}
function Visible(div)
{
if(document.getElementById(div)!=null)
document.getElementById(div).style.visibility='visible';
}
function UnVisible(div)
{
if(document.getElementById(div)!=null)
document.getElementById(div).style.visibility='hidden';
}
function ShowHideDiv(div)
{
if(document.getElementById(div)!=null)
if(document.getElementById(div).style.display!='block')
document.getElementById(div).style.display='block';
else
document.getElementById(div).style.display='none';
}

function Showmenu(id)
{
//	ShowDiv("mark"+id);
	if(document.getElementById("menu"+id)!=null)
	{
		document.getElementById("menu"+id).className="hover";
	}
}

function Hidemenu(id)
{
	//HideDiv("mark"+id);
	if(document.getElementById("menu"+id)!=null)
	{
		document.getElementById("menu"+id).className="";
	}
}
function ShowZavod(id)
{
	ShowDiv("linkzavod"+id);
	if(document.getElementById("zavod"+id)!=null)
	{
		document.getElementById("zavod"+id).className="hover";
	}
}

function HideZavod(id)
{
	HideDiv("linkzavod"+id);
	if(document.getElementById("zavod"+id)!=null)
	{
		document.getElementById("zavod"+id).className="";
	}
}

/*
function SetPhoto(id)
{
	document.getElementById("slideshow").value=0;
	document.getElementById('dopphoto').innerHTML="<img id=disp_photo src='/admin/images/big/"+document.getElementById("img_photo"+id).value+"' width=341px style='opacity:0.01;filter:alpha(opacity=1);' onload=HideAnimate('disp_photo')>";
	//document.getElementById('big_photo').style.backgroundImage="url(/img/loading.gif)";
}

function ShowAnimate(div)
{
	var name=document.getElementById('disp_photo').src;
	document.getElementById('dopphoto').innerHTML="";
	document.getElementById('big_photo').innerHTML="<img id=disp_photo src='"+name+"' width=341px style='opacity:0.01;filter:alpha(opacity=1);'>";
	//document.getElementById('big_photo').style.backgroundImage="none";
	$('#'+div).animate(
	{
		opacity: 1
	},
	500
	);	
}

function HideAnimate(div)
{
	document.getElementById('big_photo').style.backgroundImage="none";
	$('#'+div).animate(
	{
		opacity: 0.01
	},
	500
	);	
	setTimeout("ShowAnimate('disp_photo')",500);
}
function SetPhotoSlide()
{
	var id;
	document.getElementById('big_photo').style.backgroundImage="none";
	if(document.getElementById("slideshow").value==1)
	{
		id=document.getElementById("photonow").value;
		if(id>=document.getElementById("photomax").value) id=1;
		else id++;
		document.getElementById('dopphoto').innerHTML="<img id=disp_photo src='/admin/images/big/"+document.getElementById("img_photo"+id).value+"' width=341px style='opacity:0.01;filter:alpha(opacity=1);' onload=HideAnimateSlide('disp_photo')>";
		//document.getElementById('big_photo').style.backgroundImage="url(/img/loading.gif)";
		document.getElementById("photonow").value=id;
	}

}

function ShowAnimateSlide(div)
{
	var name=document.getElementById('disp_photo').src;
	document.getElementById('dopphoto').innerHTML="";
	document.getElementById('big_photo').innerHTML="<img id=disp_photo src='"+name+"' width=341px style='opacity:0.01;filter:alpha(opacity=1);'>";
	$('#'+div).animate(
	{
		opacity: 1
	},
	500
	);	
	setTimeout("SetPhotoSlide()",5000);
}
function HideAnimateSlide(div)
{
	//document.getElementById('big_photo').style.backgroundImage="none";
	$('#disp_photo').animate(
	{
		opacity: 0.01
	},
	500
	);	
	setTimeout("ShowAnimateSlide('disp_photo')",500);
}*/
