function ChGnr() {
	document.gnr.submit();
}



function CloseDiv(div) {
document.getElementById(div).style.display='none';
}	

function ShowInfo(div) {

	if (document.getElementById(div).style.display==''){
	document.getElementById(div).style.display='none'
	}
	else {
	document.getElementById(div).style.display=''
}
}
function shDiv (div,uri) {
	isDOM=document.getElementById; isMSIE=document.all && document.all.item; isNetscape4=document.layers; isOpera=window.opera; isOpera5=isOpera && isDOM; isMSIE5=isDOM && isMSIE; isMozilla=isNetscape6=isDOM && !isMSIE && !isOpera;
	if (isMozilla) { var offset=document.documentElement.scrollTop;tt=screen.height-250; }
	if (isMSIE5) { var offset=document.body.scrollTop;tt=document.body.clientHeight; }
	document.getElementById(div).style.height=150+'px';
	var z = document.getElementById(div).style.height;
	zz=(z.replace('px','')/2);
	var y = Math.floor(offset + ((tt)/2))-zz;
	var x = Math.floor((document.body.clientWidth-460)/2);
	//document.body.clientWidth
	document.getElementById(div).style.top = y + 'px';
	document.getElementById(div).style.left = x + 'px';
	document.getElementById(div).width='420px';
	document.getElementById(div).style.display='';
	
	var ajax = new Ajax();
	if (ajax.isValid){
		ajax.get(
			'http://'+ document.domain + uri+ '&pi='+Math.random(100000),
			function () {
				var response = ajax.response();
				if ( response && response.status == 200 )
					document.getElementById(div).innerHTML = response.text;
				else if ( response && response.status >= 500 )
					document.getElementById(div).innerHTML = '<'+'img'+' src="/forums/img/roter.gif" /' + '>';
				else
					document.getElementById(div).innerHTML = '<'+ 'center'+'>' +'<'+ 'img' + ' src="/forums/img/roter.gif" '+'/' +'>' + '<'+ '/' + 'center' + '>';
					
			}
		);
		return false;
	}
	else {
		return true;
	}
}

function chkfa()
     {  
		var d=document;
		var ms="";
			
		if (d.form.name.value.length<5) ms+='Пустое поле "Название"\n';
		if (d.form.opisanie.value.length<5) ms+='Пустое поле "Описание"\n';
		if (d.form.rasst.value.length<5) ms+='Пустое поле "Расстояние до ГЛЦ"\n';
		if (d.form.transfer.value.length<5) ms+='Пустое поле "Трансфер"\n';
		if (d.form.adress.value.length<5) ms+='Пустое поле "Адрес"\n';
		if (d.form.sale.value.length<5) ms+='Пустое поле "Цена"\n';
		
		
		if (ms) {
			alert ("Ошибка при отправке формы:\n" + ms );
			return false;	
		}
     }
