/**
* JavaScript
*
* @author	Sebastian Müller <sebastian produktivbuero de>
*/

function countdown(zahl){
    if(zahl>1){ 
    // über 1 Sekunde hinaus -> x Sekunden
    document.getElementById('remaining').innerHTML=zahl+" Sekunden";
    count(zahl);            
    }
    else if(zahl==1){ 
    // 1 Sekunde
    document.getElementById('remaining').innerHTML=zahl+" Sekunde";
    count(zahl);            
    }
    else { 
    // Countdown abgelaufen, beliebige Handlung kann eingebaut werden
    document.getElementById('remaining').innerHTML="0 Sekunden";
    }
}

function count(countzahl){
  // gewünschte Handlung kann hier eingebaut werden
  countzahl--;
  setTimeout("countdown("+countzahl+");",1000);            
}



/** ************************************************************************
* Entschlüsselt E-Mails
*
* @param	$s  verschlüsselte E-Mail-Adresse
* @return	E-Mail-Adresse
* @author	http://jumk.de
* @date		
***************************************************************************/

function UnCryptMailto (s) {
	var n = 0;
	var r = "";
	for( var i = 0; i < s.length; i++)
	{
	    n = s.charCodeAt( i );
	    if( n >= 8364 )
	    {
	        n = 128;
	    }
	    r += String.fromCharCode( n - 1 );
	}
	return r;
};


/** ************************************************************************
* Ruft den Link zur E-Mail-Adresse auf
*
* @param	$s  verschlüsselte E-Mail-Adresse
* @return	-
* @author	http://jumk.de
* @date		
***************************************************************************/

function linkTo_UnCryptMailto (s) {
	location.href=UnCryptMailto(s);
};


/** ************************************************************************
* Öffnet ein Popupfenster
*
* @param	$url  Zieladresse
* @param	$width  Fensterbreite
* @param	$height  Fensterhöhe
* @return	-
* @author	Sebastian Müller
* @date		12/04/2007
***************************************************************************/

function popup(url, width, height) {
	myWindow = window.open(url,'popup','width=' + width + ', height=' + height + ', dependant=yes, scrollbars=yes');
};
