/**
 * This object provides functionality for storing a region value across multiple requests by using cookies.
 *
 * @author Stefan T.
 * @copyright (c) 2010 - Godengo, Inc.
 *
 * DEPENDENCIES:
 *  prototype.js
 *  base.js
 **/ 

/* @global */
var RegionSelector = Class.create();

RegionSelector.prototype = {

	initialize: function() {
		this.region = null;
	},
	
	setRegion: function(region) {
		this.region = region;
		var cookie = new Cookie(window.document, 'housetrends_region','8766','/');
		if (this.region) {
			cookie.region = region;
			cookie.store();
		} else {
			cookie.remove();
		}
	}
}