function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function ouvre_popup()
{
	Ville=document.My_form.Ville.value;
	window.location.href = 'Diagnostiqueur-immobilier-' + Ville + '.html'; 
}
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
function verScroll(dir, spd, loop) {

loop = true;

direction = "up";

speed = 50;

scrolltimer = null;

if (document.layers) {

var page = eval(document.contentLayer);

}

else {

if (document.getElementById) {

var page= eval("document.getElementById('contentLayer').style");

}

else {

if (document.all) {

var page = eval(document.all.contentLayer.style);

      }

   }

}

direction = dir;

speed = parseInt(spd);

var y_pos = parseInt(page.top);

if (loop == true) {

if (direction == "dn" && y_pos > - 1800 ) {

page.top = (y_pos - (speed));

} else {

if (direction == "up" && y_pos < 1) {

page.top = (y_pos + (speed));

} else {

if (direction == "top") {

page.top = 50;

      }

   }

}

scrolltimer = setTimeout("verScroll(direction,speed)", 1);

   }

}

//----------------------------------------------

function stopScroll() {

loop = false;

clearTimeout(scrolltimer);

}

/*
$(document).ready(function() {
 $('.slickbox').hide();
 // toggles the slickbox on clicking the noted link
 $('a.slick-toggle').click(function() {
 var $nextDiv = $(this).next();
 var $visibleSiblings = $nextDiv.siblings('div:visible');

 if ($visibleSiblings.length ) {
 $visibleSiblings.slideUp('fast', function() {
 $nextDiv.slideToggle("slow");
 });
 } else {
 $nextDiv.slideToggle("slow");
 }
 });
});
*/
$(document).ready(function() {

 $('.slickbox').hide();

 // toggles the slickbox on clicking the noted link

 $('a.slick-toggle').click(function() {

 var $nextSpan = $(this).next();
 var $visibleSiblings = $nextSpan.siblings('span:visible');

 if ($visibleSiblings.length ) {
 $visibleSiblings.slideUp('fast', function() {
 $nextSpan.slideToggle("slow");
 });
 } else {
 $nextSpan.slideToggle("slow");
 }
 });
 
 $(function() {
	idaslider = function(id)
	{
		$('#'+id).slideToggle("slow");
	}
});
});
