/*** Funktionen für JHP-IT ***/
// Einblendeffekt
einblendenEffekt = function(num,rnd){
	$('schlagworte_box').childNodes[rnd].className = 'schlagworte_'+(num+1);
	$('schlagworte_box').childNodes[rnd].id = 'sb_'+(num+1);
	$('sb_'+(num+1)).appear({ duration: 2.0 });
}
// Alle Schlagworte Ausblenden und eine bestimmte Anzahl einblenden. 
// Diese Version funktioniert nur mit einem Level!
schlagworteAusblenden = function(count){
	var schlagworte_count = count;
	var schlagworte_document = new Array();
	var random_schlagwort = new Array();
	var element = new Array();
	var Zahlen = new Array(count);
	var rnds = new Array(Zahlen.length);
	$('schlagworte_box').style.overflow = "hidden";
	$('schlagworte_box').cleanWhitespace(); // Whitespaces aus DOM entfernen
	for(i=0;i<$('schlagworte_box').childNodes.length;i++){
		$('schlagworte_box').childNodes[i].style.display = "none"; //Alles ausblenden
	}
	for(var i=0 ; i < Zahlen.length ; i++) {
		do  {
			var rnd = parseInt(Math.random()*($('schlagworte_box').childNodes.length)); //min+parseInt(Math.random()*(max-min));
		}
		while(rnds[rnd]);
		rnds[rnd] = true;
		Zahlen[i] = rnd;
	}
	for(i=0;i<count;i++){
		schlagworte_document[i] = $$('.schlagworte_1').length; //Anzahl der Schlagwörter
		random_schlagwort[i] = Zahlen[i];
		window.setTimeout('einblendenEffekt('+i+','+random_schlagwort[i]+')',80*i);
	}
}
// Bilderscripts
/*picNum=0;
swapPictures = function(anzahl){
	$('pic_'+picNum).fade({ duration: 2.0 });
	picNum++;
	if(picNum>anzahl-1){
		picNum = 0;
	}
	$('pic_'+picNum).appear({ duration: 2.0 });
} 
picInit = function(){
	$('pics').cleanWhitespace();
	for(i=0;i<$('pics').childNodes.length;i++){
		if(i!=0){
			$('pics').childNodes[i].style.display = 'none';
		}
	}
	if($('pics').childNodes.length > 1){
		window.setInterval('swapPictures('+$('pics').childNodes.length+')',5000);
	}
}*/
function getRandom( min, max ) {
	if( min > max ) {
		return( -1 );
	}
	if( min == max ) {
		return( min );
	}
	return( min + parseInt( Math.random() * ( max-min+1 ) ) );
}
