function check() {
	boxcheck = eval("document.sumaform.sumaa");
	boxuncheck = eval("document.sumaform.sumab");
	if (boxcheck.checked == true && boxuncheck.checked == false)
	{
		for (i = 1; i < document.sumaform.length; i++)
		{
			box = eval("document.sumaform.elements[i]"); 
			if (box.checked == false && box.name != "sumab" && box.name != "q") box.checked = true;
		}
		boxcheck.checked = false;
	}
	else
	{
		for (i = 1; i < document.sumaform.length; i++)
		{
			box = eval("document.sumaform.elements[i]"); 
			if (box.checked == true && box.name != "q") box.checked = false;
		}
	}
}

function checkp() {
	boxcheck = eval("document.prodform.proda");
	boxuncheck = eval("document.prodform.prodb");
	if (boxcheck.checked == true && boxuncheck.checked == false)
	{
		for (i = 1; i < document.prodform.length; i++)
		{
			box = eval("document.prodform.elements[i]"); 
			if (box.checked == false && box.name != "prodb" && box.name != "p") box.checked = true;
		}
		boxcheck.checked = false;
	}
	else
	{
		for (i = 1; i < document.prodform.length; i++)
		{
			box = eval("document.prodform.elements[i]"); 
			if (box.checked == true && box.name != "p") box.checked = false;
		}
	}
}

function formcheck() {
	check = false;
	if (document.sumaform.q.value == "") {
		alert("Bitte geben Sie einen Suchbegriff ein!");
		document.sumaform.q.focus();
		return false;
	}
	for (i = 0; i < document.sumaform.length; i++)
	{
		box = eval("document.sumaform.elements[i]"); 
		if (box.checked == true) check = true;
	}
	if (check == false) {
		alert("Bitte wählen Sie mindestens eine Suchmaschine aus!");
		document.sumaform.google.focus();
		return false;
	}
	makeRemote();
}

function formcheckp() {
	check = false;
	if (document.prodform.p.value == "") {
		alert("Bitte geben Sie ein Produkt ein!");
		document.prodform.p.focus();
		return false;
	}
	for (i = 0; i < document.prodform.length; i++)
	{
		box = eval("document.prodform.elements[i]"); 
		if (box.checked == true) check = true;
	}
	if (check == false) {
		alert("Bitte wählen Sie mindestens eine Produktsuche aus!");
		document.prodform.smarshopping.focus();
		return false;
	}
	makeRemotep();
}

function merken() {
	cook = "";
	ii = 0
	for (i = 0; i < document.sumaform.length; i++)
	{
		box = eval("document.sumaform.elements[i]"); 
		if (box.checked == true)
		{
			if(ii > 0) 
			{
				cook += ",";
			}			
			cook += eval("box.name"); 
			ii++;
		}
	}
	var ablauf = new Date();
	var zeit = ablauf.getTime() + (10 * 365 * 24 * 60 * 60 * 1000);
	ablauf.setTime(zeit);	
	document.cookie = "s=" + cook + "; expires=" + ablauf.toGMTString();
	alert("Ihre Einstellungen wurden gespeichert!");
}

function merkenp() {
	cook = "";
	ii = 0
	for (i = 0; i < document.prodform.length; i++)
	{
		box = eval("document.prodform.elements[i]"); 
		if (box.checked == true)
		{
			if(ii > 0) 
			{
				cook += ",";
			}			
			cook += eval("box.name"); 
			ii++;
		}
	}
	var ablauf = new Date();
	var zeit = ablauf.getTime() + (10 * 365 * 24 * 60 * 60 * 1000);
	ablauf.setTime(zeit);	
	document.cookie = "ps=" + cook + "; expires=" + ablauf.toGMTString();
	alert("Ihre Einstellungen wurden gespeichert!");
}

function bookmark() {
	if(window.external) {
		window.external.AddFavorite("http://www.quemo.de", "quemo.de - die Suchhilfe");
	}
}

function addEngine() {
   if((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
      window.sidebar.addSearchEngine("http://www.quemo.de/suche/quemo.src","http://www.quemo.de/img/quemo.png","quemo web","General");
      return true;
   }
}

function addEnginep() {
   if((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
      window.sidebar.addSearchEngine("http://www.quemo.de/suche/quemop.src","http://www.quemo.de/img/quemop.png","quemo produkt","General");
      return true;
   }
}

function makeRemote() {
	qstring = document.sumaform.q.value;
	suma = "";
	ii = 0;
	for (i = 0; i < document.sumaform.length; i++)
	{
		box = eval("document.sumaform.elements[i]"); 
		if (box.checked == true)
		{	
			if(ii == 0) aktuell =  eval("box.name");
			suma += "&"+ eval("box.name") +"=1"; 
			ii++;
		}
	}
	
	breite = screen.width;
	hoehe = screen.height;
	xps = (breite-370);
	yps = (hoehe-420);

	remote = window.open("http://www.quemo.de/fernsteuerung.php?q="+ qstring +"&aktuell="+ aktuell + suma,"remotewin","status=yes,menubar=no,location=no,directories=no,scrollbars=no,toolbar=no,resizeable=no,top="+ yps +",left="+ xps +",width=310,height=295");
    remote.opener = window; 
	remote.opener.name = "opener";
}

function makeRemotep() {
	pstring = document.prodform.p.value;
	suma = "";
	ii = 0;
	for (i = 0; i < document.prodform.length; i++)
	{
		box = eval("document.prodform.elements[i]"); 
		if (box.checked == true)
		{	
			if(ii == 0) aktuell =  eval("box.name");
			suma += "&"+ eval("box.name") +"=1"; 
			ii++;
		}
	}
	
	breite = screen.width;
	hoehe = screen.height;
	xps = (breite-370);
	yps = (hoehe-420);

	remote = window.open("http://www.quemo.de/fernsteuerungp.php?p="+ pstring +"&aktuell="+ aktuell + suma,"remotewinp","status=yes,menubar=no,location=no,directories=no,scrollbars=no,toolbar=no,resizeable=no,top="+ yps +",left="+ xps +",width=310,height=295");
    remote.opener = window; 
	remote.opener.name = "opener";
}

function makeRemotePlugin(qstring,suma,aktuell) {
	
	breite = screen.width;
	hoehe = screen.height;
	xps = (breite-370);
	yps = (hoehe-420);
	
	remote = window.open("http://www.quemo.de/fernsteuerung.php?q="+ qstring +"&aktuell="+ aktuell + suma,"remotewin","status=yes,menubar=no,location=no,directories=no,scrollbars=no,toolbar=no,resizeable=no,top="+ yps +",left="+ xps +",width=310,height=295");
	if(!remote)	return false;
    remote.opener = window; 
	remote.opener.name = "opener";
}

function makeRemotePluginp(pstring,suma,aktuell) {
	
	breite = screen.width;
	hoehe = screen.height;
	xps = (breite-370);
	yps = (hoehe-420);
	
	remote = window.open("http://www.quemo.de/fernsteuerungp.php?p="+ pstring +"&aktuell="+ aktuell + suma,"remotewinp","status=yes,menubar=no,location=no,directories=no,scrollbars=no,toolbar=no,resizeable=no,top="+ yps +",left="+ xps +",width=310,height=295");
	if(!remote)	return false;   
    remote.opener = window; 
	remote.opener.name = "opener";
}

function go(URL,qstring,aktuell,suma) {
	if(opener && !opener.closed)
	{		
		opener.location.href = URL;
		opener.focus();
		location.href = "http://www.quemo.de/fernsteuerung.php?q="+ qstring +"&aktuell="+ aktuell + suma;
	}	
	else
	{
		alert("Sie haben das Suchfenster geschlossen, bitte starten Sie eine neue Suche!");
		window.open("http://www.quemo.de/?q="+ qstring +"&aktuell="+ aktuell + suma,"opener","resizable=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,toolbar=1,width=600,height=500");
		close();
	}
}

function gop(URL,pstring,aktuell,suma) {
	if(opener && !opener.closed)
	{		
		opener.location.href = URL;
		opener.focus();
		location.href = "http://www.quemo.de/fernsteuerungp.php?p="+ pstring +"&aktuell="+ aktuell + suma;
	}	
	else
	{
		alert("Sie haben das Suchfenster geschlossen, bitte starten Sie eine neue Suche!");
		window.open("http://www.quemo.de/?p="+ pstring +"&aktuell="+ aktuell + suma,"opener","resizable=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,toolbar=1,width=600,height=500");
		close();
	}
}

function popcheck(URL)
{
	if (ok == true)
	{
		document.cookie = "popup=true";		
		location.href = URL;
	}
	else 
	{
		alert("Bitte Popups für quemo akzeptieren!");
	}
}	

function closeall() {
	document.getElementById("info").style.display='none';
	document.getElementById("faq").style.display='none';
	document.getElementById("daten").style.display='none';
	document.getElementById("impressum").style.display='none';
}

function show(divid) {
	if(document.getElementById(divid).style.display=='none') document.getElementById(divid).style.display='block'; 
  	else document.getElementById(divid).style.display='none';
}