$(document).ready(function() {

	$(".submenu_hover").hover(
		function() {
			var sub_id = '#' + $(this).attr('id') + '_sub';
			$(sub_id).show();
			$(sub_id).hover(
				function() {
					$('.submenu:not('+sub_id+')').hide();
				},
				function() {
					$('.submenu').hide();
				}
			);
			//$(this).css('cursor','pointer');
		},
		function(){
			$(this).css('cursor','default');
			//$('.submenu').hide();
		}
	);

	$(".menu").hover(
		function() {
			$('.submenu').hide();
		},
		function(){
			$(this).css('cursor','default');
			//$('.submenu').hide();
		}
	);

	$('.v_row').hover(
		function () {
			$(this).css({ 'color':'#000', 'background-color':'#eaeaea' });
			$(this).css('cursor','pointer');
		}, 
		function () {
			$(this).css({ 'color':'', 'background-color':''  });
			$(this).css('cursor','default');
		}
	);

	$('.v_row').click(function() {
		var unit_id = $(this).attr('id'); 
		window.location.href = "?page=unit&id="+unit_id;
	});
});  

// image hover 
function imgHover(button_id, button_off, button_on) {
	$(button_id).hover(
		function () {
			$(this).attr({ src: button_on });
		}, 
		function () {
			$(this).attr({ src: button_off });
		}
	);
}

// map dot hover
function mapHover(area) {	
	var el = $('#map_links').find('A[href="?page=area&area='+area+'"]');
	$(el).hover(
		function () {
			$(el).children('IMG').attr({ src: 'dot2.png' });
			$(el).css({ 'color':'#000', 'font-weight':'bold' });
		}, 
		function () {
			$(el).children('IMG').attr({ src: 'dot.png' });
			$(el).css({ 'color':'', 'font-weight':'' });
		}
	);
}

// area map dot hover
function areaHover(property_id) {	
	var el = $('#map_links').find('A[href="?page=property&id='+property_id+'"]');
	$(el).hover(
		function () {
			$(el).children('IMG').attr({ src: 'dot2.png' });
			$(el).css({ 'color':'#000', 'font-weight':'bold' });
		}, 
		function () {
			$(el).children('IMG').attr({ src: 'dot.png' });
			$(el).css({ 'color':'', 'font-weight':'' });
		}
	);
}

