$(document).ready(function(){
	$('#galerie').jqGalScroll();
});

function Go (select) {
  var wert = select.options[select.options.selectedIndex].value;
  if (wert == "leer") {
	select.form.reset();
	parent.frames["unten"].focus();
	return;
  } else {
	if (wert == "ende") {
	  top.location.href = parent.frames[1].location.href;
	} else {
	  location.href = wert;
	  select.form.reset();
	  if ( parent.frames["unten"] != null ) parent.frames["unten"].focus();
	}
  }
}

function CheckContactInput (nResult) {
	var wert =  document.forms[1].elements[7].value;
	if ( wert != nResult )
	{	var dlg = document.getElementById("error_calcAntispamError");
		dlg.style.display = "block";
		return false;
	}
	return true;
}

function CheckGamesInput (nResult) {
	var wert =  document.forms[1].elements[19].value;
	if ( wert != nResult )
	{	var dlg = document.getElementById("error_calcAntispamError");
		dlg.style.display = "block";
		return false;
	}
	return true;
}	
// ============= ============= ============= ============= ============= ============= ============= ============= 
// Autocomplete Script Content
// ============= ============= ============= ============= ============= ============= ============= ============= 
function selectItem(li) {
	// document.fastsearch.focus();
	
	submitbutton = document.getElementById("sbutton");
	submitbutton.click();
	
	return false;
}

function formatItem(row) {
	var retval = row[0] + "<br>";
	return retval;
}

$(document).ready(function() {
	$("#search").autocomplete("jquery.php", { 
		minChars:2, 
		matchSubset:1, 
		matchContains:1, 
		cacheLength:10, 
		onItemSelect:selectItem, 
		formatItem:formatItem, 
		selectOnly:1 
	});
});

function replace_ftsearch()
{	varRet = document.forms[0].elements[0].value;
	document.forms[0].elements[0].value = varRet;
	
	return true;
}

// ============= ============= ============= ============= ============= ============= ============= ============= 
// Rechte Maustaste deaktivieren
// ============= ============= ============= ============= ============= ============= ============= ============= 

var zeit, message="Rechtsklick ist deaktiviert! Sorry!";
var mouse_control_enabled = 0;

function click0() 
{	
	if ( mouse_control_enabled > 0 ) 
	{	if (event.button != 1) 
		{   popup();
			return false;
		}
	}
	return true;
}

function nsc(e) 
{ 	
	if ( mouse_control_enabled > 0 ) 
		if (e.which != 1) keinkontext(); 
}

function popup() 
{	
	if ( mouse_control_enabled > 0 ) {
		mouse_control_enabled--;
		return false;
	}
	return true;
}

function nichts(e) 
{ 	
	if ( mouse_control_enabled > 0 ) 
	{
		if (e.which != 1)  
			return false; 
	}
	
	return true;
}

function keinkontext() 
{	
	if ( mouse_control_enabled > 0 ) 
	{	clearTimeout(zeit);
		zeit = setTimeout("kontext()",1);
	}
}

function kontext() 
{	
	if ( mouse_control_enabled > 0 ) 
	{	clearTimeout(zeit);
		popup();
	}
}

function retfalse()
{	return false;
}

if (document.all)
{	// ie7
	if (document.getElementById) 
		document.oncontextmenu=popup;
}
else 
	document.onmousedown=click0;

if (!(document.all) && document.getElementById)
	document.oncontextmenu=popup;

if (document.layers) 
{	document.captureEvents(Event.MOUSEUP | Event.MOUSEDOWN | Event.DBLCLICK );
	document.onmousedown=nichts;
	document.onmouseup=nsc;
}

document.ondblclick=retfalse;