// JavaScript Document
// JavaScript Document
sfHover = function() {
	var sfEls = document.getElementById("i-topnav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
					//if (document.all.formsearch) {
					//document.formsearch.style.visibility='hidden';
				//}
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
							//	if (document.all.formsearch) {
				//	document.formsearch.style.visibility='visible';
					//}
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);

function CountryFilter() {
	var country = document.getElementById("country_id");
	var c_id = country.options[country.selectedIndex].value;
	var loc = document.location.href;
	if ( loc.indexOf("?") > -1 ){
		var str = loc.substr(0,loc.indexOf("?"));
		if (c_id!="") document.location.href=str+"?country_id="+c_id;
		else document.location.href=str;
	} else {
		if (c_id!="") document.location.href=loc+"?country_id="+c_id;
		else document.location.href=loc;
	}
}

function RegionFilter() {
	var country = document.getElementById("country_id");
	var c_id = country.options[country.selectedIndex].value;
	
	var region = document.getElementById("region_id");
	var r_id = region.options[region.selectedIndex].value;
	var loc = document.location.href;
	if ( loc.indexOf("?") > -1 ){
		var str = loc.substr(0,loc.indexOf("?"));
		document.location.href=str+"?country_id="+c_id+"&region_id="+r_id;
	} else {
		document.location.href=loc+"?country_id="+c_id+"&region_id="+r_id;
	}
}


function OcupationFilter() {
	var country = document.getElementById("country_id");
	var c_id = country.options[country.selectedIndex].value;
	
	var region = document.getElementById("region_id");
	var r_id = region.options[region.selectedIndex].value;
	
	var occ = document.getElementById("occupation_id");
	var o_id = occ.options[occ.selectedIndex].value;
	
	var loc = document.location.href;
	if ( loc.indexOf("?") > -1 ){
		var str = loc.substr(0,loc.indexOf("?"));
		document.location.href=str+"?country_id="+c_id+"&region_id="+r_id+"&occ_id="+o_id;
	} else {
		document.location.href=loc+"?country_id="+c_id+"&region_id="+r_id+"&occ_id="+o_id;
	}
}
