/*
    no Conflict for MooTools
*/
jQuery.noConflict();


/*
    after Document Ready
*/
jQuery(document).ready(function() {

    /*
        jQuery Cycle
    */
    jQuery('div#imagebereich div.csc-textpic.csc-textpic-center.csc-textpic-above div.csc-textpic-imagewrap').cycle({
        timeout:            6000,
        speed:              1000,
        random:             'true'
    });
    
    /*
        Navigation ohne Glossar-Verlinkungen
    */
    jQuery('#navi-oben dfn').each(function() {
        jQuery(this).replaceWith(jQuery(this).text());
    });
    jQuery('#navi2 dfn').each(function() {
        jQuery(this).replaceWith(jQuery(this).text());
    });
    
    /*
        Glossarwörter nachträglich verlinken
    */
    /*jQuery('#content dfn').each(function() {
        if ((jQuery(this).parent('strong') || jQuery(this).parent('b')) && !jQuery(this).parent('a')) {
            jQuery(this).wrap('<a class="glossary" href="http://www.netzpepper.de/internetglossar/begriff/'+jQuery(this).text().toLowerCase().replace(' ','-')+'/"></a>');
        }
    });*/
    
    /*
        Zurück- und zum Internetglossar-Link anfügen
    */
    if(jQuery('#content .glossary').find('dd').length == 1) {
        path = window.location.pathname.split('/');
        if (path[2] == "begriff") {
            if (document.referrer.search(/netzpepper.+/) != -1) {
                referrerPath = document.referrer.replace('http://'+window.location.hostname+'/', '');
                jQuery('dl.glossary').append('<p class="back"><a href="http://www.netzpepper.de/'+referrerPath+'">&laquo; zur&uuml;ck</a></p><p class="all"><a href="/internetglossar/">zum Internetglossar &raquo;</p>');
            }
        }
    }
    
});
