
/*************************************/
/* Fonctions JavaScript : forum-immo */
/*************************************/

/*****************************************/
/* Afficher alternativement des éléments */
/*****************************************/

function setMenu(type,num,total)
{
 	for (i=1; i<=total; i++)
    {
        if (i == num)
		{
		 	if (type==1)
		 	{
		 		document.getElementById('menu' + i + '-parent').className = "on";
		 		document.getElementById('menu' + i).style.display = "";
		 	}
		 	else if (type==0)
		 	{
		 	 	document.getElementById('menu' + i + '-parent').className = "off";
		 		document.getElementById('menu'+ i).style.display = "none";
		 	}
		}
        else
		{
	 		document.getElementById('menu' + i + '-parent').className = "off";
	 		document.getElementById('menu' + i).style.display = "none";
		}
    }
}


/********************************/
/* Afficher/Cacher des éléments */
/********************************/

function showHide(id)
{
	visibilite = (document.getElementById(id).style.display == 'block') ? 'none' : 'block';
	document.getElementById(id).style.display = visibilite;
}


/************************************/
/* Génère une animation Flash (SWF) */
/************************************/

function displaySWF(name,src,width,height,flashvars)
{
 	if (name=='') {name = 'animation';}
	var html = '';
	html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + width + '" height="' + height + '" id="' + name + '" align="">';
	html += '<param name="movie" value="' + src + '" />';
	html += '<param name="quality" value="best" />';
	html += '<param name="bgcolor" value="#ffffff" />';
	if (flashvars!='') {html += '<param name="flashvars" value="' + flashvars + '" />';}
	html += '<embed src="' + src + '" quality="best" bgcolor="#ffffff" width="' + width + '" height="' + height + '" name="' + name + '" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
	html += '</object>';
	document.write(html);
}