
function gotosite()
{
var URL = document.gotoform.goto_url.options[document.gotoform.goto_url.selectedIndex].value; window.location.href = URL;
} 

function popup_code(element, gu_code, gu_id) {
//document.getElementById('vorschau').innerHTML = 'hjkh<div class="box_content1><h2>Vorschau</h2></div>\n';
document.getElementById(element).innerHTML = '<span class="showcode">Gutscheincode: ' + gu_code + '</span><br />\n';
var message = "Ihr Gutscheincode lautet:\n\n" + gu_code + "\n\nSollten sie den Gutscheincode nicht kopieren können, erscheint er an der Stelle des \"Gutschein einlösen\" Buttons.";
// alert(message);
document.getElementById('vorschau').innerHTML = '<div class="vorschau"><h2 style=\"float: left;\">Gutscheincode: '+ gu_code +'</h2><a href="#'+ gu_id + '" onclick="close_vorschau();" style="float:right; padding: 5px;\">schließen</a><iframe src="http://www.gutscheinwiese.de/out.php?id='+ gu_id +' &typ=gu" width="99%" height="350px"></ifame>\n\n\n<br /><a href="http://www.gutscheinwiese.de/out.php?id='+ gu_id +' &typ=gu" target="_blank">Fenster vergrßern</a></div>\n\n';


}

function close_vorschau() {
document.getElementById('vorschau').innerHTML = '';


}


function open_gu(gu_id) {
window.open('http://www.gutscheinwiese.de/out.php?id='+ gu_id +' &typ=gu','shop','width=500,height=350');
}


function searchFor(suchbegriff){
			var xmlHttp = null;
			// Mozilla, Opera, Safari sowie Internet Explorer 7
			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;
					}
				}
			}
			// Wenn das Objekt erfolgreich erzeugt wurde			
			if (xmlHttp) {
				var url = "http://www.gutscheinwiese.de/suche.php";
				var params = "suchbegriff="+suchbegriff;
				
				xmlHttp.open("POST", url, true);
				
				//Headerinformationen für den POST Request
				xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				xmlHttp.setRequestHeader("Content-length", params.length);
				xmlHttp.setRequestHeader("Connection", "close");					
			
				xmlHttp.onreadystatechange = function () {
					if (xmlHttp.readyState == 4) {
						// Zurückgeliefertes Ergebnis wird in den DIV "ergebnis" geschrieben
						document.getElementById("ergebnis").innerHTML = xmlHttp.responseText;
					}
				};				
				xmlHttp.send(params);
			}			
		}


