$(document).ready(function() {
	/* slider */
	
	$('ul#cycle').cycle({
	});
	
	/* menu */
	//$('#menu li').click(function() {
	$('#menu li').mouseover(function() {
		if ($(this).hasClass('option')) {
			$('#menu_pulldown').show();
			$('.submenu').hide();
			$('#menu_' + $(this).attr('id')).show();
		}
		else {
			$('#menu_pulldown').hide();			
		}

	});
	
	/*$('.submenu').mouseover(function() {
		$('#menu_pulldown').show();
		$('#' + $(this).attr('id').replace('menu_','')).addClass('active');
	});*/

	$('.close').click(function() {
		$('#menu_pulldown').hide();
		$('#' + $(this).attr('id').replace('menu_','')).removeClass('active');
	});
	
	/* zoekformulier */
  $('#huur').click(function() {
    $('#prijs_huur').show();
    $('#prijs_koop').hide();
  });

  $('#koop').click(function() {
    $('#prijs_koop').show();
    $('#prijs_huur').hide();
  });

	/* PERSOONLIJKE VOORKEUREN. */
	/*$('#wijk').hide();
	$('#plaats').change(function() {
		$.get('/site/php/ajax_wijken.php', { p: $('#plaats').val()}, function(data){
			if(data!='-|') {
				arrData = data.split ("|");
				var sOption = '<option value="">..</option>';
				for(i=0; i<arrData.length; i++) {
					if (arrData[i] != '') {
				  	sOption += '<option value="' + arrData[i] + '">' + arrData[i] + '</option>';
				  }
				}
				$('#wijk').html(sOption);
				$('#wijk').show();				
			}
			else {
				$('#wijk').hide();
			}
		});
	});*/

	/* FOOTER AUTOPOSITION TO BOTTOM */
	var iHeight = $(window).height();
	var headerHeight = $('#container_header').height() + $('#menu').height() + $('#slider').height();
	var footerHeight = $('#footer_container').height();
    var iContainer = $('#container').height();
    if (iHeight > ( iContainer + footerHeight + headerHeight ) ) {
		$('#container').height( iHeight - footerHeight - headerHeight );
    }
 	
	
});
