//var $ = jQuery.noConflict();
       
$(document).ready(function(){
	
	//Auto-Fill certain fields and auto-clear them when user clicks inside them.
	//If nothing is entered, when field is no longer in focus, auto-fill it again.
	//minimum price
    $('#minPrice').focus(function () {
        if($(this).val() == 'Minimum Price'){
            $(this).val('');
        }
    });
    $('#minPrice').blur(function () {
        if($(this).val() == ''){
            $(this).val('Minimum Price');
        }
    });
	//maximum price
	$('#maxPrice').focus(function () {
        if($(this).val() == 'Maximum Price'){
            $(this).val('');
        }
    });
    $('#maxPrice').blur(function () {
        if($(this).val() == ''){
            $(this).val('Maximum Price');
        }
    });
	//your email
	$('#yourEmail').focus(function() {
		if($(this).val() == 'Your Email') {
			$(this).val('');
		}
	});
	$('#yourEmail').blur(function() {
		if($(this).val() == '') {
			$(this).val('Your Email');
		}
	});
	
	//nav
	$(".dropdown").hover(
	  function () {
	    $(this).prev().css('background-color', '#340300');
	  }, 
	  function () {
	    $(this).prev().css('background-color', '#900000');
	  });
	
	$(".navmain").hover(
	  function () {
	    $(this).css('background-color', '#340300');
	  },
	  function () {
	    $(this).css('background-color', '#900000');
	  }
	);
	
	//round things
	//$(".nav").corner("4px");
	//$(".titlebar").corner("top 4px");
	//$(".content-container").corner("bottom 4px");
	//$(".sidebar").corner("4px bottom");
	//$(".dropdown").corner("4px bottom");
	//$("#formError").corner("4px");
	//$(".g-map").corner("4px");
	//$(".property-photos").corner("4px");
	//$(".property-details td").corner("4px");
	//$(".tabs ul li.active").corner("4px top");
	//$(".pagination ul li a").corner("4px");
	//$(".active_page").corner("4px");
	
	//add this
	
	$(function(){
	    $('.custom_button, .hover_menu').mouseenter(function()
	    {
	        $('.hover_menu').fadeIn('fast');
	        $('.custom_button').addClass('active');
	        $(this).data('in', true);
	        $('.hover_menu').data('hidden', false);
	    }).mouseleave(function()
	    {
	        $(this).data('in', false);
	        setTimeout(hideMenu, delay);
	    });

	    var delay = 400;
	    function hideMenu()
	    {
	        if (!$('.custom_button').data('in') && !$('.hover_menu').data('in') && !$('.hover_menu').data('hidden'))
	        {
	            $('.hover_menu').fadeOut('fast');
	            $('.custom_button').removeClass('active');
	            $('.hover_menu').data('hidden', true);
	        }
	    }
	});
	
	Cufon.replace('.titlebar h1');
	$('.titlebar h1').css("color","#260000");

});
