﻿function CreateFlash(id, chemin, width, height, vars){
    //id : id de l'element dans lequel on va ecrire le flash
    var d = document.getElementById(id);
    var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '">' +
    '<param name="movie" value="' + chemin + '" />' +
    '<param name="quality" value="high" />' +
    '<param name="wmode" value="transparent" />' +
    '<param name="flashvars" value="' + vars + '">' +
    '<embed src="' + chemin + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="' + vars + '" width="' + width + '" height="' + height + '"></embed></object>'
	d.innerHTML = flash

}


// onglets fiche entreprise

var rubActive = 0

window.onload = function () {	
  if (typeof(Transmettre_init) == 'function') { Transmettre_init(); }
  if ($("onglets")) {
    InitOnglets();
  }
}

function InitOnglets() {
  for(i = 0; i < 5; i++) {
    var obj = _getTag("a")[i];
		obj.onclick =  changeOngFiche;
		obj.monIndex = i;
  }	
}

function _getTag(balise) {
	return $("onglets").getElementsByTagName(balise);
}


function changeOngFiche() {		
	_getTag("a")[rubActive].style.backgroundImage = "url('../images/onglet-gris.gif')"	;
	_getTag("a")[rubActive].style.color = "#ffffff"	;
	$('onglet' + rubActive).hide();
	rubActive =	this.monIndex	;	
	this.style.backgroundImage = "url('../images/onglet-bleu.gif')";	
	this.style.color = "#1a4b67";

	$('onglet' + rubActive).show();
}

