$.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

$.innerWidth = function() {
	return this.get(0) == window || this.get(0) == document ?
		this.width() :
		this.get(0).offsetWidth - parseInt(this.css("borderLeft") || 0) - parseInt(this.css("borderRight") || 0);
}; 

$(document).ready(function(){
	$('#header div').click(function(){
		location = '/';
	});
	
	$('#properties').serialScroll({
		items: 'td', prev: '#prev', next: '#next', axis: 'x', step: 5, offset: 0, start: 0, duration: 1200, force: true, stop: true, lock: false, cycle: false, easing:'easeOutQuart', jump: false
	});

	$('#properties td').bind("click", function(){
		var id = $(this).attr("id").substring($(this).attr("id").indexOf("_") + 1);

		window.open("/property/" + id, 'info', 'width=640,height=480,scrollbars=yes,toolbar=yes');
		//window.open('?page=info&file=' + id,'info'+ $(this).attr("id").replace('-', '') ,'width=640,height=480,scrollbars=yes,toolbar=yes');

		return false;
	});

	$('#properties td').bind("mouseout", function(){
		$(this).css({"background-color":"#ffffff"});
	});

	$('#properties td').bind("mouseover", function(){
		$(this).css({"background-color":"#a7b739"});
	});
});

