/**********************************************************************/
/* Funktion laed Images vor          																  */	
/**********************************************************************/
function preload_images() 
{ 
  var d=document; 
	if(d.images)
	{ 
		if(!d.MM_p) d.MM_p=new Array();
   	var i,j=d.MM_p.length,a=preload_images.arguments; 
		for(i=0; i<a.length; i++)
		{
   		if (a[i].indexOf("#")!=0)
			{ 
				d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
			}
		}
	}
}		
/**********************************************************************/
/* Funktion erzeugt einen Mailto-Link 							             			*/	
/**********************************************************************/
function create_email_link(email,domain,linkname)
{
	document.writeln("<a onMouseMove=\"javascript:status='"+linkname+"';\" onMouseOut=\"javascript:status='';\" href=\"mailto:"+email+"@"+domain+"\">"+linkname+"</a>");
}

/**********************************************************************/
/* Funktion oeffnet ein	Pop-Up-Fenster							             			*/	
/**********************************************************************/
function open_window(url, w, h, winname, scroll, resize)  
{
	var winleft = (screen.width - w) / 2; 
	var wintop = (screen.height - h) / 2;
	var winprops = "height="+h+",width="+w+",top="+wintop+",left="+winleft+",scrollbars="+scroll+",resizable="+resize;
	//var windowname = "-"+(Math.random()*99999999);
	var win = window.open(url, winname, winprops);
	if(window.focus) 
	{
		win.focus();
	}
}
/**********************************************************************/
/* Funktion zaehlt die Zeichen in einem Textarea                      */
/**********************************************************************/
function display_count_chars(id_name,string,max_chars)
{
	if(max_chars-string.length<0)
	{
		document.getElementById(id_name).innerHTML=0;
	}else{
		document.getElementById(id_name).innerHTML=max_chars-string.length;
	}
}

/**********************************************************************/
/* Funktion integriert Flash-Player fuer FLV-Videos                    */
/**********************************************************************/
function flv_player(_file,_x_size,_y_size)
{
document.write('<object data="flash/flv_player.swf?video='+_file+'&startvolume=100&autoplay=false&'+Math.random()+'" type="application/x-shockwave-flash" width="'+_x_size+'" height="'+_y_size+'">');
document.write('<param name="movie" value="flash/flv_player.swf?video='+_file+'&startvolume=100&autoplay=false&'+Math.random()+'" />');
document.write('<param name="allowfullscreen" value="true" />');
document.write('<param name="quality" value="high" />');
document.write('</object>');
}	
	                                 
/**********************************************************************/
/* Fade-In fuer einen Container                                       */
/**********************************************************************/
function f_fade_in(element,i)
{
  if(navigator.appName=="Microsoft Internet Explorer")
  {
	 i=i+0.4;
	}else{
	 i=i+0.08;
	}
	document.getElementById(element).style.display="block";	
	document.getElementById(element).style.opacity=i;
	document.getElementById(element).style.filter="alpha(opacity="+(i*100)+");"
	if(i<1) setTimeout("f_fade_in(\""+element+"\","+i+")",10);
}

/**********************************************************************/
/* Fade-Out fuer einen Container                                      */
/**********************************************************************/
function f_fade_out(element,i)
{
  if(navigator.appName=="Microsoft Internet Explorer")
  {
	 i=i-0.4;
	}else{
	 i=i-0.08;
	}
	document.getElementById(element).style.display="block";	
	document.getElementById(element).style.opacity=i;
	document.getElementById(element).style.filter="alpha(opacity="+(i*100)+");"
	if(i>0)
  {
    setTimeout("f_fade_out(\""+element+"\","+i+")",10);
  }else{
    document.getElementById(element).style.display="none";	
  }
}



function niftyplayer(_file)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="165" height="38" id="niftyPlayer1" align="">');
document.write('<param name=movie value="flash/niftyplayer.swf?file='+_file+'&as=0">');
document.write('<param name=quality value=high>');
document.write('<param name=bgcolor value=#FFFFFF>');
document.write('<embed src="flash/niftyplayer.swf?file='+_file+'&as=0" quality=high bgcolor=#FFFFFF width="165" height="38" name="niftyPlayer1" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
document.write('</embed>');
document.write('</object>');	

}

