window.onerror = function () { return false; };
/************************************
 * JPure JavaScript Framework		*
 ************************************
 * Copyright: Robert Engelhardt		*
 * Email: engelhardt@more-style.de	*
 * Version: 1.2				*
 ************************************/


var JPure = {

	Version : '1.2',

	Load : function () {

		/********************************
		 * Load Moduls					*
		 ********************************/

		var offset = null;
		var script = document.getElementsByTagName('script');

		for (var x = 0; x < script.length; ++x) {

			if ((offset = script[x].src.indexOf('JPure.js?')) > -1) {

				var path   = script[x].src.substr(0, offset);
				var moduls = script[x].src.split('?')[1].split(',')

				for (var y = 0; y < moduls.length; ++y) {

					var head  = document.getElementsByTagName('head')[0];
					var modul = document.createElement('script');

					with (modul) {

						src  = path + moduls[y] + '/' + moduls[y] + '.js';
						type = 'text/javascript';

					} head.appendChild(modul);
				
				} break;
			}
		}


		/********************************
		 * Core Function Class			*
		 ********************************/

		window.Class = function(name, properties) {

			if (this[name] == null) {

				if (properties[name] != null && properties[name] instanceof Function) {
				
					this[name] = properties[name];
				
				} else this[name] = function() {};
				
				this[name].prototype = {

					Set : function (property, value) {

						if (!(this[property] instanceof Function)) {

							this[property] = value;
						}

						return this[property];
					},

					Get : function (property) {

						return this[property];
					},

					Unset : function () {

						for (var x = 0; x < arguments.length; ++x) {

							
							if ((this[arguments[x]] instanceof Function) && !this.MethodExists(x)) {

								delete this[arguments[x]];
								
							} else delete this[arguments[x]];
						}
					},
					
					MethodExists : function (method) {
						
						for (var x = 0; x < this.Methods.length; ++x) {
						
							if (this.Methods[x] == method) {
							
								return true;	
							}	
							
						} return false;
					}
					
				}; this[name].prototype.Methods = ['Set', 'Get', 'Unset', 'MethodExists'];

				if (properties instanceof Object) {

					for (var x in properties) {

						if (this[name].prototype[x] == null) {

							if (name != x) {

								this[name].prototype[x] = properties[x];
							}
							
							if ((properties[x] instanceof Function)) {
							
								this[name].prototype.Methods[this[name].prototype.Methods.length] = x;
							}
						}
					}

				} return true;

			} else {

				window.Extends(this[name].prototype, {

					Set : function (property, value) {

						if (!(this[property] instanceof Function)) {

							this[property] = value;
						}

						return this[property];
					},

					Get : function (property) {

						return this[property];
					},

					Unset : function () {

						for (var x = 0; x < arguments.length; ++x) {

							if ((this[arguments[x]] instanceof Function) && !this.MethodExists(x)) {

								delete this[arguments[x]];
								
							} else delete this[arguments[x]];
						}
					},
					
					MethodExists : function (method) {
						
						for (var x = 0; x < this.Methods.length; ++x) {
						
							if (this.Methods[x] == method) {
							
								return true;	
							}	
							
						} return false;
					}

				}); this[name].prototype.Methods = ['Set', 'Get', 'Unset', 'MethodExists'];
				
				return window.Extends(this[name].prototype, properties);
			}
		};



		/********************************
		 * Core Function Objects		*
		 ********************************/

		window.Objects = function(name, properties) {

			if (this[name] == null) {

				this[name] = {
					
					Set : function (property, value) {

						if (!(this[property] instanceof Function)) {

							this[property] = value;
						}

						return this[property];
					},

					Get : function (property) {

						return this[property];
					},

					Unset : function () {

						for (var x = 0; x < arguments.length; ++x) {

							if ((this[arguments[x]] instanceof Function) && !this.MethodExists(x)) {

								delete this[arguments[x]];
								
							} else delete this[arguments[x]];
						}
					},
					
					MethodExists : function (method) {
						
						for (var x = 0; x < this.Methods.length; ++x) {
						
							if (this.Methods[x] == method) {
							
								return true;	
							}	
							
						} return false;
					}
					
				}; this[name]['Methods'] = ['Set', 'Get', 'Unset', 'MethodExists'];

				if (properties instanceof Object) {

					for (var x in properties) {

						if (this[name][x] == null) {

							if (this[name][x] instanceof Function) {
							
								this[name]['Methods'][this[name]['Methods'].length] = x;
								
							} this[name][x] = properties[x];
						}
					}

				} return true;

			} else {

				window.Extends(eval(name), {

					Set : function (property, value) {

						if (!(this[property] instanceof Function)) {

							this[property] = value;
						}

						return this[property];
					},

					Get : function (property) {

						return this[property];
					},

					Unset : function () {

						for (var x = 0; x < arguments.length; ++x) {

							if ((this[arguments[x]] instanceof Function) && !this.MethodExists(x)) {

								delete this[arguments[x]];
								
							} else delete this[arguments[x]];
						}
					},
					
					MethodExists : function (method) {
						
						for (var x = 0; x < this.Methods.length; ++x) {
						
							if (this.Methods[x] == method) {
							
								return true;	
							}	
							
						} return false;
					}

				});  this[name]['Methods'] = ['Set', 'Get', 'Unset', 'MethodExists'];
				
				return window.Extends(eval(name), properties);
			}
		};



		/********************************
		 * Core Function Extends		*
		 ********************************/

		window.Extends = function (object, properties, restriction) {

			if (object != null) {

				for (var x in properties) {

					if (restriction instanceof Array) {

						for (var y = 0; y < restriction.length; ++y) {

							if (x == restriction[y] && object[x] == null) {

								if (object['Methods'] != null && (properties[x] instanceof Function)) {
								
									object['Methods'][object['Methods'].length] = x;
										
								} object[x] = properties[x];
							}
						}

					} else {

						if (object['Methods'] != null && (properties[x] instanceof Function)) {
								
							object['Methods'][object['Methods'].length] = x;
										
						} object[x] = properties[x];
					}

				} return true;

			} return false;
		};
	}

}; JPure.Load();

Extends (window, {

	Typeof : function (object) {

		if (object == null)
			return 'null';

		if (typeof object == 'undefined')
			return 'undefined';

		if (object.nodeName && object.nodeType == 1)
			return 'element';

		if (object.nodeName && object.nodeType == 3 && (!/\S/).test(object.nodeValue))
			return 'textnode';

		if (object instanceof Function)
			return 'function';

		if (object instanceof Array)
			return 'array';

		if (typeof object == 'object')
			return 'object';

		if (typeof object == 'number' && isFinite(obj))
			return 'number';

		if (typeof object == 'string')
			return 'string';

		if (typeof object == 'boolean')
			return 'boolean';
	},

	Empty : function (value) {

		return (value == '' || value == null || value == false || value == '0' || value == 0) ? true : false;
	},

	Isset : function (variable) {

		return (this[variable] == null) ? false : true;
	},
	
	Time : function () {
		
		return new Date().getTime();
	},

	SetEvent : function (event, eventFunction, before) {

		switch ((event = event.toLowerCase())) {

			case 'onload' :
			case 'onunload' :
			case 'onbeforeunload' :
			case 'onbeforeprint':
			case 'onafterprint' :
			case 'ondragdrop':
			case 'onclose':
			case 'onabort' :
			case 'onerror' :
			case 'onresize' :
			case 'onblur' :
			case 'onscroll' :
			case 'onfocus' :

				var store = window[event];

				if (!Empty(store)) {

					window[event] = function () {

						if (before == null) {
							store();
							eventFunction();
						} else {
							eventFunction();
							store();
						}
					};

				} else window[event] = eventFunction;

				return true;

			break;

			default :

				if (Typeof(document[event]) != 'undefined') {

					var store = document[event];

					if (!Empty(store)) {

						document[event] = function () {

							if (before == null) {
								store();
								eventFunction();
							} else {
								eventFunction();
								store();
							}
						};

					} else document[event] = eventFunction;

				} return true;

			break;

		} return false;
	},

	EnabledFlash : function () {

		if (navigator.mimeTypes.length > 0) {

			return navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin != null;

		} else if (window.ActiveXObject) {

			try {

				return Typeof(new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) == 'object';

			} catch (e) { return false; }

		} return false;
	},

	Body : function () {

		return (document.compatMode && document.compatMode != 'BackCompat') ? document.documentElement : ((document.body) ? document.body : null);
	},
	
	Display : function (Value, Top, Left) {

		if (document.getElementById('JPure_Window_Display')) {

			window.document.body.removeChild(document.getElementById('JPure_Window_Display'));
		}

		if (Value != '') {

			var Box = document.createElement('Div');

			with (Box) {

				style.cursor 		= 'pointer';
				style.border 		= '1px solid #666';
				style.backgroundColor 	= '#FFF';
				style.padding		= '6px';
				style.zIndex		= '999999';
				style.position		= 'absolute';
				style.left  		= (Left || '0') + 'px';
				style.top   		= (Top || '0') + 'px';

				id 			= 'JPure_Window_Display';
				innerHTML 		= Value;
			}
			
			Box.ondblclick = function () {

				window.document.body.removeChild(document.getElementById(this.id));
			
			}; document.body.appendChild(Box);

			with (document.getElementById('JPure_Window_Display')) {

				style.width = (offsetWidth > 800) ? '800px' : 'auto';
			}
		}
	}
});

Extends (Array.prototype, {

	Search : function (needle) {

		var x = -1;

		while (x < this.length - 1) {

			if (this[++x] == needle) {

				return x;
			}

		} return false;
	},

	Indexof : function (needle) {

		var x = 0;

		while (this.length > x) {

			if (this[++x].indexOf(needle) > -1) {

				return x;
			}

		} return false;
	},

	Push : function () {

		for (var x = 0; x < arguments.length; ++x) {

			if (this.push instanceof Function) {

				this.push(arguments[x]);

			} else this[this.length] = arguments[x];

		} return this;
	},

	MultiConact : function () {

		var array = this;

		for (var x = 0; x < arguments.length; ++x) {

			if (arguments[x] instanceof Array) {

				array = array.concat(arguments[x]);
			}

		} return array;
	},
	
	Unique : function () {
		
		var Temp = Output = [];
		
		for (var x = 0; x < this.length; ++x) {
		
			Temp[this[x] + '___unique'] = this[x];
		}
		
		for (var x in Temp) {
		
			if (x.match(/___unique/)) {
			
				Output[Output.length] = Temp[x];
			}
			
		} return Output;
	}
});

Objects ('Mouse', {

	X : function (e) {

		var body = (document.compatMode && document.compatMode != 'BackCompat') ? document.documentElement : ((document.body) ? document.body : null);

		if(typeof body.scrollLeft == 'number' || window.opera != null) {

			if (window.event) {

				if (!event.x) {

					return event.clientX;

				} else {

					if(event.clientY > event.screenY) {

						return body.scrollLeft + event.screenX;

					} else return body.scrollLeft + event.clientX;
				}

			} else return body.scrollLeft + e.clientX;

		} else return window.pageXOffset + e.clientX;

	},

	Y : function (e) {

		var body = (document.compatMode && document.compatMode != 'BackCompat') ? document.documentElement : ((document.body) ? document.body : null);

		if(typeof body.scrollTop == 'number' || window.opera != null) {

			if (window.event) {

				if (!event.y) {

					return event.clientY;

				} else {

					if(event.clientY > event.screenY) {

						return body.scrollTop + event.screenY;

					} else return body.scrollTop + event.clientY;
				}

			} else return body.scrollTop + e.clientY;

		} else return window.pageYOffset + e.clientY;
	}
});

Objects ('Element', {

	IsElement : function (element) {

		return (element != null && element.tagName != null && element.nodeType == 1) ? true : false;
	},

	Nodes : function (element, asArray) {

		if (asArray) {

			asArray = [];
			element = Element.Find(element);

			for (var x = 0; x < element.childNodes.length; ++x) {

				if (element.childNodes[x].tagName != null) {

					asArray[asArray.length] = element.childNodes[x];
				}

			} return asArray;

		} return Element.Find(element).childNodes.length;
	},

	Chain : function (element) {

		if ((element = Element.Find(element)) != null) {

			var chain = [];

			while (element.tagName != null) {

				chain[chain.length] = element.tagName.toLowerCase() + ((element.id != '') ? '[' + element.id + ']' : '');

				element = element.parentNode;

			} return chain.reverse().join('.');

		} return false;
	},

	Find : function () {

		if (arguments.length > 1) {

			var elements = [];

			for (var x = 0; x < arguments.length; ++x) {

				if (typeof arguments[x] == 'string') {

					elements[elements.length] = document.getElementById(arguments[x]);

				} else if (arguments[x] != null && Element.IsElement(arguments[x])) {

					elements[elements.length] = arguments[x];
				}

			} return elements;

		} else if(arguments.length == 1) {

			if (typeof arguments[0] == 'string') {

				return document.getElementById(arguments[0]);

			} else if (arguments[0] != null && Element.IsElement(arguments[0])) {

				return arguments[0];
			}

		} return null;
	},
	
	FindLike : function (likeElement, target) {
		
		var target = (target == null) ? document.body : Element.Find(target);
		
		//dev
	},

	FindByTagName : function (tag, target) {
		
		if ((tag = (target ? Element.Find(target) : document).getElementsByTagName(tag)) != null) {

			var elements = [];

			for (var x = 0; x < tag.length; ++x) {

				elements[elements.length] = tag[x];

			} return elements;

		} return [];
	},

	FindByAttribut : function (attribut, value, target){

		if (attribut == null) {

			return false;
		}

		if (Element.$$ == null) {

			if (Element.$ == null) {

				Element.$ = [];
			}

			Element.$$ = function (attribut, value, node) {

				for (var x = 0; x < node.childNodes.length; ++x) {

					if(value == null && node.childNodes[x][attribut] != null
					|| value != null && node.childNodes[x][attribut] == value) {

						Element.$[Element.$.length] = node.childNodes[x];
					}

					if (node.childNodes[x].childNodes.length > 0) {

						Element.$$(attribut, value, node.childNodes[x]);
					}
				}

			}; Element.$$(attribut, value, (target ? Element.Find(target) : document.getElementsByTagName('html')[0]));

			var elements = Element.$;

		} Element.Unset('$', '$$');

		return elements;
	},

	SetSelfOffsetWidth : function (element) {

		if (typeof element == 'string') {

			Element.SetCssProperties(Element.Find(element), {

				width : Element.Find(element).offsetWidth + 'px'

			}); return true;

		} else if (element instanceof Array) {

			for (var x = 0; x < element.length; ++x) {

				Element.SetCssProperties(Element.Find(element[x]), {

					width : Element.Find(element[x]).offsetWidth + 'px'
				});

			} return true;

		} else if (Element.IsElement(element)) {

			Element.SetCssProperties(element, {

				width : element.offsetWidth + 'px'

			}); return true;

		} return false;
	},

	SetCssProperty : function (element, properties) {

		if (typeof element == 'string') {

			for (var x in properties) {

				Element.Find(element).style[x] = properties[x];

			} return true;

		} else if (element instanceof Array) {

			for (var x = 0; x < element.length; ++x) {

				for (var y in properties) {

					Element.Find(element[x]).style[y] = properties[y];
				}

			} return true;

		} else if (Element.IsElement(element)) {

			for (var x in properties) {

				element.style[x] = properties[x];

			} return true;

		} return false;
	},

	GetCssProperty : function (element, property) {

		if ((element = Element.Find(element)) != null) {

			if (window.getComputedStyle) {

				return window.getComputedStyle(element, null).getPropertyValue(property);

			} else if (element.currentStyle) {

				property = property.split('-');

				for (var x = 1; x < property.length; ++x) {

					property[x] = property[x].substr(0, 1).toUpperCase() + property[x].substr(1);

				} return element.currentStyle[property.join('')];
			}

		} return false;
	},

	SetCssClass : function (element, className) {

		if (typeof element == 'string') {

			if ((element = Element.Find(element)) != null) {

				if (element.setAttribute instanceof Function) {

					element.setAttribute('class', className);

				} else element.className = className;

				return true;
			}

		} else if (element instanceof Array) {

			for (var x = 0; x < element.length; ++x) {

				if ((element[x] = Element.Find(element[x])) != null) {

					if (element[x].setAttribute instanceof Function) {

						element[x].setAttribute('class', className);

					} else element[x].className = className;

					return true;
				}
			}

		} else if (Element.IsElement(element)) {

			if (element.setAttribute instanceof Function) {

				element.setAttribute('class', className);

			} else element.className = className;

			return true;

		} return false;
	},

	SetEvent : function (element, event, eventFunction, before) {

		if ((element = Element.Find(element)) != null) {

			switch ((event = event.toLowerCase())) {

				case 'onblur' :
				case 'onfocus' :
				case 'onmouseover' :
				case 'onmouseout' :
				case 'onmousedown' :
				case 'onkeypress' :
				case 'onkeydown' :
				case 'onkeyup' :
				case 'onchange' :
				case 'onsubmit' :
				case 'onclick' :
				case 'onselect' :
				case 'ondblclick' :
				case 'onreset' :

					var store = element[event];

					if (store != null) {

						element[event] = function () {

							if (before == null) {
								store();
								eventFunction();
							} else {
								eventFunction();
								store();
							}
						};

					} else element[event] = eventFunction;

					return true;

				break;
			}

		} return false;
	},

	Fade : function (ElementID, Property, From, To, Steps) {
	
		if (!(ElementID instanceof Array)) {
		
			ElementID = [ElementID];
		}
	
		for (var x = 0; x < ElementID.length; ++x) {
	
			if ((ElementID[x] = Element.Find(ElementID[x]))) {
			
				To   = To.replace(/#/g, '');
				From = From.replace(/#/g, '');
	
				window.clearInterval(ElementID[x].FadeInterval);
				
				ElementID[x].Fade = {
					
					Count	 : 0,
					Steps	 : Steps,
					Element	 : ElementID[x],
					Property : Property,
					StartR	 : parseInt(From.substr(0, 2), 16),
					StartG	 : parseInt(From.substr(2, 2), 16),
					StartB	 : parseInt(From.substr(4, 2), 16),
					EndR	 : parseInt(To.substr(0, 2), 16),
					EndG	 : parseInt(To.substr(2, 2), 16),
					EndB	 : parseInt(To.substr(4, 2), 16),
					StepR	 : Math.abs(parseInt(From.substr(0, 2), 16) - parseInt(To.substr(0, 2), 16)) / Steps,
					StepG	 : Math.abs(parseInt(From.substr(2, 2), 16) - parseInt(To.substr(2, 2), 16)) / Steps,
					StepB	 : Math.abs(parseInt(From.substr(4, 2), 16) - parseInt(To.substr(4, 2), 16)) / Steps,
					EndColor : To,
					Interval : function () {
	
						if (this.Count < this.Steps) {
							
							if (this.StartR > this.EndR) {
								var R = Math.floor(this.StartR - (this.StepR * this.Count));
							} else var R = Math.floor(this.StartR + (this.StepR * this.Count));

							if (this.StartG > this.EndG) {
								var G = Math.floor(this.StartG - (this.StepG * this.Count));
							} else var G = Math.floor(this.StartG + (this.StepG * this.Count));
							
							if (this.StartB > this.EndB) {
								var B = Math.floor(this.StartB - (this.StepB * this.Count));
							} else var B = Math.floor(this.StartB + (this.StepB * this.Count));
							
							if (R.toString(16).length == 1) {
								R = R.toString(16) + R.toString(16);
							}
							
							if (G.toString(16).length == 1) {
								G = G.toString(16) + G.toString(16);
							}
							
							if (B.toString(16).length == 1) {
								B = B.toString(16) + B.toString(16);
							}

							this.Element.style[this.Property] = '#' + R.toString(16) + G.toString(16) + B.toString(16);
							this.Count++;
							
						} else {
						
							this.Element.style[this.Property] = '#' + this.EndColor;
							clearInterval(this.Element.FadeInterval);
						}
					}
					
				}; ElementID[x].FadeInterval = window.setInterval('Element.Find("' + ElementID[x].id + '").Fade.Interval()', Steps);
			}
		}
	}
});

Objects ('Formular', {

	Type : function (element, form) {

		return Formular.Find(element, form) ? Formular.Find(element, form).type : 'undefined';
	},

	Length : function () {

		return document.forms.length;
	},

	ElementsLength : function (form) {

		if (document.forms[form] != null) {

			return document.forms[form].elements.length;

		} return null;
	},

	Name : function (number) {

		if (document.forms[number] != null) {

			return document.forms[number].name;

		} return null;
	},

	Elements : function (form) {

		if (document.forms[form] != null) {

			return document.forms[form].elements;

		} return null;
	},

	Reset : function (element, form) {

		if (element instanceof Array) {

			for (var x = 0; x < element.length; ++x) {

				if ((element[x] = Formular.Find(element[x], form)) != null) {

					switch (element[x].type) {

						case 'text' 		:
						case 'hidden' 		: element[x].value = ''; break;
						case 'select-one' 	: Formular.Select.Index(element[x], 0); break;
						case 'checkbox'		:
						case 'radio'		: element[x].checked = false; break;
					}
				}

			} return true;

		} else if (typeof element == 'string') {

			if ((element = Formular.Find(element, form)) != null) {

				switch (element.type) {

					case 'text' 		:
					case 'hidden' 		:
					case 'file' 		: element.value = ''; break;
					case 'select-one' 	: Formular.Select.Index(element, 0); break;
					case 'checkbox'		:
					case 'radio'		: element.checked = false; break;

				} return true;
			}
		}
	},
	
	Submit : function (formular) {
	
		if (typeof formular == 'string') {
		
			document.forms[formular].submit();
		
		} else formular.form.submit();
	},
	
	Disabled : function (element, status) {

		if (element instanceof Array) {

			for (var x = 0; x < element.length; ++x) {

				if ((element[x] = Formular.Find(element[x])) != null) {

					element[x].disabled = status;
				}
			}

		} else if (typeof element == 'string') {

			if ((element = Formular.Find(element)) != null) {

				element.disabled = status;
			}
		}
	},

	Find : function (element, form) {

		if (typeof element == 'string') {

			if (typeof form == 'string' || typeof form == 'number') {

				return (Formular.Elements(form) != null) ? Formular.Elements(form)[element] : null;

			} else {

				for (var x = 0; x < Formular.Length(); ++x) {

					for (var y = 0; y < Formular.ElementsLength(x); ++y) {

						if (Formular.Elements(x)[y].name == element) {

							return Formular.Elements(x)[y];
						}
					}
				}

			} return null;

		} else if (element.tagName != null && element.nodeType == 1) {

			return element;

		} return false;
	},
	
	FindLike : function (needle, form) {
	
		if (typeof needle == 'string') {
		
			var elements = [];
		
			for (var x = 0; x < Formular.Length(); ++x) {

				for (var y = 0; y < Formular.ElementsLength(x); ++y) {

					if (Formular.Elements(x)[y].name.toLowerCase().substring(0, needle.length) == needle.toLowerCase()) {

						elements[elements.length] = Formular.Elements(x)[y];
					}
				}
		
			} return elements;
		}
	},

	FindByAttribut : function (attribut, value, form) {

		var elements = [];

		if (typeof form == 'string' || typeof form == 'number') {

			for (var x = 0, fields = Formular.Elements(form); x < fields.length; ++x) {

				if (value == null && fields[x][attribut] != null
				|| value != null && fields[x][attribut] == value) {

					elements[elements.length] = fields[x];
				}
			}

		} else {

			for (var x = 0; x < Formular.Length(); ++x) {

				for (var y = 0, fields = Formular.Elements(x); y < fields.length; ++y) {

					if (value == null && fields[x][attribut] != null
					|| value != null && fields[x][attribut] == value) {

						elements[elements.length] = fields[x];
					}
				}
			}

		} return elements;
	},

	Value : function (element, form) {

		if ((element = Formular.Find(element, form))) {

			if (element.type.indexOf('select') > -1) {

				return (element.selectedIndex > -1) ? element.options[element.selectedIndex].value : null;

			} else return element.value;

		} return null;
	},

	SetEvent : function (element, event, eventFunction) {

		if ((element = Formular.Find(element)) != null) {

			switch ((event = event.toLowerCase())) {

				case 'onblur' :
				case 'onfocus' :
				case 'onmouseover' :
				case 'onmouseout' :
				case 'onmousedown' :
				case 'onkeypress' :
				case 'onkeydown' :
				case 'onkeyup' :
				case 'onchange' :
				case 'onsubmit' :
				case 'onclick' :
				case 'onselect' :
				case 'ondblclick' :
				case 'onreset' :

					var store = element[event];

					if (store != null) {

						element[event] = function () {

							store();
							eventFunction();
						};

					} else element[event] = eventFunction;

					return true;

				break;
			}

		} return false;
	},

	Restrict : function (element, restrict) {

		if (typeof element == 'string') {

			element = [Formular.Find(element)];

		} else if (element instanceof Array) {

			element = element;

		} else if (element.tagName != null && element.nodeType == 1) {

			var element = [element];
		}

		for (var x = 0; x < element.length; ++x) {

			if (typeof element[x] == 'string') {

				element[x] = Formular.Find(element[x]);
			}

			if (window.opera) {

				element[x].restrict = restrict;

				Formular.SetEvent(element[x], 'onkeydown', function (e) {

					if (this.restrict.indexOf(String.fromCharCode((e.charCode) ? e.charCode : e.which)) == -1) {

						return false;
					}

				}); return true;

			} else {

				element[x].restrict = restrict;

				Formular.SetEvent(element[x], 'onkeypress', function () {

					if (this.eventKeyP != null) {

							this.eventKeyP();
					}

					if (this.restrict.indexOf(String.fromCharCode(event.keyCode)) == -1) {

						this.value = eval("this.value.replace(/" + ((String('/()?[]+*\\').indexOf(String.fromCharCode(event.keyCode)) > -1) ? "\\" : "") + String.fromCharCode(event.keyCode) + "/, '')");

						return false;
					}
				});

				Formular.SetEvent(element[x], 'onkeyup', function () {

					for (var x = 0, char = this.value.split(''); x < this.value.length; ++x) {

						if (this.restrict.indexOf(char[x]) == -1) {

							this.value = eval("this.value.replace(/" + char[x] + "/, '')");
						}
					}

				}); return true;
			}
		}
	},

	WidthToSize : function (element, width) {

		if ((element = Formular.Find(element)) != null) {

			if (element.style.width != 'auto') {

				element.style.width = 'auto';
			}

			while (element.offsetWidth < width) {

				element.size += 1;

			} element.size -= 1;

		} return false;
	}

});

Extends (Formular.Select = {}, {

	Length : function (element, form) {

		return Formular.Find(element, form) ? Formular.Find(element, form).options.length : null;
	},

	Current : function (element, form) {

		return Formular.Find(element, form) ? Formular.Find(element, form).selectedIndex : null;
	},

	Value : function (element, form, position) {

		return Formular.Find(element, form) ? Formular.Find(element, form).options[position || Formular.Select.Current(element, form)].value : null;
	},

	Add : function (element, text, value, position) {

		var options = null;

		if ((options = Formular.Select.ToArray(element)) != null) {

			if (position != null) {

				if (position < 0) position = 0;
				if (position > options.length) position = options.length;

			} else position = options.length;

			element = Formular.Select.Options(element);
			options = options.slice(0, position).concat([{text : text, value : value}]).concat(options.slice(position, options.length));

			for (var x = 0; x < options.length; ++x) {

				if (element[x] != null) {

					element[x].text  = options[x]['text'];
					element[x].value = options[x]['value'];

				} else {

					element[x] = new Option(options[x]['text'], options[x]['value']);
				}

			} return true;
		}
	},

	Remove : function (element, position) {

		var options = null;

		if ((options = Formular.Select.ToArray(element)) != null) {

			if (position < 0) position = 0;

			options = options.slice(0, position).concat(

				options.slice(position + 1, options.length)

			); Formular.Select.Clear(element);

			for (var x = 0; x < options.length; ++x) {

				Formular.Select.Add(element, options[x]['text'], options[x]['value']);

			} return true;

		} return false;
	},

	Options : function (element, form) {

		if ((element = Formular.Find(element, form)) != null) {

			return element.options;

		} return null;
	},

	ToArray : function (element, form) {

		var options = [];

		if ((element = Formular.Select.Options(element, form)) != null) {

			for (var x = 0; x < element.length; ++x) {

				options[options.length] = {

					text  : element[x].text,
					value : element[x].value
				};

			} return options;

		} return false;
	},

	Selected : function (element, position) {

		if ((element = Formular.Select.Options(element)) != null) {

			if (typeof position == 'number') {

				return element[position].selected = true;

			} else if (position instanceof Array) {

				for (var x = 0; x < position.length; ++x) {

					element[position[x]].selected = true;

				} return true;
				
			} else if (typeof position == 'string') {

				for (var x = 0; x < element.length; ++x) {

					if (element[x].value == position) {
					
						element[x].selected = true;
					}

				} return true;
			}

		} return false;
	},

	Index : function (element, offset) {

		if (element instanceof Array) {

			for (var x = 0; x < element.length; ++x) {

				if ((element[x] = Formular.Find(element[x])) != null) {

					element[x].selectedIndex = offset;
				}

			} return true;

		} else {

			if ((element = Formular.Find(element)) != null) {

				return element.selectedIndex = offset;
			}
		}
	},

	Search : function (element, needle) {

		if ((element = Formular.Select.Options(element)) != null) {

			for (var x = 0; x < element.length; ++x) {

				if (element[x].value == needle) {

					return x;
				}

			} return false;

		} return null;
	},

	Clear : function (element, form) {

		if (!(element instanceof Array)) {
			
			element = [element];
		}

		for (var x = 0; x < element.length; ++x) {

			if ((element[x] = Formular.Select.Options(element[x], form)) != null) {
	
				for (var y = element[x].length; y >= 0; --y) {
	
					element[x][y] = null;
				}
			}
			
		} return true;
	}
});

Extends (String.prototype, {

	Search : function (needle) {

		if (needle == '') {

			return false;

		} return (this.toLowerCase().indexOf(needle.toLowerCase()) < 0) ? false : true;
	},

	LeftFill : function (value, length) {

		var current = this;

		while (current.length < length) {

			current = value + current;

		} return current;
	},

	RightFill : function (value, length) {

		var current = this;

		while (current.length < length) {

			current += value;

		} return current;
	},

	BothFill : function (value, length) {

		var current = this;

		while (current.length < length) {

			if (Math.ceil(length / 2) < current.length) {

				current = value + current;

			} else current += value;

		} return current;
	},

	CharCount : function () {

		return this.replace(/\W+/, '').length;
	},

	WordCount : function () {

		return this.replace(/\W/, '').split(' ').length;
	},

	UpperCaseFirst : function () {

		return this.substr(0, 1).toUpperCase() + this.substr(1, this.length);
	},
	
	StripTags : function () {
	
		var string = this;
		
		if (arguments.length > 0) {
	
			for (var x = 0; x < arguments.length; ++x) {

				string = eval("string.replace(/< ?" + arguments[x] + "([^>]+)>/gi, '')");
				string = eval("string.replace(/<" + arguments[x] + ">/gi, '')");
				string = eval("string.replace(/<\\/" + arguments[x] + ">/gi, '')");
				string = string.replace(/\s\s+/gi, ' ');
				
			} return string;
			
		} else return string.replace(/<(.*?)>/gi, '');
	}
});

Extends (Number.prototype, {

	Dec2Hex : function () {

		return (this.toString(16).length == 1) ? '0' +  this.toString(16) : this.toString(16);
	}
});

Extends (Math, {

	EaseOutQuart : function (t, b, c, d) {
		/*
		 * Easing Equations v1.5
		 * easeOutQuart
		 * (c) Robert Penner. 
		 */
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	
	Round : function (Int, Digits) {
	
		return (Math.round(Int * Math.pow(10, Digits)) / Math.pow(10, Digits));
	}
});

Objects ('Browser', {

	Name : function () {

		if (window.opera && navigator.userAgent.indexOf('Opera') > -1)
			return 'Opera';

		else if (navigator.userAgent.indexOf('MSIE') > -1)
			return 'Internet Explorer';

		else if (navigator.userAgent.indexOf('Firefox') > -1)
			return 'Firefox';

		else if (navigator.userAgent.indexOf('Netscape') > -1)
			return 'Netscape';

		else if (navigator.userAgent.indexOf('Gecko') > -1)
			return 'Mozilla';

		else if (navigator.userAgent.indexOf('OmniWeb') > -1)
			return 'OmniWeb';

		else if (navigator.vendor.indexOf('Apple') > -1)
			return 'Safari';

		else if (navigator.vendor.indexOf('iCab') > -1)
			return 'iCab';

		else if (navigator.vendor.indexOf('KDE') > -1)
			return 'Konqueror';

		else if (navigator.vendor.indexOf('Camino') > -1)
			return 'Camino';
	},

	Version : function () {

		if (Browser.Name() == 'Opera') {

			var agent = navigator.userAgent.split(' ');

			return (isNaN(agent[agent.length - 1])) ? agent[agent.length - 3] : agent[agent.length - 1];

		} else if (Browser.Name() == 'Internet Explorer') {

			return navigator.userAgent.split('; ')[1].split(' ')[1];

		} else if (Browser.Name() == 'Firefox') {

			var agent = navigator.userAgent.split(' ');

			return agent[agent.length - 1].split('/')[1];

		} else if (Browser.Name() == 'Netscape') {

			var agent = navigator.userAgent.split('/');

			return (agent[agent.length - 1].indexOf(' ') > -1) ? agent[agent.length - 1].split(' ')[0] : agent[agent.length - 1];

		} else if (Browser.Name() == 'Mozilla') {

			var agent = navigator.userAgent.split(' ')[7];

			return agent.substring(0, String(agent).length - 1).split(':')[1];

		} else if (Browser.Name() == 'OmniWeb') {

			var agent = navigator.userAgent.split(' ');

			return agent[agent.length - 1].split('/')[1];
		}
	}
});

Class ('Ajax', {

	Ajax : function () {

		this.Data 		= null;
		this.AjaxFrameName 	= 'ajaxFrame';
		this.ProxyUrl 		= 'scripts/JPure/Ajax/Proxy.php?';
	},
	
	Send : function (url, method, type, proxy) {

		this.Set('Data', null);

		var self   	= this;
		var request 	= false;

		if (type != 'text' && type != 'xml') {

			type = 'text';
		}

		if (proxy) {

			url = this.Get('ProxyUrl') + ((type == 'text') ? 'text:' : 'xml:') + escape(url);
		}

		if (window.XMLHttpRequest) {

			request = new XMLHttpRequest();

		} else if (window.ActiveXObject) {

			try  {

				request = new ActiveXObject("Msxml2.XMLHTTP");

			} catch (e) {

				try {

					request = new ActiveXObject("Microsoft.XMLHTTP");

				} catch(e) { }
			}

		}

		if (typeof request == 'object') {
			
			request.onreadystatechange = function () {

				if (request.readyState == 4) {

					if (request.status < 400) {

						if (type == 'xml') {

							self.XMLParse(request.responseXML);

						} else if (type == 'text') {

							self.Data = {text : request.responseText};
						}

					} else return false;
				}
			};

			if(method.toLowerCase() == "post") {

				request.open("POST", url, true);
				request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				request.send(null);

			} else {

				request.open("GET", url, true);
				request.send(null);
			}

		} else if (document.createElement instanceof Function) {

			if (document.getElementById(this.ajaxFrameName)) {

				window.document.body.removeChild(document.getElementById(this.ajaxFrameName));
			}

			var iFrame = document.createElement('IFRAME');

			with (iFrame) {

				style.width 		= '1px';
				style.height 		= '1px';
				style.border 		= 'none';
				style.position		= 'absolute';
				style.left		= '0px';
				style.top		= '0px';
				style.visibility	= 'hidden';

				src			= url;
				id			= this.AjaxFrameName;
				name			= this.AjaxFrameName;
				frameborder		= '0';
			}

			document.body.appendChild(iFrame);

			window.clearInterval(this.ajaxFrameTimeout);
			window.onFrameLoad = {

				count 			: 0,
				tries 			: 100,
				self 			: this,
				type 			: type,
				ajaxFrameName 		: this.AjaxFrameName,

				status : function () {

					if (window.parent[this.ajaxFrameName]) {

						if (window.parent[this.ajaxFrameName].document.childNodes.length != null) {

							if (this.type == 'xml') {

								this.self.XMLParse(window.parent[this.ajaxFrameName].document.firstChild.parentNode);

							} else if (this.type == 'text') {

								this.self.Data = {text : window.parent[this.ajaxFrameName].document.innerHTML};
							}

							this.count = this.tries;
						}
					}

					if ((++this.count) > this.tries) {

						with (window) {

							clearInterval(this.self.ajaxFrameTimeout);
							document.body.removeChild(document.getElementById(this.ajaxFrameName));
							onFrameLoad = null;

						} this.self.Unset('ajaxFrameTimeout');
					}
				}
			}

			this.ajaxFrameTimeout = window.setInterval('window.onFrameLoad.status()', 500);
		}

	},

	XMLParse : function (node, xmlObject) {

		if (xmlObject == null) {

			xmlObject = this.Data = {};
		}

		for (var x = 0; x < node.childNodes.length; ++x) {

			if (node.childNodes[x].tagName != null) {

				if (xmlObject[node.childNodes[x].tagName] != null && !(xmlObject[node.childNodes[x].tagName] instanceof Array)) {

					xmlObject[node.childNodes[x].tagName] = [xmlObject[node.childNodes[x].tagName]];
				}

				var nodeValue = (node.childNodes[x].firstChild == null || node.childNodes[x].firstChild.nodeValue == null) ? '' : node.childNodes[x].firstChild.nodeValue;
				    nodeValue = nodeValue.replace(/\s\s+|\r|\n|\t/g, ' ');
				    nodeValue = (nodeValue == ' ') ? '' : nodeValue;

				if (nodeValue != '') {

					if (xmlObject[node.childNodes[x].tagName] instanceof Array) {

						xmlObject[node.childNodes[x].tagName][xmlObject[node.childNodes[x].tagName].length] = nodeValue;

					} else xmlObject[node.childNodes[x].tagName] = nodeValue;

				} else {

					if (xmlObject[node.childNodes[x].tagName] instanceof Array) {

						xmlObject[node.childNodes[x].tagName][xmlObject[node.childNodes[x].tagName].length] = (node.childNodes[x].childNodes.length) ? {} : '';

					} else xmlObject[node.childNodes[x].tagName] = (node.childNodes[x].childNodes.length) ? {} : '';
				}
			}

			if (node.childNodes[x].childNodes.length > 0)
			{

				if (xmlObject[node.childNodes[x].tagName] instanceof Array) {

					this.XMLParse(node.childNodes[x], xmlObject[node.childNodes[x].tagName][xmlObject[node.childNodes[x].tagName].length - 1]);

				} else {
					//alert(node.childNodes[x].tagName + ' - - ' + xmlObject[node.childNodes[x].tagName])
					this.XMLParse(node.childNodes[x], xmlObject[node.childNodes[x].tagName]);
				}
			}
		}
	},

	Call : function(callback) {

		window.clearInterval(this.timeout);
		window.controll = {

			count 		: 0,
			tries 		: 100,
			self 		: this,
			callback 	: callback,
			arguments 	: arguments,

			interval : function () {

				if (this.self.Data != null) {

					for (var x in this.self.Data) {

						if (x != null) {

							window.clearInterval(this.self.timeout);

							if (Function.apply instanceof Function && this.arguments.length > 1) {

								for (var parameter = [], y = 0; y < this.arguments.length; ++y) {

									parameter[parameter.length] = this.arguments[y];
								}

								eval(this.callback).apply(this.callback, parameter.slice(1));

							} else {

								eval(this.callback)();

							} break;

							this.count = this.tries;
						}
					}

					if ((++this.count) > this.tries) {

						with (window) {

							clearInterval(this.self.timeout);
							controll = null;

						} this.self.Unset('timeout');
					}
				}
			}
		};

		this.timeout = window.setInterval("window.controll.interval()", 500);
	}
});

Objects ('File', {

	Info : function (file) {

		return {

			URL 		: document.URL || null,
			Domain 		: document.domain || null,
			Protocol	: document.URL.split('://')[0].toUpperCase() || null,
			MimeType	: document.mimeType || document.contentType || null,
			Charset		: document.charset || document.characterSet || null,
			LastModified	: new Date(document.lastModified).getTime() || null,
			CreatedDate	: new Date(document.fileCreatedDate).getTime() || null,
			FileSize	: document.fileSize || null
		};

	},

	BaseFile : function (url) {

		var parse = ((url != null) ? url.split('/') : document.URL).split('/');

		return parse.slice(-1);
	},

	BaseDir : function (url) {

		var parse = ((url != null) ? url.split('/') : document.URL).split('/');

		return parse.slice(0, -1).join('/') + '/';
	},

	ParseQueryString : function (URL) {
		
		var URI   	= URL || window.location.search;
		var Query 	= URI.split('?')[1] || URI;
		var QueryString = [];
		
		if (Query != '') {
			
			if (Query = Query.split('&')) {
			
				for (var x = 0; x < Query.length; ++x) {
					
					QueryString[Query[x].split('=')[0]] = Query[x].split('=')[1] || null;
				}
			}
			
		} return QueryString;
	}
});

Objects ('Images', {

	Length : function () {

		return document.images.length;
	},

	Find : function (image) {


		if (typeof image == 'string') {

			return eval('document.' + image);

		} else if (image instanceof Array) {

			var images = [];

			for (var x = 0; x < image.length; ++x) {

				if (eval('document.' + image).name == image[x]) {

					images[images.length] = eval('document.' + image);
				}

			} return images.length > 0 ? images : null;

		} else if (image.tagName != null && image.nodeType == 1) {

			return image;

		} return null;
	},

	FindByAttribut : function (attribut, value) {

		if (document.images) {

			var images = [];

			for (var x = 0; x < document.images.length; ++x) {

				if (value == null) {

					if (document.images[x][attribut] != null) {

						images[images.length] = document.images[x];
					}

				} else {

					if (document.images[x][attribut] == value) {

						images[images.length] = document.images[x];
					}
				}

			} return images.length > 0 ? images : null;

		} return false;
	},

	Properties : function (image) {

		if ((image = Images.Find(image)) != null) {

			var img 	= new Image();
				img.src = Images.Find(image).src;

			return {

				src					: img.src,
				width				: img.width,
				height				: img.height,
				fileSize			: img.fileSize || null,
				mimeType			: img.mimeType || null,
				fileCreatedDate		: new Date(img.fileCreatedDate).getTime() || null,
				fileModifiedDate	: new Date(img.fileModifiedDate).getTime() || null
			};
		}
	}

});

window.HTML = function (Element, Index) {
	return new $HTML().Find(Element, Index);
};

window.Class('$HTML', {	

	Length : 0,

	Each : function (Do, Arguments) {

		if (!Function.prototype.apply || !Function.prototype.call) {
		
			switch (true) {
				
				case Arguments && !Function.prototype.apply : 
					var CallFunction = 'apply';
				break;
				case !Arguments && !Function.prototype.call :
					var CallFunction = 'call';
				break;
			}
			
			if (!Function.prototype[CallFunction]) {
			
				Function.prototype[CallFunction] = function (Object, Arguments) {
					
					var A = arguments;
					
					if (Object[this.toString()] = this) {
					
						if (Arguments = A.length == 2 && (typeof A[1] == 'object') && A[1].length ? A[1] : A) {
			
							for (var x = ((typeof A[1] == 'object') && A[1].length ? 0 : 1), Args = []; x < Arguments.length; ++x) {
								
								Args[Args.length] = typeof Arguments[x] == 'string' ? "'" + Arguments[x] + "'" : Arguments[x];
								
							} eval('Object[this.toString()](' + Args.join(',') + ')');
						}
					}
				};
			}
		}
		
		for (var x = 0; x < this.Length; ++x) {

			if (Arguments) {
			
				Do.apply(this[x], Arguments);
				
			} else Do.call(this[x]);
			
		} return this;
	},
	
	Only : function (Index, Element) {

		if (!isNaN(Index) && (Index = parseInt(Index)) < this.Length) {
		
			return Element === true ? this[Index] : new $HTML().Find(this[Index]);
		
		} else return this;
	},

	Find : function (Selector, Target) {

		if (Selector.nodeType == 1 || Selector.style) {

			this[this.Length++] = Selector;
			
		} else {

			var Match = '';

			switch (!!(Target = (Target || document))) {
				
				case !!(Match = /^(\w+)$/.exec(Selector)) : 

					if (Match = Target.getElementsByTagName(Match[1])) {

						for (var x  = 0; x < Match.length; ++x) {

							this[this.Length++] = Match[x];
						}
					}
					
				break; 
				
				case !!(Match = /^#(.*)$/.exec(Selector)) : 

					if (Match = Target.getElementById(Match[1])) {
					
						this[this.Length++] = Match;
					}
					
				break;
				
				case !!(Match = /^\/#(.*)\/$/.exec(Selector)) : 

					Match[0] = Target.all || Target.getElementsByTagName('*');

					for (var x  = 0; x < Match[0].length; ++x) {

						if (eval('/^' + Match[1] + '/').exec(Match[0][x].id)) {
						
							this[this.Length++] = Match[0][x];
						}
					}
					
				break; 
				
				case !!(Match = /^([^\.]+)?\.(\w+)$/.exec(Selector)) : 

					Match[1] = !Match[1] ? (Target.all || Target.getElementsByTagName('*')) : Target.getElementsByTagName(Match[1]);

					if (Match[1]) {
						
						for (var x  = 0; x < Match[1].length; ++x) {
							
							if (Match[1][x].className.indexOf(Match[2]) > -1) {
								
								this[this.Length++] = Match[1][x];
							}
						}
					}
					
				break;
				
				case !!(Match = /^([^\[]+)\[([^=?]+)=?([^\]]+)?\]$/.exec(Selector)) : 
					
					if (Match[1] = (Match[1] == '*' ? (Target.all || Target.getElementsByTagName('*')) : Target.getElementsByTagName(Match[1]))) {

						Match[3] = Match[3] == '' || Match[3] == null ? [] : Match[3].split('|');

						for (var x  = 0; x < Match[1].length; ++x) {
							
							if (Match[3].length > 0) {
								
								for (var y = 0; y < Match[3].length; ++y) {
	
									if (Match[1][x][Match[2]] == Match[3][y]) {
								
										this[this.Length++] = Match[1][x];
									}
								}
								
							} else if (Match[1][x][Match[2]] != '') {

								this[this.Length++] = Match[1][x];
							}
							
						}
						
					}	
				
				break; 
				
				case !!(Match = /^\*$/.exec(Selector)) : 

					if (Match = Target.all || Target.getElementsByTagName('*')) {

						for (var x  = 0; x < Match.length; ++x) {

							this[this.Length++] = Match[x];
						}
					}
					
				break;
				
				case !!(Match = /^([\w+\s\.]+)$/.exec(Selector)) : 
					
					/* DEV
					Match = Match[1].split(' ');
					
					for (var x  = 0; x < Match.length; ++x) { 
						
						HTML(Match[x]);
					}

					if (Match[1] = Target.all || Target.getElementsByTagName('*')) {

						for (var x  = 0; x < Match[1].length; ++x) {

							this[this.Length++] = Match[1][x];
						}
					}
					*/
					
				break;
			}
			
		} return this;
	},
	
	Property : function (Property, Value) {
		
		if (typeof Property == 'string' && typeof Value == 'string') {

			Properties 		= new Object();
			Properties[Property] 	= Value;
			
		} else Properties = Property;

		if (Properties instanceof Object) {
			
			this.Each(function () {

				for (var Name in Properties) {

					this[Name] = Properties[Name];
				}
				
			}); return this;
			
		} else return this[0] ? this[0][Properties] : this;
	},
	
	PropertyToggle : function (Property, From, To) {
	
		this.Each(function () {
		
			if (this.$HTMLPropertyToggleStatus == null) {
				
				this.$HTMLPropertyToggleStatus = true;
				
			} this[Property] = ((this.$HTMLPropertyToggleStatus = !this.$HTMLPropertyToggleStatus) ? From : To);

		}); return this;	
	},
	
	Attribut : function (Property, Value) {
		
		if (typeof Property == 'string' && typeof Value == 'string') {

			Properties 		= new Object();
			Properties[Property] 	= Value;
			
		} else Properties = Property;

		if (Properties instanceof Object) {
			
			this.Each(function () {

				for (var Name in Properties) {

					if (typeof this.setAttribute == 'function' && typeof Properties[Name] == 'string') {
						
						this.setAttribute(Name, Properties[Name]);
						
					} else this[Name] = Properties[Name];
				}
				
			}); return this;
			
		} else return this[0] ? (typeof this[0].getAttribute == 'function' ? this[0].getAttribute(Properties) : this[0][Properties]) : this;
	},
	
	Css : function (Property, Value) {
		
		if (typeof Property == 'string' && !Value) {
			
			if (this[0] == null) return this;
			
			if (window.getComputedStyle) {

				return window.getComputedStyle(this[0], null).getPropertyValue(Property);

			} else if (this[0].currentStyle) {

				Property = Property.split('-');

				for (var x = 1; x < Property.length; ++x) {

					Property[x] = Property[x].substr(0, 1).toUpperCase() + Property[x].substr(1);

				} return this[0].currentStyle[Property.join('')];
			}
			
		} else if (Property instanceof Object) {

			this.Each(function () {
				for (var Name in Property) {
					this.style[Name] = Property[Name];
				}
			});
			
		} else if (typeof Property == 'string' && typeof Value == 'string') {
			
			if (this[0] == null) return this;
				
			this[0].style[Property] = Value;
			
		} return this;
	},
	
	CssClass : function (Class, Add) {

		this.Each(function () {
		
			this.className = (!Add ? Class : this.className + Class);

		}); return this;	
	},
	
	CSSToggle : function (Property, From, To) {
	
		this.Each(function () {
		
			if (this.$HTMLCSSToggleStatus == null) {
				
				this.$HTMLCSSToggleStatus = true;
				
			} this.style[Property] = ((this.$HTMLCSSToggleStatus = !this.$HTMLCSSToggleStatus) ? From : To);

		}); return this;	
	},
	
	IfEvent : function (Event, Do, Overwrite) {

		this.Each(function () {
			
			Event = Event.split('|');
			
			for (var x = 0; x < Event.length; ++x) {
			
				if (!Overwrite) {
					var Current = this['on' + Event[x]];
				}
				
				if (Current != null) {
				
					this['on' + Event[x]] = function () {
						Current(); Do();
					};
					
				} else this['on' + Event[x]] = Do;
			}
			
		}); return this;
	},
	
	GetEvent : function (Event) {
		
		if (!this[0]) return this;
		
		return this[0]['on' + Event];
	},
	
	DisabledEvent : function (Event, Status) {
	
		this.Each(function () {
			
			if (Status) {

				if (typeof this['on' + Event] == 'function') {
				
					if (this['Current_Event_' + Event] == null) {
					
						this['Current_Event_' + Event] = this['on' + Event];
						
					} this['on' + Event]    = null;
				}
				
			} else {

				if (typeof this['Current_Event_' + Event] == 'function') {
				
					this['on' + Event] = function () { 
					
						this['Current_Event_' + Event]();
					};
				}
			}
			
		}); return this;
	},
	
	Html : function (Value, Add) {
	
		if (Value != null) {
		
			this.Each(function () {

				this.innerHTML = (!Add ? Value : this.innerHTML + Value);
				
			}); return this;
			
		} else return this[0] ? this[0].innerHTML : this;
	},
	
	Text : function (Value, Add) {
	
		if (Value != null) {

			this.Each(function () {
			
				if (!Add) {
				
					while (this.firstChild) {
				
						this.removeChild(this.firstChild);
					
					} this.appendChild(document.createTextNode(Value));
					
				} else this.appendChild(document.createTextNode(Value));
				
			}); return this;
			
		} else return this[0] ? this[0].firstChild.nodeValue : this;
	},
	
	Option : function (Text, Value, DefaultSelected, Selected) {
	
		this.Each(function () {
			
			this.options[this.options.length] = new Option(Text, Value, DefaultSelected, Selected);
		
		}); return this;
	},
	
	Options : function () {
		
		var Options = {'Text' : [], 'Value' : []};

		if (this[0].type.indexOf('select') > -1) {
			
			for (var x = 0; x < this[0].options.length; ++x) {

				Options['Text'][Options['Text'].length]   = this[0].options[x].text;
				Options['Value'][Options['Value'].length] = this[0].options[x].value;
			
			} return Options;
			
		} else return this;
	},
	
	SelectedOption : function () {
		
		return this[0] ? this[0].options[this[0].selectedIndex] : this;
	},
	
	SelectAllOptions : function (Status) {
	
		this.Each(function () {
			
			for (var x = 0; x < this.options.length; ++x) {
			
				this.options[x].selected = Status;
			}
		
		}); return this;
	},
	
	DropOption : function (Index) {
		
		if (this[0].type.indexOf('select') > -1) {
		
			this[0].options[Index] = null;
			
		} return this;
	},
	
	Width : function () {

		return this[0] ? parseInt(this[0].offsetWidth) : this;
	},
	
	Height : function () {

		return this[0] ? parseInt(this[0].offsetHeight) : this;
	},
	
	Left : function (CurrentNode) {
		
		if (!this[0]) return this;
		
		if (!CurrentNode) {

			var Current = this[0];
	  		var Value   = Current.offsetLeft;
	  		
	  		while((Current = Current.offsetParent) != null) {
	  		
				Value += Current.offsetLeft;
				
			} return Value;
			
		} else return this[0].offsetLeft;
	},
	
	Top : function (CurrentNode) {
		
		if (!this[0]) return this;
		
		if (!CurrentNode) {
		
			var Current = this[0];
	  		var Value   = Current.offsetTop;
	  		
	  		while((Current = Current.offsetParent) != null) {
	  		
				Value += Current.offsetTop;
				
			} return Value;
			
		} else return this[0].offsetTop;
	},
	
	ParentOffsets : function () {
	
		if (!this[0]) return this;
		
		var Current = this[0].offsetParent;
  		var Values   = {
		  	'x' : Current.offsetLeft,
		  	'y' : Current.offsetTop
		};
  		
  		while((Current = Current.offsetParent) != null) {
  		
			Values['x'] += Current.offsetLeft;
			Values['y'] += Current.offsetTop;
			
		} return Values;
	},
	
	ParentNode : function () {
		
		if (!this[0]) return this;
		
		return new $HTML().Find(this[0].parentNode);
	},
	
	TagName : function () {
		
		if (!this[0]) return this;
		
		return this[0].tagName || null;
	},
	
	Select : function (Value) {
	
		this.Each(function () {
	
			if (this.type.indexOf('select') > -1) {
				
				for (var x = 0; x < this.options.length; ++x) {
				
					if (this.options[x].value == Value) {
					
						this.options[x].selected = true; break;
					}
				}
				
			} else this.select();
			
		}); return this;	
	},
	
	Value : function (Value, Add) {

		if (Value != null) {
		
			this.Each(function () {

				if (typeof(this.value) == 'string') {
					
					Add ? (this.value += Value) : (this.value = Value);
				}
				
			}); return this;
			
		} else {
			
			if (!this[0]) return this;
			
			if (this[0].type.indexOf('select') > -1) {
			
				return this[0].options[this[0].selectedIndex].value;
				
			} else return this[0].value;
		}
	},
	
	Checked : function (Status) {

		if (Status != null) {
		
			this.Each(function () {

				this.checked = Status;
				
			}); return this;
			
		} else return this[0] ? this[0].checked : this;	
	},
	
	Disabled : function (Status) {

		if (Status != null) {
		
			this.Each(function () {

				this.disabled = Status;
				
			}); return this;
			
		} else return this[0] ? this[0].disabled : this;	
	},
	
	Clear : function () {
	
		this.Each(function () {
			
			if (typeof this.type == 'string') {
			
				if (this.type == 'text') {
				
					this.value = '';
					
				} else if (this.type.indexOf('select') > -1) {
	
					for (var x = this.options.length; x >= 0; --x) {
						
						this.options[x] = null;
					}
					
				}
				
			} else if (this.type == null && this.nodeType == 1) {

				this.innerHTML = '';
			}

		}); return this;
	},
	
	Create : function (Tag, Properties, Css) {
		
		if (!this[0]) return this;
		
		if (Tag instanceof Array) {
			
			for (var x = 0; x < Tag.length; ++x) {
			
				var Element = document.createElement(Tag[x]);
		
				HTML(Element).Attribut((Properties && Properties[x] ? Properties[x] : Properties) || {});
				HTML(Element).Css((Css && Css[x] ? Css[x] : Css) || {});
				
				this[0].appendChild(Element);
				
			} return this;
			
		} else {
		
			var Element = document.createElement(Tag);
	
			HTML(Element).Attribut(Properties || {});
			HTML(Element).Css(Css || {});
			
			return new $HTML().Find(this[0].appendChild(Element));
		}
	},
	
	Remove : function (Selector) {
	
		this.Each(function () {

			if (Selector) {
			
				var Elements = new $HTML().Find(Selector);
				
				for (var x = 0; x < Elements.Length; ++x) {
					
					this.removeChild(Elements[x]);
				}

			} else document.body.removeChild(this);
			
		}); return this;
	},
	
	Drag : function (Area) {
		
		if (!this[0]) return this;
		
		Area		= Area || {};
		document.XMouse = document.XMouse || 0;
		document.YMouse = document.YMouse || 0;

		this.Css({
			position : 'absolute',
			left 	 : this.Left() + 'px',
			top  	 : this.Top() + 'px'
		});

		if (document.onmousemove == null) {

			if (document.captureEvents != null) {
				document.captureEvents(Event.MOUSEMOVE || Event.MOUSEUP);
			}

			document.onmousemove = function (Event) {
				
				this.XMouse = document.all ? window.event.clientX : Event.pageX;
				this.YMouse = document.all ? window.event.clientY : Event.pageY;

				if (this.DragElement != null) {

					if ((Area['Left'] && (this.XMouse - this.DragElement['x'] - this.DragElement['DiffX']) >= Area['Left'] || !Area['Left']) 
					&& (Area['Right'] && (this.XMouse - this.DragElement['x'] - this.DragElement['DiffX'] + this.DragElement['Width']) <= Area['Right'] || !Area['Right'])) {
						
						this.DragElement['Element'].style.left = ((this.XMouse - this.DragElement['Offsets']['x']) - this.DragElement['x']) + 'px';
					}
					
					if ((Area['Top'] && (this.YMouse - this.DragElement['y'] - this.DragElement['DiffY']) >= Area['Top'] || !Area['Top']) 
					&& (Area['Bottom'] && (this.YMouse - this.DragElement['y'] - this.DragElement['DiffY'] + this.DragElement['Height']) <= Area['Bottom'] || !Area['Bottom'])) {

						this.DragElement['Element'].style.top  = ((this.YMouse - this.DragElement['Offsets']['y']) - this.DragElement['y']) + 'px';
					}
				}
			};
		}

		if (document.onmouseup == null) {
			
			document.onmouseup = function () {
				if (this.DragElement != null) {
					new $HTML().Find(this.DragElement['Element']).Css({MozUserSelect : '', KhtmlUserSelect : '', userSelect : ''});
					new $HTML().Find(this.DragElement['Element']).Attribut('unselectable', 'off');
					return !(document.DragElement = null);
				}
			}
		}

		this.IfEvent('mousedown', function (Event) {

			new $HTML().Find(this).Css({MozUserSelect : 'none', KhtmlUserSelect : 'none', UserSelect : 'none'});
			new $HTML().Find(this).Attribut('unselectable', 'on');
			document.DragElement = {
				Element : this,
				x	: document.XMouse - new $HTML().Find(this).Left(),
				y	: document.YMouse - new $HTML().Find(this).Top(),
				Width	: new $HTML().Find(this).Width(),
				Height	: new $HTML().Find(this).Height(),
				DiffX	: new $HTML().Find(this).Left(),
				DiffY	: new $HTML().Find(this).Top(),
				Offsets : new $HTML().Find(this).ParentOffsets()
			};
		});

		this.IfEvent('selectstart', function () {
			return false;
		});
	},
	
	Move_Slide : function (x, y, Durantion, MoveFunction, CallBack) {

		if (!this[0]) return this;
		
		var Parent   = HTML(this[0].offsetParent);
		var CurrentX = this[0].offsetLeft + (isNaN(parseInt(Parent.Css('border-left-width'))) ? 0 : parseInt(Parent.Css('border-left-width')));
		var CurrentY = this[0].offsetTop + (isNaN(parseInt(Parent.Css('border-right-width'))) ? 0 : parseInt(Parent.Css('border-right-width')));

		if (CurrentX != x || CurrentY != y) {
		
			this.Css({
				position : 'absolute',
				left 	 : CurrentX + 'px',
				top  	 : CurrentY + 'px'
			});
			
			window.clearInterval(this[0].Interval);
			
			this[0].Move_Slide = {
				
				'Element' 	: this[0],
				'Current_X'	: CurrentX,
				'Current_Y'	: CurrentY,
				'Difference_X' 	: x - CurrentX,
				'Difference_Y' 	: y - CurrentY,
				'MoveFunction'	: MoveFunction || function (t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; },
				'CallBack'	: CallBack,
				'Durantion'  	: Durantion || 20,
				'Count'	   	: 0,
				
				Interval : function () {
	
					if (this.Count < this.Durantion) {
	
						this.Element.style.left = this.MoveFunction(this.Count, this.Current_X, this.Difference_X, this.Durantion) + 'px';
						this.Element.style.top  = this.MoveFunction(this.Count, this.Current_Y, this.Difference_Y, this.Durantion) + 'px';
						
						this.Count++;
						
					} else {
					
						this.Element.style.left = x + 'px';
						this.Element.style.top  = y + 'px';
						
						if (typeof this.CallBack == 'function') {
							
							this.CallBack();
							
						} window.clearInterval(this.Element.Interval);
					}
				}
				
			}; this[0].Interval = window.setInterval('HTML("#' + this[0].id + '")[0].Move_Slide.Interval()', 10);
		}
	},
	
	Opacity : function (Value) {
		
		if (Value == null || Value < 0 || Value > 100) {
			Value = 100;
		}

		this.Each(function () {

			HTML(this).Css({
				'filter' 	: 'alpha(opacity=' + Value + ')',
				'mozOpacity'	: (Value / 100),
				'opacity'	: (Value / 100)
			});
			
		}); return this;
	},
	
	RightClick : function (Element) {

		if (document.captureEvents != null) {
			document.captureEvents(Event.MOUSEDOWN);
		} Element = Element.substr(0, 1) != '#' ? '#' + Element : Element;
		
		this.Each(function () {

			var RightClick = function (Event) {

				var E = (!Event) ? window.event : Event;

				if ((E.type && E.type == 'contextmenu') 
				|| (E.button && E.button == 2) 
				|| (E.which && E.which == 3)) {
				
					var Body = (document.compatMode && document.compatMode != 'BackCompat') ? document.documentElement : ((document.body) ? document.body : null);

					if(typeof Body.scrollLeft == 'number' && typeof Body.scrollTop == 'number' || window.opera != null) {
						if (window.event) {
							if (!event.x && !event.y) {
								var XMouse = event.clientX;
								var YMouse = event.clientY;
							} else {
								if(event.clientY > event.screenY) {
									var XMouse = Body.scrollLeft + event.screenX;
									var YMouse = Body.scrollTop + event.screenY;
								} else {
									var XMouse = Body.scrollLeft + event.clientX;
									var YMouse = Body.scrollTop + event.clientY;
								}
							}
						} else {
							var XMouse = Body.scrollLeft + Event.clientX;
							var YMouse = Body.scrollTop + Event.clientY;
						}
					} else {
						var XMouse = window.pageXOffset + Event.clientX;
						var YMouse = window.pageYOffset + Event.clientY;
					}

					HTML(Element).Css({
					
						'position'	: 'absolute',
						'top' 		: YMouse + 'px',
						'left' 		: (XMouse + 10) + 'px',
						'visibility' 	: 'visible'

					}).Property({'RightClickField' : this.id}); 
					
					return false;
					
				} else HTML(Element).Css({'visibility' : 'hidden'});
				
				HTML(Element).IfEvent('mousedown|contextmenu', function (Event) {
				
					if (!Event) Event = window.event;
					
					if ((Event.type && Event.type == 'contextmenu') 
					|| (Event.button && Event.button == 2) 
					|| (Event.which && Event.which == 3)) {
						return false;
					}	
				
				}).Each(function () {
				
					HTML('A', this).Each(function () {
						HTML(this).IfEvent('click', function () {
							HTML(Element).Css({'visibility' : 'hidden'});	
						});
					});
				
					HTML('option', this).Each(function () {
						if (String(this.label).toLowerCase() == HTML(Element).Property('id').toLowerCase()) {
							HTML(this).IfEvent('click', function () {
								HTML(Element).Css({'visibility' : 'hidden'});	
							});
						}
					});
				});
			};

			HTML(this).IfEvent('mousedown|contextmenu', RightClick);
		});
	}
});

var $Configurator = {

	'XMLHTTPRequest' 	: new Ajax(),
	'DebugMode' 		: false,
	'Images'		: {'LoadingWheel' : 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWnWK/FeqVxj3BJjFBVN1sKsfz9XFmWv6eNKJrSD8NcrH3E+CBV/fwsfDUcRQ+A9j+0ZbvB6YuLcaMV6TlgIudKO'},
	'RequestTo' 		: '/Includes/Content/Ajax/Configurator/Data.php',

	RequestURL : function (URL) {
		
		$Configurator.RequestTo = URL;
	},
	
	DisabledSearch : function (Status) {
		
		HTML('#ConfiguratorButton').Opacity(Status === true ? 40 : 100).DisabledEvent('click', Status);
		HTML('A', HTML('#ConfiguratorButton')[0]).DisabledEvent('click', Status);
	},
	
	LoadingWheel : function (Status) {
		
		HTML('#LoadingStatus').Css({
			'background' : ((Status) ? 'transparent url(' + $Configurator.Images['LoadingWheel'] + ') 94% 0 no-repeat' : 'none')
		});
	},
	
	BuildQueryString : function (First) {

		var QueryString = [];
		
		HTML('*[type=select-one]', HTML('#ConfiguratorFormular')[0]).Each(function () {
		
			if (!Empty(HTML(this).Value())) {
			
				QueryString.Push(this.name + '=' + encodeURIComponent(HTML(this).Value()));	
			}
			
		}); return (First === true ? '?' : '&') + QueryString.join('&');
	},
	
	Result : function (Output, Result) {
	
		if (!(Output instanceof Array)) {
			
			Output = [Output];
		}
	
		for (var x = 0; x < Output.length; ++x) {
			
			HTML('#' + Output[x]).Each(function () {
				
				window.clearInterval(this.Interval);
				
				this.ResultInterval = {
					
					Output 	   : this,
					Result	   : Result,
					Begin	   : parseInt(this.innerHTML),
					Difference : Result - parseInt(this.innerHTML),
					Durantion  : 20,
					Count	   : 0,
					
					Interval  : function () {
					
						if (this.Count < this.Durantion) {
						
							this.Output.innerHTML = Math.floor(Math.EaseOutQuart(this.Count, this.Begin, this.Difference, this.Durantion));
							this.Count++;
							
						} else {
						
							this.Output.innerHTML = this.Result;
							window.clearInterval(this.Output.Interval);
						}
					}
					
				}; this.Interval = window.setInterval('HTML("#' + this.id + '")[0].ResultInterval.Interval()', 10);
			});
		}
	},

	Load : function (QueryString) {
		
		var Query = File.ParseQueryString(QueryString);
	
		$Configurator.LoadingWheel(true);
		$Configurator.DisabledSearch(true);

		HTML('#price').Select(Query['price']);
		HTML('#display').Select(Query['display']);
		HTML('#disc').Select(Query['disc']);
		HTML('#battery').Select(Query['battery']);
		HTML('#memory').Select(Query['memory']);
		HTML('#weight').Select(Query['weight']);
		HTML('#graphic_card').Select(Query['graphic_card']);
		HTML('#manufacturer').Select(Query['manufacturer']);
		
		if (Query['display']) {
		
			HTML('#resolution').Clear().Option('Wird geladen ...', '').Disabled(true);	
		}
		
		if (Query['technologie']) {

			HTML('#technologie').Clear().Option('Wird geladen ...', '').Disabled(true);
			HTML('#processor_speed').Clear().Option('Wird geladen ...', '').Disabled(true);
			HTML('#processor_type').Clear().Option('Wird geladen ...', '').Disabled(true);	
			
		} else HTML('#technologie').Clear().Option('Wird geladen ...', '').Disabled(true);
		
		if (Query['graphic_card']) {
			
			HTML('#graphic_card_memory').Clear().Option('Wird geladen ...', '').Disabled(true);
			HTML('#graphic_card_processor').Clear().Option('Wird geladen ...', '').Disabled(true);
		}

		if (Empty($Configurator.LoadCallback)) {
		
			$Configurator.LoadCallback = function () {
				
				if (!Empty($Configurator.DebugMode)) {
					
					Display(
						'<strong>Generate-Time:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
						'<strong>Url-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
						'<strong>SQL-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query']
					);
				}

				if (Query['display']) {
				
					/* Display resolution */
				
					if (HTML('#resolution').Clear()) {
						
						var Result = $Configurator.XMLHTTPRequest['Data']['result']['resolution']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							HTML('#resolution').Option('alle anzeigen', '').Option('- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								HTML('#resolution').Option(Result[x]['text'], Result[x]['value']);	
							}
							
							HTML('#resolution').Select(Query['resolution']).Disabled(false);
							
						} else HTML('#resolution').Option('Keine vorhanden', '');
					}
				}
				

				/* Technologie */
				
				if (HTML('#technologie').Clear()) {
					
					var Result = $Configurator.XMLHTTPRequest['Data']['result']['technologie'];

					if (!Empty(Result['amd']) || !Empty(Result['intel']) || !Empty(Result['via'])) {
						
						HTML('#technologie').Option('alle anzeigen', '').Option('- -', '');

						if (!Empty(Result['intel'])) {
						
							if (!(Result['intel']['item'] instanceof Array)) {
								
								Result['intel']['item'] = [Result['intel']['item']];
								
							} HTML('#technologie').Option('Intel', '2');
							
							for (var x = 0; x < Result['intel']['item'].length; ++x) {
							
								HTML('#technologie').Option(':: ' + Result['intel']['item'][x]['text'], Result['intel']['item'][x]['value']);	
							}
							
							if (!Empty(Result['amd']) || !Empty(Result['via'])) {
							
								HTML('#technologie').Option('- -', '');
							}
						}

						if (!Empty(Result['amd'])) {
						
							if (!(Result['amd']['item'] instanceof Array)) {
								
								Result['amd']['item'] = [Result['amd']['item']];
								
							} HTML('#technologie').Option('AMD', '1');
							
							for (var x = 0; x < Result['amd']['item'].length; ++x) {
							
								HTML('#technologie').Option(':: ' + Result['amd']['item'][x]['text'], Result['amd']['item'][x]['value']);	
							}
							
							if (!Empty(Result['via'])) {
							
								HTML('#technologie').Option('- -', '');
							}
						}

						if (!Empty(Result['via'])) {
						
							if (!(Result['via']['item'] instanceof Array)) {
								
								Result['via']['item'] = [Result['via']['item']];
								
							} HTML('#technologie').Option('Via', '3');
							
							for (var x = 0; x < Result['via']['item'].length; ++x) {
							
								HTML('#technologie').Option(':: ' + Result['via']['item'][x]['text'], Result['via']['item'][x]['value']);	
							}
						} 
						
						HTML('#technologie').Select(Query['technologie']).Disabled(false);
						
					} else HTML('#technologie').Option('Keine vorhanden', '');
				}
				
				
				if (Query['technologie']) {
				
					/* Processor speed */
					
					if (HTML('#processor_speed').Clear()) {
						
						var Result = $Configurator.XMLHTTPRequest['Data']['result']['processor_speed']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							HTML('#processor_speed').Option('alle anzeigen', '').Option('- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								HTML('#processor_speed').Option(Result[x]['text'], Result[x]['value']);	
							} 
							
							HTML('#processor_speed').Select(Query['processor_speed']).Disabled(false);

						} else HTML('#processor_speed').Option('Keine vorhanden', '');
					}
					
					/* Processor type */
					
					if (HTML('#processor_type').Clear()) {
						
						var Result = $Configurator.XMLHTTPRequest['Data']['result']['processor_type']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							HTML('#processor_type').Option('alle anzeigen', '').Option('- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								HTML('#processor_type').Option(Result[x]['text'], Result[x]['value']);	
							} 
							
							HTML('#processor_type').Select(Query['processor_type']).Disabled(false);
							
						} else HTML('#processor_type').Option('Keine vorhanden', '');
					}
				}
				
				if (Query['graphic_card']) {
				
					/* Graphic card memory */
					
					if (HTML('#graphic_card_memory').Clear()) {
						
						var Result = $Configurator.XMLHTTPRequest['Data']['result']['graphic_card_memory']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							HTML('#graphic_card_memory').Option('alle anzeigen', '').Option('- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								HTML('#graphic_card_memory').Option(Result[x]['text'], Result[x]['value']);	
							} 
							
							HTML('#graphic_card_memory').Select(Query['graphic_card_memory']).Disabled(false);

						} else HTML('#graphic_card_memory').Option('Keine vorhanden', '');
					}
					
					/* Graphic card processor */
					
					if (HTML('#graphic_card_processor').Clear()) {
						
						var Result = $Configurator.XMLHTTPRequest['Data']['result']['graphic_card_processor']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							HTML('#graphic_card_processor').Option('alle anzeigen', '').Option('- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								HTML('#graphic_card_processor').Option(Result[x]['text'], Result[x]['value']);	
							} 
							
							HTML('#graphic_card_processor').Select(Query['graphic_card_processor']).Disabled(false);
							
						} else HTML('#graphic_card_processor').Option('Keine vorhanden', '');
					}
				}

				$Configurator.Result(['Result'], $Configurator.XMLHTTPRequest['Data']['result']['results']);
				$Configurator.LoadCallback = null;
				$Configurator.LoadingWheel(false);
				$Configurator.DisabledSearch($Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);
			};
		}
		
		with ($Configurator.XMLHTTPRequest) {
	
			QueryString = QueryString.split('?')[0] || QueryString;
			QueryString = QueryString.split('&').slice(1, -1).join('&');
			QueryString = QueryString != '' ? '&' + QueryString : QueryString;

			Send($Configurator.RequestTo + '?type=7' + QueryString + '&r=' + Time(), 'GET', 'xml');
			Call('$Configurator.LoadCallback');
		}
	},

	Update : function () {
		
		$Configurator.LoadingWheel(true);
		$Configurator.DisabledSearch(true);
	
		if (Empty($Configurator.UpdateCallback)) {
		
			$Configurator.UpdateCallback = function () {

				if (!Empty($Configurator.DebugMode)) {
					
					Display(
						'<strong>Generate-Time:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
						'<strong>Url-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
						'<strong>SQL-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query']
					);
				}
				
				$Configurator.Result(['Result'], $Configurator.XMLHTTPRequest['Data']['result']['results']);
				$Configurator.UpdateCallback = null;
				$Configurator.LoadingWheel(false);
				$Configurator.DisabledSearch($Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);
			};
		}
		
		with ($Configurator.XMLHTTPRequest) {

			Send($Configurator.RequestTo + '?type=0' + $Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
			Call('$Configurator.UpdateCallback');
		}
	},

	Default : function () {
	
		$Configurator.LoadingWheel(true);
		$Configurator.DisabledSearch(true);
		
		HTML('#resolution').Clear().Option('- -', '').Disabled(true);
		HTML('#technologie').Clear().Option('Wird geladen ...', '').Disabled(true);
		HTML('#processor_speed').Clear().Option('- -', '').Disabled(true);
		HTML('#processor_type').Clear().Option('- -', '').Disabled(true);
		HTML('#graphic_card_memory').Clear().Option('- -', '').Disabled(true);
		HTML('#graphic_card_processor').Clear().Option('- -', '').Disabled(true);

		if (Empty($Configurator.DefaultCallback)) {
		
			$Configurator.DefaultCallback = function () {
				
				if (!Empty($Configurator.DebugMode)) {
					
					Display(
						'<strong>Generate-Time:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
						'<strong>Url-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
						'<strong>SQL-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query']
					);
				}

				/* Technologie */
				
				if (HTML('#technologie').Clear()) {
					
					var Result = $Configurator.XMLHTTPRequest['Data']['result']['technologie'];

					if (!Empty(Result['amd']) || !Empty(Result['intel']) || !Empty(Result['via'])) {
						
						HTML('#technologie').Option('alle anzeigen', '').Option('- -', '');

						if (!Empty(Result['intel'])) {
						
							if (!(Result['intel']['item'] instanceof Array)) {
								
								Result['intel']['item'] = [Result['intel']['item']];
								
							} HTML('#technologie').Option('Intel', '2');
							
							for (var x = 0; x < Result['intel']['item'].length; ++x) {
							
								HTML('#technologie').Option(':: ' + Result['intel']['item'][x]['text'], Result['intel']['item'][x]['value']);	
							}
							
							if (!Empty(Result['amd']) || !Empty(Result['via'])) {
							
								HTML('#technologie').Option('- -', '');
							}
						}

						if (!Empty(Result['amd'])) {
						
							if (!(Result['amd']['item'] instanceof Array)) {
								
								Result['amd']['item'] = [Result['amd']['item']];
								
							} HTML('#technologie').Option('AMD', '1');
							
							for (var x = 0; x < Result['amd']['item'].length; ++x) {
							
								HTML('#technologie').Option(':: ' + Result['amd']['item'][x]['text'], Result['amd']['item'][x]['value']);	
							}
							
							if (!Empty(Result['via'])) {
							
								HTML('#technologie').Option('- -', '');
							}
						}

						if (!Empty(Result['via'])) {
						
							if (!(Result['via']['item'] instanceof Array)) {
								
								Result['via']['item'] = [Result['via']['item']];
								
							} HTML('#technologie').Option('VIA', '3');
							
							for (var x = 0; x < Result['via']['item'].length; ++x) {
							
								HTML('#technologie').Option(':: ' + Result['via']['item'][x]['text'], Result['via']['item'][x]['value']);	
							}
						
						} HTML('#technologie').Disabled(false);
						
					} else HTML('#technologie').Option('Keine vorhanden', '');
				}

				$Configurator.Result(['Result'], $Configurator.XMLHTTPRequest['Data']['result']['results']);
				$Configurator.DefaultCallback = null;
				$Configurator.LoadingWheel(false);
				$Configurator.DisabledSearch($Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);
			};
		}
		
		with ($Configurator.XMLHTTPRequest) {

			Send($Configurator.RequestTo + '?type=1&r=' + Time(), 'GET', 'xml');
			Call('$Configurator.DefaultCallback');
		}
	},

	Display : function () {
	
		if (!Empty(HTML('#display').Value())) {
		
			$Configurator.LoadingWheel(true);
			$Configurator.DisabledSearch(true);
			
			HTML('#resolution').Clear().Option('Wird geladen ...', '').Disabled(true);
			
			if (Empty($Configurator.DisplayCallback)) {
			
				$Configurator.DisplayCallback = function () {

					if (!Empty($Configurator.DebugMode)) {
						
						Display(
							'<strong>Generate-Time:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
							'<strong>Url-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
							'<strong>SQL-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query']
						);
					}

					/* Display resolution */
					
					if (HTML('#resolution').Clear()) {
						
						var Result = $Configurator.XMLHTTPRequest['Data']['result']['resolution']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							HTML('#resolution').Option('alle anzeigen', '').Option('- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
								
								HTML('#resolution').Option(Result[x]['text'], Result[x]['value']);	
							
							} HTML('#resolution').Disabled(false);
							
						} else HTML('#resolution').Option('Keine vorhanden', '').Disabled(true);
					}

					$Configurator.Result(['Result'], $Configurator.XMLHTTPRequest['Data']['result']['results']);
					$Configurator.DisplayCallback = null;
					$Configurator.LoadingWheel(false);
					$Configurator.DisabledSearch($Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);
				};

				with ($Configurator.XMLHTTPRequest) {

					Send($Configurator.RequestTo + '?type=2' + $Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
					Call('$Configurator.DisplayCallback');
				}
			}
		
		} else {
			
			HTML('#resolution').Clear().Option('- -', '').Disabled(true);
			
			$Configurator.Update();
		}
	},

	Technologie : function () {
	
		if (!Empty(HTML('#technologie').Value())) {
		
			$Configurator.LoadingWheel(true);
			$Configurator.DisabledSearch(true);
			
			HTML('#processor_speed').Clear().Option('Wird geladen ...', '').Disabled(true);
			HTML('#processor_type').Clear().Option('Wird geladen ...', '').Disabled(true);

			if (Empty($Configurator.TechnologieCallback)) {
			
				$Configurator.TechnologieCallback = function () {
				
					if (!Empty($Configurator.DebugMode)) {
						
						Display(
							'<strong>Generate-Time:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
							'<strong>Url-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
							'<strong>SQL-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query']
						);
					}

					/* Processor speed */
					
					if (HTML('#processor_speed').Clear()) {
						
						var Result = $Configurator.XMLHTTPRequest['Data']['result']['processor_speed']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							HTML('#processor_speed').Option('alle anzeigen', '').Option('- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								HTML('#processor_speed').Option(Result[x]['text'], Result[x]['value']);	
							}
							
						} else HTML('#processor_speed').Option('Keine vorhanden', '');
					}
					
					/* Processor type */
					
					if (HTML('#processor_type').Clear()) {
						
						var Result = $Configurator.XMLHTTPRequest['Data']['result']['processor_type']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							HTML('#processor_type').Option('alle anzeigen', '').Option('- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								HTML('#processor_type').Option(Result[x]['text'], Result[x]['value']);	
							}
							
						} else HTML('#processor_type').Option('Keine vorhanden', '');
					}


					$Configurator.Result(['Result'], $Configurator.XMLHTTPRequest['Data']['result']['results']);
					$Configurator.TechnologieCallback = null;
					$Configurator.LoadingWheel(false);
					$Configurator.DisabledSearch($Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);

					HTML('#processor_speed').Disabled(false);
					HTML('#processor_type').Disabled(false);
				};
				
				with ($Configurator.XMLHTTPRequest) {

					Send($Configurator.RequestTo + '?type=3' + $Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
					Call('$Configurator.TechnologieCallback');
				}
			}
			
		} else {

			HTML('#processor_speed').Clear().Option('- -', '').Disabled(true);
			HTML('#processor_type').Clear().Option('- -', '').Disabled(true);

			$Configurator.Update();
		}
	},
	
	ProcessorSpeed : function () {
		
		$Configurator.LoadingWheel(true);
		$Configurator.DisabledSearch(true);
		
		HTML('#processor_type').Clear().Option('Wird geladen ...', '').Disabled(true);

		if (Empty($Configurator.ProcessorSpeedCallback)) {
		
			$Configurator.ProcessorSpeedCallback = function () {
				
				if (!Empty($Configurator.DebugMode)) {
					
					Display(
						'<strong>Generate-Time:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
						'<strong>Url-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
						'<strong>SQL-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query']
					);
				}
				
				/* Processor speed */
				
				if (HTML('#processor_type').Clear()) {
					
					var Result = $Configurator.XMLHTTPRequest['Data']['result']['processor_type']['item'];
					
					if (!(Result instanceof Array)) {
						
						Result = [Result];
					}
					
					if (!Empty(Result)) {
						
						HTML('#processor_type').Option('alle anzeigen', '').Option('- -', '');

						for (var x = 0; x < Result.length; ++x) {
						
							HTML('#processor_type').Option(Result[x]['text'], Result[x]['value']);	
						}
						
					} else HTML('#processor_type').Option('Keine vorhanden', '');
				}
				
				$Configurator.Result(['Result'], $Configurator.XMLHTTPRequest['Data']['result']['results']);
				$Configurator.ProcessorSpeedCallback = null;
				$Configurator.LoadingWheel(false);
				$Configurator.DisabledSearch($Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);

				HTML('#processor_type').Disabled(false);
			}
		}
		
		with ($Configurator.XMLHTTPRequest) {

			Send($Configurator.RequestTo + '?type=4' + Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
			Call('$Configurator.ProcessorSpeedCallback');
		}
	},
	
	GraphicCard : function () {
	
		if (!Empty(HTML('#graphic_card').Value())) {
		
			$Configurator.LoadingWheel(true);
			$Configurator.DisabledSearch(true);
			
			HTML('#graphic_card_memory').Clear().Option('Wird geladen ...', '').Disabled(true);
			HTML('#graphic_card_processor').Clear().Option('Wird geladen ...', '').Disabled(true);

			if (Empty($Configurator.GraphicCardCallback)) {
			
				$Configurator.GraphicCardCallback = function () {
				
					if (!Empty($Configurator.DebugMode)) {
						
						Display(
							'<strong>Generate-Time:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
							'<strong>Url-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
							'<strong>SQL-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query']
						);
					}

					/* Graphic card memory */
					
					if (HTML('#graphic_card_memory').Clear()) {
						
						var Result = $Configurator.XMLHTTPRequest['Data']['result']['graphic_card_memory']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							HTML('#graphic_card_memory').Option('alle anzeigen', '').Option('- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								HTML('#graphic_card_memory').Option(Result[x]['text'], Result[x]['value']);	
							}
							
						} else HTML('#graphic_card_memory').Option('Keine vorhanden', '');
					}
					
					/* Graphic card processor */
					
					if (HTML('#graphic_card_processor').Clear()) {
						
						var Result = $Configurator.XMLHTTPRequest['Data']['result']['graphic_card_processor']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
						
							HTML('#graphic_card_processor').Option('alle anzeigen', '').Option('- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								HTML('#graphic_card_processor').Option(Result[x]['text'], Result[x]['value']);	
							}
							
						} else HTML('#graphic_card_processor').Option('Keine vorhanden', '');
					}

					$Configurator.Result(['Result'], $Configurator.XMLHTTPRequest['Data']['result']['results']);
					$Configurator.GraphicCardCallback = null;
					$Configurator.LoadingWheel(false);
					$Configurator.DisabledSearch($Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);

					HTML('#graphic_card_memory').Disabled(false);
					HTML('#graphic_card_processor').Disabled(false);
				};
				
				with ($Configurator.XMLHTTPRequest) {
		
					Send($Configurator.RequestTo + '?type=5' + $Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
					Call('$Configurator.GraphicCardCallback');
				}
			}
			
		} else {

			HTML('#graphic_card_memory').Clear().Option('- -', '').Disabled(true);
			HTML('#graphic_card_processor').Clear().Option('- -', '').Disabled(true);
			
			$Configurator.Update();
		}
	},
	
	GraphicCardSpeed : function () {
		
		$Configurator.LoadingWheel(true);
		$Configurator.DisabledSearch(true);
			
		HTML('#graphic_card_processor').Clear().Option('Wird geladen ...', '').Disabled(true);

		if (Empty($Configurator.GraphicCardSpeedCallback)) {
		
			$Configurator.GraphicCardSpeedCallback = function () {
				
				if (!Empty($Configurator.DebugMode)) {
					
					Display(
						'<strong>Generate-Time:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
						'<strong>Url-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
						'<strong>SQL-Query:</strong> ' + $Configurator.XMLHTTPRequest['Data']['result']['query']
					);
				}
				
				/* Graphic card processor */
				
				if (HTML('#graphic_card_processor').Clear()) {
					
					var Result = $Configurator.XMLHTTPRequest['Data']['result']['graphic_card_processor']['item'];
					
					if (!(Result instanceof Array)) {
						
						Result = [Result];
					}
					
					if (!Empty(Result)) {
						
						HTML('#graphic_card_processor').Option('alle anzeigen', '').Option('- -', '');

						for (var x = 0; x < Result.length; ++x) {
						
							HTML('#graphic_card_processor').Option(Result[x]['text'], Result[x]['value']);	
						}
						
					} else HTML('#graphic_card_processor').Option('Keine vorhanden', '');
				}
				
				$Configurator.Result(['Result'], $Configurator.XMLHTTPRequest['Data']['result']['results']);
				$Configurator.GraphicCardSpeedCallback = null;
				$Configurator.LoadingWheel(false);
				$Configurator.DisabledSearch($Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);

				HTML('#graphic_card_processor').Disabled(false);
			}
		}
		
		with ($Configurator.XMLHTTPRequest) {

			Send($Configurator.RequestTo + '?type=6' + $Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
			Call('$Configurator.GraphicCardSpeedCallback');
		}
	}	
};




Objects ('Configurator', {
	
	'XMLHTTPRequest' 	: new Ajax(),
	'DebugMode' 		: false,
	'ResultFadeSteps' 	: 15,
	'ResultFadeColor' 	: {'From' : 'FFFFFF', 'To' : 'FF4E00'},
	'Images'		: {'LoadingWheel' : 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWnWK/FeqVxj3BJjFBVN1sKsfz9XFmWv6eNKJrSD8NcrH3E+CBV/fwsfDUcRQ+A9j+0ZbvB6YuLcaMV6TlgIudKO'},
	'RequestTo' 		: '/Includes/Content/Ajax/Configurator/Data.php',
		
	RequestURL : function (URL) {
		
		Configurator.RequestTo = URL;
	},
	
	SearchButtonDisabled : function (Status) {

		var Button = Element.Find('ConfiguratorButton');
		
		if (Button) {
		
			if (Button.Event == null) {
			
				Button.Event = Button.onclick;
				
			} Button.onclick = (Status) ? (function () { return false; }) : (function () { this.Event(); });
		}
	},
	
	LoadingWheel : function (Status) {

		Element.SetCssProperty('ConfiguratorLoading', {
		
			background	: ((Status) ? 'transparent url(' + Configurator.Images['LoadingWheel'] + ') 97% 0px no-repeat' : 'none'),
			display 	: 'block',
			paddingBottom	: '1px'
		});
	},
	
	BuildQueryString : function (First) {

		var QueryString = [];
		var Elements 	= Formular.Elements('ConfiguratorFormular');

		for (var x = 0; x < Elements.length; ++x) {

			if (['select-one', 'checkbox'].Search(Elements[x].type) !== false) {

				if (!Empty(Formular.Value(Elements[x].name))) {
				
					QueryString.Push(Elements[x].name + '=' + encodeURIComponent(Formular.Value(Elements[x].name)));
				}
			}
			
		} return (First === true ? '?' : '&') + QueryString.join('&');
	},
	
	Result : function (Output, Result) {
	
		if (!(Output instanceof Array)) {
			
			Output = [Output];
		}
	
		for (var x = 0; x < Output.length; ++x) {
		
			if ((Output[x] = Element.Find(Output[x]))) {
				
				window.clearInterval(Output[x].Interval);
				
				Output[x].ResultInterval = {
					
					Output 	   : Output[x],
					Result	   : Result,
					Begin	   : parseInt(Output[x].innerHTML),
					Difference : Result - parseInt(Output[x].innerHTML),
					Durantion  : 20,
					Count	   : 0,
					
					Interval  : function () {
					
						if (this.Count < this.Durantion) {
						
							this.Output.innerHTML = Math.floor(Math.EaseOutQuart(this.Count, this.Begin, this.Difference, this.Durantion));
							this.Count++;
							
						} else {
						
							this.Output.innerHTML = this.Result;
							window.clearInterval(this.Output.Interval);
						}
					}
					
				}; Output[x].Interval = window.setInterval('Element.Find("' + Output[x].id + '").ResultInterval.Interval()', 10);
			}
		}
	},
	
	Load : function (QueryString) {
		
		var Query = File.ParseQueryString(QueryString);
	
		Configurator.LoadingWheel(true);
		Configurator.SearchButtonDisabled(true);
	
		Formular.Select.Selected('price', Query['price']);
		Formular.Select.Selected('display', Query['display']);
		Formular.Select.Selected('disc', Query['disc']);
		Formular.Select.Selected('battery', Query['battery']);
		Formular.Select.Selected('memory', Query['memory']);
		Formular.Select.Selected('drive', Query['drive']);
		Formular.Select.Selected('weight', Query['weight']);
		Formular.Select.Selected('graphic_card', Query['graphic_card']);
	
		Formular.Select.Clear('manufacturer');
		Formular.Select.Add('manufacturer', 'Wird geladen ...', '');
		Formular.Find('manufacturer').disabled = true;
	
		if (Query['display']) {
		
			Formular.Select.Clear('resolution');
			Formular.Select.Add('resolution', 'Wird geladen ...', '');
			Formular.Find('resolution').disabled = true;	
		}
		
		if (Query['technologie']) {
		
			Formular.Select.Clear(['technologie','processor_speed','processor_type']);	
			
			Formular.Select.Add('technologie', 'Wird geladen ...', '');
			Formular.Select.Add('processor_speed', 'Wird geladen ...', '');
			Formular.Select.Add('processor_type', 'Wird geladen ...', '');
			
			Formular.Find('technologie').disabled = true;
			Formular.Find('processor_speed').disabled = true;
			Formular.Find('processor_type').disabled  = true;
			
		} else {
			
			Formular.Select.Clear('technologie');
			Formular.Select.Add('technologie', 'Wird geladen ...', '');
			Formular.Find('technologie').disabled = true;
		}

		if (Query['graphic_card']) {
		
			Formular.Select.Clear(['graphic_card_memory','graphic_card_processor']);	
			
			Formular.Select.Add('graphic_card_memory', 'Wird geladen ...', '');
			Formular.Select.Add('graphic_card_processor', 'Wird geladen ...', '');
			
			Formular.Find('graphic_card_memory').disabled = true;
			Formular.Find('graphic_card_processor').disabled  = true;
		}
		
		if (Empty(Configurator.LoadCallback)) {
		
			Configurator.LoadCallback = function () {
				
				if (!Empty(Configurator.DebugMode)) {
					
					Display(
						'<strong>Generate-Time:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
						'<strong>Url-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
						'<strong>SQL-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query']
					);
				}
				
				
				/* Manufacturer */
				
				if (Formular.Select.Clear('manufacturer')) {
					
					var Result = Configurator.XMLHTTPRequest['Data']['result']['manufacturer']['item'];
					
					if (!Empty(Result)) {
						
						Formular.Select.Add('manufacturer', 'alle anzeigen', '');
						Formular.Select.Add('manufacturer', '- -', '');

						for (var x = 0; x < Result.length; ++x) {
						
							Formular.Select.Add('manufacturer', Result[x]['text'], Result[x]['value']);	
						} 
						
						Formular.Select.Selected('manufacturer', Query['manufacturer']);
						Formular.Find('manufacturer').disabled = false;
						
					} else Formular.Select.Add('manufacturer', 'Keine vorhanden', '');
				}


				if (Query['display']) {
				
					/* Display resolution */
				
					if (Formular.Select.Clear('resolution')) {
						
						var Result = Configurator.XMLHTTPRequest['Data']['result']['resolution']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							Formular.Select.Add('resolution', 'alle anzeigen', '');
							Formular.Select.Add('resolution', '- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								Formular.Select.Add('resolution', Result[x]['text'], Result[x]['value']);	
							}
							
							Formular.Select.Selected('resolution', Query['resolution']);
							Formular.Find('resolution').disabled = false;
							
						} else Formular.Select.Add('resolution', 'Keine vorhanden', '');
					}
				}
				

				/* Technologie */
				
				if (Formular.Select.Clear('technologie')) {
					
					var Result = Configurator.XMLHTTPRequest['Data']['result']['technologie'];

					if (!Empty(Result['amd']) || !Empty(Result['intel']) || !Empty(Result['other'])) {
						
						Formular.Select.Add('technologie', 'alle anzeigen', '');
						Formular.Select.Add('technologie', '- -', '');

						if (!Empty(Result['amd'])) {
						
							if (!(Result['amd']['item'] instanceof Array)) {
								
								Result['amd']['item'] = [Result['amd']['item']];
								
							} Formular.Select.Add('technologie', 'AMD', '1');
							
							for (var x = 0; x < Result['amd']['item'].length; ++x) {
							
								Formular.Select.Add('technologie', ':: ' + Result['amd']['item'][x]['text'], Result['amd']['item'][x]['value']);	
							}
							
							if (!Empty(Result['intel']) || !Empty(Result['other'])) {
							
								Formular.Select.Add('technologie', '- -', '');
							}
						}

						if (!Empty(Result['intel'])) {
						
							if (!(Result['intel']['item'] instanceof Array)) {
								
								Result['intel']['item'] = [Result['intel']['item']];
								
							} Formular.Select.Add('technologie', 'Intel', '2');
							
							for (var x = 0; x < Result['intel']['item'].length; ++x) {
							
								Formular.Select.Add('technologie', ':: ' + Result['intel']['item'][x]['text'], Result['intel']['item'][x]['value']);	
							}
							
							if (!Empty(Result['via'])) {
							
								Formular.Select.Add('technologie', '- -', '');
							}
						}

						if (!Empty(Result['via'])) {
						
							if (!(Result['via']['item'] instanceof Array)) {
								
								Result['via']['item'] = [Result['via']['item']];
								
							} Formular.Select.Add('technologie', 'Via', '3');
							
							for (var x = 0; x < Result['via']['item'].length; ++x) {
							
								Formular.Select.Add('technologie', ':: ' + Result['via']['item'][x]['text'], Result['via']['item'][x]['value']);	
							}
						} 
						
						Formular.Select.Selected('technologie', Query['technologie']);
						Formular.Find('technologie').disabled = false;
						
					} else Formular.Select.Add('technologie', 'Keine vorhanden', '');
				}
				
				
				if (Query['technologie']) {
				
					/* Processor speed */
					
					if (Formular.Select.Clear('processor_speed')) {
						
						var Result = Configurator.XMLHTTPRequest['Data']['result']['processor_speed']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							Formular.Select.Add('processor_speed', 'alle anzeigen', '');
							Formular.Select.Add('processor_speed', '- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								Formular.Select.Add('processor_speed', Result[x]['text'], Result[x]['value']);	
							} 
							
							Formular.Select.Selected('processor_speed', Query['processor_speed']);
							Formular.Find('processor_speed').disabled = false;
							
							HTML('td', HTML('#TechnologieMainOption')[0]).Css('paddingBottom', '14px');
							ElementSizer.AddElement('TechnologieOptions', 'height');
							ElementSizer.SetSize('TechnologieOptions', HTML('table', HTML('#TechnologieOptions')[0]).Height(), 20);
							
						} else Formular.Select.Add('processor_speed', 'Keine vorhanden', '');
					}
					
					/* Processor type */
					
					if (Formular.Select.Clear('processor_type')) {
						
						var Result = Configurator.XMLHTTPRequest['Data']['result']['processor_type']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							Formular.Select.Add('processor_type', 'alle anzeigen', '');
							Formular.Select.Add('processor_type', '- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								Formular.Select.Add('processor_type', Result[x]['text'], Result[x]['value']);	
							} 
							
							Formular.Select.Selected('processor_type', Query['processor_type']);
							Formular.Find('processor_type').disabled = false;
							
						} else Formular.Select.Add('processor_type', 'Keine vorhanden', '');
					}
				}
				
				if (Query['graphic_card']) {
				
					/* Graphic card memory */
					
					if (Formular.Select.Clear('graphic_card_memory')) {
						
						var Result = Configurator.XMLHTTPRequest['Data']['result']['graphic_card_memory']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							Formular.Select.Add('graphic_card_memory', 'alle anzeigen', '');
							Formular.Select.Add('graphic_card_memory', '- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								Formular.Select.Add('graphic_card_memory', Result[x]['text'], Result[x]['value']);	
							} 
							
							Formular.Select.Selected('graphic_card_memory', Query['graphic_card_memory']);
							Formular.Find('graphic_card_memory').disabled = false;
							
							ElementSizer.AddElement('GraphicOptions', 'height');
							ElementSizer.SetSize('GraphicOptions', HTML('table', HTML('#GraphicOptions')[0]).Height(), 20);

						} else Formular.Select.Add('graphic_card_memory', 'Keine vorhanden', '');
					}
					
					/* Graphic card processor */
					
					if (Formular.Select.Clear('graphic_card_processor')) {
						
						var Result = Configurator.XMLHTTPRequest['Data']['result']['graphic_card_processor']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							Formular.Select.Add('graphic_card_processor', 'alle anzeigen', '');
							Formular.Select.Add('graphic_card_processor', '- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								Formular.Select.Add('graphic_card_processor', Result[x]['text'], Result[x]['value']);	
							} 
							
							Formular.Select.Selected('graphic_card_processor', Query['graphic_card_processor']);
							Formular.Find('graphic_card_processor').disabled = false;
							
						} else Formular.Select.Add('graphic_card_processor', 'Keine vorhanden', '');
					}
				}
				
				Element.Fade(['ResultsTop'], 'color', Configurator.ResultFadeColor.From, Configurator.ResultFadeColor.To, Configurator.ResultFadeSteps);
				Configurator.Result(['ResultsTop'], Configurator.XMLHTTPRequest['Data']['result']['results']);
				Configurator.Unset('LoadCallback');
				Configurator.LoadingWheel(false);
				Configurator.SearchButtonDisabled(Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);
			};
		}
		
		with (Configurator.XMLHTTPRequest) {
	
			QueryString = QueryString.split('?')[0] || QueryString;
			QueryString = QueryString.split('&').slice(1, -1).join('&');
			QueryString = QueryString != '' ? '&' + QueryString : QueryString;

			Send(Configurator.RequestTo + '?type=7' + QueryString + '&r=' + Time(), 'GET', 'xml');
			Call('Configurator.LoadCallback');
		}
	},
	
	Update : function () {
		
		Configurator.LoadingWheel(true);
		Configurator.SearchButtonDisabled(true);
	
		if (Empty(Configurator.UpdateCallback)) {
		
			Configurator.UpdateCallback = function () {

				if (!Empty(Configurator.DebugMode)) {
					
					Display(
						'<strong>Generate-Time:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
						'<strong>Url-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
						'<strong>SQL-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query']
					);
				}
				
				Element.Fade(['ResultsTop'], 'color', Configurator.ResultFadeColor.From, Configurator.ResultFadeColor.To, Configurator.ResultFadeSteps);
				Configurator.Result(['ResultsTop'], Configurator.XMLHTTPRequest['Data']['result']['results']);
				Configurator.Unset('UpdateCallback');
				Configurator.LoadingWheel(false);
				Configurator.SearchButtonDisabled(Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);
			};
		}
		
		with (Configurator.XMLHTTPRequest) {

			Send(Configurator.RequestTo + '?type=0' + Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
			Call('Configurator.UpdateCallback');
		}
	},

	Default : function () {
	
		Configurator.LoadingWheel(true);
		Configurator.SearchButtonDisabled(true);

		Formular.Select.Clear([
		
			'manufacturer','resolution',
			'technologie','processor_speed',
			'processor_type','graphic_card_memory',
			'graphic_card_processor'
		]);
		
		Formular.Select.Add('manufacturer', 'Wird geladen ...', '');
		Formular.Select.Add('technologie', 'Wird geladen ...', '');
		
		Formular.Select.Add('resolution', '- -', '');
		Formular.Select.Add('processor_speed', '- -', '');
		Formular.Select.Add('processor_type', '- -', '');
		Formular.Select.Add('graphic_card_memory', '- -', '');
		Formular.Select.Add('graphic_card_processor', '- -', '');

		Formular.Find('resolution').disabled 		 = true;
		Formular.Find('processor_speed').disabled 	 = true;
		Formular.Find('processor_type').disabled 	 = true;
		Formular.Find('graphic_card_memory').disabled 	 = true;
		Formular.Find('graphic_card_processor').disabled = true;
		
		if (Empty(Configurator.DefaultCallback)) {
		
			Configurator.DefaultCallback = function () {
				
				if (!Empty(Configurator.DebugMode)) {
					
					Display(
						'<strong>Generate-Time:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
						'<strong>Url-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
						'<strong>SQL-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query']
					);
				}
				
				/* Manufacturer */
				
				if (Formular.Select.Clear('manufacturer')) {
					
					var Result = Configurator.XMLHTTPRequest['Data']['result']['manufacturer']['item'];
					
					if (!Empty(Result)) {
						
						Formular.Select.Add('manufacturer', 'alle anzeigen', '');
						Formular.Select.Add('manufacturer', '- -', '');

						for (var x = 0; x < Result.length; ++x) {
						
							Formular.Select.Add('manufacturer', Result[x]['text'], Result[x]['value']);	
						}
						
					} else Formular.Select.Add('manufacturer', 'Keine vorhanden', '');
				}
				
				
				/* Technologie */
				
				if (Formular.Select.Clear('technologie')) {
					
					var Result = Configurator.XMLHTTPRequest['Data']['result']['technologie'];

					if (!Empty(Result['amd']) || !Empty(Result['intel']) || !Empty(Result['other'])) {
						
						Formular.Select.Add('technologie', 'alle anzeigen', '');
						Formular.Select.Add('technologie', '- -', '');

						if (!Empty(Result['amd'])) {
						
							if (!(Result['amd']['item'] instanceof Array)) {
								
								Result['amd']['item'] = [Result['amd']['item']];
								
							} Formular.Select.Add('technologie', 'AMD', '1');
							
							for (var x = 0; x < Result['amd']['item'].length; ++x) {
							
								Formular.Select.Add('technologie', ':: ' + Result['amd']['item'][x]['text'], Result['amd']['item'][x]['value']);	
							}
							
							if (!Empty(Result['intel']) || !Empty(Result['other'])) {
							
								Formular.Select.Add('technologie', '- -', '');
							}
						}

						if (!Empty(Result['intel'])) {
						
							if (!(Result['intel']['item'] instanceof Array)) {
								
								Result['intel']['item'] = [Result['intel']['item']];
								
							} Formular.Select.Add('technologie', 'Intel', '2');
							
							for (var x = 0; x < Result['intel']['item'].length; ++x) {
							
								Formular.Select.Add('technologie', ':: ' + Result['intel']['item'][x]['text'], Result['intel']['item'][x]['value']);	
							}
							
							if (!Empty(Result['via'])) {
							
								Formular.Select.Add('technologie', '- -', '');
							}
						}

						if (!Empty(Result['via'])) {
						
							if (!(Result['via']['item'] instanceof Array)) {
								
								Result['via']['item'] = [Result['via']['item']];
								
							} Formular.Select.Add('technologie', 'VIA', '3');
							
							for (var x = 0; x < Result['via']['item'].length; ++x) {
							
								Formular.Select.Add('technologie', ':: ' + Result['via']['item'][x]['text'], Result['via']['item'][x]['value']);	
							}
						}
						
					} else Formular.Select.Add('technologie', 'Keine vorhanden', '');
				}
				
				Element.Fade(['ResultsTop'], 'color', Configurator.ResultFadeColor.From, Configurator.ResultFadeColor.To, Configurator.ResultFadeSteps);
				Configurator.Result(['ResultsTop'], Configurator.XMLHTTPRequest['Data']['result']['results']);
				Configurator.Unset('DefaultCallback');
				Configurator.LoadingWheel(false);
				Configurator.SearchButtonDisabled(Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);
			};
		}
		
		with (Configurator.XMLHTTPRequest) {

			Send(Configurator.RequestTo + '?type=1&r=' + Time(), 'GET', 'xml');
			Call('Configurator.DefaultCallback');
		}
	},
	
	Display : function () {
	
		if (!Empty(Formular.Value('display'))) {
		
			Configurator.LoadingWheel(true);
			Configurator.SearchButtonDisabled(true);
			
			Formular.Select.Clear('resolution');
			Formular.Select.Add('resolution', 'Wird geladen ...', '');
			Formular.Find('resolution').disabled = true;
			
			if (Empty(Configurator.DisplayCallback)) {
			
				Configurator.DisplayCallback = function () {

					if (!Empty(Configurator.DebugMode)) {
						
						Display(
							'<strong>Generate-Time:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
							'<strong>Url-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
							'<strong>SQL-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query']
						);
					}

					/* Display resolution */
					
					if (Formular.Select.Clear('resolution')) {
						
						var Result = Configurator.XMLHTTPRequest['Data']['result']['resolution']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							Formular.Select.Add('resolution', 'alle anzeigen', '');
							Formular.Select.Add('resolution', '- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								Formular.Select.Add('resolution', Result[x]['text'], Result[x]['value']);	
							}
							
						} else Formular.Select.Add('resolution', 'Keine vorhanden', '');
					}

					Element.Fade(['ResultsTop'], 'color', Configurator.ResultFadeColor.From, Configurator.ResultFadeColor.To, Configurator.ResultFadeSteps);
					Configurator.Result(['ResultsTop'], Configurator.XMLHTTPRequest['Data']['result']['results']);
					Configurator.Unset('DisplayCallback');
					Configurator.LoadingWheel(false);
					Configurator.SearchButtonDisabled(Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);
				
					Formular.Find('resolution').disabled = false;
				};

				with (Configurator.XMLHTTPRequest) {
		
					Send(Configurator.RequestTo + '?type=2' + Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
					Call('Configurator.DisplayCallback');
				}
			}
		
		} else {

			Formular.Select.Clear('resolution');
			Formular.Select.Add('resolution', '- -', '');
			Formular.Find('resolution').disabled = true;
			
			Configurator.Update();
		}
	},
	
	Technologie : function () {
	
		if (!Empty(Formular.Value('technologie'))) {
		
			Configurator.LoadingWheel(true);
			Configurator.SearchButtonDisabled(true);
			
			Formular.Select.Clear(['processor_speed', 'processor_type']);
			Formular.Select.Add('processor_speed', 'Wird geladen ...', '');
			Formular.Select.Add('processor_type', 'Wird geladen ...', '');
			
			Formular.Find('processor_speed').disabled = true;
			Formular.Find('processor_type').disabled = true;
			
			ElementSizer.AddElement('TechnologieOptions', 'height');

			if (Empty(Configurator.TechnologieCallback)) {
			
				Configurator.TechnologieCallback = function () {
				
					if (!Empty(Configurator.DebugMode)) {
						
						Display(
							'<strong>Generate-Time:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
							'<strong>Url-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
							'<strong>SQL-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query']
						);
					}

					/* Processor speed */
					
					if (Formular.Select.Clear('processor_speed')) {
						
						var Result = Configurator.XMLHTTPRequest['Data']['result']['processor_speed']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							Formular.Select.Add('processor_speed', 'alle anzeigen', '');
							Formular.Select.Add('processor_speed', '- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								Formular.Select.Add('processor_speed', Result[x]['text'], Result[x]['value']);	
							}
							
						} else Formular.Select.Add('processor_speed', 'Keine vorhanden', '');
					}
					
					/* Processor type */
					
					if (Formular.Select.Clear('processor_type')) {
						
						var Result = Configurator.XMLHTTPRequest['Data']['result']['processor_type']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							Formular.Select.Add('processor_type', 'alle anzeigen', '');
							Formular.Select.Add('processor_type', '- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								Formular.Select.Add('processor_type', Result[x]['text'], Result[x]['value']);	
							}
							
						} else Formular.Select.Add('processor_type', 'Keine vorhanden', '');
					}

					Element.Fade(['ResultsTop'], 'color', Configurator.ResultFadeColor.From, Configurator.ResultFadeColor.To, Configurator.ResultFadeSteps);
					Configurator.Result(['ResultsTop'], Configurator.XMLHTTPRequest['Data']['result']['results']);
					Configurator.Unset('TechnologieCallback');
					Configurator.LoadingWheel(false);
					Configurator.SearchButtonDisabled(Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);

					HTML('td', HTML('#TechnologieMainOption')[0]).Css('paddingBottom', '14px');
					ElementSizer.SetSize('TechnologieOptions', HTML('table', HTML('#TechnologieOptions')[0]).Height(), 20);
					
					Formular.Find('processor_speed').disabled = false;
					Formular.Find('processor_type').disabled = false;
				};
				
				with (Configurator.XMLHTTPRequest) {
		
					Send(Configurator.RequestTo + '?type=3' + Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
					Call('Configurator.TechnologieCallback');
				}
			}
			
		} else {

			Formular.Select.Clear(['processor_speed', 'processor_type']);
			Formular.Select.Add('processor_speed', '- -', '');
			Formular.Select.Add('processor_type', '- -', '');
			
			Formular.Find('processor_speed').disabled = true;
			Formular.Find('processor_type').disabled = true;

			ElementSizer.SetSize('TechnologieOptions', 0, 10);
			HTML('td', HTML('#TechnologieMainOption')[0]).Css('paddingBottom', '0px');
			
			Configurator.Update();
		}
	},
	
	ProcessorSpeed : function () {
		
		Configurator.LoadingWheel(true);
		Configurator.SearchButtonDisabled(true);
			
		Formular.Select.Clear(['processor_type']);
		Formular.Select.Add('processor_type', 'Wird geladen ...', '');
			
		Formular.Find('processor_type').disabled = true;

		if (Empty(Configurator.ProcessorSpeedCallback)) {
		
			Configurator.ProcessorSpeedCallback = function () {
				
				if (!Empty(Configurator.DebugMode)) {
					
					Display(
						'<strong>Generate-Time:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
						'<strong>Url-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
						'<strong>SQL-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query']
					);
				}
				
				/* Processor speed */
				
				if (Formular.Select.Clear('processor_type')) {
					
					var Result = Configurator.XMLHTTPRequest['Data']['result']['processor_type']['item'];
					
					if (!(Result instanceof Array)) {
						
						Result = [Result];
					}
					
					if (!Empty(Result)) {
						
						Formular.Select.Add('processor_type', 'alle anzeigen', '');
						Formular.Select.Add('processor_type', '- -', '');

						for (var x = 0; x < Result.length; ++x) {
						
							Formular.Select.Add('processor_type', Result[x]['text'], Result[x]['value']);	
						}
						
					} else Formular.Select.Add('processor_type', 'Keine vorhanden', '');
				}
				
				Element.Fade(['ResultsTop'], 'color', Configurator.ResultFadeColor.From, Configurator.ResultFadeColor.To, Configurator.ResultFadeSteps);	
				Configurator.Result(['ResultsTop'], Configurator.XMLHTTPRequest['Data']['result']['results']);
				Configurator.Unset('ProcessorSpeedCallback');
				Configurator.LoadingWheel(false);
				Configurator.SearchButtonDisabled(Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);

				Formular.Find('processor_type').disabled = false;
			}
		}
		
		with (Configurator.XMLHTTPRequest) {

			Send(Configurator.RequestTo + '?type=4' + Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
			Call('Configurator.ProcessorSpeedCallback');
		}
	},
	
	GraphicCard : function () {
	
		if (!Empty(Formular.Value('graphic_card'))) {
		
			Configurator.LoadingWheel(true);
			Configurator.SearchButtonDisabled(true);
			
			Formular.Select.Clear(['graphic_card_memory', 'graphic_card_processor']);
			Formular.Select.Add('graphic_card_memory', 'Wird geladen ...', '');
			Formular.Select.Add('graphic_card_processor', 'Wird geladen ...', '');
			
			Formular.Find('graphic_card_memory').disabled = true;
			Formular.Find('graphic_card_processor').disabled = true;
			
			ElementSizer.AddElement('GraphicOptions', 'height');
			
			if (Empty(Configurator.GraphicCardCallback)) {
			
				Configurator.GraphicCardCallback = function () {
				
					if (!Empty(Configurator.DebugMode)) {
						
						Display(
							'<strong>Generate-Time:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
							'<strong>Url-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
							'<strong>SQL-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query']
						);
					}

					/* Graphic card memory */
					
					if (Formular.Select.Clear('graphic_card_memory')) {
						
						var Result = Configurator.XMLHTTPRequest['Data']['result']['graphic_card_memory']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							Formular.Select.Add('graphic_card_memory', 'alle anzeigen', '');
							Formular.Select.Add('graphic_card_memory', '- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								Formular.Select.Add('graphic_card_memory', Result[x]['text'], Result[x]['value']);	
							}
							
						} else Formular.Select.Add('graphic_card_memory', 'Keine vorhanden', '');
					}
					
					/* Graphic card processor */
					
					if (Formular.Select.Clear('graphic_card_processor')) {
						
						var Result = Configurator.XMLHTTPRequest['Data']['result']['graphic_card_processor']['item'];
						
						if (!(Result instanceof Array)) {
							
							Result = [Result];
						}
						
						if (!Empty(Result)) {
							
							Formular.Select.Add('graphic_card_processor', 'alle anzeigen', '');
							Formular.Select.Add('graphic_card_processor', '- -', '');
	
							for (var x = 0; x < Result.length; ++x) {
							
								Formular.Select.Add('graphic_card_processor', Result[x]['text'], Result[x]['value']);	
							}
							
						} else Formular.Select.Add('graphic_card_processor', 'Keine vorhanden', '');
					}

					Element.Fade(['ResultsTop'], 'color', Configurator.ResultFadeColor.From, Configurator.ResultFadeColor.To, Configurator.ResultFadeSteps);
					Configurator.Result(['ResultsTop'], Configurator.XMLHTTPRequest['Data']['result']['results']);
					Configurator.Unset('GraphicCardCallback');
					Configurator.LoadingWheel(false);
					Configurator.SearchButtonDisabled(Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);

					ElementSizer.SetSize('GraphicOptions', HTML('table', HTML('#GraphicOptions')[0]).Height(), 20);
				
					Formular.Find('graphic_card_memory').disabled = false;
					Formular.Find('graphic_card_processor').disabled = false;
				};
				
				with (Configurator.XMLHTTPRequest) {
		
					Send(Configurator.RequestTo + '?type=5' + Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
					Call('Configurator.GraphicCardCallback');
				}
			}
			
		} else {

			Formular.Select.Clear(['graphic_card_memory', 'graphic_card_processor']);
			Formular.Select.Add('graphic_card_memory', '- -', '');
			Formular.Select.Add('graphic_card_processor', '- -', '');
			
			Formular.Find('graphic_card_memory').disabled = true;
			Formular.Find('graphic_card_processor').disabled = true;
			
			ElementSizer.SetSize('GraphicOptions', 0, 10);
			
			Configurator.Update();
		}
	},
	
	GraphicCardSpeed : function () {
		
		Configurator.LoadingWheel(true);
		Configurator.SearchButtonDisabled(true);
			
		Formular.Select.Clear(['graphic_card_processor']);
		Formular.Select.Add('graphic_card_processor', 'Wird geladen ...', '');
			
		Formular.Find('graphic_card_processor').disabled = true;

		if (Empty(Configurator.GraphicCardSpeedCallback)) {
		
			Configurator.GraphicCardSpeedCallback = function () {
				
				if (!Empty(Configurator.DebugMode)) {
					
					Display(
						'<strong>Generate-Time:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['generate_time'] + '<br /><br />' + 
						'<strong>Url-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query_string'] + '<br /><br />' + 
						'<strong>SQL-Query:</strong> ' + Configurator.XMLHTTPRequest['Data']['result']['query']
					);
				}
				
				/* Graphic card processor */
				
				if (Formular.Select.Clear('graphic_card_processor')) {
					
					var Result = Configurator.XMLHTTPRequest['Data']['result']['graphic_card_processor']['item'];
					
					if (!(Result instanceof Array)) {
						
						Result = [Result];
					}
					
					if (!Empty(Result)) {
						
						Formular.Select.Add('graphic_card_processor', 'alle anzeigen', '');
						Formular.Select.Add('graphic_card_processor', '- -', '');

						for (var x = 0; x < Result.length; ++x) {
						
							Formular.Select.Add('graphic_card_processor', Result[x]['text'], Result[x]['value']);	
						}
						
					} else Formular.Select.Add('graphic_card_processor', 'Keine vorhanden', '');
				}
				
				Element.Fade(['ResultsTop'], 'color', Configurator.ResultFadeColor.From, Configurator.ResultFadeColor.To, Configurator.ResultFadeSteps);	
				Configurator.Result(['ResultsTop'], Configurator.XMLHTTPRequest['Data']['result']['results']);
				Configurator.Unset('GraphicCardSpeedCallback');
				Configurator.LoadingWheel(false);
				Configurator.SearchButtonDisabled(Configurator.XMLHTTPRequest['Data']['result']['results'] == '0' ? true : false);

				Formular.Find('graphic_card_processor').disabled = false;
			}
		}
		
		with (Configurator.XMLHTTPRequest) {

			Send(Configurator.RequestTo + '?type=6' + Configurator.BuildQueryString() + '&r=' + Time(), 'GET', 'xml');
			Call('Configurator.GraphicCardSpeedCallback');
		}
	}
});



Objects ('ProductMenuHover', {
	
	Init : function () {
		
		var Menu = null;
		
		if (Menu = Element.Find('ProductMenu')) {
			
			var MenuUL = Element.FindByTagName('UL', 'ProductMenu')[0];
			var MenuLI = Element.FindByTagName('LI', MenuUL);
			
			for (var x = 0; x < MenuLI.length; ++x) {

				if (MenuLI[x].className != 'activ') {

					MenuLI[x].A	 = Element.FindByTagName('A', MenuLI[x])[0];
					MenuLI[x].Span	 = Element.FindByTagName('span', MenuLI[x].A)[0];
					MenuLI[x].Images = {
					
						LIin 	: 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWmrAs9TmiJ2M2YM4gLUVr5Bkx0tkKAQd1+zq5oyhB6otS6wlBQw8TIdKwJAgfIqLVDsmiOW1l+EW5V/l0j8Afky',
						LIout 	: 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWmrAs9TmiJ2M2YM4gLUVr5Bkx0tkKAQd1+zq5oyhB6otUGtdvauaK2dG0nsMjlCRYKAAwXRiZLwfRtkVNkU1V8Z',
						Ain 	: 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWmrAs9TmiJ2M2YM4gLUVr5Bkx0tkKAQd1+zq5oyhB6otX/e8Lk2sWAmdFbIKtHPsO7EH3OFU/nSRGOLC8A062mP',
						Aout 	: 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWmrAs9TmiJ2M2YM4gLUVr5Bkx0tkKAQd1+zq5oyhB6otcASSgDYgzq8MxWdDWNLoX0FQO1fJdbMd7w711C8FIUF',
						SPANin 	: 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWmrAs9TmiJ2M2YM4gLUVr5Bkx0tkKAQd1+zq5oyhB6otRY1WsXfdHeDNZ5R//O2ynVgEaekBBqere2qqWWeY7zh',
						SPANout : 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWmrAs9TmiJ2M2YM4gLUVr5Bkx0tkKAQd1+zq5oyhB6otfSLC/1DxqImF2fq4Nnt2hJikbZz7bON28wcI2RMm5G/'
					};
					
					Element.SetEvent(MenuLI[x], 'onmouseover', function () {
	
						Element.SetCssProperty(this, {backgroundImage : 'url(' + this.Images['LIin'] + ')'});
						Element.SetCssProperty(this.A, {backgroundImage : 'url(' + this.Images['Ain'] + ')'});
						Element.SetCssProperty(this.Span, {backgroundImage : 'url(' + this.Images['SPANin'] + ')'});
					});
					
					Element.SetEvent(MenuLI[x], 'onmouseout', function () {
	
						Element.SetCssProperty(this, {backgroundImage : 'url(' + this.Images['LIout'] + ')'});
						Element.SetCssProperty(this.A, {backgroundImage : 'url(' + this.Images['Aout'] + ')'});
						Element.SetCssProperty(this.Span, {backgroundImage : 'url(' + this.Images['SPANout'] + ')'});
					});
				}
			}
		}
	}
});

Objects('Memo', {
	
	'XMLHTTPRequest': new Ajax(),
	'RequestTo' 	: '/Includes/Content/Ajax/Memo/Data.php',
	'Images'	: {
		'add' 	 : 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWl3JktfLuk7Qc9p6BM/lV71zRD64JUWwNDjMpzGgCQZPh55pPHJhFvixNt0gycTzdalbAGBnws5g7xwvUrLYwLq', 
		'delete' : 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWl3JktfLuk7Qc9p6BM/lV71zRD64JUWwNDjMpzGgCQZPkHIygaDTrSQcQNnkzet7KE2kbuzFDCY1iQorm7I7cYF'
	},
	
	'ProcessElements' : function (Elements) {
		
		if (!Empty(Elements)) {
			
			return Memo.PElements = Elements;
			
		} else return Memo.PElements;
	},

	'Add' : function (Product, ElementID) {

		var Elements = Memo.ProcessElements();

		if (Typeof(Elements) == 'array') {
			
			for (var x = 0; x < Elements.length; ++x) {

				if (Element.Find(Elements[x])) {
					Elements[x] 		 = Element.Find(Elements[x]);
					Elements[x].OnClickStore = Elements[x].onclick;
					Elements[x].onclick 	 = null;
				}
			}
			
		} Element.FindByTagName('img', ElementID)[0].src = 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWnWK/FeqVxj3BJjFBVN1sKsfz9XFmWv6eNKJrSD8NcrH3E+CBV/fwsfDUcRQ+A9j+0ZbvB6YuLcaMV6TlgIudKO';

		if (Empty(Memo.AddCallBack)) {
			
			Memo.Product	 = Product;
			Memo.Elements 	 = Elements;
			Memo.ElementID 	 = ElementID;
			Memo.AddCallBack = function () {

				for (var x = 0; x < Memo.Elements.length; ++x) {

					if (typeof Memo.Elements[x] == 'object') {

						Memo.Elements[x].onclick = Memo.Elements[x].OnClickStore;
					}
					
				} Element.FindByTagName('img', Memo.ElementID)[0].src = Memo.Images['delete'];

				Memo.ElementID.Product = Memo.Product;
				Memo.ElementID.onclick = function () {
				
					Memo.Delete(this.Product, this);
				
				}; Memo.AddCallBack = Memo.ElementID = null;
				
				if (Element.Find('MemoAmount')) {
				
					Element.Find('MemoAmount').innerHTML = Memo.XMLHTTPRequest.Data['text'];
				}
			};
		}

		with (Memo.XMLHTTPRequest) {

			Send(Memo.RequestTo + '?type=add&id=' + Product + '&r=' + Time(), 'GET', 'text');
			Call('Memo.AddCallBack');
		}
	},

	'Delete' : function (Product, ElementID) {

		var Elements = Memo.ProcessElements();

		if (Typeof(Elements) == 'array') {
			
			for (var x = 0; x < Elements.length; ++x) {

				if (Element.Find(Elements[x])) {
					Elements[x] 		 = Element.Find(Elements[x]);
					Elements[x].OnClickStore = Elements[x].onclick;
					Elements[x].onclick 	 = null;
				}
			}
			
		} Element.FindByTagName('img', ElementID)[0].src = 'http://images.notebookinfo.de/ia6LXt5pTN0Uo4gUCCDXvvY8DfTeiMgINwBD21sp2DWnWK/FeqVxj3BJjFBVN1sKsfz9XFmWv6eNKJrSD8NcrH3E+CBV/fwsfDUcRQ+A9j+0ZbvB6YuLcaMV6TlgIudKO';

		if (Empty(Memo.DeleteCallBack)) {
			
			Memo.Product	= Product;
			Memo.Elements	= Elements;
			Memo.ElementID 	= ElementID;
			Memo.DeleteCallBack = function () {

				for (var x = 0; x < Memo.Elements.length; ++x) {
					
					if (typeof Memo.Elements[x] == 'object') {
					
						Memo.Elements[x].onclick = Memo.Elements[x].OnClickStore;
					}
					
				} Element.FindByTagName('img', Memo.ElementID)[0].src = Memo.Images['add'];
				
				Memo.ElementID.Product = Memo.Product;
				Memo.ElementID.onclick = function () {
				
					Memo.Add(this.Product, this);
				
				}; Memo.DeleteCallBack = Memo.ElementID = null;
				
				if (Element.Find('MemoAmount')) {
				
					Element.Find('MemoAmount').innerHTML = Memo.XMLHTTPRequest.Data['text'];
				}
			};
		}
		
		with (Memo.XMLHTTPRequest) {
			
			Send(Memo.RequestTo + '?type=delete&id=' + Product + '&r=' + Time(), 'GET', 'text');
			Call('Memo.DeleteCallBack');
		}
	}
});

Objects('ToogleMenu', {
	
	'ToogleCount' 	 : 0,
	'ToggleRequest'  : null,
	'ToggelTime'	 : 8,
	'Displays' 	 : ['DisplayOffer', 'DisplayNotebooks', 'DisplayAdvisory', 'DisplayAccessories'],
	'Elements' 	 : ['ToggleMenuOffer', 'ToggleMenuNotebooks', 'ToggleMenuAdvisory', 'ToggleMenuAccessories'],
	
	'Images' : {
	
		'ToggleMenuOffer' : {'in' : 'http://images.notebookinfo.de/ia8bAIMN5WARcLLLV6ewufzsd36SWPAMKOLWwzW2f7c5pluMQyONPFG3Zl0RV45qjJRqvCOibJvsvBqqRH1bSpQ==', 'out' : 'http://images.notebookinfo.de/iWgS/uNNHdR8Eo4DpHRCW5z9plbRZ5Dw6iW6iKspEbIJW3JOdH3jmSY7Ygktj5iBeIpLPRSm28iW8xDeyS2+NHQ=='},
		'ToggleMenuNotebooks' : {'in' : 'http://images.notebookinfo.de/iW6FGF6f2WA4ceLx4S5I5z/zSZyd4UmIWCTTPIB0vi8AoUSYqemxEaaY4zxXr0UHbAtP0vyj1CwLKt469CukXIQ==', 'out' : 'http://images.notebookinfo.de/ihMORTOc/E7aIldpOPZMRYYLpg1yAghq6otqYpkXefNppxj0JMf7B/IonMKSeeKvfa8c7LiN0EXR48lakR2visQ=='},
		'ToggleMenuAdvisory' : {'in' : 'http://images.notebookinfo.de/iMADYn5/gmWuSKZyqXG6iwZqItc8BrcdbIyykKx+vXC83AujI4hxONj5gKPmSz92YdUn7eBLtM40g2D6C1WVDGw==', 'out' : 'http://images.notebookinfo.de/icn+ibb4sIWvIT1ICR3m/Xj9z3o1l1zqlwihezNTrPgYoUSYqemxEaaY4zxXr0UHbAtP0vyj1CwLKt469CukXIQ=='},
		'ToggleMenuAccessories' : {'in' : 'http://images.notebookinfo.de/i2NLcUmUU/VHD7GMaL9ux8K/3ow8nolgxaxfYCvMbA98Q2GKouarGhjHNwcV0hYhI8+29TvC9Wq3CtSI6ndTe5A==', 'out' : 'http://images.notebookinfo.de/inezDmJVoVKUK/bMhJ5eF6mKildxO0PF5MiV92DRfnnfEQxQygC0Qvf3XMq8oHgZJSUIwx9EdNV16M2MlHHgLdw=='}
	},
	
	'Show' : function (Display) {
		
		window.clearTimeout(ToogleMenu.ToggleRequest);
		
		ToogleMenu.ToogleCount = Display;
		
		for (var x = 0; x < ToogleMenu.Elements.length; ++x) {
		
			if (Element.Find(ToogleMenu.Displays[x])) {
		
				Element.SetCssProperty(ToogleMenu.Displays[x], {
					visibility : 'hidden'
				});
				
				Element.SetCssProperty(Element.FindByTagName('a', ToogleMenu.Elements[x])[0], {
					backgroundImage : 'url(' + ToogleMenu.Images[ToogleMenu.Elements[x]]['out'] + ')'
				});
			}
		}

		Element.SetCssProperty(ToogleMenu.Displays[Display], {
			visibility : 'visible'
		});
			
		Element.SetCssProperty(Element.FindByTagName('a', ToogleMenu.Elements[Display])[0], {
			backgroundImage	: 'url(' + ToogleMenu.Images[ToogleMenu.Elements[Display]]['in'] + ')'
		});
	},
	
	'Toggle' : function (ToggleTime) {
	
		for (var x = 0; x < ToogleMenu.Elements.length; ++x) {
		
			if (Element.Find(ToogleMenu.Displays[x])) {
		
				Element.SetCssProperty(ToogleMenu.Displays[x], {
					visibility : 'hidden'
				});
				
				Element.SetCssProperty(Element.FindByTagName('a', ToogleMenu.Elements[x])[0], {
					backgroundImage : 'url(' + ToogleMenu.Images[ToogleMenu.Elements[x]]['out'] + ')'
				});
			}
		}

		Element.SetCssProperty(ToogleMenu.Displays[ToogleMenu.ToogleCount], {
			visibility : 'visible'
		});
			
		Element.SetCssProperty(Element.FindByTagName('a', ToogleMenu.Elements[ToogleMenu.ToogleCount])[0], {
			backgroundImage	: 'url(' + ToogleMenu.Images[ToogleMenu.Elements[ToogleMenu.ToogleCount]]['in'] + ')'
		});
	
		if (ToogleMenu.ToogleCount < (ToogleMenu.Displays.length - 1)) {
			ToogleMenu.ToogleCount++;
		} else ToogleMenu.ToogleCount = 0;

		ToogleMenu.ToggleRequest = window.setTimeout('ToogleMenu.Toggle(' + ToggleTime + ')', ToggleTime * 1000);
	}
});

Objects ('ProductToggleBox', {

	Load : function () {
		
		if (Element.Find('ProductsToggleBox')) {
			
			var Li = Element.FindByTagName('li', 'ProductsToggleBox');
			
			for (var x = 0; x < Li.length; ++x) {
				
				var A = Element.FindByTagName('a', Li[x])[0];
				
				A.Li = Li;
				A.onmouseover = function () {
					
					for (var x = 0; x < this.Li.length; ++x) {
						
						Element.FindByTagName('a', this.Li[x])[0].className = '';
					
					} this.className = 'Activated';
					
					Element.Find('ToggleBoxImageFile').src = this.rel;
					Element.Find('ToggleBoxImageLink').href = this.href;
				
				}; (new Image()).src = A.rel;
			}
		}
	}
});

$ = function (RedirictCode) {
	window.open('http://www.notebookinfo.de/go/' + RedirictCode);
};

Objects ('Flag', {
	
	Load : function () {
	
		var A = document.getElementsByTagName('A');

		for (var x = 0; x < A.length; ++x) {
			
			if (A[x].rel.indexOf('Flag:') > -1) {
				
				A[x].onclick = function () {
					
					window.location.href = 'http://www.notebookinfo.de/flag/?flag=' + this.rel.split(':')[1] + '&url=' + encodeURIComponent(this.href);
					return false;
				};
			}
		}
	}
});

Objects ('ElementSizer', {

	/**
	 *	Object zum dynamischen vergrößern und verkleinern von HTML-Elementen.
	 *
	 *	Company: Agentur More Style
	 *	Programmer: Robert Engelhardt
	 *	E-Mail: engelhardt@more-style.de
	 *
	 *	Created: 16 November 2006
	 *
	 *
	 *	Element initialisierung:
	 *	------------------------
	 *	ElementSizer.addElement('element1', 'height');
	 *	ElementSizer.addElement('element2', 'width');
	 *
	 *
	 *	Durchführen der Größenveränderung:
	 *	----------------------------------
	 *	ElementSizer.setElementSize('element1', 400, 50);
	 *	ElementSizer.setElementSize('element2', 650, 20);
	 */


	AddElement : function (element, sizeType)
	{

		/**
		 *	Methode zum initialisieren eines HTML-Elements über die ID
		 *
		 *	@param (element -> [object|string]) {
		 *		Enthält eine existierende ID oder eine direkte referenzierung auf HTML-Element.
		 *	}
		 *	@param (sizeType -> [string]) {
		 *		Enthält den Typ ('width' oder 'height') mit dem die Größe verändert werden soll.
		 *	}
		 */

		if (ElementSizer.e == null) {

			ElementSizer.e = {};
		}

		if (Element.Find(Typeof(element) == 'string' ? element : element['object']) != null) {

			ElementSizer.e[Typeof(element) == 'string' ? element : element['id']] = {

				element  		: Element.Find(Typeof(element) == 'string' ? element : element['object']),
				sizeType 		: (sizeType.toLowerCase() == 'width') ? 'width' : 'height',
				count			: null,
				newElementSize		: null,
				currentElementSize	: null,
				sizeDifferenz		: null,
				interval		: null
			};
		}
	},


	CalculateSize : function (t, b, c, d) {

		/**
		 *	Methode berechnet den derzeitigen Wert zwischen einem Anfangs- und einem Endendwert
		 *	in abhängigkeit von den bestimmten Durchlaufschritten.
		 *
		 *	Robert Penner
		 *	Easing Equations v1.5
		 *	Math.easeInOutQuart
		 *	http://www.robertpenner.com
		 */

		if (t==0) return b;
		if (t==d) return b+c;

		if ((t/=d/2) < 1) {

			return c/2 * Math.pow(2, 10 * (t - 1)) + b;

		} return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},


	SetSize : function (element, newSize, duration) {

		/**
		 *	Methode führt die Größenveränderung durch.
		 *
		 *	@param(element -> [string]) {
		 *		Enthält den anzusprechende ID-Namen des HTML-Elements.
		 *	}
		 *	@param(newSize -> [number]) {
		 *		Enthält die neues Größe.
		 *	}
		 *	@param(duration -> [number]) {
		 *		Enthält die anzahl der Durchlaufschritte.
		 *	}
		 */

		if(arguments[3] == null) {

			window.clearTimeout(ElementSizer.e[element]['interval']);

			ElementSizer.e[element]['count']		= 0;
			ElementSizer.e[element]['newElementSize']	= newSize;
			ElementSizer.e[element]['currentElementSize'] 	= parseInt(ElementSizer.e[element]['element'][(ElementSizer.e[element]['sizeType'] == 'width') ? 'offsetWidth' : 'offsetHeight']);
			ElementSizer.e[element]['sizeDifferenz']	= ElementSizer.e[element]['newElementSize'] - ElementSizer.e[element]['currentElementSize'];
			ElementSizer.e[element]['interval']		= 0;
		}

		if(ElementSizer.e[element]['count'] < duration) {

			ElementSizer.e[element]['element'].style[ElementSizer.e[element]['sizeType']] = ElementSizer.CalculateSize(ElementSizer.e[element]['count'], ElementSizer.e[element]['currentElementSize'], ElementSizer.e[element]['sizeDifferenz'], duration) + 'px';

			ElementSizer.e[element]['count']++;

			ElementSizer.e[element]['interval'] = window.setTimeout('ElementSizer.SetSize("' + element + '", ' + newSize + ', ' + duration + ', true)', duration);

		} else {

			ElementSizer.e[element]['count'] 		= null;
			ElementSizer.e[element]['newElementSize']	= null;
			ElementSizer.e[element]['currentElementSize'] 	= null;
			ElementSizer.e[element]['sizeDifferenz'] 	= null;
			ElementSizer.e[element]['interval']		= null;

			window.clearTimeout(ElementSizer.e[element]['interval']);
			
			ElementSizer.Callback();
		}
	},
	
	Callback : function (callback) {
		
		if (callback != null) {
			
			ElementSizer.CallbackFunction = callback;
			
		} else if (ElementSizer.CallbackFunction != null) {
		
			eval(ElementSizer.CallbackFunction)();
			ElementSizer.CallbackFunction = null;
		}
	}
});


Objects ('ValueClick', {
	
	Ads : function (Query, Width, Height, Results) {
		
		var IFrame  = '';

		IFrame += '<iframe ';
		IFrame += 'src="/Includes/Content/ValueClick/Output.php'
		IFrame += '?q=' + Query;
		IFrame += !Empty(Results) ? '&results=' + Results + '" ' : '" ';
		IFrame += 'frameborder="0" ';
		IFrame += 'scrolling="no" ';
		IFrame += 'marginwidth="0" ';
		IFrame += 'marginheight="0" ';
		IFrame += 'width="' + Width + '" ';
		IFrame += 'height="' + Height + '" ';
		IFrame += 'id="ValueClickFrame"';
		IFrame += '>';
		IFrame += '</iframe>';

		document.write(IFrame);
	}
});

Objects ('Test', {
	
	Request 	: new Ajax(),
	RequestURL 	: '/Includes/Content/Ajax/Test/Data.php',
	
	Output : function (TestID, ProductID, Output) {

		if (Empty(Test.CallBack)) {
		
			Test.CallBack = function () {

				HTML('#' + Output).Css({
				
					'position'	: 'relative',
					'overflow' 	: 'hidden',
					'padding'	: '0',
					'margin'	: '0',
					'background'	: 'none',
					'border'	: 'none'
				});

				HTML('#' + Output).Html(Test.Request['Data']['text']);
				
				//ElementSizer.AddElement(Output, 'height');
				//ElementSizer.SetSize(Output, HTML('#TestReport').Height() + 25, 20);
				
				Test.CallBack = null;
				
				setupZoom();
			};
		}

		with (Test.Request) {
		
			Send(Test.RequestURL + '?id=' + TestID + '&product_id=' + ProductID + '&r=' + Time(), 'GET', 'text');
			Call('Test.CallBack');
		}
	}
});

Objects ('KnowledgeBase', {
	
	Request 	: new Ajax(),
	RequestURL 	: '/Includes/Content/Ajax/Knowledge-Base/Data.php',
	
	Display : function (Text, Activator, Width) {
		
		HTML('#InformationDisplay').Remove();
		
		window.clearTimeout(KnowledgeBase.DisplayTimer);
			
		HTML(document.body).Create('Div', {'id' : 'InformationDisplay'}).Create('P'); 
		HTML('#InformationDisplay').Create('Span');
		HTML('#InformationDisplay').Create('a', {
		
			'id'	  : 'Close',
			'onclick' : 'window.clearTimeout(KnowledgeBase.DisplayTimer);HTML(\'#InformationDisplay\').Remove();'
		
		}).Create('Img', {'src' : 'http://images.notebookinfo.de/i2uZJZYn/1MSdFQQBx2c6KfpVMyMMsnnALXE+HAHCHG8='});
		
		HTML('P', HTML('#InformationDisplay')[0]).Html(Text);
		HTML('#InformationDisplay').Css('width', (Width == null ? 'auto' : Width + 'px'));
		HTML('#InformationDisplay').Css({

			'top'		: (HTML(Activator).Top() - HTML('#InformationDisplay').Height()) + 'px',
			'left'		: (HTML(Activator).Left() + 20) + 'px',
			'visibility' 	: 'visible'
		});
		
		HTML(Activator).IfEvent('mouseout', function () {
			
			window.clearTimeout(KnowledgeBase.DisplayTimer);
			
			KnowledgeBase.DisplayTimer = window.setTimeout('HTML(\'#InformationDisplay\').Remove()', 2000);
		});
		
		HTML('#InformationDisplay').IfEvent('mouseover', function () {
			
			window.clearTimeout(KnowledgeBase.DisplayTimer);
		});
		
		HTML('#InformationDisplay').IfEvent('mouseout', function () {
			
			window.clearTimeout(KnowledgeBase.DisplayTimer);
			
			KnowledgeBase.DisplayTimer = window.setTimeout('HTML(\'#InformationDisplay\').Remove()', 2000);
		});
	},
	
	Rating : function (Rate, ArticleID, RatingAreaID) {
		
		if (KnowledgeBase.CallBack == null) {
		
			KnowledgeBase.CallBack = function () {
				
				HTML('#' + RatingAreaID).Html(KnowledgeBase.Request['Data']['text']);
				
				KnowledgeBase.CallBack = null;
			};
		}
		
		with (KnowledgeBase.Request) {
		
			Send(KnowledgeBase.RequestURL + '?type=1&article=' + ArticleID + '&rating=' + Rate + '&r=' + Time(), 'GET', 'text');
			Call('KnowledgeBase.CallBack');
		}	
	}
});

Objects ('InfoDisplay', {

	'Delay'		: 2,
	'Request' 	: new Ajax(),
	'RequestURL' 	: '',
	
	'Show' : function (Content, Activator, Width) {
		
		window.clearTimeout(InfoDisplay.Timer);
		
		if (HTML('#InformationDisplay').Remove()) {

			var Left  = 0;
			var Image = {'background' : 'transparent url(http://media.notebookinfo.de/info-display-pop-arrow-left/aa262971da77b22e9660cf5f3cfa2084) 10px 0px no-repeat'};
			var Body  = document.compatMode && document.compatMode != 'BackCompat' ? document.documentElement : (document.body || null);

			if (HTML(Activator).Left() >= (HTML(Body).Width() / 2)) {
				Image = {'background' : 'transparent url(http://media.notebookinfo.de/info-display-pop-arrow-right/bc8b3bd0c4a9e75e811adec0f0cc4de1) 97% 0px no-repeat'};
			}

			HTML(document.body).Create('Div', {'id' : 'InformationDisplay'}, {'width' : !Empty(Width) ? Width + 'px' : 'auto'}).Create('P'); 
			HTML('#InformationDisplay').Create('Span', null, Image);
			HTML('#InformationDisplay').Create('a', {
			
				'id'	  : 'Close',
				'onclick' : 'window.clearTimeout(InfoDisplay.Timer);HTML(\'#InformationDisplay\').Remove();'
			
			}).Create('Img', {'src' : 'http://media.notebookinfo.de/info-display-close-button/b69c77666808cc86501d5a6e649cf8b9'});
			
			if (!Empty(InfoDisplay.RequestURL)) {
			
				if (Empty(InfoDisplay.CallBack)) {
				
					InfoDisplay.CallBack = function () {
					
						HTML('P', HTML('#InformationDisplay')[0]).Html(InfoDisplay.Request['Data']['text']);
						
						if (HTML(Activator).Left() < (HTML(Body).Width() / 2)) {
							Left  = HTML(Activator).Left() + 20;
						} else Left = HTML(Activator).Left() - HTML('#InformationDisplay').Width() + 20;
						
						HTML('#InformationDisplay').Css({
							
							'top'		: (HTML(Activator).Top() - HTML('#InformationDisplay').Height()) + 'px',
							'left'		: Left + 'px',
							'visibility' 	: 'visible'
						
						}); InfoDisplay.CallBack = null;
					};
				}
				
				with (InfoDisplay.Request) {
				
					Send(InfoDisplay.RequestURL + '?' + Content + '&r=' + Time(), 'GET', 'text');
					Call('InfoDisplay.CallBack');
				}
				
			} else {
			
				HTML('P', HTML('#InformationDisplay')[0]).Html(Content);
				
				if (HTML(Activator).Left() < (HTML(Body).Width() / 2)) {
					Left  = HTML(Activator).Left() + 20;
				} else Left = HTML(Activator).Left() - HTML('#InformationDisplay').Width() + 20;
				
				HTML('#InformationDisplay').Css({
					
					'top'		: (HTML(Activator).Top() - HTML('#InformationDisplay').Height()) + 'px',
					'left'		: Left + 'px',
					'visibility' 	: 'visible'
				});
			}

			HTML(Activator).IfEvent('mouseout', function () {
				
				window.clearTimeout(InfoDisplay.Timer);
				
				InfoDisplay.Timer = window.setTimeout('HTML(\'#InformationDisplay\').Remove()', InfoDisplay.Delay * 1000);
			});
			
			HTML('#InformationDisplay').IfEvent('mouseover', function () {
				
				window.clearTimeout(InfoDisplay.Timer);
			});
			
			HTML('#InformationDisplay').IfEvent('mouseout', function () {
				
				window.clearTimeout(InfoDisplay.Timer);
				
				InfoDisplay.Timer = window.setTimeout('HTML(\'#InformationDisplay\').Remove()', InfoDisplay.Delay * 1000);
			});
		}
	}
});

Objects ('Kaufberatung', {
	
	DisplayDelay  : 0.5,
	
	TeaserDisplay : function (Content, Activator) {
		
		Kaufberatung.TeaserDisplayClose();
		
		HTML(document.body).Create('Div', {'id' : 'KaufberatungTeaserDisplay'}, {
		
			'width'			: '350px',
			'position'		: 'absolute',
			'left'			: '0',
			'top'			: '0',
			'backgroundColor'	: '#FFF8E4',
			'border'		: '1px solid #D7D9E5',
			'MozBorderRadius' 	: '10px',
			'KhtmlBorderRadius' 	: '10px',
			'visibility'		: 'hidden'
		});
		
		HTML(document.body).Create('Span', {'id' : 'KaufberatungTeaserDisplayTube'}, {
		
			'position'		: 'absolute',
			'top'			: (HTML(Activator).Top() - 12) + 'px',
			'left'			: HTML(Activator).Left() + 'px',
			'width'			: (HTML(Activator).Width() - 2) + 'px',
			'height'		: '13px',
			'background'		: '#FFF url(http://images.notebookinfo.de/itAUmrSdyyYtMTIa7hf0rknu/W7H/YPrMEvg9ZcTBQSk=) 0px 0px repeat-x',
			'borderLeft'		: '1px solid #D7D9E5',
			'borderRight'		: '1px solid #D7D9E5',
			'display'		: 'block'
		});
		
		HTML('#KaufberatungTeaserDisplay').Create('P', null, {
		
			'lineHeight'		: '18px',
			'padding' 		: '13px 15px 13px 15px'
		});
		
		HTML('#KaufberatungTeaserDisplay').Create('A', 
		
			{'onclick' : 'Kaufberatung.TeaserDisplayClose();'},
			{'position' : 'absolute', 'top' : '5px', 'right' : '6px'}
			
		).Create('Img', {'src' : 'http://images.notebookinfo.de/imBoEZyMU44iM25JlGK2lsxulZflJ2KyVVPlZc28bDow='});
			
		HTML('P', HTML('#KaufberatungTeaserDisplay')[0]).Html(Content);
		HTML('#KaufberatungTeaserDisplay').Css({
		
			'left'		: '612px',
			'top'		: (HTML(Activator).Top() - HTML('#KaufberatungTeaserDisplay').Height() - 11) + 'px',
			'visibility' 	: 'visible'
		});
		

		HTML(Activator).IfEvent('mouseout', function () {
			
			window.clearTimeout(Kaufberatung.Timer);
			
			Kaufberatung.Timer = window.setTimeout('Kaufberatung.TeaserDisplayClose()', Kaufberatung.DisplayDelay * 1000);
		});
		
		HTML('#KaufberatungTeaserDisplay').IfEvent('mouseover', function () {
			
			window.clearTimeout(Kaufberatung.Timer);
		});
		
		HTML('#KaufberatungTeaserDisplay').IfEvent('mouseout', function () {
			
			window.clearTimeout(Kaufberatung.Timer);
			
			Kaufberatung.Timer = window.setTimeout('Kaufberatung.TeaserDisplayClose()', Kaufberatung.DisplayDelay * 1000);
		});
	},
	
	TeaserDisplayClose : function () {
		
		window.clearTimeout(Kaufberatung.Timer);
		
		HTML('#KaufberatungTeaserDisplay').Remove();
		HTML('#KaufberatungTeaserDisplayTube').Remove();
	}
});

Objects ('Login', {
	
	Do : function (Activator) {
	
		HTML('#Login').Css({
		
			'left' : (HTML(Activator).Left() - HTML('#Login').Width() + 50) + 'px',
			'top'  : (HTML(Activator).Top() + 17) + 'px'
		
		}); HTML('#Login').Css('visibility', 'visible');
	}
});

Objects ('Report', {
	
	Request 	: new Ajax(),
	RequestURL 	: '/Includes/Content/Ajax/Report/Data.php',
	
	Output : function (TextField, Output) {
		
		window.clearTimeout(Output.Interval);

		Output.Interval = window.setTimeout(function () {
			
			window.clearTimeout(Output.Interval);
			
			HTML('#' + Output).Css({'display' : 'none'}).Html('');
			HTML(TextField).Css({
				'background' : 'transparent url(http://media.notebookinfo.de/loading-wheel-white/f6f29312b178b9d79a48b64864f428b3) 98% 50% no-repeat'
			});
	
			if (Empty(Report.CallBack)) {
			
				Report.CallBack = function () {
					
					if (Empty(Report.Request['Data']['text'])) {
					
						HTML('#' + Output).Css({'display' : 'block'}).Html('<div style="cursor:default;">Es konnte kein Produkt zu Deiner Suche gefunden werden.</div>');
	
					} else HTML('#' + Output).Css({'display' : 'block'}).Html(Report.Request['Data']['text']);
					
					HTML(TextField).Css({'background' : '#FFF'});

					Report.CallBack = null;
				};
			}
	
			with (Report.Request) {
			
				Send(Report.RequestURL + '?query=' + encodeURIComponent(HTML(TextField).Value()) + '&r=' + Time(), 'GET', 'text');
				Call('Report.CallBack');
			}
			
		}, 2000);
		
		HTML('#Submit').Css({'display' : 'none'});
	},
	
	TakeProduct : function (Output, ProductName, ProductID, TextField, IDField, SeriesFieldID) {

		HTML('#' + Output).Css({'display' : 'none'}).Html('');
		HTML('#' + TextField).Value(ProductName);
		HTML('#' + IDField).Value(ProductID);
		if (!Empty(SeriesFieldID)) {
			HTML('#' + SeriesFieldID).Value('1');
		}
		HTML('#Submit').Css({'display' : ''});
		window.location.href=window.location.href + '#Wrapper';
	},
	
	RowHover : function (Object, Color) {
		
		if (Empty(Object.PreviousColor)) {
			
			Object.PreviousColor = HTML(Object).Css('background-color');
		
		} HTML(Object).Css('backgroundColor', Color);
		
		if (Empty(Object.onmouseout)) {
		
			HTML(Object).IfEvent('mouseout', function () {
				HTML(this).Css('backgroundColor', this.PreviousColor);
			});
		}
	}
});

Objects ('UserNotebook', {
	
	XHTMLRequest : new Ajax(),

	Series : function (ManufacturerID) {

		if (!Empty(ManufacturerID)) {
		
			HTML('#SeriesLoadingWheel').Css({'display' : 'inline'});
			HTML('#Series_ID').Disabled(true).Clear().Option('Lade passende Serien ...', '');
			HTML('#Product_ID').Disabled(true).Clear().Option('Keine Notebooks vorhanden', '');
			
			if (UserNotebook.CallBack == null) {
			
				UserNotebook.CallBack = function () {

					var Result = UserNotebook.XHTMLRequest['Data']['series']['item'];

					HTML('#Series_ID').Clear();
					
					if (!Empty(Result)) {
					
						if (!(Result instanceof Array)) {
							Result = [Result];
						} 
						
						HTML('#Series_ID').Option('Serie wählen', '').Option('- -', '');
						
						for (var x = 0; x < Result.length; ++x) {
							HTML('#Series_ID').Option(Result[x]['text'], Result[x]['value']);
						}
							
						HTML('#Series_ID').Disabled(false);
					
					} else HTML('#Series_ID').Option('Keine Serien vorhanden', '').Disabled(true);
					
					HTML('#SeriesLoadingWheel').Css({'display' : 'none'});
					UserNotebook.CallBack = null;
				};
			}

			UserNotebook.XHTMLRequest.Send('/Includes/Content/Ajax/User-Notebook/Produktserie.php?manufacturer=' + ManufacturerID + '&r=' + Time(), 'GET', 'xml');
			UserNotebook.XHTMLRequest.Call('UserNotebook.CallBack');
		}
	},

	Products : function (SeriesID) {

		if (!Empty(SeriesID)) {
		
			HTML('#ProductLoadingWheel').Css({'display' : 'inline'});
			HTML('#Product_ID').Disabled(true).Clear().Option('Lade passende Notebooks ...', '');
			
			if (UserNotebook.CallBack == null) {
			
				UserNotebook.CallBack = function () {

					var Result = UserNotebook.XHTMLRequest['Data']['products']['item'];

					HTML('#Product_ID').Clear();
					
					if (!Empty(Result)) {
					
						if (!(Result instanceof Array)) {
							Result = [Result];
						} 
						
						HTML('#Product_ID').Option('Notebook wählen', '').Option('- -', '');
						
						for (var x = 0; x < Result.length; ++x) {
							HTML('#Product_ID').Option(Result[x]['text'], Result[x]['value']);
						}
							
						HTML('#Product_ID').Disabled(false);
					
					} else HTML('#Product_ID').Option('Keine Notebooks vorhanden', '').Disabled(true);
					
					HTML('#ProductLoadingWheel').Css({'display' : 'none'});
					UserNotebook.CallBack = null;
				};
			}

			UserNotebook.XHTMLRequest.Send('/Includes/Content/Ajax/User-Notebook/Produkte-der-Serie.php?series=' + SeriesID + '&r=' + Time(), 'GET', 'xml');
			UserNotebook.XHTMLRequest.Call('UserNotebook.CallBack');
		}
	}
});

Objects ('Comments', {
	
	DoLogin : function () {
		HTML('#RegisterCommentBox').Css({
			'filter'	: 'alpha(opacity=20)',
			'mozOpacity'	: '0.2',
			'opacity'	: '0.2'
		});
		HTML('input[type=text|checkbox|image|hidden]', HTML('#RegisterCommentBox')[0]).Disabled(true);
		HTML('textarea', HTML('#RegisterCommentBox')[0]).Disabled(true);
		HTML('#CommentLoginBox').Css({'display' : 'block'});
	},
	
	DoRegister : function () {
		HTML('#RegisterCommentBox').Css({
			'filter'	: 'alpha(opacity=100)',
			'mozOpacity'	: '1',
			'opacity'	: '1'
		});
		HTML('input[type=text|checkbox|image|hidden]', HTML('#RegisterCommentBox')[0]).Disabled(false);
		HTML('textarea', HTML('#RegisterCommentBox')[0]).Disabled(false);
		HTML('#CommentLoginBox').Css({'display' : 'none'});
	}
});

Objects ('ItemSlider', {
	
	Move : function (Direction, SliderNumber) {

		if (Empty(SliderNumber)) SliderNumber = '';
		
		var FrameWidth	= HTML('#ItemSlider' + SliderNumber)[0].offsetParent.offsetWidth;
		var SliderWidth = HTML('#ItemSlider' + SliderNumber).Width();
		var SlideSteps	= Math.ceil(SliderWidth / FrameWidth);
		var CurrentStep	= Math.floor((Math.abs(HTML('#ItemSlider' + SliderNumber)[0].offsetLeft) / FrameWidth));

		if (Direction.toLowerCase() == 'left') {
			
			if (Math.abs(HTML('#ItemSlider' + SliderNumber)[0].offsetLeft) > 0) {
				
				HTML('A', HTML('#ButtonLeft' + SliderNumber)[0]).DisabledEvent('click', true);
				HTML('A', HTML('#ButtonRight' + SliderNumber)[0]).DisabledEvent('click', true);
				
				HTML('Img', HTML('#ButtonRight' + SliderNumber)[0])[0].src = '/Images/Buttons/item-scroller-button-right.gif';
				HTML('Img', HTML('#ButtonLeft' + SliderNumber)[0])[0].src = '/Images/Buttons/item-scroller-button-left.gif';
				
				HTML('#ItemSlider' + SliderNumber).Move_Slide(-(FrameWidth * (CurrentStep - 1) + (12 * (CurrentStep - 1))), 0, 10, null, function () {
					
					HTML('A', HTML('#ButtonLeft' + SliderNumber)[0]).DisabledEvent('click', false);
					HTML('A', HTML('#ButtonRight' + SliderNumber)[0]).DisabledEvent('click', false);
				
					if (Math.abs(HTML('#ItemSlider' + SliderNumber)[0].offsetLeft) == 0) {
						HTML('Img', HTML('#ButtonLeft' + SliderNumber)[0])[0].src = '/Images/Buttons/item-scroller-button-left_inactiv.gif';
					}
				});
			}
		}
		
		if (Direction.toLowerCase() == 'right') {
			
			if ((CurrentStep + 1) < SlideSteps) {
				
				HTML('A', HTML('#ButtonLeft' + SliderNumber)[0]).DisabledEvent('click', true);
				HTML('A', HTML('#ButtonRight' + SliderNumber)[0]).DisabledEvent('click', true);
				
				HTML('Img', HTML('#ButtonRight' + SliderNumber)[0])[0].src = '/Images/Buttons/item-scroller-button-right.gif';
				HTML('Img', HTML('#ButtonLeft' + SliderNumber)[0])[0].src = '/Images/Buttons/item-scroller-button-left.gif';
				
				HTML('#ItemSlider' + SliderNumber).Move_Slide(-(FrameWidth * (CurrentStep + 1) + (12 * (CurrentStep + 1))), 0, 10, null, function () {
					
					HTML('A', HTML('#ButtonLeft' + SliderNumber)[0]).DisabledEvent('click', false);
					HTML('A', HTML('#ButtonRight' + SliderNumber)[0]).DisabledEvent('click', false);		

					if (Math.abs(HTML('#ItemSlider' + SliderNumber)[0].offsetLeft) == ((SlideSteps * FrameWidth) - (FrameWidth - (12 * (SlideSteps - 1))))) {
						HTML('Img', HTML('#ButtonRight' + SliderNumber)[0])[0].src = '/Images/Buttons/item-scroller-button-right_inactiv.gif';
					}
				});
			}
		}
	}
});

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

// FancyZoom.js - v1.1 - http://www.fancyzoom.com
//
// Copyright (c) 2008 Cabel Sasser / Panic Inc
// All rights reserved.
// 
//     Requires: FancyZoomHTML.js
// Instructions: Include JS files in page, call setupZoom() in onLoad. That's it!
//               Any <a href> links to images will be updated to zoom inline.
//               Add rel="nozoom" to your <a href> to disable zooming for an image.
// 
// Redistribution and use of this effect in source form, with or without modification,
// are permitted provided that the following conditions are met:
// 
// * USE OF SOURCE ON COMMERCIAL (FOR-PROFIT) WEBSITE REQUIRES ONE-TIME LICENSE FEE PER DOMAIN.
//   Reasonably priced! Visit www.fancyzoom.com for licensing instructions. Thanks!
//
// * Non-commercial (personal) website use is permitted without license/payment!
//
// * Redistribution of source code must retain the above copyright notice,
//   this list of conditions and the following disclaimer.
//
// * Redistribution of source code and derived works cannot be sold without specific
//   written prior permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

var includeCaption = true; // Turn on the "caption" feature, and write out the caption HTML
var zoomTime       = 0;    // Milliseconds between frames of zoom animation
var zoomSteps      = 5;   // Number of zoom animation frames
var includeFade    = 0;    // Set to 1 to fade the image in / out as it zooms
var minBorder      = 90;   // Amount of padding between large, scaled down images, and the window edges
var shadowSettings = '0px 5px 25px rgba(0, 0, 0, '; // Blur, radius, color of shadow for compatible browsers

var zoomImagesURI   = '/Includes/Content/FancyImages/'; // Location of the zoom and shadow images

// Init. Do not add anything below this line, unless it's something awesome.

var myWidth = 0, myHeight = 0, myScroll = 0; myScrollWidth = 0; myScrollHeight = 0;
var zoomOpen = false, preloadFrame = 1, preloadActive = false, preloadTime = 0, imgPreload = new Image();
var preloadAnimTimer = 0;

var zoomActive = new Array(); var zoomTimer  = new Array(); 
var zoomOrigW  = new Array(); var zoomOrigH  = new Array();
var zoomOrigX  = new Array(); var zoomOrigY  = new Array();

var zoomID         = "ZoomBox";
var theID          = "ZoomImage";
var zoomCaption    = "ZoomCaption";
var zoomCaptionDiv = "ZoomCapDiv";

if (navigator.userAgent.indexOf("MSIE") != -1) {
	var browserIsIE = true;
}

// Zoom: Setup The Page! Called in your <body>'s onLoad handler.

function setupZoom() {
	prepZooms();
	insertZoomHTML();
	zoomdiv = document.getElementById(zoomID);  
	zoomimg = document.getElementById(theID);
}

// Zoom: Inject Javascript functions into hrefs pointing to images, one by one!
// Skip any href that contains a rel="nozoom" tag.
// This is done at page load time via an onLoad() handler.

function prepZooms() {
	if (! document.getElementsByTagName) {
		return;
	}
	var links = document.getElementsByTagName("a");
	for (i = 0; i < links.length; i++) {
		if (links[i].getAttribute("href")) {
			if (links[i].getAttribute("href").search(/media\.mopolis\.de/gi) != -1 || links[i].getAttribute("href").search(/images\.notebookinfo\.de/gi) != -1) {
				if (links[i].getAttribute("rel") != "nozoom") {
					links[i].onclick = function (event) { return zoomClick(this, event); };
					links[i].onmouseover = function () { zoomPreload(this); };
				}
			}
		}
	}
}

// Zoom: Load an image into an image object. When done loading, function sets preloadActive to false,
// so other bits know that they can proceed with the zoom.
// Preloaded image is stored in imgPreload and swapped out in the zoom function.

function zoomPreload(from) {

	var theimage = from.getAttribute("href");

	// Only preload if we have to, i.e. the image isn't this image already

	if (imgPreload.src.indexOf(from.getAttribute("href").substr(from.getAttribute("href").lastIndexOf("/"))) == -1) {
		preloadActive = true;
		imgPreload = new Image();

		// Set a function to fire when the preload is complete, setting flags along the way.

		imgPreload.onload = function() {
			preloadActive = false;
		}

		// Load it!
		imgPreload.src = theimage;
	}
}

// Zoom: Start the preloading animation cycle.

function preloadAnimStart() {
	preloadTime = new Date();
	document.getElementById("ZoomSpin").style.left = (myWidth / 2) + 'px';
	document.getElementById("ZoomSpin").style.top = ((myHeight / 2) + myScroll) + 'px';
	document.getElementById("ZoomSpin").style.visibility = "visible";	
	preloadFrame = 1;
	document.getElementById("SpinImage").src = zoomImagesURI+'zoom-spin-'+preloadFrame+'.png';  
	preloadAnimTimer = setInterval("preloadAnim()", 100);
}

// Zoom: Display and ANIMATE the jibber-jabber widget. Once preloadActive is false, bail and zoom it up!

function preloadAnim(from) {
	if (preloadActive != false) {
		document.getElementById("SpinImage").src = zoomImagesURI+'zoom-spin-'+preloadFrame+'.png';
		preloadFrame++;
		if (preloadFrame > 12) preloadFrame = 1;
	} else {
		document.getElementById("ZoomSpin").style.visibility = "hidden";    
		clearInterval(preloadAnimTimer);
		preloadAnimTimer = 0;
		zoomIn(preloadFrom);
	}
}

// ZOOM CLICK: We got a click! Should we do the zoom? Or wait for the preload to complete?
// todo?: Double check that imgPreload src = clicked src

function zoomClick(from, evt) {

	var shift = getShift(evt);

	// Check for Command / Alt key. If pressed, pass them through -- don't zoom!
	if (! evt && window.event && (window.event.metaKey || window.event.altKey)) {
		return true;
	} else if (evt && (evt.metaKey|| evt.altKey)) {
		return true;
	}

	// Get browser dimensions
	getSize();

	// If preloading still, wait, and display the spinner.
	if (preloadActive == true) {
		// But only display the spinner if it's not already being displayed!
		if (preloadAnimTimer == 0) {
			preloadFrom = from;
			preloadAnimStart();	
		}
	} else {
		// Otherwise, we're loaded: do the zoom!
		zoomIn(from, shift);
	}
	
	return false;
	
}

// Zoom: Move an element in to endH endW, using zoomHost as a starting point.
// "from" is an object reference to the href that spawned the zoom.

function zoomIn(from, shift) {

	zoomimg.src = from.getAttribute("href");

	// Determine the zoom settings from where we came from, the element in the <a>.
	// If there's no element in the <a>, or we can't get the width, make stuff up

	if (from.childNodes[0].width) {
		startW = from.childNodes[0].width;
		startH = from.childNodes[0].height;
		startPos = findElementPos(from.childNodes[0]);
	} else {
		startW = 50;
		startH = 12;
		startPos = findElementPos(from);
	}

	hostX = startPos[0];
	hostY = startPos[1];

	// Make up for a scrolled containing div.
	// TODO: This HAS to move into findElementPos.
	
	if (document.getElementById('scroller')) {
		hostX = hostX - document.getElementById('scroller').scrollLeft;
	}

	// Determine the target zoom settings from the preloaded image object

	endW = imgPreload.width;
	endH = imgPreload.height;

	// Start! But only if we're not zooming already!

	if (zoomActive[theID] != true) {

		// Clear everything out just in case something is already open

		if (document.getElementById("ShadowBox")) {
			document.getElementById("ShadowBox").style.visibility = "hidden";
		} else if (! browserIsIE) {
		
			// Wipe timer if shadow is fading in still
			if (fadeActive["ZoomImage"]) {
				clearInterval(fadeTimer["ZoomImage"]);
				fadeActive["ZoomImage"] = false;
				fadeTimer["ZoomImage"] = false;			
			}
			
			document.getElementById("ZoomImage").style.webkitBoxShadow = shadowSettings + '0.0)';			
		}
		
		document.getElementById("ZoomClose").style.visibility = "hidden";     

		// Setup the CAPTION, if existing. Hide it first, set the text.

		if (includeCaption) {
			document.getElementById(zoomCaptionDiv).style.visibility = "hidden";
			if (from.getAttribute('title') && includeCaption) {
				// Yes, there's a caption, set it up
				document.getElementById(zoomCaption).innerHTML = from.getAttribute('title');
			} else {
				document.getElementById(zoomCaption).innerHTML = "";
			}
		}

		// Store original position in an array for future zoomOut.

		zoomOrigW[theID] = startW;
		zoomOrigH[theID] = startH;
		zoomOrigX[theID] = hostX;
		zoomOrigY[theID] = hostY;

		// Now set the starting dimensions

		zoomimg.style.width = startW + 'px';
		zoomimg.style.height = startH + 'px';
		zoomdiv.style.left = hostX + 'px';
		zoomdiv.style.top = hostY + 'px';

		// Show the zooming image container, make it invisible

		if (includeFade == 1) {
			setOpacity(0, zoomID);
		}
		zoomdiv.style.visibility = "visible";

		// If it's too big to fit in the window, shrink the width and height to fit (with ratio).

		sizeRatio = endW / endH;
		if (endW > myWidth - minBorder) {
			endW = myWidth - minBorder;
			endH = endW / sizeRatio;
		}
		if (endH > myHeight - minBorder) {
			endH = myHeight - minBorder;
			endW = endH * sizeRatio;
		}

		zoomChangeX = ((myWidth / 2) - (endW / 2) - hostX);
		zoomChangeY = (((myHeight / 2) - (endH / 2) - hostY) + myScroll);
		zoomChangeW = (endW - startW);
		zoomChangeH = (endH - startH);
		
		// Shift key?
	
		if (shift) {
			tempSteps = zoomSteps * 7;
		} else {
			tempSteps = zoomSteps;
		}

		// Setup Zoom

		zoomCurrent = 0;

		// Setup Fade with Zoom, If Requested

		if (includeFade == 1) {
			fadeCurrent = 0;
			fadeAmount = (0 - 100) / tempSteps;
		} else {
			fadeAmount = 0;
		}

		// Do It!
		
		zoomTimer[theID] = setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+hostX+", "+zoomChangeX+", "+hostY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDoneIn(zoomID)')", zoomTime);		
		zoomActive[theID] = true; 
	}
}

// Zoom it back out.

function zoomOut(from, evt) {

	// Get shift key status.
	// IE events don't seem to get passed through the function, so grab it from the window.

	if (getShift(evt)) {
		tempSteps = zoomSteps * 7;
	} else {
		tempSteps = zoomSteps;
	}	

	// Check to see if something is happening/open
  
	if (zoomActive[theID] != true) {

		// First, get rid of the shadow if necessary.

		if (document.getElementById("ShadowBox")) {
			document.getElementById("ShadowBox").style.visibility = "hidden";
		} else if (! browserIsIE) {
		
			// Wipe timer if shadow is fading in still
			if (fadeActive["ZoomImage"]) {
				clearInterval(fadeTimer["ZoomImage"]);
				fadeActive["ZoomImage"] = false;
				fadeTimer["ZoomImage"] = false;			
			}
			
			document.getElementById("ZoomImage").style.webkitBoxShadow = shadowSettings + '0.0)';			
		}

		// ..and the close box...

		document.getElementById("ZoomClose").style.visibility = "hidden";

		// ...and the caption if necessary!

		if (includeCaption && document.getElementById(zoomCaption).innerHTML != "") {
			// fadeElementSetup(zoomCaptionDiv, 100, 0, 5, 1);
			document.getElementById(zoomCaptionDiv).style.visibility = "hidden";
		}

		// Now, figure out where we came from, to get back there

		startX = parseInt(zoomdiv.style.left);
		startY = parseInt(zoomdiv.style.top);
		startW = zoomimg.width;
		startH = zoomimg.height;
		zoomChangeX = zoomOrigX[theID] - startX;
		zoomChangeY = zoomOrigY[theID] - startY;
		zoomChangeW = zoomOrigW[theID] - startW;
		zoomChangeH = zoomOrigH[theID] - startH;

		// Setup Zoom

		zoomCurrent = 0;

		// Setup Fade with Zoom, If Requested

		if (includeFade == 1) {
			fadeCurrent = 0;
			fadeAmount = (100 - 0) / tempSteps;
		} else {
			fadeAmount = 0;
		}

		// Do It!

		zoomTimer[theID] = setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+startX+", "+zoomChangeX+", "+startY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDone(zoomID, theID)')", zoomTime);	
		zoomActive[theID] = true;
	}
}

// Finished Zooming In

function zoomDoneIn(zoomdiv, theID) {

	// Note that it's open
  
	zoomOpen = true;
	zoomdiv = document.getElementById(zoomdiv);

	// Position the table shadow behind the zoomed in image, and display it

	if (document.getElementById("ShadowBox")) {

		setOpacity(0, "ShadowBox");
		shadowdiv = document.getElementById("ShadowBox");

		shadowLeft = parseInt(zoomdiv.style.left) - 13;
		shadowTop = parseInt(zoomdiv.style.top) - 8;
		shadowWidth = zoomdiv.offsetWidth + 26;
		shadowHeight = zoomdiv.offsetHeight + 26; 
	
		shadowdiv.style.width = shadowWidth + 'px';
		shadowdiv.style.height = shadowHeight + 'px';
		shadowdiv.style.left = shadowLeft + 'px';
		shadowdiv.style.top = shadowTop + 'px';

		document.getElementById("ShadowBox").style.visibility = "visible";
		fadeElementSetup("ShadowBox", 0, 100, 5);
		
	} else if (! browserIsIE) {
		// Or, do a fade of the modern shadow
		fadeElementSetup("ZoomImage", 0, .8, 5, 0, "shadow");
	}
	
	// Position and display the CAPTION, if existing
  
	if (includeCaption && document.getElementById(zoomCaption).innerHTML != "") {
		// setOpacity(0, zoomCaptionDiv);
		zoomcapd = document.getElementById(zoomCaptionDiv);
		zoomcapd.style.top = parseInt(zoomdiv.style.top) + (zoomdiv.offsetHeight + 15) + 'px';
		zoomcapd.style.left = (myWidth / 2) - (zoomcapd.offsetWidth / 2) + 'px';
		zoomcapd.style.visibility = "visible";
		// fadeElementSetup(zoomCaptionDiv, 0, 100, 5);
	}   
	
	// Display Close Box (fade it if it's not IE)

	if (!browserIsIE) setOpacity(0, "ZoomClose");
	document.getElementById("ZoomClose").style.visibility = "visible";
	if (!browserIsIE) fadeElementSetup("ZoomClose", 0, 100, 5);

	// Get keypresses
	document.onkeypress = getKey;
	
}

// Finished Zooming Out

function zoomDone(zoomdiv, theID) {

	// No longer open
  
	zoomOpen = false;

	// Clear stuff out, clean up

	zoomOrigH[theID] = "";
	zoomOrigW[theID] = "";
	document.getElementById(zoomdiv).style.visibility = "hidden";
	zoomActive[theID] == false;

	// Stop getting keypresses

	document.onkeypress = null;

}

// Actually zoom the element

function zoomElement(zoomdiv, theID, zoomCurrent, zoomStartW, zoomChangeW, zoomStartH, zoomChangeH, zoomStartX, zoomChangeX, zoomStartY, zoomChangeY, zoomSteps, includeFade, fadeAmount, execWhenDone) {

	// console.log("Zooming Step #"+zoomCurrent+ " of "+zoomSteps+" (zoom " + zoomStartW + "/" + zoomChangeW + ") (zoom " + zoomStartH + "/" + zoomChangeH + ")  (zoom " + zoomStartX + "/" + zoomChangeX + ")  (zoom " + zoomStartY + "/" + zoomChangeY + ") Fade: "+fadeAmount);
    
	// Test if we're done, or if we continue

	if (zoomCurrent == (zoomSteps + 1)) {
		zoomActive[theID] = false;
		clearInterval(zoomTimer[theID]);

		if (execWhenDone != "") {
			eval(execWhenDone);
		}
	} else {
	
		// Do the Fade!
	  
		if (includeFade == 1) {
			if (fadeAmount < 0) {
				setOpacity(Math.abs(zoomCurrent * fadeAmount), zoomdiv);
			} else {
				setOpacity(100 - (zoomCurrent * fadeAmount), zoomdiv);
			}
		}
	  
		// Calculate this step's difference, and move it!
		
		moveW = cubicInOut(zoomCurrent, zoomStartW, zoomChangeW, zoomSteps);
		moveH = cubicInOut(zoomCurrent, zoomStartH, zoomChangeH, zoomSteps);
		moveX = cubicInOut(zoomCurrent, zoomStartX, zoomChangeX, zoomSteps);
		moveY = cubicInOut(zoomCurrent, zoomStartY, zoomChangeY, zoomSteps);
	
		document.getElementById(zoomdiv).style.left = moveX + 'px';
		document.getElementById(zoomdiv).style.top = moveY + 'px';
		zoomimg.style.width = moveW + 'px';
		zoomimg.style.height = moveH + 'px';
	
		zoomCurrent++;
		
		clearInterval(zoomTimer[theID]);
		zoomTimer[theID] = setInterval("zoomElement('"+zoomdiv+"', '"+theID+"', "+zoomCurrent+", "+zoomStartW+", "+zoomChangeW+", "+zoomStartH+", "+zoomChangeH+", "+zoomStartX+", "+zoomChangeX+", "+zoomStartY+", "+zoomChangeY+", "+zoomSteps+", "+includeFade+", "+fadeAmount+", '"+execWhenDone+"')", zoomTime);
	}
}

// Zoom Utility: Get Key Press when image is open, and act accordingly

function getKey(evt) {
	if (! evt) {
		theKey = event.keyCode;
	} else {
		theKey = evt.keyCode;
	}

	if (theKey == 27) { // ESC
		zoomOut(this, evt);
	}
}

////////////////////////////
//
// FADE Functions
//

function fadeOut(elem) {
	if (elem.id) {
		fadeElementSetup(elem.id, 100, 0, 10);
	}
}

function fadeIn(elem) {
	if (elem.id) {
		fadeElementSetup(elem.id, 0, 100, 10);	
	}
}

// Fade: Initialize the fade function

var fadeActive = new Array();
var fadeQueue  = new Array();
var fadeTimer  = new Array();
var fadeClose  = new Array();
var fadeMode   = new Array();

function fadeElementSetup(theID, fdStart, fdEnd, fdSteps, fdClose, fdMode) {

	// alert("Fading: "+theID+" Steps: "+fdSteps+" Mode: "+fdMode);

	if (fadeActive[theID] == true) {
		// Already animating, queue up this command
		fadeQueue[theID] = new Array(theID, fdStart, fdEnd, fdSteps);
	} else {
		fadeSteps = fdSteps;
		fadeCurrent = 0;
		fadeAmount = (fdStart - fdEnd) / fadeSteps;
		fadeTimer[theID] = setInterval("fadeElement('"+theID+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')", 15);
		fadeActive[theID] = true;
		fadeMode[theID] = fdMode;
		
		if (fdClose == 1) {
			fadeClose[theID] = true;
		} else {
			fadeClose[theID] = false;
		}
	}
}

// Fade: Do the fade. This function will call itself, modifying the parameters, so
// many instances can run concurrently. Can fade using opacity, or fade using a box-shadow.

function fadeElement(theID, fadeCurrent, fadeAmount, fadeSteps) {

	if (fadeCurrent == fadeSteps) {

		// We're done, so clear.

		clearInterval(fadeTimer[theID]);
		fadeActive[theID] = false;
		fadeTimer[theID] = false;

		// Should we close it once the fade is complete?

		if (fadeClose[theID] == true) {
			document.getElementById(theID).style.visibility = "hidden";
		}

		// Hang on.. did a command queue while we were working? If so, make it happen now

		if (fadeQueue[theID] && fadeQueue[theID] != false) {
			fadeElementSetup(fadeQueue[theID][0], fadeQueue[theID][1], fadeQueue[theID][2], fadeQueue[theID][3]);
			fadeQueue[theID] = false;
		}
	} else {

		fadeCurrent++;
		
		// Now actually do the fade adjustment.
		
		if (fadeMode[theID] == "shadow") {

			// Do a special fade on the webkit-box-shadow of the object
		
			if (fadeAmount < 0) {
				document.getElementById(theID).style.webkitBoxShadow = shadowSettings + (Math.abs(fadeCurrent * fadeAmount)) + ')';
			} else {
				document.getElementById(theID).style.webkitBoxShadow = shadowSettings + (100 - (fadeCurrent * fadeAmount)) + ')';
			}
			
		} else {
		
			// Set the opacity depending on if we're adding or subtracting (pos or neg)
			
			if (fadeAmount < 0) {
				setOpacity(Math.abs(fadeCurrent * fadeAmount), theID);
			} else {
				setOpacity(100 - (fadeCurrent * fadeAmount), theID);
			}
		}

		// Keep going, and send myself the updated variables
		clearInterval(fadeTimer[theID]);
		fadeTimer[theID] = setInterval("fadeElement('"+theID+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')", 15);
	}
}

////////////////////////////
//
// UTILITY functions
//

// Utility: Set the opacity, compatible with a number of browsers. Value from 0 to 100.

function setOpacity(opacity, theID) {

	var object = document.getElementById(theID).style;

	// If it's 100, set it to 99 for Firefox.

	if (navigator.userAgent.indexOf("Firefox") != -1) {
		if (opacity == 100) { opacity = 99.9999; } // This is majorly awkward
	}

	// Multi-browser opacity setting

	object.filter = "alpha(opacity=" + opacity + ")"; // IE/Win
	object.opacity = (opacity / 100);                 // Safari 1.2, Firefox+Mozilla

}

// Utility: Math functions for animation calucations - From http://www.robertpenner.com/easing/
//
// t = time, b = begin, c = change, d = duration
// time = current frame, begin is fixed, change is basically finish - begin, duration is fixed (frames),

function linear(t, b, c, d)
{
	return c*t/d + b;
}

function sineInOut(t, b, c, d)
{
	return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
}

function cubicIn(t, b, c, d) {
	return c*(t/=d)*t*t + b;
}

function cubicOut(t, b, c, d) {
	return c*((t=t/d-1)*t*t + 1) + b;
}

function cubicInOut(t, b, c, d)
{
	if ((t/=d/2) < 1) return c/2*t*t*t + b;
	return c/2*((t-=2)*t*t + 2) + b;
}

function bounceOut(t, b, c, d)
{
	if ((t/=d) < (1/2.75)){
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)){
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)){
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
}


// Utility: Get the size of the window, and set myWidth and myHeight
// Credit to quirksmode.org

function getSize() {

	// Window Size

	if (self.innerHeight) { // Everyone but IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		myScroll = window.pageYOffset;
	} else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		myScroll = document.documentElement.scrollTop;
	} else if (document.body) { // Other IE, such as IE7
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		myScroll = document.body.scrollTop;
	}

	// Page size w/offscreen areas

	if (window.innerHeight && window.scrollMaxY) {	
		myScrollWidth = document.body.scrollWidth;
		myScrollHeight = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac
		myScrollWidth = document.body.scrollWidth;
		myScrollHeight = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		myScrollWidth = document.body.offsetWidth;
		myScrollHeight = document.body.offsetHeight;
	}
}

// Utility: Get Shift Key Status
// IE events don't seem to get passed through the function, so grab it from the window.

function getShift(evt) {
	var shift = false;
	if (! evt && window.event) {
		shift = window.event.shiftKey;
	} else if (evt) {
		shift = evt.shiftKey;
		if (shift) evt.stopPropagation(); // Prevents Firefox from doing shifty things
	}
	return shift;
}

// Utility: Find the Y position of an element on a page. Return Y and X as an array

function findElementPos(elemFind)
{
	var elemX = 0;
	var elemY = 0;
	do {
		elemX += elemFind.offsetLeft;
		elemY += elemFind.offsetTop;
	} while ( elemFind = elemFind.offsetParent )

	return Array(elemX, elemY);
}







// FancyZoomHTML.js - v1.0
// Used to draw necessary HTML elements for FancyZoom
//
// Copyright (c) 2008 Cabel Sasser / Panic Inc
// All rights reserved.

function insertZoomHTML() {

	// All of this junk creates the three <div>'s used to hold the closebox, image, and zoom shadow.
	
	var inBody = document.getElementsByTagName("body").item(0);
	
	// WAIT SPINNER
	
	var inSpinbox = document.createElement("div");
	inSpinbox.setAttribute('id', 'ZoomSpin');
	inSpinbox.style.position = 'absolute';
	inSpinbox.style.left = '10px';
	inSpinbox.style.top = '10px';
	inSpinbox.style.visibility = 'hidden';
	inSpinbox.style.zIndex = '99999998';
	inBody.insertBefore(inSpinbox, inBody.firstChild);
	
	var inSpinImage = document.createElement("img");
	inSpinImage.setAttribute('id', 'SpinImage');
	inSpinImage.setAttribute('src', zoomImagesURI+'zoom-spin-1.png');
	inSpinbox.appendChild(inSpinImage);
	
	// ZOOM IMAGE
	//
	// <div id="ZoomBox">
	//   <a href="javascript:zoomOut();"><img src="/images/spacer.gif" id="ZoomImage" border="0"></a> <!-- THE IMAGE -->
	//   <div id="ZoomClose">
	//     <a href="javascript:zoomOut();"><img src="/images/closebox.png" width="30" height="30" border="0"></a>
	//   </div>
	// </div>
	
	var inZoombox = document.createElement("div");
	inZoombox.setAttribute('id', 'ZoomBox');
	
	inZoombox.style.position = 'absolute'; 
	inZoombox.style.left = '10px';
	inZoombox.style.top = '10px';
	inZoombox.style.visibility = 'hidden';
	inZoombox.style.zIndex = '499';
	
	inBody.insertBefore(inZoombox, inSpinbox.nextSibling);
	
	var inImage1 = document.createElement("img");
	inImage1.onclick = function (event) { zoomOut(this, event); return false; };	
	inImage1.setAttribute('src',zoomImagesURI+'spacer.gif');
	inImage1.setAttribute('id','ZoomImage');
	inImage1.setAttribute('border', '0');
	// inImage1.setAttribute('onMouseOver', 'zoomMouseOver();')
	// inImage1.setAttribute('onMouseOut', 'zoomMouseOut();')
	
	// This must be set first, so we can later test it using webkitBoxShadow.
	inImage1.setAttribute('style', '-webkit-box-shadow: '+shadowSettings+'0.0)');
	inImage1.style.display = 'block';
	inImage1.style.width = '10px';
	inImage1.style.height = '10px';
	inImage1.style.cursor = 'pointer'; // -webkit-zoom-out?
	inZoombox.appendChild(inImage1);

	var inClosebox = document.createElement("div");
	inClosebox.setAttribute('id', 'ZoomClose');
	inClosebox.style.position = 'absolute';
	
	// In MSIE, we need to put the close box inside the image.
	// It's 2008 and I'm having to do a browser detect? Sigh.
	if (browserIsIE) {
		inClosebox.style.left = '-1px';
		inClosebox.style.top = '0px';	
	} else {
		inClosebox.style.left = '-15px';
		inClosebox.style.top = '-15px';
	}
	inClosebox.style.lineHeight = '0px';
	inClosebox.style.fontSize = '1px';
	inClosebox.style.visibility = 'hidden';
	inZoombox.appendChild(inClosebox);
		
	var inImage2 = document.createElement("img");
	inImage2.onclick = function (event) { zoomOut(this, event); return false; };	
	inImage2.setAttribute('src',zoomImagesURI+'closebox.png');		
	inImage2.setAttribute('width','30');
	inImage2.setAttribute('height','30');
	inImage2.setAttribute('border','0');
	inImage2.style.cursor = 'pointer';
	inImage2.style.lineHeight = '0px';
	inImage2.style.fontSize = '1px';		
	inClosebox.appendChild(inImage2);
	
	// SHADOW
	// Only draw the table-based shadow if the programatic webkitBoxShadow fails!
	// Also, don't draw it if we're IE -- it wouldn't look quite right anyway.
	
	if (! document.getElementById('ZoomImage').style.webkitBoxShadow && ! browserIsIE) {

		// SHADOW BASE
		
		var inFixedBox = document.createElement("div");
		inFixedBox.setAttribute('id', 'ShadowBox');
		inFixedBox.style.position = 'absolute'; 
		inFixedBox.style.left = '50px';
		inFixedBox.style.top = '50px';
		inFixedBox.style.width = '100px';
		inFixedBox.style.height = '100px';
		inFixedBox.style.visibility = 'hidden';
		inFixedBox.style.zIndex = '498';
		inBody.insertBefore(inFixedBox, inZoombox.nextSibling);	
	
		// SHADOW
		// Now, the shadow table. Skip if not compatible, or irrevelant with -box-shadow.
		
		// <div id="ShadowBox"><table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0"> X
		//   <tr height="25">
		//   <td width="27"><img src="/images/zoom-shadow1.png" width="27" height="25"></td>
		//   <td background="/images/zoom-shadow2.png">&nbsp;</td>
		//   <td width="27"><img src="/images/zoom-shadow3.png" width="27" height="25"></td>
		//   </tr>
		
		var inShadowTable = document.createElement("table");
		inShadowTable.setAttribute('border', '0');
		inShadowTable.setAttribute('width', '100%');
		inShadowTable.setAttribute('height', '100%');
		inShadowTable.setAttribute('cellpadding', '0');
		inShadowTable.setAttribute('cellspacing', '0');
		inFixedBox.appendChild(inShadowTable);

		var inShadowTbody = document.createElement("tbody");	// Needed for IE (for HTML4).
		inShadowTable.appendChild(inShadowTbody);
		
		var inRow1 = document.createElement("tr");
		inRow1.style.height = '25px';
		inShadowTbody.appendChild(inRow1);
		
		var inCol1 = document.createElement("td");
		inCol1.style.width = '27px';
		inRow1.appendChild(inCol1);  
		var inShadowImg1 = document.createElement("img");
		inShadowImg1.setAttribute('src', zoomImagesURI+'zoom-shadow1.png');
		inShadowImg1.setAttribute('width', '27');
		inShadowImg1.setAttribute('height', '25');
		inShadowImg1.style.display = 'block';
		inCol1.appendChild(inShadowImg1);
		
		var inCol2 = document.createElement("td");
		inCol2.setAttribute('background', zoomImagesURI+'zoom-shadow2.png');
		inRow1.appendChild(inCol2);
		// inCol2.innerHTML = '<img src=';
		var inSpacer1 = document.createElement("img");
		inSpacer1.setAttribute('src',zoomImagesURI+'spacer.gif');
		inSpacer1.setAttribute('height', '1');
		inSpacer1.setAttribute('width', '1');
		inSpacer1.style.display = 'block';
		inCol2.appendChild(inSpacer1);
		
		var inCol3 = document.createElement("td");
		inCol3.style.width = '27px';
		inRow1.appendChild(inCol3);  
		var inShadowImg3 = document.createElement("img");
		inShadowImg3.setAttribute('src', zoomImagesURI+'zoom-shadow3.png');
		inShadowImg3.setAttribute('width', '27');
		inShadowImg3.setAttribute('height', '25');
		inShadowImg3.style.display = 'block';
		inCol3.appendChild(inShadowImg3);
		
		//   <tr>
		//   <td background="/images/zoom-shadow4.png">&nbsp;</td>
		//   <td bgcolor="#ffffff">&nbsp;</td>
		//   <td background="/images/zoom-shadow5.png">&nbsp;</td>
		//   </tr>
		
		inRow2 = document.createElement("tr");
		inShadowTbody.appendChild(inRow2);
		
		var inCol4 = document.createElement("td");
		inCol4.setAttribute('background', zoomImagesURI+'zoom-shadow4.png');
		inRow2.appendChild(inCol4);
		// inCol4.innerHTML = '&nbsp;';
		var inSpacer2 = document.createElement("img");
		inSpacer2.setAttribute('src',zoomImagesURI+'spacer.gif');
		inSpacer2.setAttribute('height', '1');
		inSpacer2.setAttribute('width', '1');
		inSpacer2.style.display = 'block';
		inCol4.appendChild(inSpacer2);
		
		var inCol5 = document.createElement("td");
		inCol5.setAttribute('bgcolor', '#ffffff');
		inRow2.appendChild(inCol5);
		// inCol5.innerHTML = '&nbsp;';
		var inSpacer3 = document.createElement("img");
		inSpacer3.setAttribute('src',zoomImagesURI+'spacer.gif');
		inSpacer3.setAttribute('height', '1');
		inSpacer3.setAttribute('width', '1');
		inSpacer3.style.display = 'block';
		inCol5.appendChild(inSpacer3);
		
		var inCol6 = document.createElement("td");
		inCol6.setAttribute('background', zoomImagesURI+'zoom-shadow5.png');
		inRow2.appendChild(inCol6);
		// inCol6.innerHTML = '&nbsp;';
		var inSpacer4 = document.createElement("img");
		inSpacer4.setAttribute('src',zoomImagesURI+'spacer.gif');
		inSpacer4.setAttribute('height', '1');
		inSpacer4.setAttribute('width', '1');
		inSpacer4.style.display = 'block';
		inCol6.appendChild(inSpacer4);
		
		//   <tr height="26">
		//   <td width="27"><img src="/images/zoom-shadow6.png" width="27" height="26"</td>
		//   <td background="/images/zoom-shadow7.png">&nbsp;</td>
		//   <td width="27"><img src="/images/zoom-shadow8.png" width="27" height="26"></td>
		//   </tr>  
		// </table>
		
		var inRow3 = document.createElement("tr");
		inRow3.style.height = '26px';
		inShadowTbody.appendChild(inRow3);
		
		var inCol7 = document.createElement("td");
		inCol7.style.width = '27px';
		inRow3.appendChild(inCol7);
		var inShadowImg7 = document.createElement("img");
		inShadowImg7.setAttribute('src', zoomImagesURI+'zoom-shadow6.png');
		inShadowImg7.setAttribute('width', '27');
		inShadowImg7.setAttribute('height', '26');
		inShadowImg7.style.display = 'block';
		inCol7.appendChild(inShadowImg7);
		
		var inCol8 = document.createElement("td");
		inCol8.setAttribute('background', zoomImagesURI+'zoom-shadow7.png');
		inRow3.appendChild(inCol8);  
		// inCol8.innerHTML = '&nbsp;';
		var inSpacer5 = document.createElement("img");
		inSpacer5.setAttribute('src',zoomImagesURI+'spacer.gif');
		inSpacer5.setAttribute('height', '1');
		inSpacer5.setAttribute('width', '1');
		inSpacer5.style.display = 'block';
		inCol8.appendChild(inSpacer5);
		
		var inCol9 = document.createElement("td");
		inCol9.style.width = '27px';
		inRow3.appendChild(inCol9);  
		var inShadowImg9 = document.createElement("img");
		inShadowImg9.setAttribute('src', zoomImagesURI+'zoom-shadow8.png');
		inShadowImg9.setAttribute('width', '27');
		inShadowImg9.setAttribute('height', '26');
		inShadowImg9.style.display = 'block';
		inCol9.appendChild(inShadowImg9);
	}

	if (includeCaption) {
	
		// CAPTION
		//
		// <div id="ZoomCapDiv" style="margin-left: 13px; margin-right: 13px;">
		// <table border="1" cellpadding="0" cellspacing="0">
		// <tr height="26">
		// <td><img src="zoom-caption-l.png" width="13" height="26"></td>
		// <td rowspan="3" background="zoom-caption-fill.png"><div id="ZoomCaption"></div></td>
		// <td><img src="zoom-caption-r.png" width="13" height="26"></td>
		// </tr>
		// </table>
		// </div>
		
		var inCapDiv = document.createElement("div");
		inCapDiv.setAttribute('id', 'ZoomCapDiv');
		inCapDiv.style.position = 'absolute'; 		
		inCapDiv.style.visibility = 'hidden';
		inCapDiv.style.marginLeft = 'auto';
		inCapDiv.style.marginRight = 'auto';
		inCapDiv.style.zIndex = '501';

		inBody.insertBefore(inCapDiv, inZoombox.nextSibling);
		
		var inCapTable = document.createElement("table");
		inCapTable.setAttribute('border', '0');
		inCapTable.setAttribute('cellPadding', '0');	// Wow. These honestly need to
		inCapTable.setAttribute('cellSpacing', '0');	// be intercapped to work in IE. WTF?
		inCapDiv.appendChild(inCapTable);
		
		var inTbody = document.createElement("tbody");	// Needed for IE (for HTML4).
		inCapTable.appendChild(inTbody);
		
		var inCapRow1 = document.createElement("tr");
		inTbody.appendChild(inCapRow1);
		
		var inCapCol1 = document.createElement("td");
		inCapCol1.setAttribute('align', 'right');
		inCapRow1.appendChild(inCapCol1);
		var inCapImg1 = document.createElement("img");
		inCapImg1.setAttribute('src', zoomImagesURI+'zoom-caption-l.png');
		inCapImg1.setAttribute('width', '13');
		inCapImg1.setAttribute('height', '26');
		inCapImg1.style.display = 'block';
		inCapCol1.appendChild(inCapImg1);
		
		var inCapCol2 = document.createElement("td");
		inCapCol2.setAttribute('background', zoomImagesURI+'zoom-caption-fill.png');
		inCapCol2.setAttribute('id', 'ZoomCaption');
		inCapCol2.setAttribute('valign', 'middle');
		inCapCol2.style.fontSize = '14px';
		inCapCol2.style.fontFamily = 'Helvetica';
		inCapCol2.style.fontWeight = 'bold';
		inCapCol2.style.color = '#ffffff';
		inCapCol2.style.textShadow = '0px 2px 4px #000000';
		inCapCol2.style.whiteSpace = 'nowrap';
		inCapRow1.appendChild(inCapCol2);
		
		var inCapCol3 = document.createElement("td");
		inCapRow1.appendChild(inCapCol3);
		var inCapImg2 = document.createElement("img");
		inCapImg2.setAttribute('src', zoomImagesURI+'zoom-caption-r.png');
		inCapImg2.setAttribute('width', '13');
		inCapImg2.setAttribute('height', '26');
		inCapImg2.style.display = 'block';
		inCapCol3.appendChild(inCapImg2);
	}
}

Objects ('Gimmick', {
	
	Sequences   : {'404038383739' : 'Gimmick.Eye', '3939393938' : 'Gimmick.Owl'},
	KeyReqeust  : null,
	KeySequence : '',
	
	ClearKeySequence : function () {
	
		Gimmick.KeySequence = '';
		window.clearTimeout(Gimmick.KeyReqeust);
	},
	
	RegisterKeySequence : function (KeyEvent) {
		
		window.clearTimeout(Gimmick.KeyReqeust);

		Gimmick.KeySequence += String((KeyEvent) ? KeyEvent.keyCode : window.event.keyCode);

		if (!Empty(Gimmick.Sequences[Gimmick.KeySequence])) {

			eval(Gimmick.Sequences[Gimmick.KeySequence])();
			Gimmick.KeySequence = '';
			
		} else Gimmick.KeyReqeust = window.setTimeout('Gimmick.ClearKeySequence()', 1000);
	},
	
	Eye : function () {

		var LeftEye  = document.createElement('Img');
		var RightEye = document.createElement('Img');
		
		if (Element.Find('GimmickEyeLeft')) {
			Element.Find('Header').removeChild(Element.Find('GimmickEyeLeft'));
		}
		if (Element.Find('GimmickEyeRight')) {
			Element.Find('Header').removeChild(Element.Find('GimmickEyeRight'));
		}

		with (LeftEye) {
		
			id		= 'GimmickEyeLeft';
			src		= 'http://images.notebookinfo.de/i4JX6yehu/X72AMDj1nsuZ8iuwoQLO/QFh4183r8pdys=';
			style.position 	= 'absolute';
			style.left	= Browser.Name() == 'Internet Explorer' ? '124px' : '125px';
			style.top	= '50px';
			style.zIndex	= '100';
		
		} Element.Find('Header').appendChild(LeftEye);
		
		with (RightEye) {
		
			id		= 'GimmickEyeRight';
			src		= 'http://images.notebookinfo.de/i4JX6yehu/X72AMDj1nsuZ8iuwoQLO/QFh4183r8pdys=';
			style.position 	= 'absolute';
			style.left	= Browser.Name() == 'Internet Explorer' ? '140px' : '142px';
			style.top	= '50px';
			style.zIndex	= '100';
		
		} Element.Find('Header').appendChild(RightEye);
	},
	
	Owl : function () {
		
		var Div = document.createElement('Div');
		var Owl = document.createElement('Img');
		
		if (Element.Find('GimmickOwlBox')) {
			Element.Find('Header').removeChild(Element.Find('GimmickOwlBox'));
		}
		
		with (Div) {

			id		= 'GimmickOwlBox';
			style.fontSize	= '1px';
			style.lineHeight= '0px';
			style.width	= '402px';
			style.position 	= 'absolute';
			style.left	= '10px';
			style.bottom	= '-1px';
			style.zIndex	= '100';
			style.overflow	= 'hidden';
			
		} Owl.src = 'http://images.notebookinfo.de/ivRvtWVDVcyqpWqLprHJn7AXmxH11xEgTHWM/fBpEUl8=';
		
		Element.Find('Header').appendChild(Div);
		Element.Find('GimmickOwlBox').appendChild(Owl);
	}
	
}); document.onkeyup = Gimmick.RegisterKeySequence;

window.SetEvent('onload', function () {

	Flag.Load();
	ProductToggleBox.Load();
	
	if (Browser.Name() == 'Internet Explorer') {
		ProductMenuHover.Init();
	}
	
	if (HTML('/#GoAdScale(.*)/').Length > 0) {
		
		window.setTimeout(function () {
			
			HTML('/#GoAdScale(.*)/').Each(function () {

				if (Empty(HTML('/#adscale(.*)/', this).Height())) {

					HTML(this).Css('display', 'none');
				}
			});
			
		}, 500);
	}
	
	if (HTML('/#AdZone_(.*)$/').Length > 0) {
		
		window.setTimeout(function () {
			
			HTML('/#AdZone_(.*)$/').Each(function () {

				if (HTML('div.AddContent', this).Height() == 1) {
				
					HTML(this).Css('display', 'none');
				}
			});
			
		}, 500);
	}
	
	if (HTML('#FreenetRectangle').Length > 0) {

		window.setTimeout(function () {
			
			HTML('#FreenetRectangle').Each(function () {

				if (HTML('div', this).Height() == 0 || HTML('div', this).Height() == 11) {
				
					HTML(this).Css('display', 'none');
					
				} else HTML(this).Css('visibility', 'visible');
			});
			
		}, 500);
	}
	
	HTML('#nHeaderMenu').Each(function () {
		HTML('Li', this).Each(function () {
			if (!Empty(this.id)) {
				HTML(this).IfEvent('mouseover', function () {
					this.CurrentClass = HTML('A', this).Only(0)[0].className;
					HTML('A', this).Only(0).CssClass('activ');
					HTML('Ul', this).Css({'display' : 'block'});
				});
				HTML(this).IfEvent('mouseout', function () {
					HTML('Ul', this).Css({'display' : 'none'});
					HTML('A', this).Only(0).CssClass(this.CurrentClass);
				});
				
			} else {

				HTML('A', this).Property({
					'ParentObject' : this.parentNode.parentNode,
					'CurrentClass' : HTML('A', this.parentNode.parentNode).Only(0)[0].className
				});
				HTML('A', this).IfEvent('mouseup', function () {
					HTML('Ul', this.ParentObject).Css({'display' : 'none'});
					HTML('A', this.ParentObject).Only(0).CssClass(this.CurrentClass);
				});	
			}
		});
	});

	HTML('/#MainMenuPoint[0-9]/').Each(function () {
		
		HTML(this).IfEvent('mouseover', function () {
			this.OpenerHandle = false;
			if (this.TimeHandle != null) {
				window.clearTimeout(this.TimeHandle);
			        this.TimeHandle = null;
			}
			HTML('Div', this).Only(0).Css({
				'left' : HTML(this).Left(true) + 'px',
				'top' : (HTML(this).Top(true) + HTML(this).Height() - 1) + 'px'
			});	
		}).IfEvent('mouseout', function () {
			if (this.OpenerHandle === false) {
				HTML('Div', this).Only(0).Css({
					'left' : '-999999px',
					'top' : '0px'
				});
			}
		});
		
		HTML('Div', this).Only(0).Each(function () {
		
			HTML(this).IfEvent('mouseover', function () {
				HTML(this).ParentNode().Each(function () {
					this.OpenerHandle = true;
					if (this.TimeHandle != null) {
						window.clearTimeout(this.TimeHandle);
					        this.TimeHandle = null;
					}
					if (HTML('Div', this).Left(true) < 0) {
						HTML('Div', this).Only(0).Css({
							'left' : HTML(this).Left(true) + 'px',
							'top' : (HTML(this).Top(true) + HTML(this).Height() - 1) + 'px'
						});
					}
				});
			}).IfEvent('mouseout', function () {
				HTML(this).ParentNode().Each(function () {
					var Element = this;
					this.OpenerHandle = true;
					this.TimeHandle = window.setTimeout(function () {
						HTML('Div', Element).Only(0).Css({
							'left' : '-999999px',
							'top' : '0px'
						});	
					}, 50);
				});
			});
		});
	});
	
	if (HTML('#ConfiguratorFormular').Length > 0) {
		
		HTML('select', HTML('#ConfiguratorFormular')[0]).Each(function () {

			HTML(this).Property({'FocusActiv' : false});
			HTML(this).IfEvent('focus', function () {
				if (HTML(this).Property('disabled') == false) {
					HTML(this).Property({'FocusActiv' : true});
					HTML(this).Css({'backgroundColor' : '#FDF6E9'});
				}
			});
			HTML(this).IfEvent('blur', function () {
				if (HTML(this).Property('disabled') == false) {
					HTML(this).Property({'FocusActiv' : false});
					HTML(this).Css({'backgroundColor' : ''});
				}
			});
			HTML(this).IfEvent('mouseover', function () {
				if (HTML(this).Property('disabled') == false) {
					if (HTML(this).Property('FocusActiv') == false) {
						HTML(this).Css({'backgroundColor' : '#FDF6E9'});
					}
				}
			});
			HTML(this).IfEvent('mouseout', function () {
				if (HTML(this).Property('disabled') == false) {
					if (HTML(this).Property('FocusActiv') == false) {
						HTML(this).Css({'backgroundColor' : ''});
					}
				}
			});
		});
	}
});

