// МЕНЮ
function TopMOver(id) {
	document.getElementById('menu_'+id).className='topm_over';
}
function TopMOut(id) {
	document.getElementById('menu_'+id).className='topm_out';
}

function show_photo(path) {
	popupWin = window.open('/show_photo.php?photo=' + path, "фото","directories=no,height=240,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=320");
	popupWin.focus();
	return false;
}

function popup_open(path,w,h,label) {
	popupWin = window.open(path, label ,"directories=no,width=" + w + ",height=" + h + ",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,top=50,left=50");
	popupWin.focus();
	return false;
}
function get(id) { return document.getElementById(id) }
// Список - меню
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


// Ввод только численных значений
function EnsureNumeric(event) {
  if (!window.event) {
    evt=event;
    var k = evt.charCode; 
    if ((k < 48 || k > 57) && k != 0  && k != 44  && k != 46) 
    evt.preventDefault();
  } else {
    evt=window.event;
    var k = evt.keyCode; 
    if ((k < 48 || k > 57) && k != 0  && k != 44  && k != 46) 
    evt.returnValue = false;
  }
}

function init_len(val, len) {
	val= document.new_blank.comp_addres.value;
	real_len=val.length;
	//alert(val);
	if(real_len>=len)
		window.event.returnValue = false; 
}

function showtip (v) {
	if (document.all['idt'+v]) {
		var sw = document.body.clientWidth;
		var sh = document.body.clientHeight;
		var dw = document.all['idt'+v].clientWidth;
		var dh = document.all['idt'+v].clientHeight;
		var cx = self.event.clientX;
		var cy = self.event.clientY;
		if (sw < cx+dw+20) cx=sw-dw-20;
		if (sh < cy+dh+20) cy=sh-dh-20;
		document.all['idt'+v].style.top=cy+document.body.scrollTop+15;
		document.all['idt'+v].style.left=cx+document.body.scrollLeft+10;
		document.all['idt'+v].style.visibility='visible';
	}
}
function hidetip (v) {
	if (document.all['idt'+v]) {
		document.all['idt'+v].style.visibility='hidden';
	}
}
function to_title(page,body_title,body_descr,body_keyw){
window.open('/title/index.php?page='+page+'&body_title='+body_title+'&body_descr='+body_descr+'&body_keyw='+body_keyw, 'Заголовок', 'toolbar=no,location=no,directoties=no,status=no,scrollbars=yes,menubar=no,resizable=no,width=750,height=500');
}
