function showCopy () {
  document.getElementById('copier').style.display='block';
}

function hideCopy () {
  document.getElementById('copier').style.display='none';
}

function highLightMenu (leftSepId,rightSepId) {
	document.getElementById(leftSepId).className="menu_sep_highlight";
	document.getElementById(rightSepId).className="menu_sep_highlight";
}

function deHighLightMenu (leftSepId,rightSepId) {
	document.getElementById(leftSepId).className="menu_sep";
	document.getElementById(rightSepId).className="menu_sep";
}

function nextGroup (direct) {
	var nextGroupId = "";
	document.getElementById('group'+document.getElementById('chdivide').value).className='invisible';
	if (direct == 1) {
		nextGroupId = Number(document.getElementById('chdivide').value) + 1;
	} else {
		nextGroupId = Number(document.getElementById('chdivide').value) - 1;
	}
	//alert (nextGroupId);
	document.getElementById('group'+nextGroupId).className='visible';
	document.getElementById('chdivide').value = nextGroupId;
	if (document.getElementById('chdivide').value == 1) {
		document.getElementById('left_arrow').style.visibility = 'hidden';
	} else {
		document.getElementById('left_arrow').style.visibility = 'visible';
	}
	if (document.getElementById('chdivide').value == document.getElementById('chdivmax').value) {
		document.getElementById('right_arrow').style.visibility = 'hidden';
	} else {
		document.getElementById('right_arrow').style.visibility = 'visible';
	}
	return;
}

// Задвигаем меню на место
function moveMenuToThePlace(lang) {
	var moveLeft5 = 0;
	var moveLeft6 = 0;
  if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
     moveLeft5 = Math.round (0.32 * document.body.clientWidth - (220+0.8*220));  
     if (lang == 'ru') {
      moveLeft6 = Math.round (0.16 * document.body.clientWidth - (230));
     } else {
      moveLeft6 = Math.round (0.2 * document.body.clientWidth - (230));
     }
   }
   if (navigator.appName.indexOf("Microsoft")!=-1) {
     moveLeft5 = Math.round (0.32 * document.body.offsetWidth - (237+0.8*220));  
     if (lang == 'ru') { 
      moveLeft6 = Math.round (0.16 * document.body.offsetWidth - (230));
     } else {
      moveLeft6 = Math.round (0.2 * document.body.offsetWidth - (230));
     }
   }
  }
  if (moveLeft5 < 0) {
   if (lang == 'ru') {
    document.getElementById('ulsub5').style.left = moveLeft5+'px';  
   }
  }
  if (moveLeft6 < 0) {
   if (lang == 'ru') {
    document.getElementById('ulsub6').style.left = moveLeft6+'px';  
   } else {
     document.getElementById('ulsub305').style.left = moveLeft6+'px';  
   }
  }
}

// Закрываем прелоадер
function closePreloader(){
  document.getElementById('preloader').style.display='none';
  document.body.style.overflow='auto';
  return;
}

// Запрещаем отправку форм по ентеру
function disableEnterKey(e) {
     var key;
     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
          return false;
     else
          return true;
}

function go (where, what, pid, lang) {
  switch (what) {
    case 'news': {
      if (where != 0) {
        document.location = '/index.php?pid='+pid+'&lang='+lang+'&news_id='+where;
      } else {
        document.location = '/index.php?pid='+pid+'&lang='+lang;
      }
      break;
    }
    default: {
      document.location = '/index.php?pid='+pid+'&lang='+lang;
      break;
    }
  }
  return true;
}
