$(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>');

     });     

     $('#coin-slider').coinslider({ width: 973, height: 363, navigation: true, delay: 5000, hoverPause: true, effect: 'rain', spw: 5, sph: 5});
     /*
      spw: 7, // squares per width
      sph: 5, // squares per height
      sDelay: 30, // delay beetwen squares in ms
      opacity: 0.7, // opacity of title and navigation
      titleSpeed: 500, // speed of title appereance in ms
      effect: '', // random, swirl, rain, straight
      navigation: true, // prev next and buttons
      links : true, // show images as links 
       // pause on hover
     */
     
     $('#coin-slider').css('visibility','visible');     
});

