// Copyright 2008 ProjectWizards GmbH. All rights reserved.

//console.log("Environment");

var Environment  = WRLObject.extend({
	constructor: function(json, resourcesURL, isBeingExportedForQuicklook) {
		this.base();
		this.images = {};
		this.resourcesURL = resourcesURL;
		var json = eval("("+json+")");
		for(key in json)
			this[key] = json[key];
			
		if(!this.localizedStrings)
			this.localizedStrings = {};
		Date.meridian = this.date.meridian;
		Date.MONTH_NAMES=this.date.monthNames;
		Date.DAY_NAMES=this.date.dayNames;
		this.format.systemTimeFormatFixedHours = this.format.systemTimeFormatUses12Hours ?  "hh:00 a" : "HH:00";
		this.format.systemOnlyHourNumberTimeFormat = this.format.systemTimeFormatUses12Hours ?  "hh" : "HH";
		this.format.systemOnlyHourTimeFormat = this.format.systemTimeFormatUses12Hours ?  "hh a" : "HH";
		this.format.systemShortDateFormatWithWeekday = 'E, '+this.format.systemShortDateFormat;
		this.format.systemDateFormat = 'EE, dd. MMM yyyy';
		this.format.systemDateFormatWithoutWeekday = 'dd. MMM yyyy';
		this.format.systemShortDateFormatWithoutYear = 'dd.MM.'; 
		this.format.systemDateFormatWithoutYearAndWeekday = 'dd. MMM';			
											
		// Datepicker settings
		if(!isBeingExportedForQuicklook && window['setLanguageCode'])
			setLanguageCode(this.language);

	},
	
	localizedString: function(aString) {
		var result = this.localizedStrings[aString];
		if(!result)
			result = aString
		return result;
	},
	
	updateInfoIcons: function(){
		this.infoIconURLs = [];
		this.infoIconURLs.push(this.images.InfoConflicts);
		this.infoIconURLs.push(this.images.InfoWarnings);
		this.infoIconURLs.push(this.images.InfoConstraints);
		this.infoIconURLs.push(this.images.InfoASAP);
		this.infoIconURLs.push(this.images.InfoALAP);
		this.infoIconURLs.push(this.images.InfoElements);
		this.infoIconURLs.push(this.images.InfoDescription);	
		this.infoIconURLs.push(this.images.InfoCalendar);	
	}
	
});
