function RubSel (ValueSel){
	//var country = document.getElementById ("CountryAlias").value; было
	if (!country)
		var country = document.getElementById ("COUNTRY").value;
	var cntr = country.split ("++");
		SwapNav('Price','hide');
		SwapNav('Elite','hide');
		SwapNav('Zagorod','hide');
		SwapNav('Commerce','hide');
		SwapNav('Submit','hide');
		SwapNav('URL','hide');
		SwapNav('Sortir','hide');
		/*SwapNav('AddressInfo','hide');*/
	
	if (cntr[0]!='' && cntr[0]!='Выберите страну'){
		if (ValueSel.substr (0,10) == '0000000001'){
		SwapNav('Price','show');
		SwapNav('Commerce','show');
		SwapNav('Submit','show');
		SwapNav('URL','show');
		SwapNav('Sortir','show');
		/*SwapNav('AddressInfo','show');*/
			rubrika = 'commerce';
		}
		else
			if (ValueSel.substr (0,10) == '0000000005'){
			SwapNav('Price','show');
			SwapNav('Elite','show');
			SwapNav('Submit','show');
			SwapNav('URL','show');
			SwapNav('Sortir','show');
			/*SwapNav('AddressInfo','show');*/
				rubrika = 'living';
			}
		else
		if (ValueSel.substr (0,10) == '0000000002' | ValueSel.substr (0,10) == '0000000003'){
			SwapNav('Price','show');
			SwapNav('Zagorod','show');
			SwapNav('Submit','show');
			SwapNav('URL','show');
			SwapNav('Sortir','show');
			/*SwapNav('AddressInfo','show');*/
				rubrika = 'country';
		}
		else
		if (ValueSel.substr (0,10) == '0000000026' | ValueSel.substr (0,10) == '0000000029'){
			SwapNav('Submit','show');
			SwapNav('URL','show');
			SwapNav('Sortir','show');
			/*SwapNav('AddressInfo','show');*/
				rubrika = 'commerce';
		}
		else
		if (ValueSel==''){
			SwapNav('Price','show');
			SwapNav('Commerce','show');
			SwapNav('Submit','show');
			SwapNav('URL','show');
			SwapNav('Sortir','show');
			/*SwapNav('AddressInfo','show');*/
			rubrika = 'all';
		}
		else{
			SwapNav('Price','hide');
			SwapNav('Elite','hide');
			SwapNav('Zagorod','hide');
			SwapNav('Commerce','hide');
			SwapNav('Submit','hide');
			SwapNav('URL','hide');
			SwapNav('Sortir','hide');
			/*SwapNav('AddressInfo','hide');*/
		}
		/*document.getElementById ("url1").href = '/view/'+rubrika+'/?country='+cntr[1];
		было*/
	}
}

function ActionChange (){
	var rub = document.getElementById ("SelRub").value;

	if (rub.substr (0,10) == '0000000001'){
		rubrika = 'commerce';
	}
	else if (rub.substr (0,10) == '0000000005'){
		rubrika = 'living';
	}
	else if (rub.substr (0,10) == '0000000002' | rub.substr (0,10) == '0000000003'){
		rubrika = 'country';
	}
	else if (rub == ''){
		rubrika = 'all';
	}
	if (rub.substr (0,10) == '0000000026' | rub.substr (0,10) == '0000000029'){
		rubrika = 'commerce';
	}
	else if (rub.substr (0,10) =='0000000001'){
		rubrika = 'commerce';
	}
	
	var country = document.getElementById ("CountryAlias").value;
	var cntr = country.split ("++");
	if (cntr[0]=='' || cntr[0]=='Выберите страну'){
		SwapNav('Price','hide');
		SwapNav('Elite','hide');
		SwapNav('Zagorod','hide');
		SwapNav('Commerce','hide');
		SwapNav('Submit','hide');
		SwapNav('URL','hide');
		SwapNav('Sortir','hide');
		/*SwapNav('AddressInfo','hide');*/
	document.getElementById ("f_sel").action = '/country/index.php';
	}
	else if (cntr[0]!='' && cntr[0]!='Выберите страну'){
		document.getElementById ("f_sel").action = '/country/'+cntr[0]+'/';
		document.getElementById ("url1").href = '/view/'+rubrika+'/?country='+cntr[1];
		RubSel (rub);
	}
}

function ActionChange1 (){
	var rub = document.getElementById ("WHAT").value;
	var country = document.getElementById ("COUNTRY").value;
	if (!country){
		SwapNav('Price','hide');
		SwapNav('Elite','hide');
		SwapNav('Zagorod','hide');
		SwapNav('Commerce','hide');
		SwapNav('Submit','hide');
		SwapNav('URL','hide');
	}
	else{
		SwapNav('Price','show');
		SwapNav('Elite','show');
		SwapNav('Zagorod','show');
		SwapNav('Commerce','show');
		SwapNav('Submit','show');
		SwapNav('URL','show');
	}
	document.getElementById ("f_sel").action = '/country/'+country+'/filter/index.php';
}

