
	var HeipeSoft_AjaxRuns = Array();
	var HeipeSoft_AjaxRunsCount = 0;

	function HeipeSoft_AjaxHttp(informations) {
		var oDragManie = null;
		
  		var aUrlParts = informations["web"].split("?");
   		ajaxUrl = aUrlParts[0];
   		if ( typeof(aUrlParts[1]) == "undefined" ) {
   			parameters = "";
   		} else {
   			parameters = aUrlParts[1];
   		}

		if ( parameters == "" ) {
			parameters += "?";
		} else {
			parameters += "&";
		}
		parameters += 'ie=' + encodeURIComponent(new Date().getTime());
		
		informations["web"] = ajaxUrl + "?" + parameters;
		
		var oAjax;
		oAjax = new HeipeSoft_Ajax(HeipeSoft_AjaxRunsCount, informations);
			
		HeipeSoft_AjaxRuns[ HeipeSoft_AjaxRunsCount ] = oAjax;
		HeipeSoft_AjaxRunsCount++;
		
		return oAjax;
	}
	
	function HeipeSoft_Ajax(id, informations) {
		this.informations = informations;
		this.id = id;
		this.responseText = "";
		
		var thisInstance = this;
		
		setTimeout( function() {
			HeipeSoft_RunAjax(thisInstance);
		}, 500 );
	}
	
	function HeipeSoft_RunAjax(oAjax) {
		var webHttp = null;
		webHttp = false;
	    // branch for native XMLHttpRequest object
	    if(window.XMLHttpRequest) {
	    	try {
				webHttp = new XMLHttpRequest();
	        } catch(e) {
				webHttp = false;
	        }
	    // branch for IE/Windows ActiveX version
	    } else if(window.ActiveXObject) {
	       	try {
	        	webHttp = new ActiveXObject("Msxml2.XMLHTTP");
	      	} catch(e) {
	        	try {
	          		webHttp = new ActiveXObject("Microsoft.XMLHTTP");
	        	} catch(e) {
	          		webHttp = false;
	        	}
			}
	    }

		if (webHttp) {
			//fastTip( "ajax initialized" );
		    webHttp.onreadystatechange = function() {
		    	/*
		    	if ( webHttp.readyState ) {
		    		fastTip( "ajax " + webHttp.readyState );
		    	}
		    	*/
		    	
	        	oAjax.readyState = webHttp.readyState;
		        if (webHttp.readyState == 4) {
		        	oAjax.responseText = webHttp.responseText;
		        }
		        
		        oAjax.informations["onreadystatechange"](oAjax);
		    }
		    
		    var postSend;
		    postSend = false;
		    
		    if ( oAjax.informations["method"] == 'POST' ) {
		    	postSend = true;
		    	
		    	var aUrl = oAjax.informations["web"] + "&iebb=" + encodeURIComponent(new Date().getTime());
		    	if ( aUrl.replace("?", "") == aUrl ) { 
		    		postSend = false;
		    	} else {
		    		var aUrlParts = aUrl.split("?");
		    		ajaxUrl = aUrlParts[0];
		    		ajaxPosting = aUrlParts[1];
		    	}
		    }
		    
		    if ( postSend == true ) {
		    	webHttp.open(oAjax.informations["method"], ajaxUrl, true);
		    	//webHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		    	//webHttp.setRequestHeader('charset', 'iso-8859-1');
		    	webHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
		    	webHttp.send(ajaxPosting);
		    } else {
		    	webHttp.open(oAjax.informations["method"], oAjax.informations["web"], true);
		    	webHttp.send(null);
		    }
		} else {
			fastTip( "ajax not initialized" );
		}
	}
	
	function HeipeSoft_AjaxStrip(stripName, content) {
		return content.split("[ajax:"+stripName+"]")[1].split("[/ajax:"+stripName+"]")[0];
	}
	
	function HeipeSoft_extractFromUrlParameter(aUrl, parName) {
		var wk = "";
		if ( aUrl.replace("?", "") == aUrl ) { 
			wk = aUrl;
		} else {
			wk = aUrl.split("?")[1];
		}
		
		var parameters = wk.split("&");
		for(var z = 0; z < parameters.length; z++) {
			var parUnits = parameters[z].split("=");
			if ( parUnits[0] == parName ) {
				return parUnits[1];
			}
		}
		
		return "";
	}
	
	function HeipeSoft_BuildObjectFromString(workString) {
		var myObject;
		eval("myObject = {" + workString + "}");
		return myObject;
	}
	
	
	
	var Base64 = {
	
	    // private property
	    _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
	
	    // public method for encoding
	    encode : function (input) {
	        var output = "";
	        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
	        var i = 0;
	
	        input = Base64._utf8_encode(input);
	
	        while (i < input.length) {
	
	            chr1 = input.charCodeAt(i++);
	            chr2 = input.charCodeAt(i++);
	            chr3 = input.charCodeAt(i++);
	
	            enc1 = chr1 >> 2;
	            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
	            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
	            enc4 = chr3 & 63;
	
	            if (isNaN(chr2)) {
	                enc3 = enc4 = 64;
	            } else if (isNaN(chr3)) {
	                enc4 = 64;
	            }
	
	            output = output +
	            this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
	            this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
	
	        }
	
	        return output;
	    },
	
	    // public method for decoding
	    decode : function (input) {
	        var output = "";
	        var chr1, chr2, chr3;
	        var enc1, enc2, enc3, enc4;
	        var i = 0;
	
	        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
	
	        while (i < input.length) {
	
	            enc1 = this._keyStr.indexOf(input.charAt(i++));
	            enc2 = this._keyStr.indexOf(input.charAt(i++));
	            enc3 = this._keyStr.indexOf(input.charAt(i++));
	            enc4 = this._keyStr.indexOf(input.charAt(i++));
	
	            chr1 = (enc1 << 2) | (enc2 >> 4);
	            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
	            chr3 = ((enc3 & 3) << 6) | enc4;
	
	            output = output + String.fromCharCode(chr1);
	
	            if (enc3 != 64) {
	                output = output + String.fromCharCode(chr2);
	            }
	            if (enc4 != 64) {
	                output = output + String.fromCharCode(chr3);
	            }
	
	        }
	
	        output = Base64._utf8_decode(output);
	
	        return output;
	
	    },
	
	    // private method for UTF-8 encoding
	    _utf8_encode : function (string) {
	        string = string.replace(/\r\n/g,"\n");
	        var utftext = "";
	
	        for (var n = 0; n < string.length; n++) {
	
	            var c = string.charCodeAt(n);
	
	            if (c < 128) {
	                utftext += String.fromCharCode(c);
	            }
	            else if((c > 127) && (c < 2048)) {
	                utftext += String.fromCharCode((c >> 6) | 192);
	                utftext += String.fromCharCode((c & 63) | 128);
	            }
	            else {
	                utftext += String.fromCharCode((c >> 12) | 224);
	                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
	                utftext += String.fromCharCode((c & 63) | 128);
	            }
	
	        }
	
	        return utftext;
	    },
	
	    // private method for UTF-8 decoding
	    _utf8_decode : function (utftext) {
	        var string = "";
	        var i = 0;
	        var c = c1 = c2 = 0;
	
	        while ( i < utftext.length ) {
	
	            c = utftext.charCodeAt(i);
	
	            if (c < 128) {
	                string += String.fromCharCode(c);
	                i++;
	            }
	            else if((c > 191) && (c < 224)) {
	                c2 = utftext.charCodeAt(i+1);
	                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
	                i += 2;
	            }
	            else {
	                c2 = utftext.charCodeAt(i+1);
	                c3 = utftext.charCodeAt(i+2);
	                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
	                i += 3;
	            }
	
	        }
	
	        return string;
	    }
	
	}
	
	
	
	
	
	var mousePosition_x = 0;
	var mousePosition_y = 0;
	var mousePositionHook_onmousemove = false;
	
	function setMousePosition(e) {
	    mousePosition_x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	    mousePosition_y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY;
	    if ( typeof(mousePositionHook_onmousemove) != "undefined" ) {
	    	if ( mousePositionHook_onmousemove != false ) {
	    		mousePositionHook_onmousemove(e);
	    	}
	    }
	}
	
	mousePositionHook_onmousemove = false;
	if ( typeof(document.onmousemove) != "undefined" ) {
		if ( document.onmousemove ) {
			mousePositionHook_onmousemove = document.onmousemove;
		}
	}
	document.onmousemove = setMousePosition;
	
	
	
	
	
	
	

	var webJS = function() {
		this.iG = null;
		this.onPageChange = new Array();
		this.onPageChangeCount = 0;
		this.myWebArea = "";
		
		this.myAjaxLinks = new Object();
		this.myAjaxLinksCopy = new Object();
		this.myActualAjaxContainer = new Object();
		this.ajaxLoadName = "ajaxload";
		this.ajaxUseFade = true;
	}
	
	var hover_menu_marker;
	var hover_menu_positionier;
	
	webJS.prototype.run = function() {
		this.runIntoHtmlElements(false, null, document.body, function(el, info) {
			//if ( typeof(el.href) != "undefined" ) {
				//alert(el.href);
			//}
			//^ contains a bug
		} );
		
		//alert(this.myWebArea);
		
		
		var me = this;
		setTimeout( function() {
			hover_menu_positionier = document.createElement("DIV");
			hover_menu_positionier.style.position = "absolute";
			hover_menu_positionier.style.left = "0";
			hover_menu_positionier.style.top = "0";
			hover_menu_positionier.style.display = "none";
			hover_menu_positionier.style.zIndex = 1000;
			document.getElementById("preheader_menu").appendChild(hover_menu_positionier);
			
			hover_menu_marker = document.createElement("DIV");
			hover_menu_marker.style.backgroundColor = "#72783D";
			hover_menu_marker.style.display = "block";
			hover_menu_marker.style.width = "100px";
			hover_menu_marker.style.height = "2px";
			hover_menu_marker.style.overflow = "hidden";
			hover_menu_marker.style.innerHTML = "&nbsp;";
			hover_menu_marker.style.zIndex = 1000;
			hover_menu_positionier.appendChild(hover_menu_marker);
			
			for(var z = 0; z < 7; z++) {
				var myEl = document.getElementById('menu_top_' + z);
				if ( myEl ) {
					myEl.onmouseover = function() {
						var pTop = myWeb.getElementTop(this, false);
						pTop = Number(pTop) + 27;
						
						hover_menu_positionier.style.marginTop = pTop + "px";
						hover_menu_positionier.style.paddingLeft = myWeb.getElementLeft(this, true) + "px";
						hover_menu_marker.style.width = this.style.width;
						
						hover_menu_positionier.style.display = "block";
					}
					
					myEl.onmouseout = function() {
						hover_menu_positionier.style.display = "none";
					}
				}
			}
		}, 500 );
	}
	
	
	webJS.prototype.getElementTop = function(obj,relative) { if(!relative){relative=false;}var y=0; if(typeof(obj)=="object" && document.getElementById) { y=obj.offsetTop; if(obj.offsetParent && !relative) { y+=this.getElementTop(obj.offsetParent); } return y; } else  { return false; } }
	webJS.prototype.getElementLeft = function(obj,relative) { if(!relative){relative=false;}var x=0; if(typeof(obj)=="object" && document.getElementById) { x=obj.offsetLeft; if(obj.offsetParent && !relative) { x+=this.getElementLeft(obj.offsetParent); } return x; } else  { return false; } }
	
	webJS.prototype.getElementHeight = function(elm)
	{
	  if (!elm)
	    return 0;
	
	  if (document.layers)
	  {
	    if (!elm.height)
	      elm.height = elm.clip.height;
	    return elm.height;
	  }
	  else if (typeof(elm.style && elm.style.height) == 'number')
	  {
	    return elm.style.height;
	  }
	  else if (typeof(elm.style && elm.style.height) == 'string' && !isNaN(parseInt(elm.style.height)))
	  {
	    return parseInt(elm.style.height);
	  }
	  else if (elm.offsetHeight)
	  {
	    return elm.offsetHeight;
	  }
	  else if (typeof(elm.style && elm.style.pixelHeight) == 'number')
	  {
	    return elm.style.pixelHeight;
	  }
	  else if (elm.clientHeight)
	  {
	    return elm.clientHeight;
	  }
	
	  return 0;
	}
	

	webJS.prototype.getElementWidth = function(elm)
	{
	  if (!elm)
	    return 0;

	  if (document.layers)
	  {
	    if (!elm.width)
	      elm.width = elm.clip.width;
	    return elm.width;
	  }
	  else if (typeof(elm.style && elm.style.width) == 'number')
	  {
	    return elm.style.width;
	  }
	  else if (elm.offsetWidth)
	  {
	    return elm.offsetWidth;
	  }
	  else if (elm.clientWidth)
	  {
	    return elm.clientWidth;
	  }
	  
	  if (typeof(elm.style && elm.style.width) == 'string' && !isNaN(parseInt(elm.style.width)))
	  {
  		return parseInt(elm.style.width);
	  } else if (typeof(elm.style && elm.style.pixelWidth) == 'number')
	  {
	    return elm.style.pixelWidth;
	  }
	  
	  
	  return 0;
	}
	
	
	
	
	webJS.prototype.addPageChangeEvent = function(func) {
		this.onPageChange[this.onPageChangeCount] = func;
		this.onPageChangeCount++;
	}
	
	webJS.prototype.runIntoHtmlElements = function(runTheFunction, infoVariable, node, runFunction) {
		if ( runTheFunction == true ) {
			if ( typeof(node) != "undefined" ) {
				if ( node != null ) {
					runFunction(node, infoVariable);
				}
			}
		}
		
	    if (node.hasChildNodes()) {
	        for (var i = 0; i < node.childNodes.length; i++) {
	            newnode = node.childNodes[i];
	            this.runIntoHtmlElements(true, infoVariable, newnode, runFunction);
	        }
	    }
	}
	
	
	
	webJS.prototype.topDocument = function() {
		var topWindow = window.parent ;
	
		while ( topWindow.parent && topWindow.parent != topWindow )
		{
			try
			{
				//if ( topWindow.parent.document.domain != document.domain )
					//break ;
				if ( topWindow.parent.document.getElementsByTagName( 'frameset' ).length > 0 )
					break ;
			}
			catch ( e )
			{
				break ;
			}
			topWindow = topWindow.parent ;
		}
	
		return topWindow.document;
	}

	
	
	
	
	webJS.prototype.setAjaxLink = function(linkId, destId, dataSourceName, group, isActive) {
		if ( typeof(document.getElementById(destId + "0")) != "undefined" && document.getElementById(destId + "0") != null ) {
			this.myAjaxLinks[linkId] = {
				"linkId" : linkId,
				"destId" : destId,
				"dataSourceName" : dataSourceName,
				"group" : group,
				"isActive" : isActive,
				"ajaxLoadName" : this.ajaxLoadName,
				"ajaxUseFade" : this.ajaxUseFade,
				"href" : ""
			};
			
			/*
			this.myAjaxLinksCopy[linkId] = {
				"linkId" : linkId,
				"destId" : destId,
				"dataSourceName" : dataSourceName,
				"group" : group,
				"isActive" : isActive,
				"ajaxLoadName" : this.ajaxLoadName,
				"ajaxUseFade" : this.ajaxUseFade,
				"href" : ""
			};
			*/
			
			this.myActualAjaxContainer[destId] = 0;
			
			var me = this;
			var el_link = document.getElementById(linkId);
			this.myAjaxLinks[linkId]["href"] = el_link.href;
			el_link.href = "#";
			el_link.onfocus = function() { this.blur(); }
			el_link.onclick = function() {
				this.blur();
				me.activateAjaxLink(this.id);
			}
		}
	}
	
	webJS.prototype.activateAjaxLink = function(linkId) {
		var ajaxInf = this.myAjaxLinks[linkId];
		
		var me = this;
		var myAjax = HeipeSoft_AjaxHttp( {
			"method" : "POST",
			"web" : ajaxInf["href"] + "&"+ajaxInf["ajaxLoadName"]+"=true",
			"onreadystatechange" : function(oAjax) {
				if ( oAjax.readyState == 4 ) {
					
					for(ajLinkId in me.myAjaxLinks) {
						if ( me.myAjaxLinks[ajLinkId]["group"] == me.myAjaxLinks[linkId]["group"] ) {
							if ( document.getElementById(me.myAjaxLinks[ajLinkId]["linkId"]) ) {
								var clName = document.getElementById(me.myAjaxLinks[ajLinkId]["linkId"]).className;
								document.getElementById(me.myAjaxLinks[ajLinkId]["linkId"]).className = clName.replace("_active", "");
							}
						}
					}
					
					var clName = document.getElementById(me.myAjaxLinks[linkId]["linkId"]).className;
					document.getElementById(me.myAjaxLinks[linkId]["linkId"]).className = clName + "_active";
					
					/*
					for(ajLinkId in me.myAjaxLinks) {
						//document.getElementById(me.myAjaxLinks[ajLinkId]["linkId"]).id = document.getElementById(me.myAjaxLinks[ajLinkId]["linkId"]).id + "_notuse";
						document.getElementById(me.myAjaxLinks[ajLinkId]["linkId"]).id = "qq";
					}
					*/
					
					
					me.switchAjaxLinkContent(linkId, HeipeSoft_AjaxStrip(ajaxInf["dataSourceName"], oAjax.responseText));
					
					/*
					var s_ajaxLoadName = this.ajaxLoadName;
					var s_ajaxUseFade = this.ajaxUseFade;
					
					myAjaxLinks = new Object();
					for(ajLinkId in me.myAjaxLinksCopy) {
						this.ajaxLoadName = me.myAjaxLinksCopy["ajaxLoadName"];
						this.ajaxUseFade = me.myAjaxLinksCopy["ajaxUseFade"];
						me.setAjaxLink(ajLinkId, me.myAjaxLinksCopy["destId"], me.myAjaxLinksCopy["dataSourceName"], me.myAjaxLinksCopy["group"], me.myAjaxLinksCopy["isActive"]);
					}
					
					this.ajaxLoadName = s_ajaxLoadName;
					this.ajaxUseFade = s_ajaxUseFade;
					*/
					
					/*
					for(ajLinkId in me.myAjaxLinks) {
						var el_link = document.getElementById(ajLinkId);
						me.myAjaxLinks[ajLinkId]["href"] = el_link.href;
						el_link.href = "#";
						el_link.onfocus = function() { this.blur(); }
						el_link.onclick = function() {
							this.blur();
							me.activateAjaxLink(this.id);
						}
					}
					*/
					
				}
			}
		} );
	}
	
	webJS.prototype.switchAjaxLinkContent = function(linkId, newContent) {
		var ajaxInf = this.myAjaxLinks[linkId];
		var destId = ajaxInf["destId"];
		var actualContainer = this.myActualAjaxContainer[destId];
		
		if ( ajaxInf["ajaxUseFade"] == true ) {
			this.myActualAjaxContainer[destId] = 1 - this.myActualAjaxContainer[destId];
			actualContainer = this.myActualAjaxContainer[destId];
			
			document.getElementById(destId + actualContainer).innerHTML = newContent;
		
			var me = this;
			tweenTB = new Tween(new Object(),'xyz',Tween.strongEaseOut,0,100,1);
			tweenTB.onMotionChanged = function(event) {
				var elStyle1 = document.getElementById(destId + me.myActualAjaxContainer[destId]).style;
				var elStyle2 = document.getElementById(destId + (1-me.myActualAjaxContainer[destId])).style;
				var alphVal1 = event.target._pos;
				var alphVal2 = 100 - event.target._pos;
				
				if ( alphVal1 >= 100 ) { alphVal1 = 100; }
				if ( alphVal1 <= 0 ) { alphVal1 = 0; }
				if ( alphVal2 >= 100 ) { alphVal2 = 100; }
				if ( alphVal2 <= 0 ) { alphVal2 = 0; }
				
				if ( typeof(elStyle1.opacity) != "undefined" ) {
					elStyle1.opacity = alphVal1 / 100;
					elStyle2.opacity = alphVal2 / 100;
				}
				
				if ( typeof(elStyle1.filter) != "undefined" ) {
					elStyle1.filter = 'alpha(opacity='+alphVal1+')';
					elStyle2.filter = 'alpha(opacity='+alphVal2+')';
				}
				
				if ( typeof(elStyle1.MozOpacity) != "undefined" ) {
					elStyle1.MozOpacity = alphVal1 / 100;
					elStyle2.MozOpacity = alphVal2 / 100;
				}
				
				elStyle1.visibility = "";
				elStyle2.visibility = "";
			};
			tweenTB.onMotionFinished = function() {
				var elStyle1 = document.getElementById(destId + me.myActualAjaxContainer[destId]).style;
				var elStyle2 = document.getElementById(destId + (1-me.myActualAjaxContainer[destId])).style;
				var alphVal1 = 100;
				var alphVal2 = 0;
				
				if ( alphVal1 >= 100 ) { alphVal1 = 100; }
				if ( alphVal1 <= 0 ) { alphVal1 = 0; }
				if ( alphVal2 >= 100 ) { alphVal2 = 100; }
				if ( alphVal2 <= 0 ) { alphVal2 = 0; }
				
				if ( typeof(elStyle1.opacity) != "undefined" ) {
					elStyle1.opacity = alphVal1 / 100;
					elStyle2.opacity = alphVal2 / 100;
				}
				
				if ( typeof(elStyle1.filter) != "undefined" ) {
					elStyle1.filter = 'alpha(opacity='+alphVal1+')';
					elStyle2.filter = 'alpha(opacity='+alphVal2+')';
				}
				
				if ( typeof(elStyle1.MozOpacity) != "undefined" ) {
					elStyle1.MozOpacity = alphVal1 / 100;
					elStyle2.MozOpacity = alphVal2 / 100;
				}
				
				//elStyle1.display = "";
				//elStyle2.display = "none";
				elStyle1.visibility = "";
				elStyle2.visibility = "hidden";
				
				//galerie__stored__isInTween = false;
			};
			tweenTB.onMotionStarted = function() {
				//galerie__stored__isInTween = true;
			};
			tweenTB.start();
		} else {
			actualContainer = this.myActualAjaxContainer[destId];
			document.getElementById(destId + actualContainer).innerHTML = newContent;
			
			/*
			var elStyle1 = document.getElementById(destId + this.myActualAjaxContainer[destId]).style;
			var elStyle2 = document.getElementById(destId + (1-this.myActualAjaxContainer[destId])).style;
			
			elStyle1.visibility = "";
			elStyle2.visibility = "hidden";
			*/
		}
	}
	
