function Site() {

	var hashObj = {};
	var hash = "";

	this.settings = {
		highlight: {
			color: "yellow",
			fadeTime: 2000
		},
		hash: {
			SEPARATOR_OBJECT: "/",
			SEPARATOR_VALUE: "="
		}
	};

	this.getHash = function(property) {
		var s = window.location.hash;
		s = s.substring(1, s.length);
		//
		if( s != this._hash ) {
			var a = s.split(ill.settings.hash.SEPARATOR_OBJECT);
			//
			var i;
			var o;
			//
			for( i in a ) {
				o = a[i].split(ill.settings.hash.SEPARATOR_VALUE);
				this._hashObj[ o[0] ] = o[1];
			}
			delete s;
			delete a;
			delete i;
			delete o;
			//
			this._hash = s;
		} else {

		}
		return this._hashObj[property];
	};

	this.setHash = function(property, value) {
		if (this._hashObj[property] != value) {
			this._hashObj[property] = value;
			//
			var s = "";
			var i;
			//
			for( i in this._hashObj ) {
				if( this._hashObj[i] !== undefined )  {
					s += i + ill.settings.hash.SEPARATOR_VALUE + this._hashObj[i] + ill.settings.hash.SEPARATOR_OBJECT;
				}
			}
			this._hash = String(s).substring(0, s.length - 1);
			window.location.hash = this._hash;
			//
			delete s;
			delete i;
		}
	};
	
	this.getAlertLevelText = function(alertLevel) {
		var level = "low";
		if (alertLevel>0.33) {
			level = "medium";
		}
		if (alertLevel>0.66) {
			level = "high";
		}
		//
		return level;
	};

	this.getContextTypeName = function(contextTypeId) {
		var name = texts['contextTypeName_' + contextTypeId];
		if (!name) { name = '-'; }
		return name;
	};
	
	this.getContextIconType = function(contextTypeId) {
		switch (parseInt(contextTypeId)) {
			case 1:
			case 3:
				return 'district';
			case 10:
			case 12:
			case 13:
			case 14:
				return 'city';
			case 11:
			case 22:
			case 24:
				return 'food';
			case 23:
			case 26:
				return 'bar';
			case 15:
			case 16:
			case 17:
				return 'store';
			case 25:
				return 'daycare';
			case 18:
				return 'school';
			case 19:
			case 20:
			case 21:
				return 'edu';
			case 27:
				return 'house'; // CULTURE
			case 28:
			case 29:
				return 'facebook';
			default:
				return 'house';
		}
	};
	
	this.construct = function() {
		$('.help-tooltip')
			.attr('href', '#')
			.bind('click', function() {
				return false;
			})	
			.bind("mouseover", function() {
				tooltip.show("help", $(this).attr("name"));
			})
			.bind("mouseout", function() {
				tooltip.hide();
			});
		$("#slogan").show();
		$("#slogan #ticker").newsTicker();
	};
}

var site;

$(document).ready(function() {
	site = new Site();
	site.construct();
});

//console.log("site.js");