// JavaScript Document

defURL = "index-rent.htm?";
setURL = "";

$(document).ready(function() {
	$("form#searchForm input:image").bind("click", function() {
		setURL = defURL;
		$("form#searchForm select").each(function() {
			$("option", this).each(function() {
				if($(this).attr("selected") == "selected" && $(this).attr("value") != "") {
					setURL += $(this).attr("value");
				}
			});
		});
		$("form#searchForm input").each(function() {
			if($(this).attr("checked") == "checked") {
				setURL += $(this).attr("value");
			}
		});
		if(setURL.match(/\?\&/)) {
			setURL = setURL.replace(/\?\&/, "?");
		} else {
			setURL = setURL.replace(/\?/, "");
		}
		location.href = setURL;
		return false;
	}).bind("mouseover", function() {
		if($(this).attr("src").match(/_off.(gif|jpg|png)/)) {
			$(this).attr("src", $(this).attr("src").replace(/_off.(gif|jpg|png)/, "_on.$1"));
		}
	}).bind("mouseout", function() {
		if($(this).attr("src").match(/_on.(gif|jpg|png)/)) {
			$(this).attr("src", $(this).attr("src").replace(/_on.(gif|jpg|png)/, "_off.$1"));
		}
	});
});


