

IE  = document.all &&!window.opera;
GK  = window.sidebar;
AOB = [];
x   = 0;

function Fader()
{
  this.timeOut=false;
  this.fade=function(y)
    {
      clearTimeout(this.timeOut);
      this.value=Number(eval('this.object.'+this.attr))+(this.delta*this.evt[y]);
      if(this.value>=this.min && this.value<=this.max)
        {
          eval('this.object.'+this.attr+'='+this.value)
          this.timeOut=setTimeout('AOB['+this.index+'].fade('+y+')',this.rate);
        }
    }
}


function init_fader(obj,delta,rate,min,max,dir)
{
  
      AOB.push(new Fader(x));
      OB        = AOB[x];
      OB.index  = x;
      OB.object = obj;
      if(IE)
        {
          OB.attr = 'filters.alpha.opacity';
          OB.faktor = 1;
        }
      else if(GK)
        {
          OB.attr   = 'style.MozOpacity';
          OB.faktor = 100;
        }
      else 
        {
          OB.attr   = 'style.opacity';
          OB.faktor = 100;
        }
      OB.delta = delta/OB.faktor;
      OB.rate  = rate;
      OB.min   = min/OB.faktor;
      OB.max   = max/OB.faktor;
      OB.evt=[-1,1];if(dir)OB.evt.reverse();
      OB.object.onmouseover = new Function('f1','AOB['+x+'].fade(0)');
      OB.object.onmouseout  = new Function('f2','AOB['+x+'].fade(1)');
      OB.fade(0);x++;
   
}


jQuery(document).ready(function(){

	//Hide (Collapse) the toggle containers on load
	jQuery(".toggle_container").hide(); 
	
    	jQuery('.trigger').click(function(){
		idelem = jQuery(this).attr('id');
		idelemdiv = idelem.replace('trigger_', 'boxelem_');
		jQuery('#'+idelem).toggleClass("jsactive");
		jQuery('#'+idelemdiv).slideToggle("slow");
	});
});


jQuery(document).ready(function() {
	jQuery('div.rgaccord1-nest> div').hide();
	jQuery('div.rgaccord1-nest> h3').click(function() {
		jQuery(this).next('div').slideToggle('fast');
		
		if(jQuery(this).hasClass("act"))
			jQuery(this).removeClass("act");
		else {
			jQuery(this).addClass("act");
		}
		//schließen, wenn ein anderer geklickt wird
		//.siblings('div:visible').slideUp('fast');
	});

	jQuery('div.rgaccord2-nest> div').hide();
	jQuery('div.rgaccord2-nest> h3').click(function() {
		jQuery(this).next('div').slideToggle('fast');
        
		if(jQuery(this).hasClass("act"))
			jQuery(this).removeClass("act");
		else {
			jQuery(this).addClass("act");
		}
		//schließen, wenn ein anderer geklickt wird
		//.siblings('div:visible').slideUp('fast');
	});

});

// Korando Module
jQuery(document).ready(function() {
	jQuery(".korandoWrapper").scrollable({
		speed : 1000
	});

	jQuery(".detailedInformation").tooltip({
		position : 'bottom left',
		tip : '#tooltip',
		effect : 'fade',
		fadeInSpeed : 500,
		fadeOutSpeed : 500,
		onBeforeShow : function() {
			var tooltipHTML = this.getTrigger().next('div').html();
			jQuery('#tooltip').find('*').remove();
			jQuery('#tooltip').append(tooltipHTML);
		}
	}).dynamic();

});
