﻿$(function(){
  $("#ctl00_nav li a:first").css({borderLeft: 'none'})
  $("#ctl00_nav li a:last").css({borderRight: 'none'})
  $("#ctl00_nav li a:last").css({paddingRight: '3px'})

  // Fancy nav
  $("#ctl00_nav li:not(.current) a")
    .css( {backgroundPosition: "0 0"} )
  $("#ctl00_nav li a")
	  .mouseover(function(){
		  $(this).stop().animate(
			  {backgroundPosition:"(0 -60px)"}, 
			  {duration:300})
		  })
  $("#ctl00_nav li:not(.current) a")
	  .mouseout(function(){
		  $(this).stop().animate(
			  {backgroundPosition:"(0 0)"}, 
			  {duration:300})
		  })

  // Document previews
  var obj = $('ul.imgPreview a');
  if (obj.length>0) {
    $('ul.imgPreview a').imgPreview({
      containerID: 'imgPreviewWithStyles',
      srcAttr: 'rel',
      // When container is shown:
      onShow: function(link){
        if($(link).attr('title')=='') {} {
          $('<span>' + $(link).attr("title") + '</span>').appendTo(this);  // Append title
        }
      },
      // When container hides: 
      onHide: function(link){
        // Hide title
        $('span', this).remove();
      }
    });
  };

});

