//loaderImg = new Image(32, 32);
//loaderImg.src = "/Images/ajax-preloader2.gif";




Estate = (function() {
	/* START PUBLIC */
	return {
		Trace: function(string) {
			if (Estate.Develop && Estate.Develop.Trace) {
				Estate.Develop.Trace(string)
			}
		}
	}
	/* END PUBLIC */
})();






Estate.Events = (function() {
	/* START PUBLIC */
	return {
		/*
		* Summary:
		* Adds a function to an event of a single element
		* 
		* Usage:
		* Estate.Events.AddEvent( document.getElementById('elementId'), functionName, "onclick" )
		*/
		AddEvent: function(element, 	/* the element on which the event is placed */
						   	newFunction, /* the function that has to be added to the event */
							eventType		/* the event type itself */
							  ) {
			var error;
			error = Estate.Check.VariableType(element, "object")
			if (error != "") throw new Error(error);
			error = Estate.Check.VariableType(newFunction, "function")
			if (error != "") throw new Error(error);


			var oldEvent = eval("element." + eventType);
			var eventContentType = eval("typeof element." + eventType)

			if (eventContentType != 'function') {
				eval("element." + eventType + " = newFunction")
			} else {
				eval("element." + eventType + " = function(e) { oldEvent(e); newFunction(e); }")
			}
		}
	}
	/* END PUBLIC */
})();






/*
* Summary:
* Truncates a string until it fits in its parent block.
*
* Warning:
* In most cases it's better to cut the string on the server side
* 
* Usage:
jQuery(document).ready( function() {
Estate.jQuery.TextOverflowFix( ['.block1','.block2'], ['span',''] )
})
*/
Estate.jQuery = (function() {
	/* START PUBLIC */
	return {
		TextOverflowFix: function(aQueryBlock,  /* array of containers (as jQuery selector) */
                                                          aQueryText /* array of tags with the text that has to be shortened (as jQuery selector) */
                                                          ) {
			var error
			error = Estate.Check.VariableType(aQueryBlock, "object")
			if (error != "") throw new Error(error);
			error = Estate.Check.VariableType(aQueryText, "object")
			if (error != "") throw new Error(error);
			if (typeof (jQuery) != "function") throw new Error("jQuery library must be loaded before you can use this method")

			var cutStringStepSize = 15;
			var articleText = '';
			var loopCount;
			var maxCount = 100;

			for (var i = 0; i < aQueryBlock.length; i++) {
				loopCount = 0;
				jQuery(aQueryBlock[i]).scrollTop(100);
				if (jQuery(aQueryBlock[i] + ' ' + aQueryText[i]).size() > 0) {
					while (jQuery(aQueryBlock[i]).scrollTop() != 0) {
						articleText = jQuery(aQueryBlock[i] + ' ' + aQueryText[i]).html()
						jQuery(aQueryBlock[i] + ' ' + aQueryText[i]).html(articleText.substr(0, articleText.length - cutStringStepSize) + "...")
						jQuery(aQueryBlock[i]).scrollTop(0)
						jQuery(aQueryBlock[i]).scrollTop(100)
						loopCount++
						if (loopCount > maxCount) {
							break;
						}
					}
				}

				loopCount = 0;
				jQuery(aQueryBlock[i]).scrollLeft(100);
				if (jQuery(aQueryBlock[i] + ' ' + aQueryText[i]).size() > 0) {
					while (jQuery(aQueryBlock[i]).scrollLeft() != 0) {
						articleText = jQuery(aQueryBlock[i] + ' ' + aQueryText[i]).html()
						jQuery(aQueryBlock[i] + ' ' + aQueryText[i]).html(articleText.substr(0, articleText.length - cutStringStepSize) + "...")
						jQuery(aQueryBlock[i]).scrollLeft(0)
						jQuery(aQueryBlock[i]).scrollLeft(100)
						jQuery(aQueryBlock[i] + ' ' + aQueryText[i]).width('auto')
						loopCount++
						if (loopCount > maxCount) {
							break;
						}
					}
				}
			}
		}
	}
	/* END PUBLIC */
})();






Estate.StringTools = (function() {
	/* START PRIVATE */
	function TranslateScrambledAddress(string) {
		var returnString = "";
		var aCharacters;

		string = string.replace("scrambled:", "")
		string = string.substring(1, (string.length - 1))
		aCharacters = string.split("][")
		for (var i = 0; i < aCharacters.length; i++) {
			returnString += String.fromCharCode(aCharacters[i])
		}

		return returnString
	}
	/* END PRIVATE */

	/* START PUBLIC */
	return {
		/*
		* Summary:
		* Returns the filename is it exists in the address bar
		*
		* Usage:
		* var filename = Estate.StringTools.GetFilenameFromUrl()
		*/
		GetFilenameFromUrl: function() {
			var error;
			error = Estate.Check.ArgumentsCount(arguments.length, 0);
			if (error != "") throw new Error(error);


			var file_name = document.location.href;
			var end = (file_name.indexOf("?") == -1) ? file_name.length : file_name.indexOf("?");
			return file_name.substring(file_name.lastIndexOf("/") + 1, end);
		},

		GetFilenameWithoutExtension: function(data) {
			var data = data.replace(/^\s|\s$/g, "");
			if (/\.\w+$/.test(data)) {
				var m = data.match(/([^\/\\]+)\.(\w+)$/);
				if (m)
					return m[1];
				else
					return "no file name";
			} else {
				var m = data.match(/([^\/\\]+)$/);
				if (m)
					return m[1];
				else
					return "no file name";
			}
		},

		/*
		* Summary:
		* Removes measurement unit from a string
		*
		* Usage:
		* width = Estate.StringTools.RemoveMeasurement( width )
		*/
		RemoveMeasurement: function(SuppliedString) {
			var error;
			error = Estate.Check.ArgumentsCount(arguments.length, 1);
			if (error != "") throw new Error(error);
			error = Estate.Check.VariableType(SuppliedString, "string");
			if (error != "") throw new Error(error);


			var StringWithoutMeasure = SuppliedString
			StringWithoutMeasure = StringWithoutMeasure.replace("px", "")
			StringWithoutMeasure = StringWithoutMeasure.replace("em", "")
			StringWithoutMeasure = StringWithoutMeasure.replace("pt", "")

			return StringWithoutMeasure
		},

		/*
		* Summary:
		* Searches all scrambled mailto:links and unscrambles them
		*
		* Requires:
		* jQuery
		*
		* Usage:
		* Estate.StringTools.ShowScrambledMailtoLinks()
		*/
		ShowScrambledMailtoLinks: function() {
			var error;
			error = Estate.Check.ArgumentsCount(arguments.length, 0);
			if (error != "") throw new Error(error);

			//alert( jQuery( 'a[href^="scrambled:"]').size() )
			var mailaddress
			jQuery('a[href^="scrambled:"]').each(function() {
				mailaddress = TranslateScrambledAddress(jQuery(this).attr('href'))
				jQuery(this).attr('href', "mailto:" + mailaddress)
				jQuery(this).html(mailaddress)
			})
		}
	}
	/* END PUBLIC */
})();






Estate.Forms = (function() {
	/* START PUBLIC */
	return {
		/*
		* Summary:
		* Inverts the checked state of all checkboxes in a box
		*
		* Usage:
		* Estate.Forms.InvertCheckboxSelection( document.getElementsByTagName('form')[0] )
		*/
		InvertCheckboxSelection: function(collectionParent) {
			var error;
			error = Estate.Check.Element(collectionParent);
			if (error != "") throw new Error(error);


			var formFieldsCollection = collectionParent.getElementsByTagName("input")
			if (collectionParent.alt == "true") {
				collectionParent.alt = ""
			} else {
				collectionParent.alt = "true"
			}
			var isAllChecked = collectionParent.alt

			for (var i = 0; i < formFieldsCollection.length; i++) {
				if (formFieldsCollection[i].type == "checkbox") {
					if (collectionParent.alt != "true") {
						formFieldsCollection[i].checked = ""
					} else {
						formFieldsCollection[i].checked = "checked"
					}
				}
			}
		}
	}
	/* END PUBLIC */
})();






Estate.Navigation = (function() {
	/* START PUBLIC */
	return {

		/*
		* Summary:
		* Navigates one step backwards in browser history. If no browser history is available the static link in the href is used
		* 
		* Usage:
		* <a href="contact.asp" onclick="return Estate.Navigation.LinkBack()">Terug</a>
		*/
		LinkBack: function() {
			if (history.length > 0) {
				history.go(-1)
				return false
			} else {
				return true
			}
		}
	}
	/* END PUBLIC */
})();






Estate.CSSTools = (function() {
	/* START PUBLIC */
	return {

		/*
		* Summary:
		* With ClassToggle you can let a specific class on an element be switched on or off
		* 
		* Usage:
		* Estate.CSSTools.ClassToggle( document.getElementById('elementId'), 'className')
		*/
		ClassToggle: function(el, className) {
			var error;
			error = Estate.Check.Element(el);
			if (error != "") throw new Error(error);
			error = Estate.Check.VariableType(className, "string")
			if (error != "") throw new Error(error);


			if (el.className.indexOf(className) < 0) {
				el.className += " " + className
			} else {
				while (el.className.indexOf(className) >= 0) {
					el.className = el.className.replace(" " + className, "")
					el.className = el.className.replace(className, "")
				}
			}
		},

		AddClass: function(el, className) {
			var error;
			error = Estate.Check.Element(el);
			if (error != "") throw new Error(error);
			error = Estate.Check.VariableType(className, "string")
			if (error != "") throw new Error(error);


			if (el.className.indexOf(className) < 0) {
				el.className += " " + className
			}
		},

		RemoveClass: function(el, className) {
			var error;
			error = Estate.Check.Element(el);
			if (error != "") throw new Error(error);
			error = Estate.Check.VariableType(className, "string")
			if (error != "") throw new Error(error);


			while (el.className.indexOf(className) >= 0) {
				el.className = el.className.replace(" " + className, "")
				el.className = el.className.replace(className, "")
			}
		}
	}
	/* END PUBLIC */
})();






/*
* Summary:
* Tools to validate function arguments
*/
Estate.Check = (function() {
	/* START PRIVATE */
	function LiteralsAreCompatible(mainLiteral, updateLiteral) {
		for (prop in updateLiteral) {
			if (typeof (mainLiteral[prop]) == "undefined") {
				return "The variable '" + prop + "'in the object literal cannot be merged with the original object literal.";
			}

			if (typeof (updateLiteral[prop]) != typeof (mainLiteral[prop])) {
				return "The variable '" + prop + " is of the wrong type. It is '" + typeof (updateLiteral[prop]) + "' but it should be '" + typeof (mainLiteral[prop]) + "'";
			}

			if (typeof (updateLiteral[prop]) == "object") {
				LiteralsAreCompatible(mainLiteral[prop], updateLiteral[prop]);
			}
		}
	}
	/* END PRIVATE */



	/* START PUBLIC */
	return {
		/*
		* Summary:
		* Checks if the right amount of arguments are used when calling the function
		* 
		* Usage:
		error = Estate.Check.ArgumentsCount( arguments.length, 1 );
		if ( error != "" ) throw new Error( error );
		*/
		ArgumentsCount: function(CurrentArgumentsLength, CorrectArgumentsLength) {
			if (typeof (CorrectArgumentsLength) == "number") {
				if (CurrentArgumentsLength != CorrectArgumentsLength) {
					return "Wrong number of arguments. There argument count should be " + CorrectArgumentsLength + ", but it is " + CurrentArgumentsLength;
				}
			}
			if (typeof (CorrectArgumentsLength) == "array") {
				var CorrectArgumentsCount = false;
				for (var i = 0; i < CorrectArgumentsLength.length; i++) {
					if (CorrectArgumentsCount == CorrectArgumentsLength[i]) {
						CorrectArgumentsCount = true
					}
				}
			}
			return ""
		},

		/*
		* Summary:
		* Checks if an element with a particular id exists
		* 
		* Usage:
		error = Estate.Check.ElementById( 'elID' );
		*OR*
		error = Estate.Check.ElementById( 'elID', 'div' );

			if ( error != "" ) throw new Error( error );
		*/
		ElementById: function(ElementID, RequiredTagName) {
			if (typeof (ElementID) != "string") {
				return "Provided element id is not a string but  '" + typeof (ElementID) + "'.";
			}
			if (!document.getElementById(ElementID)) {
				return "Cannot find HTML element with the id '" + ElementID + "'";
			}
			if (arguments.length > 1 && typeof (RequiredTagName) == "string") {
				if (document.getElementById(ElementID).tagName.toLowerCase() != RequiredTagName && RequiredTagName != "") {
					return "HTML element with ID '" + ElementID + "' has the tagname '" + document.getElementById(ElementID).tagName + "' but it should be '" + RequiredTagName + "'";
				}
			}
			return ""
		},

		/*
		* Summary:
		* Checks if the referenced object is an HTML element
		* 
		* Usage:
		error = Estate.Check.Element( document.getElementsByTagName('a')[0] );
		if ( error != "" ) throw new Error( error );
		*/
		Element: function(Element) {
			if (typeof (Element.tagName) == "undefined") {
				return "HTML element expected. Type of checked variable is " + typeof (Element)
			}
			return ""
		},

		/*
		* Summary:
		* Checks if argument is of the expected variable type
		* 
		* Usage:
		error = Estate.Check.VariableType( id, "string" );
		if ( error != "" ) throw new Error( error );
		*/
		VariableType: function(Variable, ExpectedVariableType) {
			if (typeof (Variable) != ExpectedVariableType) {
				return "Unexpected variable type. There variable type should be " + ExpectedVariableType + ", but it is " + typeof (Variable);
			}
			return ""
		},

		/*
		* Summary:
		* Checks an object literal
		* 
		* Usage:
		oLiteral.foo = Estate.Check.SetLiteralIfDefined( oLiteral, oNewLiteral, "foo" )
		*/
		SetLiteralIfDefined: function(oldVariable, newVariable, arrayID) {
			if (typeof (newVariable) == "undefined") {
				return oldVariable[arrayID]
			}

			if (typeof (newVariable[arrayID]) == "undefined") {
				return oldVariable[arrayID]
			} else {
				return newVariable[arrayID]
			}
		},

		/*
		* Summary:
		* Updates object literal. The 2nd argument is merged with the 1st. Please use
		* Estate.Check.LiteralUpdatable if you want to be sure that this method
		* only updates variables and doesn't create new ones.
		* 
		* Usage:
		Estate.Check.UpdateLiteral( mainLiteral, updatingLiteral )
		*/
		UpdateLiteral: function(mainLiteral, updateLiteral) {
			for (prop in updateLiteral) {
				mainLiteral[prop] = updateLiteral[prop]

				if (typeof (updateLiteral[prop]) == "object") {
					Estate.Check.UpdateLiteral(mainLiteral[prop], updateLiteral[prop]);
				}
			}
		},

		/*
		* Summary:
		* Compares 2 object literals and checks if the 2nd argument can be merged
		* with the 1st. If there's a variable in the 1st argument that's not
		* been defined in the 2nd, the function returns the name of the variable.
		* 
		* Usage:
		error = Estate.Check.LiteralUpdatable( mainLiteral, updatingLiteral );
		if ( error != "" ) throw new Error( error );
		*/
		LiteralUpdatable: function(mainLiteral, updateLiteral) {
			if (typeof (mainLiteral) != "object") {
				throw new Error("Cannot check literal: 'mainLiteral' is not an object")
			}
			if (typeof (updateLiteral) != "object") {
				throw new Error("Cannot check literal: 'updateLiteral' second argument is not an object")
			}


			var isNotUpdatableVariable = LiteralsAreCompatible(mainLiteral, updateLiteral)

			if (typeof (isNotUpdatableVariable) == "undefined") {
				return ''
			} else {
				return isNotUpdatableVariable;
			}
		}
	}
	/* END PUBLIC */
})();






Estate.GetElements = (function() {
	/* START PUBLIC */
	return {
		/*
		* Summary:
		* Returns all elements with a specific class as an array
		* 
		* Usage:
		* var elementCollection = Estate.GetElements.ByClassName( 'className', 'a', document.getElementById('parentElement') );
		*/
		ByClassName: function(CurrentArgumentsLength, CorrectArgumentsLength) {
			if (document.getElementsByClassName) {
				getElementsByClassName = function(className, tag, elm) {
					elm = elm || document;
					var elements = elm.getElementsByClassName(className),
						nodeName = (tag) ? new RegExp("\\b" + tag + "\\b", "i") : null,
						returnElements = [],
						current;
					for (var i = 0, il = elements.length; i < il; i += 1) {
						current = elements[i];
						if (!nodeName || nodeName.test(current.nodeName)) {
							returnElements.push(current);
						}
					}
					return returnElements;
				};
			}
			else if (document.evaluate) {
				getElementsByClassName = function(className, tag, elm) {
					tag = tag || "*";
					elm = elm || document;
					var classes = className.split(" "),
						classesToCheck = "",
						xhtmlNamespace = "http://www.w3.org/1999/xhtml",
						namespaceResolver = (document.documentElement.namespaceURI === xhtmlNamespace) ? xhtmlNamespace : null,
						returnElements = [],
						elements,
						node;
					for (var j = 0, jl = classes.length; j < jl; j += 1) {
						classesToCheck += "[contains(concat(' ', @class, ' '), ' " + classes[j] + " ')]";
					}
					try {
						elements = document.evaluate(".//" + tag + classesToCheck, elm, namespaceResolver, 0, null);
					}
					catch (e) {
						elements = document.evaluate(".//" + tag + classesToCheck, elm, null, 0, null);
					}
					while ((node = elements.iterateNext())) {
						returnElements.push(node);
					}
					return returnElements;
				};
			}
			else {
				getElementsByClassName = function(className, tag, elm) {
					tag = tag || "*";
					elm = elm || document;
					var classes = className.split(" "),
						classesToCheck = [],
						elements = (tag === "*" && elm.all) ? elm.all : elm.getElementsByTagName(tag),
						current,
						returnElements = [],
						match;
					for (var k = 0, kl = classes.length; k < kl; k += 1) {
						classesToCheck.push(new RegExp("(^|\\s)" + classes[k] + "(\\s|$)"));
					}
					for (var l = 0, ll = elements.length; l < ll; l += 1) {
						current = elements[l];
						match = false;
						for (var m = 0, ml = classesToCheck.length; m < ml; m += 1) {
							match = classesToCheck[m].test(current.className);
							if (!match) {
								break;
							}
						}
						if (match) {
							returnElements.push(current);
						}
					}
					return returnElements;
				};
			}
			return getElementsByClassName(className, tag, elm);
		}
	}
	/* END PUBLIC */
})();





Estate.Layers = (function() {
	/* START PUBLIC */
	return {
		/*
		* Summary:
		* Returns the position of the element on the y-axis
		* 
		* Usage:
		* Estate.Layers.GetPositionX( document.getElementById('elementId') )
		*/
		GetPositionX: function(obj) {
			var error
			error = Estate.Check.Element(obj);
			if (error != "") throw new Error(error);


			var x = 0
			if (obj.offsetParent) {
				while (obj.offsetParent) {
					x += obj.offsetLeft
					obj = obj.offsetParent
				}
			} else if (obj.x) {
				x += obj.x
			}
			return x
		},

		/*
		* Summary:
		* Returns the position of the element on the x-axis
		* 
		* Usage:
		* Estate.Layers.GetPositionX( document.getElementById('elementId') )
		*/
		GetPositionY: function(obj) {
			var error
			error = Estate.Check.Element(obj);
			if (error != "") throw new Error(error);


			var y = 0
			if (obj.offsetParent) {
				while (obj.offsetParent) {
					y += obj.offsetTop
					obj = obj.offsetParent
				}
			} else if (obj.y) {
				y += obj.y
			}
			return y
		}
	}
	/* END PUBLIC */
})();







/*
* Summary:
* Hacks to bypass browser errors
*/
Estate.Hack = {}






/*
* Summary:
* Converts PNG-images in <IMG>-tags to something IE6 supports
* 
* Usage:
Estate.Hack.PNG4IE6.Run()
*/
Estate.Hack.PNG4IE6 = (function() {
	/* START PUBLIC */
	return {
		Run: function(obj) {
			for (var i = 0; i < document.images.length; i++) {
				var img = document.images[i]
				var imgName = img.src.toUpperCase()
				if (imgName.substring(imgName.length - 3, imgName.length) == "PNG" && imgName.indexOf("-ALPHA.PNG") >= 0) {
					var imgID = (img.id) ? "id='" + img.id + "' " : ""
					var imgClass = (img.className) ? "class='" + img.className + "' " : ""
					var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
					var imgStyle = "display:inline-block;" + img.style.cssText
					var imgAttribs = img.attributes;
					for (var j = 0; j < imgAttribs.length; j++) {
						var imgAttrib = imgAttribs[j];
						if (imgAttrib.nodeName == "align") {
							if (imgAttrib.nodeValue == "left") imgStyle = "float:left;" + imgStyle
							if (imgAttrib.nodeValue == "right") imgStyle = "float:right;" + imgStyle
							break
						}
					}
					var strNewHTML = "<span " + imgID + imgClass + imgTitle
					strNewHTML += " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
					strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
					strNewHTML += "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
					img.outerHTML = strNewHTML
					i = i - 1
				}
			}
		}
	}
	/* END PUBLIC */
})();






/*
* Summary:
* Makes certain incompatible CSS selectors and selectors work in IE6
* 
* Usage:
Estate.Hack.IE6ClassGenerator.Run()
*/
Estate.Hack.IE6Fix = (function() {
	/* START PRIVATE */
	var httpRequest
	if (window.ActiveXObject) {
		httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}
	var newRules = new Array
	var config = {
		classNumber: 0,
		className: "IE6Fix",
		regExIncompatibleSelectors: {
			attribute: /\[/,
			adjacent: /\+/,
			child: /\>/,
			firstchild: /\:first-child/
		},
		regExIncompatibleStyles: {
			minHeight: /\min-height/,
			alphaPNG: /\alpha.png/
		},
		regExUnQueriable: {
			link: /\:link/,
			hover: /\:hover/,
			active: /\:active/,
			visited: /\:visited/,
			focus: /\:focus/,
			after: /\:after/,
			IE7Fix: /\*\:first-child\+html/
		},
		regExDelete: {
			comment: /\/\*([\s\S]*?)\*\//g
		}
	}

	var fileCache = {};
	function loadFile(href) {
		try {
			if (!fileCache[href]) {
				httpRequest.open("GET", href, false);
				httpRequest.send();
				if (httpRequest.status == 0 || httpRequest.status == 200) {
					fileCache[href] = httpRequest.responseText;
				}
			}
		} catch (e) {
			// ignore errors
		} finally {
			return fileCache[href] || "";
		}
	}

	function GetNewClassName() {
		return config.className + config.classNumber++
	}

	function IsIE6Incompatible(cssFileSource) {
		for (regEx in config.regExIncompatibleSelectors) {
			if (config.regExIncompatibleSelectors[regEx].test(cssFileSource) == true) {
				return true
			}
		}
		for (regEx in config.regExIncompatibleStyles) {
			if (config.regExIncompatibleStyles[regEx].test(cssFileSource) == true) {
				return true
			}
		}
		return false
	}

	function HasIE6IncompatibleStyles(styles) {
		for (regEx in config.regExIncompatibleStyles) {
			if (config.regExIncompatibleStyles[regEx].test(styles) == true) {
				return true
			}
		}
		return false
	}

	function IsQueriable(cssFileSource) {
		for (regEx in config.regExUnQueriable) {
			if (config.regExUnQueriable[regEx].test(cssFileSource) == true) {
				return false
			}
		}
		return true
	}

	function RemoveComments(cssFileSource) {
		var _cssFileSource = cssFileSource;
		while (config.regExDelete.comment.test(_cssFileSource) == true) {
			_cssFileSource = _cssFileSource.replace(config.regExDelete.comment, "")
		}
		return _cssFileSource
	}

	function AddRule(selectors, styles) {
		var regExCharacter = /\S/;
		if (typeof selectors == "string" && typeof styles == "string") {
			if (regExCharacter.test(selectors) == true && regExCharacter.test(styles) == true) {
				var newRulesLength = newRules.length++
				newRules[newRulesLength] = new Array;
				newRules[newRulesLength][0] = selectors;
				newRules[newRulesLength][1] = styles;
			}
		}
	}

	function FixStyles(styles) {
		var fixedStyles = styles

		if (config.regExIncompatibleStyles.minHeight.test(fixedStyles) == true) {
			fixedStyles = fixedStyles.replace(config.regExIncompatibleStyles.minHeight, "height")
		}
		if (config.regExIncompatibleStyles.alphaPNG.test(fixedStyles) == true) {
			var regExURL = /\/[\S]*alpha.png/
			var regExBackgroundStyle = /background[\s\S]*;/
			var imageUrl = fixedStyles.match(regExURL)
			fixedStyles = fixedStyles.replace(regExBackgroundStyle, "background: none !important; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageUrl + "', sizingMethod='crop');")
		}

		return fixedStyles
	}

	function Fixselector(selector, newClassName) {
		var _selector = selector
		var regExInvalidSelector = /\* html/;

		if (regExInvalidSelector.test(_selector) == true) {
			_selector = _selector.replace(regExInvalidSelector, "")
		}

		return _selector
	}

	function FixCssRule(CssRule) {
		var aCssRule = CssRule.split("{");
		var aSelectors = aCssRule[0].split(",")
		var styles = aCssRule[1]
		var stylesNeedFix = false
		var newClassName = GetNewClassName()

		stylesNeedFix = HasIE6IncompatibleStyles(styles)
		styles = FixStyles(styles)
		for (var i in aSelectors) {
			if ((IsIE6Incompatible(aSelectors[i]) == true || stylesNeedFix == true) && IsQueriable(aSelectors[i]) == true) {
				//Estate.Trace( Fixselector(aSelectors[i]) +" - "+ styles +" >> "+ newClassName )
				try {
					jQuery(Fixselector(aSelectors[i])).addClass(newClassName)
				}
				catch (error) {
					Estate.Trace(
						"IE6Fix: could not fix selector '" + Fixselector(aSelectors[i]) + "'<br />" +
						"&ensp; Error message: " + error.description
					)
				}
			}
		}
		AddRule("." + newClassName, styles)
	}

	function FixCss(cssFileSource) {
		var _cssFileSource = RemoveComments(cssFileSource);

		if (IsIE6Incompatible(_cssFileSource)) {
			var aCssRules = _cssFileSource.split("}")
			for (var i = 0; i < aCssRules.length; i++) {
				if (IsIE6Incompatible(aCssRules[i]) == true) {
					FixCssRule(aCssRules[i])
				}
			}
		}
	}

	function CreateNewCssWithFix() {
		var newCss = document.createStyleSheet()

		for (var i = 0; i < newRules.length; i++) {
			try {
				newCss.addRule(newRules[i][0], newRules[i][1])
			}
			catch (e) {
				//
			}
		}
	}
	/* END PRIVATE */

	/* START PUBLIC */
	return {
		Run: function() {
			var CSSDocRules;
			// Load source code of all stylesheets
			for (CSSDoc = 0; CSSDoc < document.styleSheets.length; CSSDoc++) {
				if (document.styleSheets[CSSDoc].href.indexOf("develop") < 0) {
					if (httpRequest) {
						FixCss(loadFile(document.styleSheets[CSSDoc].href));
					}
				}
			}
			CreateNewCssWithFix()
		}
	}
	/* END PUBLIC */
})();


















Amersfoort = (function() {
	/* START PUBLIC */
	return {

		SetTextBalloons: function() {
		
		if (jQuery("ol.emailrubrieken li span.meerInfo").size() > 0) {
			jQuery("ol.emailrubrieken li span.meerInfo").each(function(index) {
				var selectedTextBalloon = jQuery("ol.emailrubrieken div.textBalloon:eq(" + index + ")")
					jQuery(this).mouseover(function() {
						jQuery(selectedTextBalloon).data("cornerBottom", jQuery(selectedTextBalloon).find("div.corner").css("bottom"));
						jQuery(selectedTextBalloon).fadeIn()
						jQuery(selectedTextBalloon).css("top", "0")
						jQuery(selectedTextBalloon).css("left", ((jQuery(this).offset().left - 15) + "px"))
						
						var corner = jQuery(selectedTextBalloon).find("div.corner")
						var cornerPos = parseInt(Estate.StringTools.RemoveMeasurement(jQuery(corner).css("bottom"))) + (jQuery(corner).height() / 2) + 3
						var newTop = jQuery(this).offset().top - (jQuery(selectedTextBalloon).offset().top + (jQuery(selectedTextBalloon).height() - cornerPos))
						jQuery(selectedTextBalloon).css("top", newTop + "px")
						var documentY = jQuery(window).scrollTop()
						
						var textBalloonY = jQuery(selectedTextBalloon).offset().top
						if (textBalloonY < documentY) {
							newTop += documentY - textBalloonY
							jQuery(selectedTextBalloon).css("top", newTop + "px")
							var cornerBottom = parseInt(Estate.StringTools.RemoveMeasurement(jQuery(selectedTextBalloon).find("div.corner").css("bottom")))
							jQuery(selectedTextBalloon).find("div.corner").css("bottom", cornerBottom + (documentY - textBalloonY) + "px")
						}
					}),
					jQuery(this).mouseout(function() {
						jQuery(selectedTextBalloon).fadeOut(100)
						jQuery(selectedTextBalloon).find("div.corner").css("bottom", jQuery(selectedTextBalloon).data("cornerBottom"))
					})
				})
			}
		}
	}
	/* END PUBLIC */
})();

