function viewImg(url, breite, hoehe, isHP)
{
  if ( (breite == '' || breite == 'undefined' || breite == null) || (breite > 640 && isHP == true) )
  {
    breite = 640;
  } else
  {
    // explizit in Zahl wandeln
    breite = breite * 1;
  }

  if ( hoehe == '' || hoehe == 'undefined' || hoehe == null )
  {
    hoehe = Math.round(breite * .75);
  } else
  {
    // explizit in Zahl wandeln
    hoehe = hoehe * 1;
  }

  fensterHoehe = hoehe + 24;

  // Fenster anpassen
  // dazu brauchen wir breite und H�e des Haupt-Fensters
  hauptBreite = 948; // sollte hier bei Spreequell 948 sein
  hauptHoehe = 648; // sollte hier bei Spreequell 648 sein

  if ( breite > hauptBreite || fensterHoehe > hauptHoehe )
  {
    theTop = '0';
    theLeft = '0';
  } else
  {
    theTop = Math.round((hauptHoehe - fensterHoehe) / 2);
    theLeft = Math.round((hauptBreite - breite + 2) / 2);
  }
  if ( theLeft < 280 && isHP == true )
  {
    theLeft = 280;
  }

  //alert(hauptHoehe + ' ' + fensterHoehe);

  $('imgViewer').setStyle( { width:breite+'px', height:fensterHoehe+'px', top:theTop+'px', left:theLeft+'px' } );

  // das funktioniert im IE 6 nicht richtig:
  $('imgViewerContent').update('<img src="/standard/inc/php/resizeImg.php?image=' + url + '&width=' + breite + '&height=' + hoehe + '" alt="" border="0" />');
  // deshalb so:
  /*
  $('theBigImg').src = '/standard/inc/php/resizeImg.php?image=' + url + '&width=' + breite + '&height=' + hoehe;
  $('theBigImg').width = breite;
  $('theBigImg').height = hoehe;
  */
  // ende workaround IE 6
  eff = Effect.Appear($('imgViewer'), {duration:0.2});
  //$('imgViewer').show();

  return true;
}

function showDetail(url, extraPar, whichDiv)
{
  if ( whichDiv == '' || whichDiv == undefined || whichDiv == null )
  {
    whichDiv = 'content';
  }
  // tauscht den Inhalt von div#content gegen den
  // Inhalt von url aus
  $(whichDiv).update('<p>Lade, bitte warten...</p>');
  new Ajax.Updater(whichDiv, url,
  {
    method      : 'get',
    parameters  : extraPar,
    onFailure   : function(resp)
                  {
                    alert('Fehler: ' + resp.responseText);
                  },
    onException : function(resp)
                  {
                    alert('Ausnahme: ' + resp.responseText);
                  }
  }
  );
  return true;
}

function restore(modulName, whichDiv)
{
  if ( whichDiv == '' || whichDiv == undefined || whichDiv == null )
  {
    whichDiv = 'content';
  }
  if ( modulName == 'undefined' || modulName == null || modulName == '' )
  {
    modulName = 'content';
  }

  $(whichDiv).update('<p>Lade, bitte warten...</p>');
  new Ajax.Updater(whichDiv, modulName + '_mods/default.php',
  {
    method      : 'post',
    postBody    : 'mimeType=text/xml',
    evalScripts : false,
    onFailure   : function(resp)
                  {
                    alert('Fehler: ' + resp.responseText);
                  },
    onException : function(resp, ex)
                  {
                    alert('Ausnahme: ' + ex);
                  }

  }
  );
  return true;
}

function setAktMonth(monat)
{
  // erst mal alle ausschalten
  alleMonate = $$('span');
  for ( i = 0; i < alleMonate.length; i++ )
  {
    alleMonate[i].removeClassName('aktMonat');
  }
  
  // jetzt den einen einschalten
  $('mon_' + monat).addClassName('aktMonat');

}

var to = null;

function removeFB()
{
	//setzt nach einem Timeout
	// das Facebook-Dinges zurück
	if ( to == null )
	{
		to = setTimeout("_removeFB()", 800);
	}
}

function _removeFB()
{
	Effect.BlindUp('fb_text', { duration:0.5, scaleX:true, scaleY:false });
	clearTimeout(to);
	to = null;
}
