/**
* JavaScript
*
* @author	Sebastian Müller <sebastian produktivbuero de>
* @date		03/02/2007
*/

$(document).ready(function(){
  $("#navigation ol").corner("cc:#000 top");
});

$(window).load(function(){
  $("body.dozenten div.articleContainer").each( function(i) {
   var height = $(this).height()+25;
    $(this).attr("rel",height).css({'position':'relative', 'height':130, 'overflow':'hidden'}).bind("click", function(){
      if ($(this).height() == 130)
        $(this).animate({height:$(this).attr("rel")}, 'fast', function () { $(this).append("<b class='closebutton'>schließen</b>"); });
      else
        $(this).animate({height:130}, 'fast', function () { $(this).find(".closebutton").remove(); });
    });
  });
});

/** ************************************************************************
* 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 + ', toolbar=no,location=no,status=no,menubar=no,resizable=yes,top=0,left=0');
};


/** ************************************************************************
* Positioniert das aktuelle Fenster
*
* @return	-
* @author	Sebastian Müller
* @date		07/02/2008
***************************************************************************/

function positionWindow() {
  self.resizeTo(screen.availWidth, screen.availHeight);
  self.moveTo(0,0);
  self.focus();
};
