/**
 *
 * @author: Jens Hoffmann <jens.hoffmann@dkd.de> (c) DKD.2oo7
 *
 */

var clientTimeZone = {
	
	getZone: function() {
		var clientNow  = this.getClientTime().toInt();
		var clientZone = "";
		
		if (clientNow >= par.timeZones.zone1.from.toInt() && clientNow < par.timeZones.zone1.to.toInt()) {
			clientZone = par.timeZones.zone1.name;
		} else if (clientNow >= par.timeZones.zone2.from.toInt() && clientNow < par.timeZones.zone2.to.toInt()) {
			clientZone = par.timeZones.zone2.name;
		} else if (clientNow >= par.timeZones.zone3.from.toInt() && clientNow < par.timeZones.zone3.to.toInt()) {
			clientZone = par.timeZones.zone3.name;
		} else if (clientNow >= par.timeZones.zone4.from.toInt() && clientNow < par.timeZones.zone4.to.toInt()) {
			clientZone = par.timeZones.zone4.name;
		} else if (clientNow >= par.timeZones.zone5.from.toInt() && clientNow < par.timeZones.zone5.to.toInt()) {
			clientZone = par.timeZones.zone5.name;
		}
		
		/* if (window.gecko && typeof(console) == 'object') {
			// Debug logging
			   console.log(clientZone.toLowerCase());
		} */

		return clientZone.toLowerCase();
	},
	
	getTimedEmotionTitle: function() {
		var clientNow  = this.getClientTime().toInt();
		var clientZone = "";
		
		if (clientNow >= par.timeZones.zone1.from.toInt() && clientNow < par.timeZones.zone1.to.toInt()) {
			clientZone = par.timeZones.zone1.emotionTitle;
		} else if (clientNow >= par.timeZones.zone2.from.toInt() && clientNow < par.timeZones.zone2.to.toInt()) {
			clientZone = par.timeZones.zone2.emotionTitle;
		} else if (clientNow >= par.timeZones.zone3.from.toInt() && clientNow < par.timeZones.zone3.to.toInt()) {
			clientZone = par.timeZones.zone3.emotionTitle;
		} else if (clientNow >= par.timeZones.zone4.from.toInt() && clientNow < par.timeZones.zone4.to.toInt()) {
			clientZone = par.timeZones.zone4.emotionTitle;
		} else if (clientNow >= par.timeZones.zone5.from.toInt() && clientNow < par.timeZones.zone5.to.toInt()) {
			clientZone = par.timeZones.zone5.emotionTitle;
		}
		
		/* if (window.gecko && typeof(console) == 'object') {
			// Debug logging
			   console.log(clientZone.toLowerCase());
		} */

		return clientZone;
	},
	
	getClientTime: function() {
		var hours = new Date().getHours();
		return hours;
	}
	
};