// JavaScript Document


$(document).ready(function() {
  $('a[rel*="external"]').click(function(){
    $(this).attr('target','_blank');
  });
  
  $('article').css({background:"#993300"});
  
  /*back to top	
	$(function() {		
		var divHeight = $("div#top").height();
		if (divHeight > 100) { 
			$("a.top").css("display", "block"); 
			} else {
			$("a.top").css("display", "none");
		}
		
	});
  $('a.top').click(function(){
     $('html, body').animate({scrollTop: '0px'}, 300);
     return false;
  });
  */
  // hide #back-top first
	$("#back-top").hide();
	
	// fade in #back-top
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#back-top').fadeIn();
			} else {
				$('#back-top').fadeOut();
			}
		});

		// scroll body to 0px on click
		$('#back-top a.top').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});

  /*
  $('#banner').cycle({ 
    speed: 1000
  });
*/
  
  
});

