jQuery(document).ready(function(){
  /**
   * CarouFredsel
   */
  jQuery("#site-carousel").carouFredSel({
    width: 960,
    height: 300,
    items: {
      start: "random",
      visible: 1,
      width: 960,
      height: 300
    },
    scroll: {
      items: 1,
      fx: "crossfade",
      duration: 1250
    }
  });

  /**
   * Menu Mod's
   */
  var arr = jQuery("ul > li a").not("ul li ul a");
  jQuery.each(arr, function() {
/*     alert(jQuery(this).attr("href")); */
    jQuery(this).attr("href", "#");
  });

  jQuery("li.page-item-1090 > a").not("a li a").attr("href", "#");

  /**
   * FancyBox
   */
  jQuery("a[href*='"+location.hostname+"']:has(img)").fancybox({
    "titleShow": true,
    "titlePosition": "outside",
    "hideOnContentClick": true,
    "transitionIn": "elastic",
    "transitionOut": "elastic",
    "speedIn": 500,
    "speedOut": 200,
    "overlayShow": true,
    "centerOnScroll": true,
    "hideOnOverlayClick": true
  });

  /**
   * File Icons
   */
  jQuery("a[href*='http://']:not([href*='"+location.hostname+"']),[href*='https://']:not([href*='"+location.hostname+"'])")
    .addClass("external")
    .attr("target","_blank");

  jQuery("a[href*='.pdf']")
    .addClass("file")
    .addClass("pdf")
    .attr("target","_blank");

  jQuery("a[href*='.xls'],[href*='.xlsx'][href*='.csv']")
    .addClass("file")
    .addClass("xls")
    .attr("target","_blank");

  jQuery("a[href*='.doc'],[href*='.docx']")
    .addClass("file")
    .addClass("doc")
    .attr("target","_blank");

  jQuery("a[href*='.ppt'],[href*='.pptx']")
    .addClass("file")
    .addClass("ppt")
    .attr("target","_blank");
});
