$(document).ready(
	function() {

		// Open links with rel="external" in new window - like ye ole' target="_blank"
		$('a[rel="external"]').click(function() {window.open( $(this).attr('href') ); return false;});


		// Zebra-stripe data tables
		$(".editable table").each(function () {
		  if ($(this).attr("class").toLowerCase() == "statstables") {
		    $(this).removeClass("odd even");
		    $("tr:odd", this).addClass("odd");
		    $("tr:even", this).addClass("even");
		  }
		});
		
		$(".boxlocation").each(function() {
			$(this).removeClass("odd even");
			$("div:odd", this).addClass("odd");
			$("div:even", this).addClass("even");
		});

		// Alternate Property Views
		$('ul#altimages a').click(function() {
		  var swapimg = $(this).attr('href');
		  var swapimgmed = swapimg.replace('large', 'medium');
		  $('ul#altimages a').removeClass('active');
		  $(this).addClass('active');
		  $('#propertyimage').attr('href', swapimg);
		  $('#propertyimage img').attr('src', swapimgmed);
		  return false;
		});

		
		var randNum = Math.floor(Math.random() * 3 + 1);
		
		if(randNum == 1)
		{
			$('blockquote').addClass('one');
		}
		
		if(randNum == 2)
		{
			$('blockquote').addClass('two');
		}
		if(randNum == 3)
		{
			$('blockquote').addClass('three');
		}
	}
);

