function key_up (el, f) {
			if (f==1) {
				new_firm=el.value;
				old_firm=el.value;
			}
			
			if(f==2) {
				new_arm=el.value;
				old_arm=el.value;
			}
			
			if(f==3) {
				new_new_eml=el.value;
				old_new_eml=el.value;
			}
			
			if(f==4) {
				new_search=el.value;
				old_search=el.value;
			}
		}

		function loose_focus (el, f) {
			if(f==1) {
				el.value=old_firm;
			}
			
			if(f==2) {
				el.value=old_arm;
			}
			
			if(f==3) {
				el.value=old_new_eml;
			}
			
			if(f==4) {
				el.value=old_search;
			}
		}

		function get_click (el, f) {
			if(f==1) {
				el.value=new_firm;
			}
			
			if(f==2) {
				el.value=new_arm;
			}
			
			if(f==3) {
				el.value=new_new_eml;
			}
			
			if(f==4) {
				el.value=new_search;
			}
		}

		function ShowBann (path, w, h) {
			window.open(path,'SBann','width='+w+',height='+h+',status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no,top=200,left=200');
		}

		function openControl(path) {
			h = screen.availHeight*3/4;
			window.open(path, 'mirControl', 'width=640,height='+h+',status=yes,toolbar=no,menubar=no,locationbar=no,resizable=yes,scrollbars=yes,top=20,left=20');
		}

		function ask(targetName, targetURL) {
			if (confirm ('Вы действительно хотите '+targetName+'?' ))
			self.location.replace(targetURL);
		}

		function remind (loc) {
  			var w=200;
  			var h=100;
  			var m = window.open('/admin/remind.php?loc='+loc,'remind','width='+w+',height='+h+',status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,top='+ Math.round((screen.height/2)-(h/2)) +',left=' + Math.round((screen.width/2)-(w/2)));
  			m.focus();
		}
		
		function openComparison () {
			var w=640;
			var h=480;
  			var m = window.open('/?see_comparison=1','Comparison','width='+w+',height='+h+',status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,top='+ Math.round((screen.height/2)-(h/2)) +',left=' + Math.round((screen.width/2)-(w/2)));
  			m.focus();
		}
		
		function openAddComparison (href) {
			var w=640;
			var h=480;
  			var m = window.open(href,'Comparison','width='+w+',height='+h+',status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,top='+ Math.round((screen.height/2)-(h/2)) +',left=' + Math.round((screen.width/2)-(w/2)));
  			m.focus();			
		}

		function eng_version() {
			var m = window.open('http://64.233.179.104/translate?hl=en&ie=UTF-8&oe=UTF-8&langpair=ru%7Cen&u=http://www.arms-expo.ru/&prev=http://www.arms-expo.ru/');
			m.focus();
		}

		function check_cat() {
			var flag=false;
			for (var i=0; i<document.add_catalog.elements.length; i++) {
				if (document.add_catalog.elements[i].type=='radio' && document.add_catalog.elements[i].checked)
					flag=true;
			}

			if (flag) document.add_catalog.submit();
			else alert('Не выбран ни один каталог');
		}