/*============================================================================================
 Fichier Javascript
 Fichier contenant divers Fonction de manipulation de style html

 AUTEUR:					Alban BALLIEUX
 CREATION:					20/02/2009
 VARIABLE GLOBALES:
 MODIFICATIONS:
===============================================================================================
	copyright 2009 Alban BALLIEUX - ballieuxa@laon.noirot
	http://www.phpmyportal.info

	This file is part of phpMyPortal.

    phpMyPortal is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 2.1 of the License, or
    any later version.

    phpMyPortal is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with phpMyPortal; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
===============================================================================================*/
/**
 * Grise ou degrise automatiquement un champ
 * 
 * 
 * @param {Object} Id			Pointeur sur l'identifiant ou nom du champ
 * @param {Object} Val			si vide la fonction est en automatique sinon je force la valeur
 */
function autogrise(Id,Val){
	Id = GetPtId(Id);
	if (Id != false){
		if (isset(Val) && isBool(Val)){
			Id.disabled = Val;
		}else{
			Id.disabled=!Id.disabled;
		}
	}
}

/**
 * Changement de l'opacité
 * Compatible IE/W3c
 * 
 * @param {Object} id			Identifiant de la zone a rendre transparente 
 * @param {Object} opacity		Pourcentage d'opacité
 */	
function ChangeOpac(id,opacity) {
	var object = GetPtId(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}
