/*****************************************************************************
'*                                                                           *
'* Fichier     : scripts/libNote.js                                          *
'* Application : Portail                                                     *
'* Société     : DoubleTrade                                                 *
'* Copyright   : (c) 2007 DoubleTrade                                        *
'* Auteur      : Eric Bonnot                                                 *
'* Créé le     : 14 mars 2006                                                *
'* Date Modif  : Raison Modif                                                *
'*                                                                           *
'* Description :                                                             *
'* Ce fichier javascript rajout des méthodes pour gerer les notes.           *
'*                                                                           *
'****************************************************************************/

function showNote(psId) {
	var eNote = document.getElementById(psId);
	
	if (eNote != null) {
		eNote.style.display = "block";
	}
}

function hideNote(psId) {
	var eNote = document.getElementById(psId);
	
	if (eNote != null) {
		eNote.style.display = "none";
	}
}

function switchNote(psId) {
	var eNote = document.getElementById(psId);
	
	if (eNote != null) {
		if (eNote.style.display == "none")
			eNote.style.display = "block";
		else
			eNote.style.display = "none";
	}
}

function setNoteHeight(psId, piValue) {
	var eNote = document.getElementById(psId);
	
	if (eNote != null) {
		eNote.style.height = piValue + "px";
	}
}

function setNoteWidth(psId, piValue) {
	var eNote = document.getElementById(psId);
	
	if (eNote != null) {
		eNote.style.width = piValue + "px";
	}
}

function GetNoteElement(psId) {
	var eNote = document.getElementById(psId);
	var eBody = document.getElementsByTagName("body")[0];
	
	if (eNote == null && eBody != null) {
		eNote = document.createElement("div");
		eNote.id = psId;
		eNote.className = "note";
		eNote.style.whiteSpace = "nowrap";
		eNote.style.width = "auto";
		eNote.style.height = "auto";
		eBody.appendChild(eNote);
	}
	
	return eNote;
}
