function TasteGedrueckt (Ereignis)
{
	if (!Ereignis) Ereignis = window.event;
	if (Ereignis.which)
	{
		Tastencode = Ereignis.which;
	}
	else if (Ereignis.keyCode)
	{
		Tastencode = Ereignis.keyCode;
	}
	if(Tastencode == 40)
	{
		document.getElementById("hits").focus();
		//document.getElementById("hits").selectedIndex = 0;
	}
}

function mouseMove(e)
{
	if(navigator.appName == "Netscape")
	{
    	x=e.pageX;
		y=e.pageY;
	}
	else
	{
		x=event.x;
		y=event.y;
	}
	if(document.getElementById("bildinfo"))
	{
		if(navigator.appName == "Netscape")
		{
			document.getElementById("bildinfo").style.top = y - 20;
			document.getElementById("bildinfo").style.left = x + 30;
		}
		else
		{
			document.getElementById("bildinfo").style.top = y + 60;
			document.getElementById("bildinfo").style.left = x + 100;
		}
	}
}

function my_event()
{
	document.onmousemove = mouseMove;
}

var http = null;
if (window.XMLHttpRequest)
{
   http = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
   http = new ActiveXObject("Microsoft.XMLHTTP");
}

function pictureinfo(eid)
{
	if (http != null)
	{
		http.open("POST", "ajaxpictureinfo.php", true);
		http.onreadystatechange = picture_form;
		http.setRequestHeader(
				"Content-Type",
		"application/x-www-form-urlencoded");
		http.send("eid=" + eid);
	}
}

function picture_form()
{
   	if (http.readyState == 4)
	{
    	document.getElementById("bildinfo").innerHTML = http.responseText;
    	bildinfo.style.visibility = "visible";
   	}
}

function pictureinfo_hide()
{
	document.getElementById("bildinfo").innerHTML = "";
	bildinfo.style.visibility = "hidden";
	document.getElementById("bildinfo").style.top = 0;
	document.getElementById("bildinfo").style.left = 0;
}


function send_request_form(searchvalue)
{
	if(document.getElementById("search").value.length < 1)
	{
		musi_hide();
	}
	else
	{
		if (http != null)
		{
			http.open("POST", "ajaxinfo.php", true);
			http.onreadystatechange = ausgeben_form;
			http.setRequestHeader(
					"Content-Type",
			"application/x-www-form-urlencoded");
			http.send("searchvalue=" + searchvalue);
		}
	}
}
function ausgeben_form()
{
   	if (http.readyState == 4)
	{
    	document.getElementById("recherche").innerHTML = http.responseText;
    	recherche.style.visibility = "visible";
    	document.onkeydown = TasteGedrueckt;
   	}
}

function musi_hide()
{
	document.getElementById("recherche").innerHTML = "";
	recherche.style.visibility = "hidden";
}

function get_search_value(searchvalue)
{
	document.getElementById("search").value = searchvalue;
	document.searchform.submit();
}

function check_save(the_text)
{
	speichern = confirm("Wollen Sie " + the_text + "?");
	if(speichern == false)
	{
		return false;
	}
}

function Go(xy)
{
   	if(xy == "nothing")
   	{
   		document.fwdlink.reset();
     	document.fwdlink.elements[0].blur();
     	return;
   	}
   	else
   	{
     	window.location.href = xy;
     	document.fwdlink.reset();
     	document.fwdlink.elements[0].blur();
   	}
}

function myprinter(breite,cat,subcat)
{
	window.open("myprintout.php?breite="+breite+"&cat="+cat+"&subcat="+subcat+"&print=true");
}

function kontact()
{
	if(document.formular.vorname.value == "")
	{
		alert("* - Felder ausfüllen / * - fields you have to subscribe");
		document.formular.vorname.focus();
		return false;
	}
	if(document.formular.nname.value == "")
	{
		alert("* - Felder ausfüllen / * - fields you have to subscribe");
		document.formular.nname.focus();
		return false;
	}	
	if(document.formular.email.value == "")
	{
		alert("* - Felder ausfüllen / * - fields you have to subscribe");
		document.formular.email.focus();
		return false;
	}
	if(document.formular.text.value == "")
	{
		alert("* - Felder ausfüllen / * - fields you have to subscribe");
		document.formular.text.focus();
		return false;
	}
}

