activeChange = false;
function showRequest(show, boxId)
{
	if(activeChange || currentContent == show || !reqActive)
		return false;
	activeChange = true;
	currentContent = show;
	this.req = null;
	this.cell = null;
	try
	{
		this.req = new XMLHttpRequest();
	}
	catch(e)
	{
		try
		{
			this.req = new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch(e)
		{
			try
			{
				this.req = new ActiveXObject('Microsoft.XMLHTTP');
			}
			catch(failed)
			{
				this.req = null;
			}
		}
	}
	if(this.req == null)
		return true;
	if(!document.getElementById("content2").innerHTML)
		return true;
//	if(document.getElementById("box" + boxId))
//		document.getElementById("box" + boxId).firstChild.style.backgroundImage = "url(img/loader.gif)";
	gotSplitted = false;
	 lastS = s;
	 s = show;
	 d = '';
	if(show.lastIndexOf('/')!=-1)
	{
		var splitted = show.split('/');
		show = splitted[0] + '&detail=' + splitted[1];
		 s = splitted[0];
		 d = splitted[1];
		gotSplitted = true;
	}
	if(document.URL.substr(7,9)=='localhost')
		var url = 'http://localhost/Haarstudio_Dopplinger/getContent.php?show=' + show;
	else if(document.URL.substr(7,9)=='127.0.0.1')
		var url = 'http://127.0.0.1/Haarstudio_Dopplinger/getContent.php?show=' + show;
	else
		var url = 'http://www.haar-studio.com/getContent.php?show=' + show;
	this.req.open('GET',url,true);
	this.req.onreadystatechange = function()
	{
		if(this.readyState==4)
		{
			if(this.status!=200)
				return true;
			else
			{
				var answer = this.responseXML;
				if(answer.getElementsByTagName('message')[0])
				{
					alert(answer.getElementsByTagName('message')[0].firstChild.nodeValue);
					return true;
				}
				var titel = answer.getElementsByTagName('title')[0].firstChild.nodeValue;
				content = answer.getElementsByTagName('content')[0].firstChild.nodeValue;
				titel += ' | Haarstudio Karin Dopplinger';
				 titel = titel.replace(/&quot;/g,'"');
				 titel = titel.replace(/ -> /g,'/');
				contentChange(content);
				if(boxId != -1)
					boxChange(boxId);
				titleChange(0,titel);
			}
		}
	};
	this.req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	this.req.send(null);
	return false;
}
function sendMail()
{
	if(!checkMailContents())
		return false;
	this.req = null;
	this.cell = null;
	try
	{
		this.req = new XMLHttpRequest();
	}catch(e)
	{
		try
		{
			this.req = new ActiveXObject('Msxml2.XMLHTTP');
		}catch(e)
		{
			try
			{
				this.req = new ActiveXObject('Microsoft.XMLHTTP');
			}catch(failed)
			{
				this.req = null;
			}
		}
	}
	if(this.req == null)
		return true;
	lastS = 'kontakt';
	s = 'kontakt2';
	d = '';
	if(document.URL.substr(7,9)=='localhost')
		var url = 'http://localhost/Haarstudio_Dopplinger/getContent.php?show=kontakt2';
	else if(document.URL.substr(7,9)=='127.0.0.1')
		var url = 'http://127.0.0.1/Haarstudio_Dopplinger/getContent.php?show=kontakt2';
	else
		var url = 'http://www.haar-studio.com/getContent.php?show=kontakt2';
	this.req.open('POST',url,true);
	this.req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-2");
	this.req.onreadystatechange = function()
	{
		if(this.readyState==4)
		{
			if(this.status!=200)
				return true;
			else
			{
				var answer = this.responseXML;
				if(answer.getElementsByTagName('message')[0])
				{
					alert(answer.getElementsByTagName('message')[0].firstChild.nodeValue);
					return true;
				}
				var titel = answer.getElementsByTagName('title')[0].firstChild.nodeValue;
				content = answer.getElementsByTagName('content')[0].firstChild.nodeValue;
				titel += ' | Haarstudio Karin Dopplinger';
				titel = titel.replace(/&quot;/g,'"');
				titel = titel.replace(/ -> /g,'/');
				contentChange(content);
				titleChange(0,titel);
			}
		}
	};
	this.req.send(getMailContents());
	return false;
}
