// Newsletter

function nl_send() {



	var theForm = document.forms[0];

	mylength = theForm.elements.length;

	mystring = "";

	mycounter = 0;

	tmpcounter = 0;

	while ( mycounter < mylength ) {

		mytype = theForm.elements[mycounter].type;

		if ( mytype != 'button' ) {

			myname = theForm.elements[mycounter].name;
			myvalue = theForm.elements[mycounter].value;

			if ( tmpcounter == 0 ) {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = myname + "=" + myvalue;

			} else {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = mystring + "&" + myname + "=" + myvalue;

			}

			tmpcounter = tmpcounter + 1;

		}

		mycounter = mycounter + 1;

	}

	ajaxURL='newsletter.snd' + '?' + mystring;

	document.getElementById("ma").innerHTML = "<div align=\'center\'><br><br><img src='circle-ball-dark-antialiased.gif'></div><br><div align=\'center\' class=\'style17\'>Sende Ihre Daten<br><br>Bitte warten ...</div>";

	xmlhttp.open("GET", ajaxURL, true);
	xmlhttp.onreadystatechange=function() {
	if (xmlhttp.readyState==4) {

		if ( xmlhttp.responseText == "" ) {

		} else {

			ajaxResponse = xmlhttp.responseText;

			document.getElementById("ma").innerHTML = ajaxResponse;

		}

	}
	}
	xmlhttp.send(null);

}


// Benachrichtigung

function bn() {



	var theForm = document.forms["bnr"];

	mylength = theForm.elements.length;

	mystring = "";

	mycounter = 0;

	tmpcounter = 0;

	while ( mycounter < mylength ) {

		mytype = theForm.elements[mycounter].type;

		if ( mytype != 'button' ) {

			myname = theForm.elements[mycounter].name;
			myvalue = theForm.elements[mycounter].value;

			if ( tmpcounter == 0 ) {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = myname + "=" + myvalue;

			} else {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = mystring + "&" + myname + "=" + myvalue;

			}

			tmpcounter = tmpcounter + 1;

		}

		mycounter = mycounter + 1;

	}

	ajaxURL='http://www.pricehopper.de/ajax_extended_bn.php' + '?' + mystring;

	document.getElementById("benachrichtigung").innerHTML = "<div align=\'center\'><br><br><img src='circle-ball-dark-antialiased.gif'></div><br><br><div align=\'center\' class=\'style17\'>Sende Ihre Daten<br><br>Bitte warten ...</div>";

	xmlhttp.open("GET", ajaxURL, true);
	xmlhttp.onreadystatechange=function() {
	if (xmlhttp.readyState==4) {

		if ( xmlhttp.responseText == "" ) {

		} else {

			ajaxResponse = xmlhttp.responseText;

			document.getElementById("benachrichtigung").innerHTML = ajaxResponse;

		}

	}
	}
	xmlhttp.send(null);

}



// Anmeldung

function signup() {



	var theForm = document.forms["gosignup"];

	mylength = theForm.elements.length;

	mystring = "";

	mycounter = 0;

	tmpcounter = 0;

	while ( mycounter < mylength ) {

		mytype = theForm.elements[mycounter].type;

		if ( mytype != 'button' ) {

			myname = theForm.elements[mycounter].name;
			myvalue = theForm.elements[mycounter].value;

			if ( tmpcounter == 0 ) {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = myname + "=" + myvalue;

			} else {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = mystring + "&" + myname + "=" + myvalue;

			}

			tmpcounter = tmpcounter + 1;

		}

		mycounter = mycounter + 1;

	}

	ajaxURL='http://www.pricehopper.de/ajax_extended_signup.php' + '?' + mystring;

	document.getElementById("signupfield").innerHTML = "<div align=\'center\'><br><br><img src='circle-ball-dark-antialiased.gif'></div><br><br><div align=\'center\' class=\'style17\'>Sende Ihre Daten<br><br>Bitte warten ...</div>";

	xmlhttp.open("GET", ajaxURL, true);
	xmlhttp.onreadystatechange=function() {
	if (xmlhttp.readyState==4) {

		if ( xmlhttp.responseText == "" ) {

		} else {

			ajaxResponse = xmlhttp.responseText;

			document.getElementById("signupfield").innerHTML = ajaxResponse;

		}

	}
	}
	xmlhttp.send(null);

}




// Quicksearch

function quicksearch() {



	var theForm = document.forms["form3"];

	mylength = theForm.elements.length;

	mystring = "";

	mycounter = 0;

	tmpcounter = 0;

	while ( mycounter < mylength ) {

		mytype = theForm.elements[mycounter].type;

		if ( mytype != 'button' ) {

			myname = theForm.elements[mycounter].name;
			myvalue = theForm.elements[mycounter].value;

			if ( tmpcounter == 0 ) {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = myname + "=" + myvalue;

			} else {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = mystring + "&" + myname + "=" + myvalue;

			}

			tmpcounter = tmpcounter + 1;

		}

		mycounter = mycounter + 1;

	}

	ajaxURL='http://www.pricehopper.de/ajax_extended_quicksearchresponse.php' + '?' + mystring;

	document.getElementById("qsd").innerHTML = "<br><br><div align=\'center\'><img src='circle-ball-dark-antialiased.gif'></div>";

	xmlhttp.open("GET", ajaxURL, true);
	xmlhttp.onreadystatechange=function() {
	if (xmlhttp.readyState==4) {

		if ( xmlhttp.responseText == "" ) {

		} else {

			ajaxResponse = xmlhttp.responseText;

			document.getElementById("qsd").innerHTML = ajaxResponse;

		}

	}
	}
	setTimeout("xmlhttp.send(null)",500);

}


// System

function sendform(form) {



	var theForm = document.forms["accountform"];

	mylength = theForm.elements.length;

	mystring = "";

	mycounter = 0;

	tmpcounter = 0;

	while ( mycounter < mylength ) {

		mytype = theForm.elements[mycounter].type;

		if ( mytype != 'button' ) {

			myname = theForm.elements[mycounter].name;
			myvalue = theForm.elements[mycounter].value;

			if ( tmpcounter == 0 ) {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = myname + "=" + myvalue;

			} else {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = mystring + "&" + myname + "=" + myvalue;

			}

			tmpcounter = tmpcounter + 1;

		}

		mycounter = mycounter + 1;

	}

	ajaxURL=form + '?' + mystring;

	document.getElementById("accountdiv").innerHTML = "<div align=\'center\'><br><br><img src='circle-ball-dark-antialiased.gif'></div><br><br><div align=\'center\' class=\'style17\'>Sende Ihre Daten<br><br>Bitte warten ...</div>";

	xmlhttp.open("GET", ajaxURL, true);
	xmlhttp.onreadystatechange=function() {
	if (xmlhttp.readyState==4) {

		if ( xmlhttp.responseText == "" ) {

		} else {

			ajaxResponse = xmlhttp.responseText;

			document.getElementById("accountdiv").innerHTML = ajaxResponse;

		}

	}
	}
	xmlhttp.send(null);

}


// System

function sendpreistipps(form) {



	var theForm = document.forms["accountformpreistipps"];

	mylength = theForm.elements.length;

	mystring = "";

	mycounter = 0;

	tmpcounter = 0;

	while ( mycounter < mylength ) {

		mytype = theForm.elements[mycounter].type;

		if ( mytype != 'button' ) {

			myname = theForm.elements[mycounter].name;
			myvalue = theForm.elements[mycounter].value;

			if ( tmpcounter == 0 ) {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = myname + "=" + myvalue;

			} else {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = mystring + "&" + myname + "=" + myvalue;

			}

			tmpcounter = tmpcounter + 1;

		}

		mycounter = mycounter + 1;

	}

	ajaxURL=form + '?' + mystring;

	document.getElementById("preistipps").innerHTML = "<div align=\'center\'><br><br><img src='circle-ball-dark-antialiased.gif'></div><br><br><div align=\'center\' class=\'style17\'>Sende Ihre Daten<br><br>Bitte warten ...</div>";

	xmlhttp.open("GET", ajaxURL, true);
	xmlhttp.onreadystatechange=function() {
	if (xmlhttp.readyState==4) {

		if ( xmlhttp.responseText == "" ) {

		} else {

			ajaxResponse = xmlhttp.responseText;

			document.getElementById("preistipps").innerHTML = ajaxResponse;

		}

	}
	}
	xmlhttp.send(null);

}

// System

function sendtestberichte(form) {



	var theForm = document.forms["accountformtestberichte"];

	mylength = theForm.elements.length;

	mystring = "";

	mycounter = 0;

	tmpcounter = 0;

	while ( mycounter < mylength ) {

		mytype = theForm.elements[mycounter].type;

		if ( mytype != 'button' ) {

			myname = theForm.elements[mycounter].name;
			myvalue = theForm.elements[mycounter].value;

			if ( tmpcounter == 0 ) {

				myvalue = myvalue.replace(/&/g,"zzz");

				mystring = myname + "=" + myvalue;

			} else {

				myvalue = myvalue.replace("\r\n","<br>");

				mystring = mystring + "&" + myname + "=" + myvalue;

			}

			tmpcounter = tmpcounter + 1;

		}

		mycounter = mycounter + 1;

	}

	ajaxURL=form + '?' + mystring;

	document.getElementById("testbericht").innerHTML = "<div align=\'center\'><br><br><img src='circle-ball-dark-antialiased.gif'></div><br><br><div align=\'center\' class=\'style17\'>Sende Ihre Daten<br><br>Bitte warten ...</div>";

	xmlhttp.open("GET", ajaxURL, true);
	xmlhttp.onreadystatechange=function() {
	if (xmlhttp.readyState==4) {

		if ( xmlhttp.responseText == "" ) {

		} else {

			ajaxResponse = xmlhttp.responseText;

			document.getElementById("testbericht").innerHTML = ajaxResponse;

		}

	}
	}
	xmlhttp.send(null);

}