/**
 *  Externe Links
 *  Anwendung:
 *      <a class="extern" href="http://www.example.com">extern</a>
 */   
$$('a.extern').each(function(link){
    link.setProperty('target','_blank');    
});

/**
 *  Popuplinks
 *  Anwendung:
 *      <a class="popup" href="http://www.example.com">In Popup öffnen</a> 

SqueezeBox.assign($$('a[class~=popup]'), {
    size: {x: 600, y: 400},
    ajaxOptions: {
        method: 'get'
    }
});
*/

/**
 *  Zoom für Bilder
 *  Anwendung:
 *      <a class="remooz" href="/bild.jpg" title="Bild Titel[ :: Bildbeschreibung]"><img src="/thumbnail.jpg" alt="bild" /></a> 
 */
ReMooz.assign('.remooz', {
    'origin': 'img',
    //'shadow': 'onOpenEnd', // fx is faster because shadow appears after resize animation
    'shadow': 'onOpen', // fx is faster because shadow appears after resize animation
    'resizeFactor': 0.8, // resize to maximum 80% of screen size
    'cutOut': false, // don't hide the original
    'opacityResize': 0.4, // opaque resize
    'dragging': true, // disable dragging
    'centered': true // resize to center of the screen, not relative to the source element
});
    
var container = $('tab-container');
if (container !== null) {
    new SimpleTabs(container, {
        selector: 'h2'
    });
}
 
if( $chk( document.id('startseite') ) ) {
	document.getElements('dl.accordion]').each( function(accordion) {
    	new Accordion( accordion, 'dt', 'dd', {
            display    : true,
            show       : 0,
            alwaysHide : false,
            onActive   : function(toggler, section){
            	toggler.setStyle('color', '#eee' );
            	toggler.setStyle('background-color', '#333' );
	        },
	        onBackground : function(toggler, section){
	            toggler.setStyle('color', '#333' );
            	toggler.setStyle('background-color', '#e0e1e3' );
	        }
	        /*
	        onComplete: function(){
	            this.display.delay(1500, this, (this.previous + 1) % this.togglers.length);
	        }
	        */            
        });
    });
}  

if( document.id('aktion') !== null ) {
    new SimpleTabs( document.id('aktion'), {
        selector: 'h3.toggler'
    });
}  
/**
 *  Tooltips
 *  Anwendung:
 *      <a class="tip" href="/bild.jpg" title="Tip- Text"><img src="/thumbnail.jpg" alt="bild" /></a> 
 *    
var tips = new Tips( '.tip', {
    className:'hilfe',
    offsets: {x: 20, y: 20}
});
*/
