  (function($){

    $('html').addClass('js');// add class if user used js
    jQuery.fn.textShadow = function () {
      return this.each(function () {
        var el = $(this);
        var text = el.html();
        el.html('<span class="jquery-text-shadow">' + text + '</span>');
        jQuery('<span class="jquery-text-shadow-text">' + text + '</span>').appendTo(el);
      });
    };
    
    $(function(){
      $("a[href$=jpg], a[href$=png], a[href$=gif], .imgbox").fancybox({transitionIn:'elastic'
        , transitionOut:'elastic' ,titlePosition:'inside','showCloseButton':false});// show image
      $('.box_inline').fancybox({'titleShow':false,'showCloseButton':false});
      $('.tm a span.ltext').textShadow();

      var curr_link = window.location.href.replace(/[\/]+$/, '');
      $('a').each(function(){ // find current link
        if(this.href.split('#')[0].replace(/[\/]+$/, '') == curr_link){
          $(this).addClass('current');
        }
      });
    });

  })(jQuery);

