/**
* Javascript
* standard-funktionen
*
* @author heiko pfefferkorn
* @copyright 2006 i-fabrik gmbh
* @version $Id: core.js,v 1.6 2007/08/13 15:40:30 michael Exp $
*
*/

	var CORE = {
		start: function(){
			if( self.parent.frames.length>0 )
				self.parent.location = self.location;

			$$('img.toggle_src').each(function(img) {
				var img = $(img);
				if ($type(img.src)) {
					if (img.src.indexOf('_off')>0) {
						img.addEvent('mouseover',function() {
							img.src = img.src.replace('_off', '_on');
						}).addEvent('mouseout', function() {
							img.src = img.src.replace('_on', '_off');
						});
					}
				}
			});

			if ($$('h1.atStart'))
				CORE.myaccordion();

			// Tooltips initialisieren
			var siteTip = new Tips($$('.tooltip'), {
				onShow: function(toolTip) {
					toolTip.setOpacity(0.8);
				},
				maxTitleChars: 100,
				offsets      : {x:12,y:14},
				className    : 'standard'
			});

			// Smoothbox initialisieren
			TB_init();
  },
  myaccordion: function() {
		// Akkordeon, wenn vorhanden
		var myaccordion = new Accordion('h1.acc_toggler', 'div.acc_slider', {
			opacity: false,
			duration: 200,
			alwaysHide: true,
			show: -1,
			onActive: function(toggler, element){
			},

			onBackground: function(toggler, element){
			}
		}, $('inhalt'));
  }
	};

	if (window.opera)
		window.addEvent('load', CORE.start);
	else
		window.addEvent('domready', CORE.start);

