// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function clearElement(id) {
	document.getElementById(id).value = '';
}

/**
 * Custom button state handler for enabling/disabling button state. 
 * Called when the carousel has determined that the previous button
 * state should be changed.
 * Specified to the carousel as the configuration
 * parameter: prevButtonStateHandler
 **/
var handlePrevButtonState = function(type, args) {

    var enabling = args[0];
    var leftImage = args[1];

    if(enabling) {
        leftImage.src = "/images/style/but_left_blue.jpg";
    } else {
        leftImage.src = "/images/style/but_left_gray.jpg";
    }
    
};

/**
 * Custom button state handler for enabling/disabling button state. 
 * Called when the carousel has determined that the next button
 * state should be changed.
 * Specified to the carousel as the configuration
 * parameter: nextButtonStateHandler
 **/
var handleNextButtonState = function(type, args) {

    var enabling = args[0];
    var rightImage = args[1];
    
    if(enabling) {
        rightImage.src = "/images/style/but_right_blue.jpg";
    } else {
        rightImage.src = "/images/style/but_right_gray.jpg";
    }
    
};


function category_selected(value) {
	if (value == 2) { // for sale
		$("rental").hide();
	    $("price").show();
	}
	else if (value == 3) { // rental
	    $("price").show();
		$("rental").show();
	}
	else {
	    $("price").hide();
	}
} 