/* IE6nomore
------------------------------------------------------------------------------------------------ */

$.IE6nomore = function() {

    if(!$('#ie6nomore').length)
        return;

    $('#ie6nomore').css({
        'left'      : 0,
        'top'       : 0,
        'bottom'    : 0,
        'right'     : 0,
        'position'  : 'absolute',
        'z-index'   : 9999
    });

};

/* Swap image
------------------------------------------------------------------------------------------------ */

function swapImage(element, newimage) {

    var oldsrc      = element.src;
    element.src     = newimage;

    if (!element.onmouseout) {
        element.onmouseout = function() {
            swapImage(this, oldsrc);
        }
    }

}

/* Get url vars
------------------------------------------------------------------------------------------------ */

$.getUrlVars = function() {

    var vars    = [],
        hash    = '',
        hashes  = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

    $(hashes).each(function() {
        hash = this.split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    });

    return vars;
};

/* Spam protection
------------------------------------------------------------------------------------------------ */

function getAdr(prefix, postfix, text) {
    document.write('<a href="mailto:' + prefix + '@' + postfix + '">' + (text ? text.replace(/&quot;/g, '"').replace(/%EMAIL%/, prefix + '@' + postfix) : prefix + '@' + postfix) + '</a>');
}


/* DOM
------------------------------------------------------------------------------------------------ */


$(document).ready(function() {

    // IE6nomore
    $.IE6nomore();
    
    if( $('#archive_separate'.length) ){
            $('#archive_separate').appendTo($('#deubner_archive'));            
        }
   
    $(".publikation_accordion > h3").click(function() {

        if ($(this).hasClass('active')) {
               $(this).next().slideToggle();
              $(this).removeClass('active');
        }
        else{
          $(".publikation_accordion > h3").removeClass('active');
          $(this).addClass('active');
          $(this).next().slideToggle();
          }
      $(".publikation_accordion > h3").not('.active').next().hide();
      
    });

});



