//проверка броузера

DOM = (document.getElementById) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
Konqueror = (navigator.userAgent.indexOf("Konqueror") > -1) ? 1 : 0;
Konqueror22 = (navigator.userAgent.indexOf("Konqueror 2.2") > -1 || navigator.userAgent.indexOf("Konqueror/2.2") > -1) ? 1 : 0;
Opera = (navigator.userAgent.indexOf("Opera") > -1) ? 1 : 0;
Opera5 = (navigator.userAgent.indexOf("Opera 5") > -1 || navigator.userAgent.indexOf("Opera/5") > -1) ? 1 : 0;
Opera6 = (navigator.userAgent.indexOf("Opera 6") > -1 || navigator.userAgent.indexOf("Opera/6") > -1) ? 1 : 0;
Opera56 = Opera5 || Opera6;
IE = (navigator.userAgent.indexOf("MSIE") > -1) ? 1 : 0;
IE = IE && !Opera;
IE5 = IE && DOM;
IE4 = (document.all) ? 1 : 0;
IE4 = IE4 && IE && !DOM;

//функция смены изображений-------------------------------------
function swapImg(id,img)
{
	if( document.getElementById)
	{
		obj	= document.getElementById(id);
		obj.setAttribute( 'src', img );
	}
}
//Изменение вида элемента левого меню при наведении курсора ---------
function LeftMenuOver(cellId, linkId){
	cell = document.getElementById(cellId);
	cell.style.background = '#6699CC';
	hyperlink = document.getElementById(linkId);
	hyperlink.style.color = 'ffffff';
}
//Изменение вида элемента левого меню при снятии курсора ---------
function LeftMenuOut(cellId, linkId){
	cell = document.getElementById(cellId);
	cell.style.background = '';
	hyperlink = document.getElementById(linkId);
	hyperlink.style.color = '';
}

//Показать меню-------------------------------------------------
function show(menuID,imgId,imgBase)
{
	if( !document.getElementById )
	{
		return;
	}
	Menu	= document.getElementById(menuID);
	if( imgId != 'NULL' )
	{
		imgObj	= document.getElementById( imgId );
		imgObj.setAttribute( 'base', imgBase );
		imgObj.setAttribute( 'src', imgBase );
	}
	Menu.style.display		= "block";
	Menu.style.visibility	= "visible";
}

// Скрыть меню---------------------------------------------------------------------
function hide(menuID,imgId,imgBase)
{
	if( !document.getElementById )
	{
		return;
	}
	if( imgId != 'NULL' )
	{
		imgObj	= document.getElementById( imgId );
		imgObj.setAttribute( 'base', imgBase );
		imgObj.setAttribute( 'src', imgBase );
	}
	Menu	= document.getElementById(menuID);
	Menu.style.visibility	= "hidden";
}
function hide2(menuID,imgId,imgBase)
{
	if( !document.getElementById )
	{
		return;
	}
	if( imgId != 'NULL' )
	{
		imgObj	= document.getElementById( imgId );
		imgObj.setAttribute( 'base', imgBase );
		imgObj.setAttribute( 'src', imgBase );
	}
	Menu	= document.getElementById(menuID);
	Menu.style.display = "none";
	Menu.style.visibility	= "hidden";
}
function show_catalogue(menuID1,menuID2,imgId,imgBase){
	if(screen.width > 800) {
		show(menuID1,imgId,imgBase); 
		show(menuID2,'NULL','NULL');
	}
}
function hide_catalogue(menuID1,menuID2,imgId,imgBase){
	if(screen.width > 800) {
		hide(menuID1,imgId,imgBase); 
		hide(menuID2,'NULL','NULL');
	}
}
function cl(plusID, divID){
	if( !document.getElementById ){return;}
	div = document.getElementById(divID);
	plus = document.getElementById(plusID);
	if(div.style.display == "none"){
		plus.setAttribute('base', 'images/minus.gif');
		plus.setAttribute('src', 'images/minus.gif');
		div.style.display = "block";
		div.style.visibility = "visible";
	}
	else{
		plus.setAttribute('base', 'images/plus.gif');
		plus.setAttribute('src', 'images/plus.gif');
		div.style.display = "none";
		div.style.visibility = "hidden";
	}
}
