function ActionChange (FormId,Action,nWind){
	document.getElementById (FormId).action = Action;
		if (nWind != null && nWind)
			document.getElementById (FormId).target = '_blank';
		else
			document.getElementById (FormId).target = '';
}

function AllInvert() {
	var len = document.FVyborka.elements.length;
	var i = 0;
	var chbox;

	chbox = 'document.getElementById(\'invall\')';
	chbox = eval(chbox);
	if(chbox != null) 
	{
		if(chbox.checked == 0) {chbox.checked = 1;}
		else if(chbox.checked == 1) {chbox.checked = 0;}
	}
	for(i=0;i<len;i++) {
		chbox = document.FVyborka.elements[i];
		if(chbox.type == "checkbox")
		{
			if(chbox.checked == 0) {chbox.checked = 1;}
			else if(chbox.checked == 1) {chbox.checked = 0;}
		}
	}
}

function go2map (url) {
	if (url){
		window.open ('http://www.eip.ru/links/out.php?'+url);
	}
	else{
		return false;
	}
}

function go2mapgoogle (url) {
	if (url){
		var zzz='http://maps.google.ru/maps?f=q&source=s_q&hl=ru&geocode=&q='+encodeURI (url)+'&ie=UTF8&z=10&t=p';
		window.open ('http://www.eip.ru/links/out.php?'+zzz);
	}
	else{
		return false;
	}
}


function sort (id){
	//alert (top.location.href);
	var url = top.location.href;
	var re = /(&sortby=(.*))/g;
	url = url.replace(re,'');
	top.location.href = url + '&sortby='+Ridv (id);
	/*alert (Ridv (id));*/
}
/*
function CheckCB (Id, Val){
	if (document.getElementById (Id).checked){
		var cookie = getCookie('NumRecs');
				if (cookie.length > 0)
					var Value = cookie+String.fromCharCode (59)+Val;
				else
					var Value = Val;
		setCookie ('NumRecs', Value,'','/view/');
		//alert ('чекнут');
	}
	else{
		//setCookie ('NumRecs', '','01 jan 2001','/view/');
		var cookie = getCookie('NumRecs');
		Nrecs = explode (cookie,";");
		alert (Nrecs);
	//alert (getCookie ('city'));
	}
}

function setCookie (name, value, expires, path, domain, secure) {
		document.cookie = name + "=" + escape(value) +
		((expires) ? "; expires=" + expires : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
}

function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}
*/
