// JavaScript Document
//fader
$(document).ready(function(){
   //$("a[rel^='lightbox']").append('<img src="/_sysimg/zoom.png" style="position:relative; top:5px; left:5px;">');
   //$("a[rel^='lightbox']").addClass('lb');
   $(".showLogin").click(function () {
      if($('div.login').is(':hidden')) 
        $('div.login').show("slide", { direction: "right" }, 1000);
      else
        $('div.login').hide("slide", { direction: "right" }, 1000);
      return false;
   });
   $(".imagegroup .first, .social img, .rightcol a img, .thumb").fadeTo("400", 1.0); // This sets the opacity of the thumbs to fade down to 30% when the page loads
   $(".imagegroup .first, .social img, .rightcol a img, .thumb").hover(function(){
   $(this).fadeTo("400", 0.6); // This should set the opacity to 100% on hover
   },function(){
   $(this).fadeTo("400",1.0); // This should set the opacity back to 30% on mouseout
		});

    $(".popup").click(function () {
      //alert($(this).attr('href'));
      window.open($(this).attr('href'), $(this).attr('title'),'width=800,height=600');
      //ev.preventDefault();
      return false;
   }); 
	
			 $(".inform a img").fadeTo("400", 1.0); // This sets the opacity of the thumbs to fade down to 30% when the page loads
			 $(".inform a img").hover(function(){
			 $(this).fadeTo("400", 0.6); // This should set the opacity to 100% on hover
			 },function(){
			 $(this).fadeTo("400",1.0); // This should set the opacity back to 30% on mouseout
			});
	
    
    
    $('.fancybox, a[rel="lightbox"]').fancybox({
        'transitionIn'   : 'elastic',
        'transitionOut'  : 'elastic',
        'speedIn'        : 600, 
        'speedOut'       : 200, 
        'overlayShow'    : true ,
        'titlePosition'  : 'over',
        'onComplete'     : function() {
            $("#fancybox-wrap").hover(function() {
                $("#fancybox-title").fadeIn('slow');
            }, function() {
                $("#fancybox-title").fadeOut('slow');
            });
        }
    }); 
    $("[href$='.pdf']").fancybox({
        'width'                : '80%',
        'height'            : '90%',
        'autoScale'            : true,
        'transitionIn'        : 'elastic',
        'transitionOut'        : 'elastic',
        'type'                : 'iframe'}); 
});
