/*
 * home.js - the most of this are help-texts
 */

function show_help_dialog(helpident) {
	switch (helpident) {
		case "searchfilter":
	  		$("#dialog_help_content").load("/help/searchfilter.html");
	  	break;
		case "searchfulltext":
	  		$("#dialog_help_content").load("/help/search_fulltext.html");
	  	break;
	}
	// bestimmen der Auflösung und ermitteln wie weit gescrollt wurde
	var x,y;
	if (self.pageYOffset) { // all except Explorer
		x = self.pageXOffset;
		y = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		// Explorer 6 Strict
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;
	} else if (document.body) {
		// all other Explorers
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}
	
	$.dimScreen(1000, 0.7, y, function() {
		pX = ($(window).width()/2)-400;
		pY = ($(window).height()/2)-350;
		$('#dialog_help').css("top",pY+"px");
		$('#dialog_help').css("left",pX+"px");
 		$("#dialog_help").show(800);
 	});
}

function hide_help_dialog() {
	$("#dialog_help").hide(300);
	$('#__dimScreen').hide('slow');
	$('#__dimScreen').remove();
}

function random_entries() {
	box = document.getElementById('r_entry_box');
	var l = all_entries.length;
	var rnd = new Array();
	for(i=0;i<4;i++) {
		rnd[i] = Math.floor(l*Math.random());
	}
	while((rnd[0] == rnd[1]) || (rnd[0] == rnd[2]) || (rnd[0] == rnd[3])) {
		rnd[0] = Math.flo||(l*Math.random());
	}
	while((rnd[1] == rnd[0]) || (rnd[1] == rnd[2]) || (rnd[1] == rnd[3])) {
		rnd[1] = Math.flo||(l*Math.random());
	}
	while((rnd[2] == rnd[0]) || (rnd[2] == rnd[1]) || (rnd[2] == rnd[3])) {
		rnd[2] = Math.flo||(l*Math.random());
	}
	while((rnd[3] == rnd[0]) || (rnd[3] == rnd[1]) || (rnd[3] == rnd[2])) {
		rnd[3] = Math.flo||(l*Math.random());
	}
	for(i=0;i<4;i++) {
		no = rnd[i];
		document.getElementById("r_entry_"+(i+1)).src = all_entries[no].img;
	}
}	





