// jQuery conflict mode
$.noConflict();

// jQuery starts here

// jQuery document.ready
jQuery(document).ready(function() {


// Start Flackern IE6 abstellen
if (jQuery.browser.msie) {
    try {
        document.execCommand("BackgroundImageCache", false, true);
    } catch (err) { }
};// End Flackern IE6 abstellen


// Start toggle box
//Hide the tooglebox on pageload
jQuery(".togglebox").hide();
//Switch the "Open" and "Close" state per click
jQuery(".toggle").toggle(function(){
	jQuery(this).addClass("toggledown");
	}, function () {
	jQuery(this).removeClass("toggledown");
});
//slide up and down on click
jQuery(".toggle").click(function() {
    jQuery(this).next(".togglebox").slideToggle("slow");
    return true;
});// end toggle box


// Start document icons
var iconPath = '/images/FileManager/Icons/';

var fileTypes = {
    doc: 'doc.gif',
    docx: 'doc.gif',
    xls: 'xls.gif',
    xlsx: 'xls.gif',
    ppt: 'ppt.gif',
    pptx: 'ppt.gif',
    pdf: 'pdf.gif',
    jpg: 'jpg.gif',
    tif: 'tif.gif',
    tiff: 'tif.gif'
};
// All but not article images
jQuery('.article a').not('.article-image a').each(function() {
    var $a = jQuery(this);
    var href = $a.attr('href');
    if (
(href.match(/^http/)) &&
(!href.match(document.domain))
) {
// use a special image for external links
var image = 'link-external.gif';
}
// mailto link
else if (
(href.match(/^mailto:/))
) {
// use a special image for external links
var image = 'link-email.gif';
}
else {
// get the extension from the href
var hrefArray = href.split('.');
var extension = hrefArray[hrefArray.length - 1];
var image = fileTypes[extension];
}
if (image) {
$a.css({
    paddingLeft: '20px',
    background: 'transparent url("' + iconPath + image + '") no-repeat center left'
}).attr("target", "_blank");
}
});// End document icons

// Remove line
jQuery('#dnn_ContentPane .teaserlist .teaser').last().css('background', 'none');
jQuery('#dnn_RightPane .teaserlist .teaser').last().css('background', 'none');
jQuery('#dnn_LeftPane .teaserlist .teaser').last().css('background', 'none');
jQuery('#dnn_OutputPane .teaserlist .teaser').last().css('background', 'none');

// Teaser Box 4 in right or left pane
jQuery('#dnn_LeftPane .teaser-box4-list').append('<p style="color: red; width: 200px;">Das Teaser Modul kann mit der aktuell eingestellten Vorlage <strong>"Box4"</strong> in der linken und rechten Spalte der Website nicht dargestellt werden<br /><br />Bitte &auml;ndern Sie &uuml;ber <strong>"Moduleinstellungen"</strong> > <strong>"Einstellungen f&uuml;r Teaser Meldungen"</strong> die Vorlage des Teaser Moduls auf <strong>"Default"</strong></p>');

// Vertical Menu
jQuery('.nav-vertical ul.level1:last-child').css({margin: '0 0 20px 0'});


}); // Close document.ready
