// Krollis API - hwnd

function hWnd (fix, width, height, top, name,hRef) 
{
	this.self   = name;
	this.site   = hRef;
	this.postData = "";
	this.top    = top;
	this.width  = width;
	this.height = height;
	this.fix    = fix;

	this.FaderValue   = 0.0075;
	this.FaderStart   = 100;
	this.FaderStop    = 0;
	this.FaderSpeed   = 2;
	this.FaderNow     = this.FaderStart;
	
	this.LoaderStep   = 4;
	this.LoaderValue  = 0.15;
	this.LoaderStart  = 0;
	this.LoaderStop   = 0;
	this.LoaderSpeed  = 2;
	this.LoaderWidth  = 350;
	this.LoaderHeight = 110;
	this.LoaderCode   = 0;
	this.LoaderUse    = false;
	this.LoaderData   = "";
	this.LoaderNow    = 100;
	
	this.frame  = document.createElement("div");
	this.frame.style.position = "relative";
	this.frame.style.width  	  = this.LoaderWidth + "px";
	this.frame.style.marginTop	  = this.top + "px";	
	this.frame.style.marginLeft   = "auto";
	this.frame.style.marginRight  = "auto";
	this.frame.style.visibility = "hidden";
	this.frame.style.filter = "Alpha(opacity=0)";
	this.frame.style.opacity = 0;
	this.frame.style.MozOpacity = 0;
	this.header = document.createElement("div");
	this.header.style.width = "100%";
	this.temp = document.createElement("div");
	this.temp.style.width = "29px";
	this.temp.style.height = "29px";
	this.temp.style.backgroundImage = "url('bilder/headertl.png')";
	setFloat(this.temp, "left");
	this.header.appendChild(this.temp);
	this.temp = document.createElement("div");
	this.temp.style.width = "44px";
	this.temp.style.height = "29px";
	this.temp.style.backgroundImage = "url('bilder/headertr.png')";
	setFloat(this.temp, "right")
	this.header.appendChild(this.temp);
	this.temp = document.createElement("div");
	this.temp.style.height = "29px";
	this.temp.style.marginLeft = "29px";
	this.temp.style.marginRight = "44px";
	this.temp.style.backgroundImage = "url('bilder/headertm.png')";
	this.header.appendChild(this.temp);
	this.header.appendChild(this.clear());
	this.headerr = document.createElement("div");
	this.headerr.style.width = "300px";
	this.headerr.style.height = "50px";
	setFloat(this.headerr,"right");
	this.header.appendChild(this.headerr);
	this.temp = document.createElement("div");
	this.temp.style.height = "24px";
	this.temp.style.width = "44px";
	this.temp.style.backgroundImage = "url('bilder/headermr.png')";
	setFloat(this.temp, "right");
	this.headerr.appendChild(this.temp);
	this.temp = document.createElement("div");
	this.temp.style.height = "24px";
	this.temp.style.marginLeft = "0px";
	this.temp.style.marginRight = "44px";
	this.temp.style.backgroundImage = "url('bilder/headermm.png')";
	this.headerr.appendChild(this.temp);
	this.temp = document.createElement("div");
	this.temp.style.height = "26px";
	this.temp.style.width ="49px";
	this.temp.style.backgroundImage = "url('bilder/headerbm2.png')";
	setFloat(this.temp, "left");
	this.headerr.appendChild(this.temp);
	this.temp = document.createElement("div");
	this.temp.style.height = "26px";
	this.temp.style.width = "44px";
	this.temp.style.backgroundImage = "url('bilder/headerbr.png')";
	setFloat(this.temp, "right");
	this.headerr.appendChild(this.temp);
	this.temp = document.createElement("div");
	this.temp.style.height = "26px";
	this.temp.style.marginRight = "44px";
	this.temp.style.marginLeft = "49px";
	this.temp.style.backgroundImage = "url('bilder/headerbm3.png')";
	this.headerr.appendChild(this.temp);
	this.headerl = document.createElement("div");
	this.headerl.style.height = "50px";
	this.headerl.style.marginLeft = "0px";
	this.headerl.style.marginRight = "300px";
	this.header.appendChild(this.headerl);
	this.temp = document.createElement("div");
	this.temp.style.width = "29px";
	this.temp.style.height = "42px";
	this.temp.style.backgroundImage = "url('bilder/headerml.png')";
	setFloat(this.temp,"left");
	this.headerl.appendChild(this.temp);
	this.headertxtholder = document.createElement("div");
	this.headertxtholder.style.height = "42px";
	this.headertxtholder.style.marginLeft = "29px";
	this.headertxtholder.style.margiRight = "0px";
	this.headertxtholder.style.backgroundImage = "url('bilder/headermm.png')";
	this.headertxt = document.createElement("div");
	this.headertxt.style.height = "42px";
	this.headertxt.style.width = "100%";
	this.headertxt.style.fontFamily = "Georgia, 'Times New Roman', Times, serif";
	this.headertxt.style.fontSize = "40px";
	this.headertxt.style.fontWeight = "bolder";
	this.headertxt.style.color = "#FFFFFF";
	this.headertxt.style.visibility = "hidden";
	this.headertxt.style.filter = "Alpha(opacity=0)";
	this.headertxt.style.opacity = 0;
	this.headertxt.style.MozOpacity = 0;

	this.headertxtholder.appendChild(this.headertxt);
	this.headerl.appendChild(this.headertxtholder);
	this.temp = document.createElement("div");
	this.temp.style.width = "29px";
	this.temp.style.height = "8px";
	this.temp.style.backgroundImage = "url('bilder/headerbl.png')";
	setFloat(this.temp, "left");
	this.headerl.appendChild(this.temp);
	this.temp = document.createElement("div");
	this.temp.style.height = "8px";
	this.temp.style.marginLeft = "29px";
	this.temp.style.marginRight = "0px";
	this.temp.style.backgroundImage = "url('bilder/headerbm.png')";
	this.headerl.appendChild(this.temp);
	this.header.appendChild(this.clear());
	this.contentwnd = document.createElement("div");
	this.contentwnd.style.width = "100%";
	this.content = document.createElement("div");
	this.content.style.marginLeft = "29px";
	this.content.style.marginRight = "44px";
	this.content.style.zoom = "1";
	this.content.style.position = "relative";
	this.content.style.backgroundImage = "url('bilder/contentmm.png')";
	this.content.style.height = this.LoaderHeight + "px";
	this.content.style.overflow = "hidden";
	this.contentholder = document.createElement("div");
	this.contentholder.style.width = this.content.offsetWidth;
	this.contentholder.style.position = "absolute";
	this.contentholder.style.top = "0px";
	this.contentholder.style.left = "0px";
	this.contentholder.style.height = "0px";
	this.contentholder.style.visibility = "hidden";
	this.contentholder.style.filter = "Alpha(opacity=0)";
	this.contentholder.style.opacity = 0;
	this.contentholder.style.MozOpacity = 0;
	this.contentholder.style.overflow = "hidden";
	this.loader = document.createElement("div");
	this.loader.style.margin = "0px auto";
	this.loader.style.width = "100px";
	this.loader.style.height = "100px";
	this.loader.style.backgroundImage = "url('bilder/loader.gif')";
	
	this.content.appendChild(this.loader);
	this.content.appendChild(this.contentholder);
	
	this.temp = document.createElement("div");
	this.temp.style.width = "100%";
	this.temp.style.backgroundImage = "url('bilder/contentml.png')";
	this.temp.style.backgroundRepeat = "repeat-y";
	this.temp.style.backgroundPosition = "left";
	this.contentwnd.appendChild(this.temp);
	this.temp2 = document.createElement("div");
	this.temp2.style.width = "100%";
	this.temp2.style.backgroundImage = "url('bilder/contentmr.png')";
	this.temp2.style.backgroundRepeat = "repeat-y";
	this.temp2.style.backgroundPosition = "right";
	this.temp.appendChild(this.temp2);
	this.temp2.appendChild(this.content);
	this.temp = document.createElement("div");
	this.temp.style.width = "29px";
	this.temp.style.height = "44px";
	this.temp.style.backgroundImage = "url('bilder/contentbl.png')";
	setFloat(this.temp, "left");
	this.contentwnd.appendChild(this.temp);
	this.temp = document.createElement("div");
	this.temp.style.width = "44px";
	this.temp.style.height ="44px";
	this.temp.style.backgroundImage = "url('bilder/contentbr.png')";
	setFloat(this.temp, "right");
	this.contentwnd.appendChild(this.temp);
	this.temp = document.createElement("div");
	this.temp.style.marginLeft = "29px";
	this.temp.style.marginRight = "44px";
	this.temp.style.height = "44px";
	this.temp.style.backgroundImage = "url('bilder/contentbm.png')";
	this.contentwnd.appendChild(this.temp);
	this.contentwnd.appendChild(this.clear());
	this.frame.appendChild(this.header);
	this.frame.appendChild(this.contentwnd);
};

hWnd.prototype.setFrameOpacity = function(richtung,step)
{
	if(richtung)
	{
		var temp = this.FaderNow + step;
		if(temp >= 100)
		{
			temp = 100;
		}
		
		if(temp > 0 )
		{
			this.frame.style.visibility = "visible";
		}

		this.frame.style.filter = "Alpha(opacity=" + temp +")";
		this.frame.style.opacity = (temp / 100);
		this.frame.style.MozOpacity = (temp / 100);
		this.FaderNow = temp;
	}
	else
	{
		var temp = this.FaderNow - step;
		if(temp <= 0)
		{
			temp = 0;
			this.frame.style.visibility = "hidden";
		}
		this.frame.style.filter = "Alpha(opacity=" + temp +")";
		this.frame.style.opacity = (temp / 100);
		this.frame.style.MozOpacity = (temp / 100);
		this.FaderNow = temp;
	}
}

hWnd.prototype.setContentOpacity = function(richtung,step)
{
	if(richtung)
	{
		var temp = this.FaderNow + step;
		if(temp >= 100)
		{
			temp = 100;
		}
		
		if(temp > 0 )
		{
			this.contentholder.style.visibility = "visible";
			this.headertxt.style.visibility = "visible";
			if(this.fix)
			{
				this.content.style.overflow = "auto";
			}
			else
			{
				this.content.style.overflow = "hidden";
			}
		}

		this.contentholder.style.filter = "Alpha(opacity=" + temp +")";
		this.contentholder.style.opacity = (temp / 100);
		this.contentholder.style.MozOpacity = (temp / 100);
		this.headertxt.style.filter = "Alpha(opacity=" + temp +")";
		this.headertxt.style.opacity = (temp / 100);
		this.headertxt.style.MozOpacity = (temp / 100);
		this.FaderNow = temp;
	}
	else
	{
		var temp = this.FaderNow - step;
		if(temp <= 0)
		{
			temp = 0;
			this.headertxt.style.visibility = "hidden";
			this.contentholder.style.visibility = "hidden";
			this.content.style.overflow = "hidden";
		}
		this.headertxt.style.filter = "Alpha(opacity=" + temp +")";
		this.headertxt.style.opacity = (temp / 100);
		this.headertxt.style.MozOpacity = (temp / 100);
		this.contentholder.style.filter = "Alpha(opacity=" + temp +")";
		this.contentholder.style.opacity = (temp / 100);
		this.contentholder.style.MozOpacity = (temp / 100);
		this.FaderNow = temp;
	}
}

hWnd.prototype.setLoaderOpacity = function(richtung,step)
{
	if(richtung)
	{
		var temp = this.LoaderNow + step;
		if(temp >= 100)
		{
			temp = 100;
		}
		
		if(temp > 0 )
		{
			this.loader.style.height = "100px";
			this.loader.style.visibility = "visible";
		}

		this.loader.style.filter = "Alpha(opacity=" + temp +")";
		this.loader.style.opacity = (temp / 100);
		this.loader.style.MozOpacity = (temp / 100);
		this.LoaderNow = temp;
	}
	else
	{
		var temp = this.LoaderNow - step;
		if(temp <= 0)
		{
			temp = 0;
			this.loader.style.visibility = "hidden";
			this.loader.style.height = "0px";
		}
		this.loader.style.filter = "Alpha(opacity=" + temp +")";
		this.loader.style.opacity = (temp / 100);
		this.loader.style.MozOpacity = (temp / 100);
		this.LoaderNow = temp;
	}
}

hWnd.prototype.setWidth = function(richtung,step)
{
	if(richtung)
		this.frame.style.width = (this.frame.offsetWidth + step) + "px";
	else
		this.frame.style.width = (this.frame.offsetWidth - step) + "px";

}

hWnd.prototype.setHeight = function(richtung,step)
{
	if(richtung)
		this.content.style.height = (this.content.offsetHeight + step) + "px";
	else
		this.content.style.height = (this.content.offsetHeight - step) + "px";
}

hWnd.prototype.showLoad = function(schritt)
{
	if(this.showLoad.arguments.length == 0)
		var step = this.FaderStart;
	else
		var step = schritt;
		
	if(this.LoaderCode == 0)
	{
		if(step == 0)
		{
			window.setTimeout(this.self + ".runload();",this.LoaderSpeed);
			return;
		}
		var timecode = nextTimeStep(this.FaderValue, step, this.FaderSpeed);
		this.LoaderCode = 7;
		window.setTimeout(this.self + ".showLoad(" + step + ");",timecode);
		return;
	}
	if(this.LoaderCode == 1)
	{
		if(this.frame.offsetWidth > (this.LoaderWidth + this.LoaderStop))
		{
			this.setWidth(false, this.LoaderStep);
			window.setTimeout(this.self + ".showLoad(0);",this.LoaderSpeed);
			return;
		}
		else
		{
			this.setWidth(false, (this.LoaderWidth - this.frame.offsetWidth));
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step + 1;
			this.LoaderCode = 8;
			window.setTimeout(this.self + ".showLoad(0);",timecode);
			return;
		}

	}
	if(this.LoaderCode == 2)
	{
		this.setWidth(false,this.LoaderStep);
		if(step > 0)
		{
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step - 1;
			window.setTimeout(this.self + ".showLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			this.LoaderCode = 1;
			window.setTimeout(this.self + ".showLoad(0);",this.LoaderSpeed);
			return;
		}
	}
	if(this.LoaderCode == 3)
	{
		this.setWidth(false,this.LoaderStep);
		if(step < this.LoaderStop)
		{
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step + 1;
			window.setTimeout(this.self + ".showLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			this.LoaderCode = 8;
			window.setTimeout(this.self + ".showLoad(0);",timecode);
			return;
		}

	}
	if(this.LoaderCode == 4)
	{
		if(this.content.offsetHeight > (this.LoaderHeight + this.LoaderStop))
		{
			this.setHeight(false,this.LoaderStep);
			window.setTimeout(this.self + ".showLoad(0);",this.LoaderSpeed);
			return;
		}
		else
		{
			this.setHeight(false,(this.LoaderHeight - this.content.offsetHeight));
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step + 1;
			this.LoaderCode = 1;
			window.setTimeout(this.self + ".showLoad(0);",timecode);
			return;
		}
	}
	if(this.LoaderCode == 5)
	{
		this.setHeight(false,this.LoaderStep);
		if(step > 0)
		{
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step - 1;
			window.setTimeout(this.self + ".showLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			this.LoaderCode = 4;
			window.setTimeout(this.self + ".showLoad(0);",this.LoaderSpeed);
			return;
		}
	}
	if(this.LoaderCode == 6)
	{
		this.setHeight(false,this.LoaderStep);
		if(step < this.LoaderStop)
		{
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step + 1;
			window.setTimeout(this.self + ".showLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			this.LoaderCode = 2;
			window.setTimeout(this.self + ".showLoad(15);",timecode);
			return;
		}
	}
	if(this.LoaderCode == 7)
	{
		this.setContentOpacity(false,4);
		if(step > 0)
		{
			var timecode = nextTimeStep(this.FaderValue, step, this.FaderSpeed);
			step = step - 4;
			window.setTimeout(this.self + ".showLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			var timecode = nextTimeStep(this.LoaderValue, this.LoaderStart, this.LoaderSpeed);
			this.LoaderCode = 4;
			window.setTimeout(this.self + ".showLoad(" + this.LoaderStart + ");",timecode);
			return;
		}
	}
	if(this.LoaderCode == 8)
	{
		this.setLoaderOpacity(true,4);
		if(step < 100)
		{
			var timecode = nextTimeStep(this.FaderValue, step, this.FaderSpeed);
			step = step + 4;
			window.setTimeout(this.self + ".showLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			var timecode = nextTimeStep(this.LoaderValue, this.LoaderStart, this.LoaderSpeed);
			this.LoaderCode = 0;
			window.setTimeout(this.self + ".showLoad(0);",timecode);
			return;
		}
	}
}


hWnd.prototype.hideLoad = function(schritt)
{
	if(this.hideLoad.arguments.length == 0)
		var step = 100;
	else
		var step = schritt;
		
	if(this.LoaderCode == 0)
	{
		if(step == 0)
		{
			if(this.LoaderUse)
			{
				var timecode = nextTimeStep(this.FaderValue, step, this.FaderSpeed);
				this.LoaderCode = 7;
				window.setTimeout(this.self + ".hideLoad(0);",timecode);
				return;
			}
			else
			{
				return;
			}
		}
		this.set_title(this.LoaderData.title);
		this.set_content(this.LoaderData.content);
		var timecode = nextTimeStep(0.000075, step, this.LoaderSpeed);
		this.LoaderCode = 8;
		window.setTimeout(this.self + ".hideLoad(" + step + ");",timecode);
		return;
	}
	if(this.LoaderCode == 1)
	{
		if(this.frame.offsetWidth < (this.width - this.LoaderStop))
		{
			this.setWidth(true,this.LoaderStep);
			window.setTimeout(this.self + ".hideLoad(0);",this.LoaderSpeed);
			return;
		}
		else
		{
			this.setWidth(true,(this.width - this.frame.offsetWidth));
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step + 1;
			this.LoaderCode = 0;
			window.setTimeout(this.self + ".hideLoad(0);",timecode);
			return;
		}

	}
	if(this.LoaderCode == 2)
	{
		this.setWidth(true,this.LoaderStep);
		if(step > 0)
		{
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step - 1;
			window.setTimeout(this.self + ".hideLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			this.LoaderCode = 1;
			window.setTimeout(this.self + ".hideLoad(0);",this.LoaderSpeed);
			return;
		}
	}
	if(this.LoaderCode == 3)
	{
		this.setWidth(true,this.LoaderStep);
		if(step < this.LoaderStop)
		{
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step + 1;
			window.setTimeout(this.self + ".hideLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			this.LoaderCode = 0;
			window.setTimeout(this.self + ".hideLoad(0);",timecode);
			return;
		}

	}
	if(this.LoaderCode == 4)
	{
		if(this.height == "auto");
		{ 
			this.height = this.contentholder.offsetHeight + this.LoaderStop;
		}
			
		if(this.content.offsetHeight < (this.height - this.LoaderStop))
		{
			this.setHeight(true,this.LoaderStep);
			window.setTimeout(this.self + ".hideLoad(0);",this.LoaderSpeed);
			return;
		}
		else
		{
			this.setHeight(true,(this.height - this.content.offsetHeight));
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step + 1;
			this.LoaderCode = 1;
			window.setTimeout(this.self + ".hideLoad(" + this.LoaderStop + ");",timecode);
			return;
		}
	}
	if(this.LoaderCode == 5)
	{
		this.setHeight(true,this.LoaderStep);
		if(step > 0)
		{
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step - 1;
			window.setTimeout(this.self + ".hideLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			this.LoaderCode = 4;
			window.setTimeout(this.self + ".hideLoad(0);",this.LoaderSpeed);
			return;
		}
	}
	if(this.LoaderCode == 6)
	{
		this.setHeight(true,this.LoaderStep);
		if(step < this.LoaderStop)
		{
			var timecode = nextTimeStep(this.LoaderValue, step, this.LoaderSpeed);
			step = step + 1;
			window.setTimeout(this.self + ".hideLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			this.LoaderCode = 2;
			window.setTimeout(this.self + ".hideLoad(15);",timecode);
			return;
		}
	}
	if(this.LoaderCode == 7)
	{
		this.setContentOpacity(true,4);
		if(step < 100)
		{
			var timecode = nextTimeStep(this.FaderValue, step, this.FaderSpeed);
			step = step + 4;
			window.setTimeout(this.self + ".hideLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			this.LoaderCode = 0;
			this.LoaderUse = false;
			window.setTimeout(this.self + ".hideLoad(0);",timecode);
			return;
		}
	}

	if(this.LoaderCode == 8)
	{
		this.setLoaderOpacity(false,4);
		if(step > 0)
		{
			var timecode = nextTimeStep(this.FaderValue, step, this.FaderSpeed);
			step = step - 4;
			window.setTimeout(this.self + ".hideLoad(" + step + ");",timecode);
			return;
		}
		else
		{
			this.LoaderCode = 4;
			this.contentholder.style.height = "auto";
			window.setTimeout(this.self + ".hideLoad(0);",timecode);
			return;
		}
	}
}

hWnd.prototype.set_title = function(txt) 
{
	this.headertxt.innerHTML = txt;
};

hWnd.prototype.set_content = function(txt) 
{
	this.contentholder.style.width = (this.width - 73) + "px";
	this.contentholder.innerHTML = txt;
};

hWnd.prototype.runload = function(url)
{
	var newsite;
	if(this.runload.arguments.length == 0)
		newsite = this.site;
	else 
		newsite = url;
	
	var method;
	if(this.postData.length == 0)
		method = "GET";
	else
		method = "POST";
	
	var self = this;
	var request = null;
	try 
	{
    	request = new XMLHttpRequest();
	} 
	catch(e) 
	{
    	try 
		{
        	request  = new ActiveXObject("Microsoft.XMLHTTP");
    	} 
		catch(e) 
		{
        	try 
			{
            	request  = new ActiveXObject("Msxml2.XMLHTTP");
        	} 
			catch(e) 
			{
            	request  = null;
        	}
    	}
	}
	
	if (request) 
	{
    	request.onreadystatechange = function () 
		{
			if (request.readyState == 4 && request.status == 200) 
			{ 
				if(self.LoaderUse)
				{
					eval("self.LoaderData = " +  request.responseText);
					if(self.LoaderData.setup.width)
						self.width = self.LoaderData.setup.width;
					if(self.LoaderData.setup.fix)
						self.fix = self.LoaderData.setup.fix;
					if(self.LoaderData.setup.height)
						self.height = self.LoaderData.setup.height;
					self.hideLoad();
				}
				else
				{
					eval("var Data = " +  request.responseText);
					if(Data.setup.width)
					{
						self.width = Data.setup.width;
						self.frame.style.width = Data.setup.width + "px";
					}
					if(Data.setup.fix)
					{
						self.fix = Data.setup.fix;
					}
					if(Data.setup.height)
					{
						self.height = Data.setup.height;
						if(self.height = "auto")
							self.content.style.height = "auto"
						else
							self.content.style.height = Data.setup.height + "px";
					}
					if(self.fix)
					{
						self.content.style.overflow = "hidden";
					}
					else
					{
						self.content.style.overflow = "auto";
					}

					self.set_content(Data.content);
					self.set_title(Data.title);
				}
    		}
		};
		var jetzt = new Date();
		var urlcode = '?code=' + newsite + "&time=" + jetzt.getTime();
    	request.open(method, urlcode, true);
		request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    	request.send(this.postData);
		
	}			
}

hWnd.prototype.load = function(url,postdata) 
{
	if(this.LoaderUse)
		return;
	if(this.load.arguments.length == 2)
		this.postData = postdata;
	else
		this.postData = "";
		
	this.LoaderUse = true;
	this.site = url;
	this.showLoad();
};

hWnd.prototype.clear = function()
{
	var clear = document.createElement("div");
	clear.style.clear = "both";
	return clear;
}

hWnd.prototype.insert = function(dom,step) 
{
	if(this.insert.arguments.length < 2)
	{
    	dom.appendChild(this.frame);
		this.FaderNow = 0;
		window.setTimeout(this.self + ".insert('',0);",10);
	}
	else
	{
		this.setFrameOpacity(true,4);
		if(step < 100)
		{
			var timecode = nextTimeStep(this.FaderValue, step, this.FaderSpeed);
			step = step + 4;
			window.setTimeout(this.self + ".insert(''," + step + ");",timecode);
			return;
		}
		else
		{
			this.FaderNow = 0;
			this.LoaderUse = true;
			this.LoaderCode = 0;
			this.showLoad(0);
			return;
		}

	}
};
