(function() { // SCOPE

    // ONLY for inclusion in localized resources.
    // See Localization module for handling
    var cookiematch = document.cookie.match(/locale=([0-9A-Z_-]*)/i)
    var pathmatch = window.location.pathname.match(/^\/([^\/]*)/)

    if(cookiematch && pathmatch && (cookiematch[1] == pathmatch[1])) {
	; // OK
    }
    else {
	
	var guess = 'en-us';
	if(pathmatch) { var guess = pathmatch[1]; }
	window.location.search = '?locale=' + guess;
    }


})(); // END SCOPE
