jQuery(document).ready(function($) {
  $('a').each(function() {
     var a = new RegExp('/' + window.location.host + '/');
     if(!a.test(this.href)) {
         $(this).click(function(event) {
             event.preventDefault();
             event.stopPropagation();
             window.open(this.href, '_blank');
         });
     }
  });
  
	$("select").uniform();
  
  $('.clickable li').click(function() {
   window.location.href=$(this).children('a').attr('href');;
	});
  
  $('ul.sf-menu').superfish({delay: 100, autoArrows:false, animation: {opacity:'show',height:'show'}});  
  
  //$('#logo a img').hover(function() {
//    $(this).animate({opacity: 0.6}, 200);
//  }, function() {
//    $('#logo a img').animate({opacity: 1}, 200);
//  });
  
  $('input.button, a.button').css('opacity', '0.8');    
  $('input.button, a.button').hover(function() {
    $(this).animate({opacity: 1}, 80);
  }, function() {
    $(this).animate({opacity: 0.8}, 80);
  });

  $('#activity li').hover(function() {
    $(this).addClass('hover');
  }, function() {
    $(this).removeClass('hover');
  });


  $('nav#actions li').animate({opacity:0.4}, 'fast');
  $('nav#actions li').hover(function() {
    $(this).animate({opacity:1},'slow');
    $(this).children('a').addClass('hover', 2).animate({top:"+=10px"});
  }, function() {
    $(this).animate({opacity:0.4},'fast');
    $(this).children('a').animate({top:"-=10px"}, 200).removeAttr('class').removeAttr('style');
  });
  
  $('a[rel=cbox_2]').colorbox();
  
	$('#downloads h2').click(function() {
	  $('#downloads ul').toggle('fast');
	});
	
	$('a[href$=pdf],a[title=Apartment Blog]').click(function() {
	 $(this).attr('target', '_blank');
	});
	
	$("#ispire_trigger").colorbox({inline:true, href:"#ispire"});
	 
});

