$(document).ready(function(){
	if (top.location != location) {
		top.location.href = document.location.href;
	}
	$(".menu-more").hover(function(){
		var height = 0;
		$(this).children(".submenu").slideToggle("normal",function(){
			// ie6-7 fix :)
			height = $(this).height();
			$(this).parent(".menu-more").height(height);
		});
	},function(){
		$(this).children(".submenu").slideToggle();
		$(this).height(35);
	});
	$('#slide-images').innerfade({
		speed: 'slow',
		timeout: 9000,
		type: 'sequence',
		containerheight: '329px'
	});
	$(".offer_a").fancybox({
		'titleShow'     : false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'easingOut'     : 'easeInBack'
	});
	$(".metro").fancybox({
		"titlePosition" : 'over'
	});
	
	$("#offer_form_data").bind("submit", function() {
	
	$.fancybox.showActivity();

	$.ajax({
		type		: "POST",
		cache	: false,
		url		: "/offer.php",
		data	: $(this).serializeArray(),
		success: function(data) {
			$.fancybox(data);
		}
	});
	
	return false;
	});
	
	$("#flats-filter-rooms").change(function(){
		var str = $("#flats-filter-rooms :selected").html();
		$("#flats-filter-type :contains('"+str+"')").attr("selected", "selected");
	});
});
