Cufon.replace('h1,h2,#title,#content-text,h3,h4,.home-icon,#search-container');
Cufon.replace('#container-menu ul li a.firstniv', { hover: true });

function onBefore() { 
	$("[id^='desc-']").fadeOut('slow');
	$("#desc-" + this.title).fadeIn('slow');
}

$(document).ready(function() {

	$('#s5').cycle({ 
		fx:     'fade', 
		next:   '#next2', 
		prev:   '#prev2',
		before:   onBefore
	});
	
	$('input[type=text]').clearOnFocus();
	$("[id^='desc-photo-']").css('display','none');
	
	$('.object-image-link').each(function(){
		this.href = 'lightbox/realworksimage.jpg?imageurl='+this.href.replace(/\&/g,'::and::').replace(/\?/g,'::question::');
	});
	
	$('.object-image-link').colorbox({
		maxWidth: '90%',
		maxHeight: '90%'
	});
	
	$('table.housing tr').each(function(){
		this.onclick = function(){
			var link = this.getElementsByTagName('a')
			window.location = link[0].href;
		}
	});
	
	$('.morebutton').click(function(){
		$('.object-image-container').show();
		$('.morebutton').hide();
	});
	
	$('#search-container input').change(function(){
		var value = $(this).attr('value');
		if( value == 'huur' ){
			$('.biginput').animate({ opacity: 0}, 150);
		} else {
			$('.biginput').animate({ opacity: 1}, 150);
		}
	});
	
});
