$(document).ready(function(){
     
    $("#content img").each(function (i) {
       var img_href = $(this).attr("src");
       
       if($(this).attr("alt")){
         var title = $(this).attr("alt");
       }else{
         var title = '';
       }

       if (img_href.indexOf('content/images/')!=-1 && img_href.indexOf('content/images/small')==-1){
         $(this).wrap('<a href="'+img_href+'" class="fancybox" title="'+title+'" rel="group"></a>');
       }else{
//         $(this).wrap('<div style="height:200px; width:130px; float:left; padding:20px;"><center><b></b><div style="text-align:center;">'+title+'</div></center></div>');
       }
     });
     
     $('#content a[class=fancybox]').fancybox({'titlePosition' : 'inside', 'SpeedIn': 500, 'SpeedOut': 400, 'overlayShow': true, 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'easingIn' : 'easeOutBack', 'easingOut' : 'easeInBack' });// titlePosition:over
 
     $('a[class=new_page]').fancybox({'autoScale' : false, 'type' : 'iframe', 'width':500, 'height':500});
     $('a[class=edit]').fancybox({'autoScale' : false, 'type' : 'iframe', 'width':600,'height':550});

     //typography
     $(".attention, .notice, .alert, .download, .approved, .media, .note, .camera, .doc").each(function (i) {
        var txt = $(this).html();
        $(this).html('<div class="typo-icon">'+txt+'</div>');

     });     

     $('#slider').nivoSlider({effect:'fade', animSpeed:400, pauseTime:4000, controlNav:false});

      /*
      $('#slider').nivoSlider({
      effect:'random', //    * sliceDown    * sliceDownLeft    * sliceUp    * sliceUpLeft    * sliceUpDown    * sliceUpDownLeft    * fold    * fade    * random    * slideInRight    * slideInLeft
      slices:15,
      animSpeed:500, //Slide transition speed
      pauseTime:3000,
      startSlide:0, //Set starting Slide (0 index)
      directionNav:true, //Next & Prev
      directionNavHide:true, //Only show on hover
      controlNav:true, //1,2,3...
      controlNavThumbs:false, //Use thumbnails for Control Nav
      controlNavThumbsFromRel:false, //Use image rel for thumbs
      controlNavThumbsSearch: '.jpg', //Replace this with...
      controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
      keyboardNav:true, //Use left & right arrows
      pauseOnHover:true, //Stop animation while hovering
      manualAdvance:false, //Force manual transitions
      captionOpacity:0.8, //Universal caption opacity
      beforeChange: function(){},
      afterChange: function(){},
      slideshowEnd: function(){}, //Triggers after all slides have been shown
      lastSlide: function(){}, //Triggers when last slide is shown
      afterLoad: function(){} //Triggers when slider has loaded
      });
      */

});

