﻿function switchDomain(current_reg, region) {
	//alert("AAAA"); 
	if(region != "" && region != current_reg) {
		window.location="http://"+region;
	}
}

function getCitiesForRegion(region, p_where) {
	//alert('http://'+region+'?m=home&a=GetCities&region='+region);
	
	//w linku wolamy m=home (taki jest def tak jak resolver)
	if(p_where == "header") {
		//alert("sdfg");
		$.ajax({ url: abs_path+'?m=Home&a=GetCities&region_domain='+region+'&loc='+p_where, dataType: "html", success: function(data){
			//$("#region_sel").replaceWith(data);
			$("#miasto_sel").html(data)
		}
		})
	} else if (p_where == "preform") {
		$.ajax({ url: abs_path+'?m=Home&a=GetCities&region_domain='+region+'&loc='+p_where, dataType: "html", success: function(data){
			$("#miasto_sel_preform").html(data)
		}
		})
	} else if (p_where == "form") {
		$.ajax({ url: abs_path+'?m=Home&a=GetCities&region_domain='+region+'&loc='+p_where, dataType: "html", success: function(data){
			$("#miasto_sel_preform").html(data)
		}
		})
	}
}
