/* wasmitmedien.de javascript sorcery / electricgecko says "thank you kndly, mootools" */

var openstate = 360; // wenn kein title definiert
var closedstate = 105;

  Window.onDomReady(function(){
   $$('h2').each(function(el) {  
   var knot = 'box_'+el.getProperty('id').substr(3);
   el.addEvent('click', function(){ 
      if (this.getStyle('height') == closedstate+'px') {
      if (this.getFirst().getProperty('title')) {openstate = this.getFirst().getProperty('title')} else {openstate = 360;} 
      this.effect('height').custom(closedstate,openstate);
      if (this.getProperty('id').substr(4) == 'one') {$('player').setStyle('visibility', 'visible');}
      }
      }.bind($(knot))    
	);
	});
  	   });
  	   
  Window.onDomReady(function(){
  $$('.closer').each(function(el) {   
   var knot = 'box_'+el.getProperty('id').substr(3);
   el.addEvent('click', function(){
   	if (this.getProperty('id').substr(4) == 'one') {$('player').setStyle('visibility', 'hidden');}
   	this.effect('height').custom(openstate,closedstate);}.bind($(knot)));
	});  
  	   });

 
  Window.onDomReady(function(){
   var toolTips = new Tips($$('h2'), {
    maxTitleChars: 50, 
    maxOpacity: .8, 
    timeOut: 400, 
    className: 'tip'
    });
   });
   
  Window.onDomReady(function(){
   var toolTips = new Tips($$('.meta-icon'), {
    maxTitleChars: 50, 
    maxOpacity: .8, 
    timeOut: 400, 
    className: 'icontip'
    });
   });
   
 
var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 150;
  h = (h) ? h += 25 : 150;
  var args = 'width='+w+',height='+h+', scrollbars=yes';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}


