function checkInput(id,text) {
	if (id) {
		if (id.value==text) {
			id.value='';
		}
		else if (id.value=='') {
			id.value=text;
		}
	}
}
function checkInput_id(id,text) {
	if (document.getElementById(id)) {
	  if (document.getElementById(id).value=='Что ищем') { document.getElementById(id).value=''; }
	}
}

function openMenu(id) {
	var element=id.parentNode;
	var parentElement=id.parentNode.parentNode.parentNode;
	var li = document.getElementsByTagName('li');

	/*for (var i=0;i<li.length;i++) {
		if (li[i].className=='catalog' || li[i].className=='catalog current active' || li[i].className=='catalog active' || li[i].className=='catalog current') {
			li[i].className = 'catalog';
		}
	}*/
	if (element.className=='catalog current active') {
		element.className='catalog active';
		showElemMenu("node__"+id.parentNode.id, 'none');
		return;
	}
	if (element.className=='catalog active') {
		element.className='catalog current active';
		showElemMenu("node__"+id.parentNode.id, 'inline');
        return;
	}
	if (element.className=='catalog') {
		parentElement.className = 'catalog current';
		element.className='catalog current';
		showElemMenu("node__"+id.parentNode.id, 'inline');
		return;
	}
	if (element.className=='catalog current') {
		element.className='catalog';
		showElemMenu("node__"+id.parentNode.id, 'none');
		return;
	}
}

function showElemMenu(id, act) {
 element=document.getElementById(id);
 if(element) { element.style.display = act; }
}

function OpenMainMenu(id) {

  var IdMenuArray = new Array('menu_velo_id', 'menu_acs_id', 'menu_ekip_id', 'menu_zp_id');
  element=document.getElementById(id);
  if (element.style.display == 'none') {
	element.style.display = 'inline';
  }else{
	element.style.display = 'none';
  }
  if(element.style.display == 'inline') {
    for(i = 0; i < IdMenuArray.length; i++) {
	   if(id != IdMenuArray[i]) {
	    document.getElementById(IdMenuArray[i]).style.display = 'none';
	   }
    }
  }
} 

function showElem(id) {
	element=document.getElementById(id);
	if (element) {
		if (element.style.display == 'none') {
			element.style.display = 'inline';
			return;		}
		if (element.style.display == 'inline') {
			element.style.display = 'none';
			return;
		}
		element.style.display = 'inline';
	}else{ 
	 element.style.display = 'inline';
	}
}

function showImg(id, fileName) {
	var bigimg = document.getElementById(id);
	if ((bigimg) && (fileName)) {
		bigimg.src=fileName;
	}
}


function resize() {
	/*M = window.navigator.appName.substring(0,8);
	N = window.navigator.appName.substring(0,8);
	O = window.navigator.appName.substring(0,5);
	F = window.navigator.appName.substring(0,7);
	dd = document;
	ww = window;
	if (M == "Microsof") {
		w = dd.body.clientWidth;

	} else if (N == "Netscape") {
		w = ww.innerWidth;
	} else if (O == "Opera") {
		w = dd.body.clientWidth;
	} else if (F == "Firefox") {
		w = ww.innerWidth;
	}
*/
	var html = document.documentElement;  
	w=html.clientWidth; 
	if (w <= "1025") {
	    document.getElementById('id_1024').href = '/css/1024.css';
	}
}
