/** recherche * */
function lancerRecherche() {
	document.forms[0].submit();
}

function setBienCount($val) {
	$('#biensCount').html($val);
}

$(document).ready(function() {
	$('#boutonRechercheHint').hide();
	// $("#boutonRechercheHint").fadeTo("fast", 0);
		$('#blocRecherche select').change(
				function() {

					$('#biensCount').load(
							$(this).parents('form').attr('action'),
							formValues(), function() {
								$('#boutonRechercheHint').show();
								$('#boutonRechercheHint').fadeTo("slow", 0.1);
								$('#boutonRechercheHint').fadeTo("fast", 1.0);
							});

				});
	});

function formValues() {
	return {
		'recherche[ville]' : $('#recherche_ville').val(),
		'recherche[type]' : $('#recherche_type').val(),
		'recherche[surface]' : $('#recherche_surface').val(),
		'recherche[pieces]' : $('#recherche_pieces').val(),
		'recherche[budgetMin]' : $('#recherche_budgetMin').val(),
		'recherche[budgetMax]' : $('#recherche_budgetMax').val()
	};
}

$(document).ready(function() {
	var xy = YAHOO.util.Dom.getXY('fak');
	YAHOO.util.Dom.setXY('resumeRecherche', xy);
	if (showresume && resumeRecherche) {
		$('#resumeRecherche').removeClass("cache");
	}
});

var swfs = Array('praedia.swf','kariba-bandeau.swf','kphoto-bandeau.swf','etude.swf');
var bgcolors =Array('#ffffff','#ffffff','#000000','#81725e');
var urls =Array('http://www.praedia-office.com','http://www.kariba-productions.com','http://www.karibaphotos.com','http://www.etude-vidal.com');

var index= Math.floor(Math.random() * 4);

//alert(index);

 function initSwfObject() {
	 var flashvars = {};
	 flashvars.url1=urls[index];
	 var params = {};
     params.menu = "false";
     params.quality = "high";
     params.bgcolor=bgcolors[index];
     
     
     var attributes = {};
     attributes.id = "myDynamicContent";
     attributes.name = "myDynamicContent";
     attributes.bgcolor=bgcolors[index];
     
     var container = YAHOO.util.Dom.get('banniereContainer');
     swfobject.embedSWF(swfs[index], 'banniereContainer', container.offsetWidth, container.offsetHeight+1, "9.0.0", "expressInstall.swf", flashvars, params, attributes);

}
// $(document).ready(initSwfObject);

