var neww=0;
<!--
// To hide the codes from the old browsers

<!--CLOCK -->
var timerID = null;

var timerRunning = false;

function stopclock (){
        if(timerRunning)
                cleartimeout(timerID);
                timerRunning=false;
}

function startclock (){
        stopclock();
        showtime();
}

function showtime (){	
	    var now = new Date();
 		var hours = now.getHours(); 
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();
        var timeValue = " ";		
        timeValue += "   " + ((hours > 12) ? hours - 0 : hours);
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
        timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
        document.clock.face.value = timeValue;		
        timerID = setTimeout("showtime()",1000);
        timerRunning = true;
}

<!--MENU -->
var idKeyInfoAct='0',idKeyInfoActSub='1'
function showKeyInfo(a,b){
   var o;if(b){
	  o=document.getElementById('ki'+idKeyInfoAct+'_'+idKeyInfoActSub);if(o)o.style.display='none'
      document.getElementById('ki'+idKeyInfoAct+'_'+b).style.display='block'
      idKeyInfoActSub=b
   }else{
      if(a==idKeyInfoAct)return
      o=document.getElementById('ki'+idKeyInfoAct+'_'+idKeyInfoActSub);if(o)o.style.display='none'
      o=document.getElementById('ki'+a+'_1');if(o)o.style.display='block'
      idKeyInfoAct=a;idKeyInfoActSub='1'
   }
}

function onchangedb(n) {
	for (var intLoop = 1; intLoop <= n; intLoop++)	{
	var sel2 = false;
	var sel3 = false;
	var sel4 = false;
	if (intLoop == 2) sel2 = true;
	if (intLoop == 3) sel3 = true;
	if (intLoop == 4) sel4 = true;
		
	while (document.all.item("LookForItem" + intLoop).options.length>0) {
		document.all.item("LookForItem" + intLoop).options.remove(0); 		 
	}
	switch (document.all.odbcdb.value) {
	  case "books": 		
		document.all.item("LookForItem" + intLoop).options[length]=new Option("Автор","100a",false,false);
		document.all.item("LookForItem" + intLoop).options[length+1]=new Option("Название","245a",false,sel2);
		document.all.item("LookForItem" + intLoop).options[length+2]=new Option("Издательство","260b",false,false);
		document.all.item("LookForItem" + intLoop).options[length+3]=new Option("Год издания","260c",false,sel4);
		document.all.item("LookForItem" + intLoop).options[length+4]=new Option("Ключевое слово","653a",false,sel3);
		document.all.item("LookForItem" + intLoop).options[length+5]=new Option("Основная рубрика","650a",false,false);
		break; 
		
	  case "methodics": 
		document.all.item("LookForItem" + intLoop).options[length]=new Option("Автор","100a",false,false);
		document.all.item("LookForItem" + intLoop).options[length+1]=new Option("Название","245a",false,sel2);
		document.all.item("LookForItem" + intLoop).options[length+2]=new Option("Ключевое слово","653a",false,sel3);
		document.all.item("LookForItem" + intLoop).options[length+3]=new Option("Год издания","260c",false,sel4);
		break; 

	  case "cd": 
		document.all.item("LookForItem" + intLoop).options[length]=new Option("Автор","100a",false,false);
		document.all.item("LookForItem" + intLoop).options[length+1]=new Option("Название","245a",false,sel2);
		document.all.item("LookForItem" + intLoop).options[length+2]=new Option("Издательство","260b",false,false);
		document.all.item("LookForItem" + intLoop).options[length+3]=new Option("Год издания","260c",false,sel4);
		document.all.item("LookForItem" + intLoop).options[length+4]=new Option("Ключевое слово","653a",false,sel3);
		break; 	  
	}
	}
}
// Функция отображения словарей
function ShowVoc(comp) {	
	switch (comp.name) {
		case "vb1": var vb=document.all.lookForItem1.value; var input='vb1'; var odbcdb='searchBook'; break;
		case "vb2": var vb=document.all.lookForItem2.value; var input='vb2'; var odbcdb='searchArticle'; break;		
	}
	var w = window.open('vocab.phpm?vb='+vb+'&odbcdb='+odbcdb+'&from=0&id=0', input, 'titlebar=yes,toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizeable=yes,width=580,height=600');
}
// Функция для сохранения в input поле выбранного значения
function doclick(text,wname) {
	switch (wname) {
		case "vb1": document.all.nmTerms1.value=text; break;
		case "vb2": document.all.nmTerms2.value=text; break;		
	}
}

document.onkeydown = NavigateThrough;
function NavigateThrough (event) {
    if (!document.getElementById) return;
    if (window.event) event = window.event;
	if (event.ctrlKey) {
		var link = null;
		var href = null;
		switch (event.keyCode ? event.keyCode : event.which ? event.which : null) {
			case 0x25:
				link = document.getElementById ('previous_page');
				break;
			case 0x27:
				link = document.getElementById ('next_page');
				break;			
		}
        if (link) document.location = link.href;
	}
}

function Toggle(id) {
	el = document.getElementById(id);
	if(el.style.display == "")
		el.style.display = "none";
	else
		el.style.display = "";
}

function checkFields() {
	username = document.all.name.value;
	pass = document.all.password.value;
	if(username == "" || pass == "") {
		alert("Пожалуйста, заполните поля");
		return false;
	}
	return true;
}

function uploadFile() {
	upfile = document.all.efile.value;
	if(upfile == "") {
		alert("Выберите файл");
		return false;
	}
	return true;
}