
function pageinit() {
	
}



function showinfo(evt,object) {
	
	
	// ------ positioning of infolyer to mouseover-a -------
	var xposition = 500;
	var yposition = 500;  
	  
	if (document.getElementById) {
    	xposition  = evt.clientX;
		yposition = evt.clientY;
	}
  
	if (document.all) {
		scrollposition = document.documentElement.scrollTop ;
	}
	else {
		scrollposition = window.pageYOffset
	}
	
	document.getElementById("infolayer").style.left = xposition - 220 + "px";
	document.getElementById("infolayer").style.top = yposition + scrollposition + 15 + "px";
	
	// -------- get infos an write new infolayer ----------
	
	var atext = object.innerHTML;
	
	infostring = "<div>" + atext.replace(/<dfn>/i,'</div><p>');
	infostring = infostring.replace(/<\/dfn>/i,'</p>');
	infostring = infostring.replace('(','');
	infostring = infostring.replace(')','');
	
	
	
	document.getElementById("infolayer").innerHTML = infostring;

	// -------- show infolayer ----------
  
	document.getElementById("infolayer").style.visibility = "visible";
	
	return false;
}

function hideinfo() {
	document.getElementById("infolayer").style.visibility = "hidden";
}


// ------------------ methods-db ajax ----------- rma 20100312 -------



function getmethods() {
	
	var laender = '';	
	$("input[name='country[]']:checked").each (function() {
		laender += '&country[]='+$(this).val();
	});
	var kategorie = '';	
	$("input[name='category[]']:checked").each (function() {
		kategorie += '&category[]='+$(this).val();
	});
	var gigs = '';	
	$("input[name='gig[]']:checked").each (function() {
		gigs += '&gig[]='+$(this).val();
	});
	var bqes = '';	
	$("input[name='bqe[]']:checked").each (function() {
		bqes += '&bqe[]='+$(this).val();
	});
	
	
	var getstring = (laender + kategorie + gigs + bqes);
	getstring = getstring.substr(1);
	
	if (getstring == "") {
		//alert("Bitte wählen Sie mindestens 1 Feld aus");
		$("#dyncontent").html("");
	}
	
	
	else $.get (
		"/includes/methodsearch.inc.php",
		getstring,
		function(data) {
			$("#dyncontent").html(data);
		},
		"html"
	)
	
	

} 

function showdetails(telement,id) {
	dasdiv = $(telement).parent().children("div");
	
	/* wenn content dynamisch nachgeladen wird
	derinhalt = dasdiv.html();
		
	if (derinhalt == "") {
		dasdiv.hide("fast");
		getstring = "?id=" + id;
		$.get (
			"/includes/get-detail-from-id.inc.php",
			getstring,
			function(data) {
				$(telement).parent().children("div").html(data);
			},
			"html"
		)
	}
	*/
	dasdiv.toggle("slow");
}



function selectallcountry(what) {
	if (what == 1 ) $("input[name='country[]']").attr("checked",true);
	else $("input[name='country[]']").attr("checked",false);
	getmethods();
}

function resetcheckboxes() {
	$('#methodform :checkbox').removeAttr('checked');
	getmethods();
}

 $(document).ready(function(){
 if($("#methodform").length != 0) {
   $("#methodform :checkbox").click(function(event){
     getmethods();
   });
  }
 });

 