function montrer(idDiv) {
	var div = document.getElementById(idDiv);
	if(div)
	{
			div.style.display = 'block';		
	}
}
function cacher(idDiv) {
	var div = document.getElementById(idDiv);
	if(div)
	{
			div.style.display = 'none';		
	}
}
function hover(idDiv) {
	var titre = document.getElementById(idDiv);
	if(titre)
	{
		titre.className = 'hover';		
	}
}
function nohover(idDiv) {
	var titre = document.getElementById(idDiv);
	if(titre)
	{
		titre.className = '';		
	}
}


function create_input(type,name,value) {
	nouvelInput = document.createElement("input");
	nouvelInput.name = name;
	nouvelInput.type = type;
	if(value)
		nouvelInput.value = value;
		
	return nouvelInput;
}

function create_option (value,texte) {
		new_option = document.createElement("option");
		new_option.setAttribute("value", value);
		new_option.innerHTML = texte;

		return new_option;
}

function create_select(name,className,listeOptions) {
	nouveauSelect = document.createElement("select");

	for (var i in listeOptions) {
		new_option = create_option(i,listeOptions[i]);
		nouveauSelect.appendChild(new_option);
	}
	nouveauSelect.name = name;
	nouveauSelect.className = className;
	return nouveauSelect;
}

function addCh(label,listeOptions,listCotes) {

	var nouvelleDiv = document.createElement("div");
	nouvelleDiv.className = 'champ_form';
	
	var nouveauP = document.createElement("p");
	nouveauP.className = 'label';
	var texte_label = document.createTextNode(label);
	
	var nouveauP2 = document.createElement("p");
	var nouveauSelect = create_select('chambres[]','larg_2t',listeOptions);
	var nouveauSelectCotes = create_select('cotes_mer[]','larg_1t',listCotes);
	
	// on crée les noeuds
		nouvelleDiv.appendChild(nouveauP);
			nouveauP.appendChild(texte_label);
		nouvelleDiv.appendChild(nouveauP2);
			nouveauP2.appendChild(nouveauSelect);
		nouvelleDiv.appendChild(nouveauP2);
			nouveauP2.appendChild(nouveauSelectCotes);

	document.getElementById("bla").insertBefore(nouvelleDiv, document.getElementById("chambre_src"));
}
// pour un flash en background
function RunFooBack(swf,largeur, hauteur, couleur, nom) {
	document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('WIDTH="'+largeur+'" HEIGHT="'+hauteur+'"');
	document.write('CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0">');
	document.write('<PARAM NAME="MOVIE" VALUE="'+swf+'">');
	document.write('<PARAM NAME="PLAY" VALUE="true">');
	document.write('<PARAM NAME="LOOP" VALUE="true">');
	document.write('<PARAM NAME="WMODE" VALUE="opaque">');
	document.write('<PARAM NAME="QUALITY" VALUE="high">');
	document.write('<EMBED SRC="'+swf+'" WIDTH="'+largeur+'" HEIGHT="'+hauteur+'" PLAY="true" LOOP="true" WMODE="opaque" QUALITY="high"');
	document.write('PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
	document.write('</EMBED>');
	document.write('</OBJECT>');
}