	var http_request = false;
	
/*
function createXMLHttpRequest() {
  var req = null;
  try {
    req = new ActiveXObject("MSXML2.XMLHTTP");
  }
  catch (err_MSXML2) {
    try {
      req = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (err_Microsoft) {
      if (typeof XMLHttpRequest != "undefined")
        req = new XMLHttpRequest;
    }
  }
  return req;
} // function*/

function createXMLHttpRequest()
{
	var xmlHttp = null;
	// Mozilla, Opera, Safari sowie Internet Explorer (ab v7)
	if (typeof XMLHttpRequest != 'undefined') {
		xmlHttp = new XMLHttpRequest();
	}
	if (!xmlHttp) {
		// Internet Explorer 6 und älter
		try {
			xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xmlHttp  = null;
				
			}
		}
	}
	return xmlHttp;
}

function getTarifById(id)
{
	var id_tarif = id.substr(1);
	http_request = createXMLHttpRequest();
	http_request.onreadystatechange = getTarifContent;
	http_request.open("GET", "http://" + window.location.hostname + "/handys/fileadmin/ajax/getTarife.php?id=" + id_tarif + "&type=", true);
	http_request.send(null);
} // function

function getTarifContent()
{
	
	if (http_request.readyState == 4)
	{
		var xmldoc = http_request.responseXML;
		
		/*
		 document.getElementById('handydescription').innerHTML = URLDecode(xmldoc.getElementsByTagName('handydescription').item(0).firstChild.data);
		document.getElementById('deeplink').href = xmldoc.getElementsByTagName('deeplink').item(0).firstChild.data;
		document.getElementById('benefit').innerHTML = URLDecode(xmldoc.getElementsByTagName('benefit').item(0).firstChild.data);
		document.getElementById('tarifname').innerHTML = URLDecode(xmldoc.getElementsByTagName('tarifname').item(0).firstChild.data);
		document.getElementById('price').innerHTML = URLDecode(xmldoc.getElementsByTagName('price').item(0).firstChild.data);
		document.getElementById('o2_footnote').innerHTML = URLDecode(xmldoc.getElementsByTagName('footnote').item(0).firstChild.data);
		 */
		
		document.getElementById('deeplink').href = xmldoc.getElementsByTagName('deeplink').item(0).firstChild.data;
		document.getElementById('tarifname').innerHTML = URLDecode(xmldoc.getElementsByTagName('tarifname').item(0).firstChild.data);
		document.getElementById('price').innerHTML = URLDecode(xmldoc.getElementsByTagName('price').item(0).firstChild.data);
		document.getElementById('footnote').innerHTML = URLDecode(xmldoc.getElementsByTagName('footnote').item(0).firstChild.data);
		document.getElementById('myHandyPrice').innerHTML = URLDecode(xmldoc.getElementsByTagName('myhandy').item(0).firstChild.data);
		http_request = false;
	}
}
function URLDecode(psEncodeString)
{
  // Create a regular expression to search all +s in the string
  var lsRegExp = /\+/g;
  // Return the decoded string
  return unescape(String(psEncodeString).replace(lsRegExp, " "));
}

function showtarifbox(art)
{
	if(document.getElementById("scrollbox").style.display == "none" || document.getElementById("scrollbox").style.display == "")
		document.getElementById("scrollbox").style.display = "block";
	else
		document.getElementById("scrollbox").style.display = "none";

/*
	if(art == "show")
		document.getElementById("scrollbox").style.display = "block";
	else
		document.getElementById("scrollbox").style.display = "none";
	 */
}

