jQuery(document).ready(function($) {
	$(".nav_button img").css({opacity : '0'});
	$(".homes_button img").css({opacity : '0'});
	$("body.category-lots-homes .lots_homes a, body.s-category-lots-homes .lots_homes a").addClass("current");
	$("body.slug-prime-location .prime_location a").addClass("current");
	$("body.slug-contact-us .contact_us a").addClass("current");
	$(".widget_pages li.page_item").append("<div class='hover_tree'></div>");

	if ($.support.htmlSerialize == true) {	
		$(".widget_pages li.page_item a").hover(
			function() {
				$(this).next().stop(true,true).fadeIn("400");
			},
			function() {
				$(this).next().stop(true,true).fadeOut("400");
			}
		);
	}
	$("#nav_buttons a:not('.current')").hover(
		function() {
			$(this).children().stop(true,true).animate({opacity: "1"}, 700);
		},
		function() {
			$(this).children().stop(true,true).animate({opacity: "0"}, 700);
		}
	);
	$(".homes_button a").hover(
		function() {
			$(this).children().stop(true,true).animate({opacity: "1"}, 700);
		},
		function() {
			$(this).children().stop(true,true).animate({opacity: "0"}, 700);
		}
	);
	$(".archive-meta p:first-child").css({
		'fontFamily' : "'Times New Roman', Times, serif",
		'fontStyle' : 'italic',
		'fontSize' : '1.3em'
	});
	$("#container").randombg({
		directory: "/wp-content/themes/colvardfarms/images/left-side/",
		howmany: 8,
		color: "#ABAB9F",
		align: "top left"
	});
	$("#main").randombg({
		directory: "/wp-content/themes/colvardfarms/images/interior-bkgrnd/",
		howmany: 7,
		align: "top center"
	});
	$("div.category-lots-homes:odd").css({
		'backgroundColor' : '#F3F2ED',
		'margin' : '0',
		'padding' : '30px 32px 0 32px'
	});
	$(".homes_button a[rel]").overlay({
		expose: {maskId : 'exposeMask', color : '#333333'},
		onBeforeLoad: function() {
			var wrap = this.getContent().find(".contentWrap");
			wrap.load(this.getTrigger().attr("href"));
		}
	});
	if (jQuery.browser.safari) {
		$(".contact_form input:text").removeAttr("size");
	};
	
	$("#crazymap").tabs("div.map-pane > div", {
		event: 'mouseover',
		effect: 'ajax',
		initialIndex: null
	}); 

	$("#crazymap area").click(function() {return false; });
	
	$("area.mapleft").hover(
		function(){
			$(".map-pane").addClass($(this).attr('class'));
		},
		function(){
			$(".map-pane").removeClass('mapleft');
			$(".map-pane div").empty();
		}
	);
	
	$("area.mapright").hover(
			function(){
				$(".map-pane").addClass($(this).attr('class'));
			},
			function(){
				$(".map-pane").removeClass('mapright');
				$(".map-pane div").empty();
			}
		);
	
	$("body.slug-home pre a").click(function() {
		$(this).remove();
		$('object').remove();
	});
	
});