var NETVISION = {
	version: "0.0.1",
	versionDetail: {
		major: 0,
		minor: 1,
		patch: 1
	}
};

NETVISION.adapters = {};
NETVISION.components = {};
NETVISION.form = {
	components: {}
};
NETVISION.ui = {
	navigation: {}
};
NETVISION.util = {};
NETVISION.validation = {};if("undefined" === typeof Function.prototype.wait) {
    Function.prototype.wait = function(time){
		var fn = this;
		var timeout = null;
		return function(){
		    var inst = this;
		    var args = arguments;
		    $clear(timeout);
		    timeout = window.setTimeout( function(){
			var ret = fn.apply(inst,args);
		    }, time);
		};
    };
}if("undefined" === typeof Number.prototype.toCurrencyString) {
    Number.prototype.toCurrencyString = function(decimals, dec_point, thousands_sep) {
	decimals      = Math.abs(decimals) + 1 ? decimals : 2;
	dec_point     = dec_point || '.';
	thousands_sep = thousands_sep || '';

	if(thousands_sep === 'n') {
	    thousands_sep = "";
	}

	var matches   = /(-)?(\d+)(\.\d+)?/.exec(this+'');
	var remainder = matches[2].length > 3 ? matches[2].length % 3 : 0;

	return (matches[1] ? matches[1] : '') + (remainder ? matches[2].substr(0, remainder) + thousands_sep : '') + matches[2].substr(remainder).replace(/(\d{3})(?=\d)/g, "$1" + thousands_sep) +
	(decimals ? dec_point + (+matches[3] || 0).toFixed(decimals).substr(2) : '');
    }
}if("undefined" === typeof String.prototype.currencyStringToNumber) {
	
	String.prototype.currencyStringToNumber = function(dec_point, thousands_sep) {
		dec_point     = dec_point || ',';
		thousands_sep = thousands_sep || '.';
	
		var str	      = this;
		var regexp    = new RegExp("(\\"+thousands_sep+")?","g");
	
		str = str.replace(regexp, "");
		str = str.replace(dec_point,".");
	
		return parseFloat(str);
    }
}if("hash" === $type(Event.Keys)) {
	Event.Keys.extend({
		"shift": 16,
		"multiply": 106,
		"add": 107,
		"subtract": 109,
		"decimalPoint": 110,
		"divide": 111,
		"semiColon": 186,
		"equalSign": 187,
		"comma": 188,
		"dash": 189,
		"period": 190,
		"forwardSlash": 191,
		"graveAccent": 192,
		"openBracket": 219,
		"backSlash": 220,
		"closeBracket": 221,
		"singleQuote": 222
	});
}
NETVISION.adapters.BrowserSupport = {
	canvas: Modernizr.canvas,
	canvastext: Modernizr.canvastext,
	rgba: Modernizr.rgba,
	hsla: Modernizr.hsla,
	multiplebgs: Modernizr.multiplebgs,
	backgroundsize: Modernizr.backgroundsize,
	borderimage: Modernizr.borderimage,
	borderradius: Modernizr.borderradius,
	boxshadow: Modernizr.boxshadow,
	opacity: Modernizr.opacity,
	cssanimations: Modernizr.cssanimations,
	csscolumns: Modernizr.csscolumns,
	cssgradients: Modernizr.cssgradients,
	cssreflections: Modernizr.cssreflections,
	csstransforms: Modernizr.csstransforms,
	csstransforms3d: Modernizr.csstransform3d,
	csstransitions: Modernizr.csstransitions,
	fontface: Modernizr.fontface,
	geolocation: Modernizr.geolocation,
	video: Modernizr.video,
	audio: Modernizr.audio,
	input: Modernizr.input,
	svg: Modernizr.svg,
	smil: Modernizr.smil,
	svgclippaths: Modernizr.svgclippaths,
	background: Modernizr.background,
	backgroundColor: Modernizr.backgroundColor,
	canPlayType: Modernizr.canPlayType,
	localstorage: Modernizr.localstorage,
	sessionstorage: Modernizr.sessionstorage,
	applicationcache: Modernizr.applicationcache,
	webworkers: Modernizr.webworkers,
	hashchange: Modernizr.haschange,
	crosswindowmessaging: Modernizr.crosswindowmessaging,
	historymanagement: Modernizr.historymanagement,
	draganddrop: Modernizr.draganddrop,
	websqldatabase: Modernizr.websqldatabase,
	indexedDB: Modernizr.indexedDB,
	websockets: Modernizr.websockets
};NETVISION.util.BrowserSupport = {
	canvas: NETVISION.adapters.BrowserSupport.canvas,
	canvastext: NETVISION.adapters.BrowserSupport.canvastext,
	rgba: NETVISION.adapters.BrowserSupport.rgba,
	hsla: NETVISION.adapters.BrowserSupport.hsla,
	multiplebgs: NETVISION.adapters.BrowserSupport.multiplebgs,
	backgroundsize: NETVISION.adapters.BrowserSupport.backgroundsize,
	borderimage: NETVISION.adapters.BrowserSupport.borderimage,
	borderradius: NETVISION.adapters.BrowserSupport.borderradius,
	boxshadow: NETVISION.adapters.BrowserSupport.boxshadow,
	opacity: NETVISION.adapters.BrowserSupport.opacity,
	cssanimations: NETVISION.adapters.BrowserSupport.cssanimations,
	csscolumns: NETVISION.adapters.BrowserSupport.csscolumns,
	cssgradients: NETVISION.adapters.BrowserSupport.cssgradients,
	cssreflections: NETVISION.adapters.BrowserSupport.cssreflections,
	csstransforms: NETVISION.adapters.BrowserSupport.csstransforms,
	csstransforms3d: NETVISION.adapters.BrowserSupport.csstransform3d,
	csstransitions: NETVISION.adapters.BrowserSupport.csstransitions,
	fontface: NETVISION.adapters.BrowserSupport.fontface,
	geolocation: NETVISION.adapters.BrowserSupport.geolocation,
	video: NETVISION.adapters.BrowserSupport.video,
	audio: NETVISION.adapters.BrowserSupport.audio,
	input: NETVISION.adapters.BrowserSupport.input,
	svg: NETVISION.adapters.BrowserSupport.svg,
	smil: NETVISION.adapters.BrowserSupport.smil,
	svgclippaths: NETVISION.adapters.BrowserSupport.svgclippaths,
	background: NETVISION.adapters.BrowserSupport.background,
	backgroundColor: NETVISION.adapters.BrowserSupport.backgroundColor,
	canPlayType: NETVISION.adapters.BrowserSupport.canPlayType,
	localstorage: NETVISION.adapters.BrowserSupport.localstorage,
	sessionstorage: NETVISION.adapters.BrowserSupport.sessionstorage,
	applicationcache: NETVISION.adapters.BrowserSupport.applicationcache,
	webworkers: NETVISION.adapters.BrowserSupport.webworkers,
	hashchange: NETVISION.adapters.BrowserSupport.haschange,
	crosswindowmessaging: NETVISION.adapters.BrowserSupport.crosswindowmessaging,
	historymanagement: NETVISION.adapters.BrowserSupport.historymanagement,
	draganddrop: NETVISION.adapters.BrowserSupport.draganddrop,
	websqldatabase: NETVISION.adapters.BrowserSupport.websqldatabase,
	indexedDB: NETVISION.adapters.BrowserSupport.indexedDB,
	websockets: NETVISION.adapters.BrowserSupport.websockets
};NETVISION.ui.UIComponent = new Class({
	initialized: false,
	element: null,
	
	initialize: function(element,properties) {
		this.element = $(element);
		
		if(!this.element) {
			this.element = new Element(element,properties);
		} else {
			this.element.setProperties(properties);
		}
		
		var e = this.element;
		
		for(var key in e) {
			var type = null;
			try {
				type = $type(e[key]);
			} catch(ex) {}
			
			if(type === "function" && !this[key]) {
				try {
					this[key] = e[key].bind(e);
				} catch(exc) {}
			}
		}
	},
	
	initializeChildren: function(){},
	
	childrenInitialized: function(){},
	
	initializationComplete: function() {
		this.initialized = true;
	},
	
	addChild: function(child) {
		this.grab(child.element);
		child.initializeChildren();
		child.childrenInitialized();
		child.initializationComplete();
		child.fireEvent('added');
		
		return this;
	},
	
	disable: function() {
		this.element.disabled = true;
	},
	
	enable: function() {
		this.element.disabled = false;
	},
	
	isDisabled: function() {
		return this.element.disabled;
	},
	
	isEnabled: function() {
		return !this.element.disabled;
	}
});NETVISION.validation.Validator = new Class({
	
	_pattern: null,

	_tempPattern: null,
	
	_allowEmpty: null,
	
	_allowedCharacters: null,
	
	
	// CONSTRUCTOR
	
	initialize: function(allowEmpty) {
		this._allowEmpty = ($defined(allowEmpty)) ? allowEmpty : false;
		
		this._allowedCharacters = /.+/;

		this._setPattern();
	},
	
	
	// PUBLIC METHODS

	validate: function(value) {
		var result = value.toString().search(this._pattern);
		
		return {
			valid: (-1 !== result),
			message: (-1 !== result) ? "" : NETVISION.validation.Validator.ERROR_ILLEGAL_CHARACTERS
		};
	},
	
	validateTemp: function(value) {
		var result = value.toString().search(this._tempPattern);
		
		return {
			valid: (-1 !== result),
			message: (-1 !== result) ? "" : NETVISION.validation.Validator.ERROR_ILLEGAL_CHARACTERS
		};
	},
	
	validateCharacter: function(character) {
		switch(character) {
			case 'multiply':
				character = '*';
				break;
			case 'add':
				character = '+';
				break;
			case 'subtract':
				character = '-';
				break;
			case 'divide':
			case 'forwardSlash':
				character = '/';
				break;
			case 'semiColon':
				character = ';';
				break;
			case 'equalSign':
				character = '=';
				break;
			case 'comma':
				character = ',';
				break;
			case 'dash':
				character = '-';
				break;
			case 'period':
			case 'decimalPoint':
				character = '.';
				break;
			case 'singleQuote':
				character = '\'';
				break;
		}
		
		var result = character.toString().search(this._allowedCharacters);
		
		return (-1 !== result);
	},
	
	// "PRIVATE" METHODS
	
	_setPattern: function() {
		if(true === this._allowEmpty) {
			this._pattern	  = /^.?/g;
			this._tempPattern = /^.?/g;
		} else {
			this._pattern	  = /^.+$/g;
			this._tempPattern = /^.+$/g;
		}
	},
	
	
	// GETTER AND SETTER
	getPattern: function() {
		return this._pattern;
	},
	
	setPattern: function(pattern) {
		this._pattern = pattern;
	},

	getTempPattern: function() {
		return this._tempPattern;
	},
	
	setTempPattern: function(pattern) {
		this._tempPattern = pattern;
	},
	
	getAllowedCharacters: function() {
		return this._allowedCharacters;
	},
	
	setAllowedCharacters: function(characters) {
		this._allowedCharacters = characters;
	}
});
NETVISION.validation.Validator.ERROR_ILLEGAL_CHARACTERS = 'Illegal characters found';
NETVISION.validation.Validator.ERROR_LESS_THAN_MIN_VALUE = 'Value is less than minimal value';
NETVISION.validation.Validator.ERROR_LESS_THAN_MIN_LENGTH = 'Value is shorter than minimal length';
NETVISION.validation.Validator.ERROR_GREATER_THAN_MAX_VALUE = 'Value is greater than maximum value';
NETVISION.validation.Validator.ERROR_GREATER_THAN_MAX_LENGTH = 'Value is longer than maximum length';
NETVISION.validation.Validator.SUCCESS = 'Value is valid';
NETVISION.validation.CurrencyValidator = new Class({
	Extends: NETVISION.validation.Validator,
	
	_format: null,
	
	// CONSTRUCTOR
	
	initialize: function(allowEmpty, format) {
		this.parent(allowEmpty);
		
		this._format = ($defined(format)) ? format : 'SWISS';
		
		this._setAllowedCharacters();
		
		this._setPattern();
	},
	
	
	// PUBLIC METHODS
	
	validate: function(value) {
		value = value.trim();
		
		return this.parent(value);
	},
	
	validateTemp: function(value) {
		value = value.trim();
		
		return this.parent(value);
	},
	
	
	// "PROTECTED" METHODS
	
	_setAllowedCharacters: function() {
		switch(this._format) {
			case 'SWISS':
				this._allowedCharacters = /[0-9\.]+/;
				break;
			case 'GERMAN':
				this._allowedCharacters = /[0-9\,]+/;
				break;
		}
	},
	
	_setPattern: function() {
		if(true === this._allowEmpty) {
			switch(this._format) {
				case 'SWISS':
					this._pattern	  = /^$|^(([0-9]+(\.{1}[0-9]{2})?)|([0-9]{1,3}(\'){1}){1}([0-9]{3}(\')?){1,}(\.{1}[0-9]{2})?)$/g;
					this._tempPattern = /^$|^\d+\.?\d{0,2}$/g;
					break;
				case 'GERMAN':
					this._pattern	  = /^$|^(([0-9]+(\,{1}[0-9]{2})?)|([0-9]{1,3}(\.){1}){1}([0-9]{3}(\.)?){1,}(\,{1}[0-9]{2})?)$/g;
					this._tempPattern = /^$|^\d+\,?\d{0,2}$/g;
					break;
			}
		} else {
			switch(this._format) {
				case 'SWISS':
					this._pattern	  = /^([0-9]{1,3}(\')?)+(\.){0,1}[0-9]{2}$/g;
					this._tempPattern = /^\d+\.?\d{0,2}$/g;
					break;
				case 'GERMAN':
					this._pattern	  = /^$|^(([0-9]+(\,{1}[0-9]{2})?)|([0-9]{1,3}(\.){1}){1}([0-9]{3}(\.)?){1,}(\,{1}[0-9]{2})?)$/g;
					this._tempPattern = /^\d+\,?\d{0,2}$/g;
					break;
			}
		}
	}
});NETVISION.validation.DateValidator = new Class({
	Extends: NETVISION.validation.Validator,
	
	_format: null,
	
	
	// CONSTRUCTOR
	
	initialize: function(allowEmpty,format) {
		this.parent(allowEmpty);
		
		this._format = ($defined(format)) ? format : 'YYYY-mm-dd';
		
		this._setAllowedCharacters();
		
		this._setPattern();
	},
	
	
	// "PUBLIC" METHODS
	
	
	
	// "PROTECTED" METHODS
	_setAllowedCharacters: function() {
		switch(this._format) {
			case 'YYYY-mm-dd':
				this._allowedCharacters = /[0-9\-]+/;
				break;
			case 'dd.mm.YYYY':
				this._allowedCharacters = /[0-9\.]+/;
				break;
			default:
				this._allowedCharacters = /[0-9\-]+/;
		}
	},
	
	_setPattern: function() {
		if (true === this._allowEmpty) {
			switch (this._format) {
				case 'YYYY-mm-dd':
					this._pattern	  = /^$|^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/g;
					this._tempPattern = /^$|(^\d{1,4}$)|(^\d{4}\-$)|(^\d{4}\-{1}\d{1,2}$)|(^\d{4}\-{1}\d{2}\-\d{0,2}$)/g;
					break;
				case 'dd.mm.YYYY':
					this._pattern	  = /^$|^[0-9]{2}\.[0-9]{2}\.[0-9]{4}$/g;
					this._tempPattern = /^$|(^\d{1,2}$)|(^\d{2}\.$)|(^\d{2}\.{1}\d{1,2}$)|(^\d{2}\.{1}\d{2}\.\d{0,4}$)/g;
					break;
				default:
					this._pattern	  = /^$|^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/g;
					this._tempPattern = /^$|(^\d{1,4}$)|(^\d{4}\-$)|(^\d{4}\-{1}\d{1,2}$)|(^\d{4}\-{1}\d{2}\-\d{0,2}$)/g;
			}
		} else {
			switch (this._format) {
				case 'YYYY-mm-dd':
					this._pattern	  = /^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/g;
					this._tempPattern = /(^\d{1,4}$)|(^\d{4}\-$)|(^\d{4}\-{1}\d{1,2}$)|(^\d{4}\-{1}\d{2}\-\d{0,2}$)/g;
					break;
				case 'dd.mm.YYYY':
					this._pattern	  = /^[0-9]{2}\.[0-9]{2}\.[0-9]{4}$/g;
					this._tempPattern = /(^\d{1,2}$)|(^\d{2}\.$)|(^\d{2}\.{1}\d{1,2}$)|(^\d{2}\.{1}\d{2}\.\d{0,4}$)/g;
					break;
				default:
					this._pattern	  = /^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/g;
					this._tempPattern = /(^\d{1,4}$)|(^\d{4}\-$)|(^\d{4}\-{1}\d{1,2}$)|(^\d{4}\-{1}\d{2}\-\d{0,2}$)/g;
			}
		}
	}
});NETVISION.validation.TextValidator = new Class({
	Extends: NETVISION.validation.Validator,
	
	_minLength: null,
	
	_maxLength: null,

	// CONSTRUCTOR
	
	initialize: function(allowEmpty,minLength,maxLength) {
		this.parent(allowEmpty);
		
		this._minLength = $defined(minLength) ? parseInt(minLength,10) : null;
		this._maxLength = $defined(maxLength) ? parseInt(maxLength,10) : null;
	},
	
	
	// PUBLIC METHODS
	
	validate: function(value) {
		var validation = this.parent(value.trim());
		
		if(false === validation.valid) {
			return validation;
		}
		
		return this._validateRange(value.trim());
	},
	
	validateTemp: function(value) {
		var validation = this.parent(value.trim());
		
		if(false === validation.valid) {
			return validation;
		}
		
		if(0 === value.trim().length) {
			return {
				valid: true,
				message: NETVISION.validation.Validator.SUCCESS
			}
		}
		
		return this._validateRange(value.trim());
	},
	
	
	// "PROTECTED" METHODS
	
	_validateRange: function(value) {
		if(null !== this._minLength && value.toString().length < this._minLength) {
			return {
				valid: false,
				message: NETVISION.validation.Validator.ERROR_LESS_THAN_MIN_LENGTH
			};
		}
		
		if(null !== this._maxLength && value.toString().length > this._maxLength) {
			return {
				valid: false,
				message: NETVISION.validation.Validator.ERROR_GREATER_THAN_MAX_LENGTH
			};
		}
		
		return {
			valid: true,
			message: NETVISION.validation.Validator.SUCCESS
		};
	}
});NETVISION.validation.EmailValidator = new Class({
	Extends: NETVISION.validation.TextValidator,
	
	
	// CONSTRUCTOR
	
	initialize: function(allowEmpty,minLength,maxLength) {
		this.parent(allowEmpty,minLength,maxLength);
		
		this._allowedCharacters = /[\d\w@\'\.]+/;
	},
	
	
	// PUBLIC METHODS
	
	
	
	
	// "PROTECTED" METHODS
	
	_setPattern: function() {
		if(true === this._allowEmpty) {
			this._tempPattern = /^$|^[\w\d]{1}$|^[\w\d\-\.\']+[\w\d\_\'\.]+@?([\w\d\-]+\.{1}){0,}((\w){0,9}\.?)?(\w){0,9}$/gi;
			this._pattern = /^$|^[\w\d\_\'\.\-öäüß]+@([\w\d\-öäüß]+\.{1})+(\w){0,9}$/gi
		} else {
			this._tempPattern = /^[\w\d]{1}$|^[\w\d\-\.\']+[\w\d\_\'\.]+@?([\w\d\-]+\.{1}){0,}((\w){0,9}\.?)?(\w){0,9}$/gi;
			this._pattern = /^[\w\d\_\'\.\-öäüß]+@([\w\d\-öäüß]+\.{1})+(\w){0,9}$/gi
		}
		
	}
	
	
	// GETTER AND SETTER
	
	
});NETVISION.validation.NumberValidator = new Class({
	Extends: NETVISION.validation.Validator,

	_allowNegative: null,
	
	_minLength: null,
	
	_maxLength: null,
	
	_minValue: null,
		
	_maxValue: null,
	
	// CONSTRUCTOR
	
	initialize: function(allowEmpty, minLength, maxLength, minValue, maxValue, allowNegative) {
		this.parent(allowEmpty, minLength, maxLength);
		
		this._allowNegative = allowNegative || false;
		
		this._minLength = $defined(minLength) ? parseInt(minLength,10) : null;
		this._maxLength = $defined(maxLength) ? parseInt(maxLength,10) : null;
		
		if($defined(minValue)) {
			if(false === this._allowNegative && minValue < 0) {
				this._minValue = 0.0;
			} else {
				this._minValue = minValue;
			}
		} else {
			this._minValue = null;
		}
		
		if($defined(maxValue)) {
			this._maxValue = maxValue;
		} else {
			//this._maxValue = Number.MAX_VALUE;
			this._maxValue = null;
		}
		
		this._allowedCharacters = /[0-9\.]+/;
		
		this._setPattern();
	},
	
	
	// PUBLIC METHODS
	
	validate: function(value) {
		var validation = this.parent(value);
		
		if(false === validation.valid) {
			return validation;
		}
		
		return this._validateRange(value);
 	},
	
	validateTemp: function(value) {
		var validation = this.parent(value);
		
		if(false === validation.valid) {
			return validation;
		}
		
		if(0 === value.trim().length) {
			return {
				valid: true,
				message: NETVISION.validation.Validator.SUCCESS
			}
		}
		
		return this._validateRange(value);
 	},
	
	// "PRIVATE" METHODS
	
	_setPattern: function() {
		if(true === this._allowEmpty) {
			this._pattern	  = /^$|^[0-9',\.]+$/g;
			this._tempPattern = /^$|^[0-9',\.]+$/g;
		} else {
			this._pattern	  = /^[0-9',\.]+$/g;
			this._tempPattern = /^[0-9',\.]+$/g;
		}
	},
	
	_validateRange: function(value) {
		if(null !== this._minValue && value < this._minValue) {
			return {
				valid: false,
				message: NETVISION.validation.Validator.ERROR_LESS_THAN_MIN_VALUE
			};
		}
		
		if(null !== this._maxValue && value > this._maxValue) {
			return {
				valid: false,
				message: NETVISION.validation.Validator.ERROR_GREATER_THAN_MAX_VALUE
			};
		}
		
		if(null !== this._minLength && value.toString().length < this._minLength) {
			return {
				valid: false,
				message: NETVISION.validation.Validator.ERROR_LESS_THAN_MIN_LENGTH
			};
		}
		
		if(null !== this._maxLength && value.toString().length > this._maxLength) {
			return {
				valid: false,
				message: NETVISION.validation.Validator.ERROR_GREATER_THAN_MAX_LENGTH
			};
		}
		
		return {
			valid: true,
			message: NETVISION.validation.Validator.SUCCESS
		};
	}
});NETVISION.validation.IntegerValidator = new Class({
	Extends: NETVISION.validation.NumberValidator,
	
	// CONSTRUCTOR
	
	initialize: function(allowEmpty,minLength,maxLength,minValue,maxValue,allowNegative) {
		if($defined(minValue)) {
			minValue = parseInt(minValue,10);
		} else {
			if($defined(allowNegative) && true === allowNegative) {
				minValue = Number.NEGATIVE_INFINITY;
			} else {
				minValue = 0;
			}
		}
		
		if($defined(maxValue)) {
			maxValue = parseInt(maxValue,10);
		} else {
			maxValue = null;
		}
		
		this.parent(allowEmpty,parseInt(minLength,10),parseInt(maxLength,10),minValue,maxValue,allowNegative);
		
		this._allowedCharacters = /[0-9]+/;
		
		this._setPattern();
	},
	
	
	// PUBLIC METHODS
	
	
	
	// "PRIVATE" METHODS
	
	_setPattern: function() {
		if(true === this._allowEmpty) {
			this._pattern = /^$|^[0-9]+$/g;
		} else {
			this._pattern = /^[0-9]+$/g;
		}
		
		this._tempPattern = /^$|^[0-9]+$/g;
	}
});NETVISION.validation.FloatValidator = new Class({
	Extends: NETVISION.validation.NumberValidator,
	

	// CONSTRUCTOR
	
	initialize: function(allowEmpty,minLength,maxLength,minValue,maxValue,allowNegative) {
		if($defined(minValue)) {
			minValue = parseFloat(minValue);
		} else {
			if($defined(allowNegative) && true === allowNegative) {
				minValue = Number.NEGATIVE_INFINITY;
			} else {
				minValue = 0;
			}
		}
		
		if($defined(maxValue)) {
			maxValue = parseFloat(maxValue);
		} else {
			maxValue = null;
		}
		
		this.parent(allowEmpty,parseInt(minLength,10),parseInt(maxLength,10),minValue,maxValue,allowNegative);
		
		this._setPattern();
	},
	
	// PUBLIC METHODS
	
	
	// "PRIVATE" METHODS
	
	_setPattern: function() {
		if(true === this._allowEmpty) {
			this._pattern = /^$|^[0-9]{0,}(\.){0,1}[0-9]{0,}$/g;
		} else {
			this._pattern = /^[0-9]{0,}(\.){0,1}[0-9]{0,}$/g;
		}
		
		this._tempPattern = this._pattern;
	},
	
	_validateRange: function(value) {
		if((value.lastIndexOf('.') === value.length-1 || -1 === value.lastIndexOf('.')) && parseInt(this._minValue) >= parseInt(value)) {
			return {
				valid: true,
				message: NETVISION.validation.Validator.SUCCESS
			};
		}
		
		if(null !== this._minValue && value < this._minValue) {
			return {
				valid: false,
				message: NETVISION.validation.Validator.ERROR_LESS_THAN_MIN_VALUE
			};
		}
		
		if(null !== this._maxValue && value > this._maxValue) {
			return {
				valid: false,
				message: NETVISION.validation.Validator.ERROR_GREATER_THAN_MAX_VALUE
			};
		}
		
		if(null !== this._minLength && value.toString().length < this._minLength) {
			return {
				valid: false,
				message: NETVISION.validation.Validator.ERROR_LESS_THAN_MIN_LENGTH
			};
		}
		
		if(null !== this._maxLength && value.toString().length > this._maxLength) {
			return {
				valid: false,
				message: NETVISION.validation.Validator.ERROR_GREATER_THAN_MAX_LENGTH
			};
		}
		
		return {
			valid: true,
			message: NETVISION.validation.Validator.SUCCESS
		};
	}
});NETVISION.form.Form = new Class({
	Extends: NETVISION.ui.UIComponent,
	
	_components: [],
	
	initialize: function(el) {
		this.parent(el);
	},
	
	
	// PUBLIC METHODS
	
	addComponent: function(comp) {
		this._components.push(comp);
	},
	
	validate: function() {
		var invalid = [];
		var validation = null;
		this._components.each(function(field){
			
			if(field.isEnabled()) {
				var validation = field.validate();
				if(false === validation.valid) {
					invalid.push(field);
				}
			}
		}.bind(this));
		
		return {
			valid: (0 === invalid.length),
			invalidFields : invalid
		};
	},
	
	
	// GETTER AND SETTER
	
	getComponents: function() {
		return this._components;
	},
	
	setComponents: function(components) {
		this._components = components;
	},
	
	getComponent: function(id) {
		var c = null;
		this._components.each(function(comp){
			if(comp.element.id === id) {
				f = comp;
				return;
			}
		}.bind(this));
		return c;
	}
});NETVISION.form.components.FormComponent = new Class({
	Extends: NETVISION.ui.UIComponent,
	
	_required: null,
	
	
	// CONSTRUCTOR
	
	initialize: function(el,config) {
		this.parent(el);
		this._required = ($defined(config) && $defined(config.required)) ? config.required : true;
	},
	
	
	// GETTER AND SETTER
	
	isRequired: function() {
		return this._required;
	},
	
	setRequired: function(required) {
		this._required = required;
	},
	
	isDisabled: function() {
		var disabled = this.parent();
		
		if(disabled || "none" === this.element.getStyle("display")) {
			return true;
		}
		
		return false;
	},
	
	isEnabled: function() {
		var enabled = this.parent();
		if(enabled && "none" !== this.element.getStyle("display")) {
			return true;
		}
		
		
		return false;
	}
});
NETVISION.form.components.FormComponent.ERROR_COMPONENT_REQUIRED = "This component is required";NETVISION.form.components.Field = new Class({
	Extends: NETVISION.form.components.FormComponent,
	
	_validator: null,
	
	_cutOnTypeError: null,
	
	_validateOnChange: null,
	
	_validateOnBlur: null,
	
	_validateOnSubmit: null,
	
	_minLength: null,
	
	_maxLength: null,
	
	_validation: null,
	
	
	// CONSTRUCTOR
	
	initialize: function(el,config) {
		this.parent(el,config);
		
		this._cutOnTypeError   = ($defined(config) && $defined(config.cutOnTypeError)) ? config.cutOnTypeError : true;
		this._validateOnChange = ($defined(config) && $defined(config.validateOnChange)) ? config.validateOnChange : true;
		this._validateOnBlur   = ($defined(config) && $defined(config.validateOnBlur)) ? config.validateOnBlur : true;
		this._validateOnSubmit = ($defined(config) && $defined(config.validateOnSubmit)) ? config.validateOnSubmit : false;
		this._minLength		   = ($defined(config) && $defined(config.minLength)) ? parseInt(config.minLength,10) : null;
		this._maxLength		   = ($defined(config) && $defined(config.maxLength)) ? parseInt(config.maxLength,10) : null;
	},

	// PUBLIC METHODS
	disable: function() {
		this.element.setStyle('disabled',true);
	},
	
	enable: function() {
		this.element.setStyle('disabled',false);
	},
	
	clear: function() {
		this.element.set('value','');
		
		if(true === this._required) {
			this.renderInvalid(NETVISION.form.components.Field.ERROR_FIELD_REQUIRED);
		}
	},
	
	validate: function() {
		this._validation = this._validator.validate(this.element.value);
		
		if(true === this._validation.valid) {
			this.renderValid();
		} else {
			this.renderInvalid();
		}
		
		return this._validation;
	},

	cutValue: function() {
		this.element.value = this.element.value.substr(0,this.element.value.length-1);
	},
	
	renderValid: function() {
		this.element.removeClass("NETVISION__fieldInvalid");
	},
	
	renderInvalid: function(message) {
		this.element.addClass("NETVISION__fieldInvalid");
	},
		
	
	// "PROTECTED" METHODS
	
	_registerValidator: function() {
		var self = this;
		var validation = null;
		var characterValid = false;
		var tempValue = null;
		
		if (true === this._validateOnChange) {
			// checking whether the character is one of the allowed characters
			this.element.addEvent('keydown',function(e){
				var tempValue = self.element.value;
				
				switch(e.key) {
					case 'shift':
					case 'esc':
					case 'backspace':
					case 'delete':
					case 'enter':
					case 'tab':
					case 'up':
					case 'right':
					case 'down':
					case 'left':
						characterValid = true;
						break;
					default:
						characterValid = self._validator.validateCharacter(e.key);
				}
				
				self.element.removeEvents("keyup");
				
				if (true === characterValid) {
					// character is valid, so let's check the entire field value
					self.element.addEvent("keyup", function(e){
						validation = self._validator.validateTemp(self.element.value);
						if (false === validation.valid) {
							if (true === self._cutOnTypeError) {
								self.element.value = tempValue;
							}
						}
						else {
							self.renderValid();
						}
					});
				} else {
					// character is not allowed - restore original value
					self.element.addEvent("keyup",function(e){
						self.element.value = tempValue;
					});
				}
			});
		}
		
		if(true === this._validateOnBlur) {
			this.element.addEvent("blur",function(e) {
				validation = self._validator.validate(self.element.value);
				if(false === validation.valid) {
					self.renderInvalid(validation.message);
				}
			});
		}
	},
	
	// GETTERS AND SETTERS
	
	getValidator: function() {
		return this._validator;
	},
	
	setValidator: function(validator) {
		this._validator = validator;
	},
	
	cutOnTypeError: function() {
		return this._cutOnTypeError;
	},
	
	setCutOnTypeError: function(cut) {
		this._cutOnTypeError = cut;
	},
	
	validateOnChange: function() {
		return this._validateOnChange;
	},
	
	setValidateOnChange: function(validate) {
		this._validateOnChange = validate;
	},
	
	validateOnBlur: function() {
		return this._validateOnBlur;
	},
	
	setValidateOnBlur: function(validate) {
		this._validateOnBlur = validate;
	},
	
	validateOnSubmit: function() {
		return this._validateOnBlur;
	},
	
	setValidateOnSubmit: function(validate) {
		this._validateOnSubmit = validate;
	},
	
	getMinLength: function() {
		return this._minLength;
	},
	
	setMinLength: function(minLength) {
		this._minLength = minLength;
	},
	
	getMaxLength: function() {
		return this._minLength;
	},
	
	setMaxLength: function(maxLength) {
		this._maxLength = maxLength;
	},
	
	getValue: function() {
		return this.element.get("value");
	},
	
	setValue: function(value) {
		this.element.set("value",value.toString().trim());
		this.validate();
	},
	
	getValidation: function() {
		return this._validation;
	},
	
	isValid: function() {
		return this._validation.valid;
	},
	
	getTitle: function() {
		return this.element.get("title");
	}
});
NETVISION.form.components.Field.ERROR_FIELD_REQUIRED = 'This field is required';
NETVISION.form.components.CurrencyField = new Class({
	Extends: NETVISION.form.components.Field,
	
	_format: null,
	
	_decPoint: null,
	
	_thousandsSeparator: null,
	
	_parseOnInit: null,
	
	
	// CONSTRUCTOR
	
	initialize: function(el,config) {
		this.parent(el,config);
		
		this._format = ($defined(config) && $defined(config.format)) ? config.format : 'SWISS';
		this._parseOnInit = ($defined(config) && $defined(config.parseOnInit)) ? config.parseOnInit : true;
		
		switch(this._format) {
			case 'SWISS':
				this._decPoint = '.';
				this._thousandsSeparator = '\'';
				break;
			case 'GERMAN':
				this._decPoint = ',';
				this._thousandsSeparator = '.';
				break;
			default:
				this._decPoint = '.';
				this._thousandsSeparator = '\'';
		}
		
		this._validator = new NETVISION.validation.CurrencyValidator(!this._required,this._format);
		
		this._registerValidator();
		
		if(true === this._parseOnInit) {
			this._parseValue();
		}

		this.element.addEvent("blur",function() {
			this.formatValueToCurrency();
		}.bind(this));
		
		
		/*
this.element.addEvent("focus",function() {
			this.formatValueToFloat();
		}.bind(this));
*/
		

	},
	
	
	// PUBLIC METHODS
	
	formatValueToCurrency: function() {
		var num,str;
		num = this.element.get("value").currencyStringToNumber(this._decPoint,this._thousandsSeparator);
		str = num.toCurrencyString(2,this._decPoint,this._thousandsSeparator);
		this.element.set("value",str);
	},
	
	formatValueToFloat: function() {
		if(0 === this.element.get("value").length) {
			return;
		}
		
		num = this.element.get("value").currencyStringToNumber(this._decPoint,this._thousandsSeparator);
		
		this.element.set("value",num);
	},
	
	
	// "PROTECTED" METHODS
	
	_parseValue: function() {
		var value = this.element.value;
		// no value in field
		if(0 === value.length) {
			if(true === this.required) {
				this.setValue('0'+this._decPoint+'00');
			}
			return;
		}
		
		// value is already formatted as currency
		if(-1 !== value.lastIndexOf(this._decPoint)
			&& true === this._validator.validate(value).valid) {
			return;
		}
		
		value = value.toFloat();
		value = value.toCurrencyString(2,this._decPoint,this._thousandsSeparator);
		this.setValue(value);
	},
	
	
	// GETTER AND SETTER
	
	getFormat: function() {
		return this._format;
	},
	
	setFormat: function(format) {
		this._format = format;
	}
});
NETVISION.form.components.DateField = new Class({
	Extends: NETVISION.form.components.Field,
	
	_format: null,
	
	initialize: function(el,config) {
		this.parent(el,config);
		
		this._format = ($defined(config) && $defined(config.format)) ? config.format : 'YYYY-mm-dd';
		
		this._validator = new NETVISION.validation.DateValidator(!this._required,this._format);
		
		this._registerValidator();
	}
});NETVISION.form.components.TextField = new Class({
	
	Extends: NETVISION.form.components.Field,
	
	initialize: function(el,config) {
		this.parent(el,config);
		
		this._validator = new NETVISION.validation.TextValidator(
							!this._required,
							this._minLength,
							this._maxLength
						  );
						  
		this._registerValidator();
	}
});NETVISION.form.components.EmailField = new Class({
	Extends: NETVISION.form.components.TextField,
	
	initialize: function(el,config) {
		this.parent(el,config);
		
		this._validator = new NETVISION.validation.EmailValidator(
			!this._required,
			this._minLength,
			this._maxLength
		);
		
		this._registerValidator();
	}
});
NETVISION.form.components.NumberField = new Class({
	Extends: NETVISION.form.components.Field,
	
	_minValue: null,
	
	_maxValue: null,
	
	initialize: function(el,config) {
		this.parent(el,config);
	}
});NETVISION.form.components.IntegerField = new Class({
	Extends: NETVISION.form.components.NumberField,
	
	initialize: function(el,config) {
		this.parent(el,config);
		
		this._minValue	  = ($defined(config) && $defined(config.minValue)) ? parseInt(config.minValue,10) : null;
		this._maxValue	  = ($defined(config) && $defined(config.maxValue)) ? parseInt(config.maxValue,10) : null;
		var allowNegative = ($defined(config) && $defined(config.allowNegative)) ? config.allowNegative : true;
		
		this._validator = new NETVISION.validation.IntegerValidator(
			!this.required,
			this._minLength,
			this._maxLength,
			this._minValue,
			this._maxValue,
			allowNegative
		);
		
		this._registerValidator();
	}
});NETVISION.form.components.FloatField = new Class({
	Extends: NETVISION.form.components.NumberField,
	
	initialize: function(el,config) {
		this.parent(el);
		
		var minValue	  = ($defined(config) && $defined(config.minValue)) ? parseFloat(config.minValue) : null;
		var maxValue	  = ($defined(config) && $defined(config.maxValue)) ? parseFloat(config.maxValue) : null;
		var allowNegative = ($defined(config) && $defined(config.allowNegative)) ? config.allowNegative : true;
		
		this._validator = new NETVISION.validation.FloatValidator(
			!this._required,
			this._minLength,
			this._maxLength,
			minValue,
			maxValue,
			allowNegative
		);
		
		this._registerValidator();
	}
});NETVISION.ui.navigation.Navigation = new Class({
	Extends: NETVISION.ui.UIComponent,
	
	_navigationItems: [],
	
	
	// CONSTRUCTOR
	
	initialize: function(el) {
		this.parent(el);
	},
	
	
	// PUBLIC METHODS
	


	
	// "PROTECTED" METHODS
	
	
	
	// ACCESSORS AND MUTATORS
	
	getNavigationItems: function() {
		return this._navigationItems;
	},
	
	setNavigationItems: function(items) {
		this._navigationItems = items;
	}
});NETVISION.ui.navigation.NavigationItem = new Class({
	Extends: NETVISION.ui.UIComponent,
	
	_link: null,
	
	
	// CONSTRUCTOR
	
	initialize: function(el,config,link) {
		this.parent(el,config);
		
		this._link = this._retrieveLink(link);
	},
	
	
	// PUBLIC METHODS
	
	toString: function() {
		return this._link;
	},
	
	
	// "PROTECTED" METHODS
	
	_retrieveLink: function(link) {
		var h = "";
		
		if($defined(link) && "string" === $type(link)) {
			h = link.trim();
		} else if($defined(this.element.get("href"))) {
			h = this.element.get("href").trim();
		} else if($defined(this.element.getFirst("a"))) {
			h = this.element.getFirst("a").get("href");
		}
		
		return h;
	},
	
	// ACCESSORS AND MUTATORS
	
	getLink: function() {
		return this._link;
	}
});NETVISION.ui.navigation.NavigationItemDrawer = new Class({
	Extends: NETVISION.ui.UIComponent,
	
	_visible: false,
	
	_navigation: null,
	
	
	// CONSTRUCTOR
	
	initialize: function(el,config,navigation) {
		this.parent(el);
		
		if("object" === $type(navigation)) {
			this._navigation = navigation;
		}
	},
	
	
	// PUBLIC METHODS
	
	show: function() {
		this.element.setStyle("display","block");
		this._visible = true;
	},
	
	hide: function() {this.element.setStyle("display","none");
		this._visible = false;
	},
	
	
	// "PROTECTED" METHODS
	
	
	
	
	// ACCESSORS AND MUTATORS
	
	isVisible: function() {
		return this._visible;
	},
	
	getNavigation: function() {
		return this._navigation;
	},
	
	setNavigation: function(navigation) {
		this._navigation = navigation;
	}
});NETVISION.ui.navigation.NavigationItemTweenDrawer = new Class({
	Extends: NETVISION.ui.navigation.NavigationItemDrawer,
	
	_size: null,
	
	_cssProperty: null,
	
	_fx: null,
	
	initialize: function(el,config,navigation,classes) {
		this.parent(el,config,navigation,classes);
		
		this._size		  = this._getSize();
		this._cssProperty = ($defined(config) && "string" === $type(config.cssProperty)) ? config.cssProperty.trim() : 'height';
		this._fx		  = new Fx.Tween(this.element);
	},
	
	show: function() {
		this._fx.start(this._cssProperty,0,this._size.y);
	}.wait(100),
	
	hide: function() {
		this._fx.start(this._cssProperty,this.element.getSize().y,0);
	}.wait(100),
	
	_getSize: function() {
		this.element.setStyle("display","block");
		var size = this.element.getSize();
		this.element.setStyle("display","none");
		this.element.setStyles({
			"height": 0,
			"display": "block"
		});
		return size;
	}
});NETVISION.ui.navigation.NavigationItemWithDrawer = new Class({
	Extends: NETVISION.ui.UIComponent,
	
	_drawer: null,
	
	_delay: 0,
	
	
	// CONSTRUCTOR
	
	initialize: function(el,config,link,drawer) {
		this.parent(el,config,link,drawer);
		
		if($defined(config) && $defined(config.delay)) {
			this._delay = parseInt(config.delay,10);
		}
		
		if("object" === $type(drawer)) {
			this._drawer = drawer;
		}
		
		this._registerHoverEvents();
	},
	
	
	// PUBLIC METHODS
	
	
	
	// "PROTECTED" METHODS
	
	_registerHoverEvents: function() {
		var self = this;
		
		this.element.removeEvents();
		
		if(null === this._drawer) {
			return;
		}
		
		this.element.addEvent('mouseenter',function() {
			if(null !== self._drawer) {
				self._drawer.show();
			}
		});
		
		this.element.addEvent('mouseleave',function() {
			if(null !== self._drawer) {
				self._drawer.hide();
			}
		});
	},
	
	// ACCESSORS AND MUTATORS
	
	getDrawer: function() {
		return this._drawer;
	},
	
	setDrawer: function(drawer) {
		this._drawer = drawer;
	}
	
});NETVISION.components.RoundedCornerImage = function() {
	this.Extends = NETVISION.ui.UIComponent;
	
	this.cornersStyles = null;
	this.shadowStyles  = null;
	this.image		   = null;
	
	this.initialize = function(el,properties,styles) {
		this.parent(el,properties);
		
		this.cornersStyles = $defined(styles.corners) ? styles.corners : null;
		this.shadowStyles  = this.createShadowStyles(styles.shadow);
		
		if("IMG" === this.element.tagName) {
			this.wrapImageInDiv();
		}
		
		if($defined(this.cornersStyles)) {
			this.applyCornersStyles();
		}
		
		if($defined(this.shadowStyles)) {
			this.applyShadowStyles();
		}
	};
	
	this.wrapImageInDiv = function() {
		var div = new Element("div",{
			id: this.element.id,
			width: this.element.getSize().x,
			height: this.element.getSize().y,
			html: "&nbsp;"
		});
		
		div.addClass(this.element.get("class"));
		
		div.setStyles(this.element.getStyles("width","height","float","position")); 
		
		div.setStyles({
			"font-size": "0px",
			"line-height": "0px",
			"background-image": "url("+this.element.get("src")+")",
			"background-position": "top left",
			"background-repeat": "no-repeat"
		});
		
		div.cloneEvents(this.element,null);
		
		div.inject(this.element,"after");
		this.image = this.element.dispose();
		this.element = new NETVISION.ui.UIComponent(div);
	};
	
	this.applyCornersStyles = function() {
		this.element.setStyles({
			"-moz-border-radius": this.cornersStyles.radius+"px",
			"-webkit-border-radius": this.cornersStyles.radius+"px",
			"-khtml-border-radius": this.cornersStyles.radius+"px",
			"border-radius": this.cornersStyles.radius+"px",
			"behavior": "url(/js/border-radius.htc)"
		});
	};
	
	this.applyShadowStyles = function() {
		this.element.setStyles({
			"box-shadow": this.shadowStyles.toString(),
			"-moz-box-shadow": this.shadowStyles.toString(),
			"-webkit-box-shadow": this.shadowStyles.toString()
		});
	};
	
	this.createShadowStyles = function(styles) {
		if(!$defined(styles)) {
			return null;
		}
		
		return {
			horizontalOffset: styles.horizontalOffset || 0,
			verticalOffset: styles.verticalOffset || 0,
			blur: styles.blur || 5,
			color: styles.color || "#000",
			toString: function() {
				return this.horizontalOffset+"px "+this.verticalOffset+"px "+this.blur+"px "+this.color; 
			}
		};
	};
};

NETVISION.components.RoundedCornerImage = new Class(new NETVISION.components.RoundedCornerImage());

NETVISION.components.RoundedCornerImage.parse = function(selector,styles) {
	$$(selector).each(function(el){
		el = new NETVISION.components.RoundedCornerImage(el,null,styles);
	});
};
