<!--
// JavaScript Document.
// ===================
// © 2004 Monceau-FontaiNES ASBL - http://www.monceau-fontaines.be/
// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/

function KC_ExitFrames(){
	adresse = window.location.href ;
	if (parent.frames.length != 0){
		parent.location.href = adresse ;
	}
}

function KC_AppendToString(strFormName,strVariables) {
// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
//	Return a string corresponding with the GET FORM METHOD without the submit buttons values.
//	strFormName: the name of the form to consider.
//	strVariables: a string with the form field names separated by a comma.
//	ex KC_AppendToString('form1','name,e-mail,address') ; Where "name", "e-mail", "address" are the field names of a form to pass its value to the string.
	if (strVariables != "") {
		if (strVariables.indexOf(",") > -1) {
			passV = strVariables.split(",") ;
			arrV = true ;
		} 
		else {
			passV = strVariables ;
			arrV = false ;
		}
	}
	
	strAdress = window.location.href ;
	strReturn = "" ;
	if (strAdress.indexOf("?") > -1) {
		strPrefix = strAdress.substring(0,strAdress.indexOf("?")) ;
		strAdress = strAdress.substring(strAdress.indexOf("?")+1) ;
		if (strAdress.indexOf("#") > -1) {
			strAnchor = strAdress.substring(strAdress.indexOf("#")+1) ;
			strAdress = strAdress.substring(0,strAdress.indexOf("#")) ;
		}
		else {
			strAnchor = "" ;
		}
	}
	else if (strAdress.indexOf("#") > -1) {
		strPrefix = strAdress.substring(0,strAdress.indexOf("#")) ;
		strAnchor = strAdress.substring(strAdress.indexOf("#")+1) ;
		strAdress = "" ;
	}
	else {
		strPrefix = strAdress ;
		strAdress = "" ;
		strAnchor = "" ;
	}
//	=================================================================
//	1. Prefix.
//	=================================================================
	if (strPrefix != "") {
		strReturn += strPrefix ;
	}
//	=================================================================
//	2. Address.
//	=================================================================
	if (strAdress != "") {
//		I. *** Compare the existing location elements with the passed elements, and change its value.
//		Verify the existing of variables passed in strVariables in the strAdress.
//		Remove it.
		if (strAdress.indexOf("&") > -1) {
			arrAdress = strAdress.split("&") ;
			arrA = true ;
		}
		else {
			arrAdress = strAdress ;
			arrA = false ;
		}
		// After the creation of this array above, we can reinitialize the variable to reuse it.
		strAdress = "" ;
		
//			4 Case studies are possible.
//			*************************************************
// I(1,2).	Case 1 and 2, (arrA && arrV) and (arrA && !arrV).
//			*************************************************
		if (arrA) {
			for (i in arrAdress) {
				// Split the current arrAdress[i] element to find the name of the variable before equal character.
				if (arrAdress[i].indexOf("=") > -1) {
					arrAdressPrim = arrAdress[i].split("=") ;
				}
				else {
					arrAdressPrim[0] = arrAdress[i] ;
				}
				// Check if the current element of arrAdress[i] is present in the passV to can remove it of the list.
				// I(1). Case 1 (arrA && arrV) (true && true).
				if (arrV) {
					for (j in passV) {
						// Check to find it.
						if (arrAdressPrim[0] == passV[j]) {
							found = true ;
							break ;
						}
						else {
							found = false ;
						}
					}
				}
				// I(2). Case 2 (arrA && !arrV) (true && false).
				else {
					// Check to find it.
					if (arrAdressPrim[0] == passV) {
						found = true ;
					}
					else {
						found = false ;
					}
				}
				// Construction of the new state of the strAdress variable.
				if (!found) {
					if (i != 0) {
						strAdress += "&" + arrAdress[i] ;
					}
					else {
						strAdress += arrAdress[i] ;
					}
				}
				else {
					// Get the form field value.
					if (arrV) {
						eval("formfieldvalue = document." + strFormName + "." + passV[j] + ".value ;") ;
					}
					else {
						eval("formfieldvalue = document." + strFormName + "." + passV + ".value ;") ;
					}
					// Pass the form field value.
					if (i != 0) {
						strAdress += "&" + arrAdressPrim[0] + "=" + formfieldvalue ;
					}
					else {
						strAdress += arrAdressPrim[0] + "=" + formfieldvalue ;
					}
				}
			}// Next
		}// End If
		
//			**************************************************
// I(3,4). 	Case 3 and 4, (!arrA && arrV) and (!arrA && !arrV)
//			**************************************************
		else {
			// Split the arrAdress variable to find the name of the variable before equal character.
			if (arrAdress.indexOf("=") > -1) {
				arrAdressPrim = arrAdress.split("=") ;
			}
			else {
				arrAdressPrim[0] = arrAdress ;
			}
			// Check if the current arrAdress variable is present in the passV to can remove it of the list.
			// I(3). Case 3 (!arrA && arrV) (false && true).
			if (arrV) {
				for (j in passV) {
					// Check to find it.
					if (arrAdressPrim[0] == passV[j]) {
						found = true ;
						break ;
					}
					else {
						found = false ;
					}
				}
			}
			// I(4). Case 4 (!arrA && !arrV) (false && false).
			else {
				// Check to find it.
				if (arrAdressPrim[0] == passV) {
					found = true ;
				}
				else {
					found = false ;
				}
			}
			// Construction of the new state of the strAdress variable.
			if (!found) {
				if (i != 0) {
					strAdress += "&" + arrAdress[i] ;
				}
				else {
					strAdress += arrAdress[i] ;
				}
			}
			else {
				// Get the form field value.
				if (arrV) {
					eval("formfieldvalue = document." + strFormName + "." + passV[j] + ".value ;") ;
				}
				else {
					eval("formfieldvalue = document." + strFormName + "." + passV + ".value ;") ;
				}
				// Pass the form field value.
				if (i != 0) {
					strAdress += "&" + arrAdressPrim[0] + "=" + formfieldvalue ;
				}
				else {
					strAdress += arrAdressPrim[0] + "=" + formfieldvalue ;
				}
			}
		}// End Else
		
		strAdressUpdate = strAdress ; 

//		II. *** Compare the New location elements with the passed elements, and Add missing values.
//		Verify the existing of variables passed in strVariables in the strAdress.
//		Add it.
		if (strAdress.indexOf("&") > -1) {
			arrAdress = strAdress.split("&") ;
			arrA = true ;
		}
		else {
			arrAdress = strAdress ;
			arrA = false ;
		}

		// After the creation of this array above, we can reinitialize the variable to reuse it.
		strAdress = "" ;
		
//			4 Case studies are possible.
//			*************************************************
// II(1,2).	Case 1 and 2, (arrV && arrA) and (arrV && !arrA).
//			*************************************************
		if (arrV) {
			for (i in passV) {
				// Get the form field value.
				eval("formfieldvalue = document." + strFormName + "." + passV[i] + ".value ;") ;
				if (arrA) {
					for (j in arrAdress) {
						// Split the current arrAdress[j] element to find the name of the variable before equal character.
						if (arrAdress[j].indexOf("=") > -1) {
							arrAdressPrim = arrAdress[j].split("=") ;
						}
						else {
							arrAdressPrim[0] = arrAdress[j] ;
						}
						if (passV[i] == arrAdressPrim[0]) {
							foundAdress = arrAdress[j] ;
							found = true ;
							break ;
						}
						else {
							found = false ;
						}
					}// Next
					if (!found) {
						// Pass the form field value.
						if (i != 0) {
							strAdress += "&" + passV[i] + "=" + formfieldvalue ;
						}
						else {
							strAdress += passV[i] + "=" + formfieldvalue ;
						}
					}
				}// End If
				else {
					// Split the current arrAdress[j] element to find the name of the variable before equal character.
					if (arrAdress.indexOf("=") > -1) {
						arrAdressPrim = arrAdress.split("=") ;
					}
					else {
						arrAdressPrim[0] = arrAdress ;
					}
					if (passV[i] == arrAdressPrim[0]) {
						foundAdress = arrAdress ;
						found = true ;
					}
					else {
						found = false ;
					}
					if (!found) {
						if (i != 0) {
							strAdress += "&" + passV[i] + "=" + "addValue" + i ;
						}
						else {
							strAdress += passV[i] + "=" + "addValue" + i ;
						}
					}
				}// End If
			}// Next	
		} // End If
//			**************************************************
// II(3,4).	Case 3 and 4, (!arrV && arrA) and (!arrV && !arrA)
//			**************************************************
		else {
				// Get the form field value.
				eval("formfieldvalue = document." + strFormName + "." + passV + ".value ;") ;
				if (arrA) {
					for (j in arrAdress) {
						// Split the current arrAdress[j] element to find the name of the variable before equal character.
						if (arrAdress[j].indexOf("=") > -1) {
							arrAdressPrim = arrAdress[j].split("=") ;
						}
						else {
							arrAdressPrim[0] = arrAdress[j] ;
						}
						if (passV == arrAdressPrim[0]) {
							foundAdress = arrAdress[j] ;
							found = true ;
							break ;
						}
						else {
							found = false ;
						}
					}// Next
					if (!found) {
						if (strAdress != "") {
							strAdress += "&" + passV + "=" + formfieldvalue ;
						}
						else {
							strAdress += passV + "=" + formfieldvalue ;
						}
					}
				}// End If
				else {
					// Split the current arrAdress[j] element to find the name of the variable before equal character.
					if (arrAdress.indexOf("=") > -1) {
						arrAdressPrim = arrAdress.split("=") ;
					}
					else {
						arrAdressPrim[0] = arrAdress ;
					}
					if (passV == arrAdressPrim[0]) {
						foundAdress = arrAdress ;
						found = true ;
					}
					else {
						found = false ;
					}
					if (!found) {
						if (strAdress != "") {
							strAdress += "&" + passV + "=" + formfieldvalue ;
						}
						else {
							strAdress += passV + "=" + formfieldvalue ;
						}
					}
				}// End If
		}// End Else

		
		strAdressAdd = strAdress ;
		strAdress = "" ;
		
		if (strAdressUpdate != ""){
			strAdress += strAdressUpdate ;
		}
		if (strAdressAdd != "") {	
			strAdress += "&" + strAdressAdd ;
		}
		// alert(strAdress) ; // DEVELOPMENT
		
		
		strReturn += "?" + strAdress ;
	} // End If.
//	=================================================================
//	3. Anchor.
//	=================================================================
	if (strAnchor != "") {
		strReturn += "#" + strAnchor ;
	}
	// alert("strAdress: <=>" + strAdress + "<=>\nstrReturn: <=>" + strReturn + "<=>") ; // DEVELOPMENT.
	return strReturn ;
}// End Function.

var kc_PFBEMail = 0 ; // "Session" JavaScript (global variable) for the following function.
function KC_ProductFeedbackEMailing() {
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// Telebuy product catalog.
	// Return explonations texte before send an e-mail about a product.
	// Boolean: true/false.
	boolReturn = false ;
	numTime = 1 ;
	if ( kc_PFBEMail < numTime ) {
		// From /be/Library/switch_language_dernieremodif.js
		kc_langue = prerequis() ;
		texte = "" ;
		switch ( kc_langue ) {
			case "/fr/" :
				texte += "    Pour tous renseignements complémentaires, " ;
				texte += "\n  anomalies découvertes dans ce listing, " ;
				texte += "\n  questions, commentaires à propos d\'un produit, " ;
				texte += "\n  remarques, critiques, suggestions à formuler, etc. :" ;
				texte += "\n  cette boîte vous permet d\'envoyer un courriel." ;
				texte += "\n\n" ;
				texte += "    Vous pouvez aussi nous contacter au numéro de " ;
				texte += "\n  Télé-achat : " ;
				texte += "\n\n" ;
				if ( numTime > 1 ) {
				texte += "    Ce message n\'apparaitra que " + numTime + " fois." ;
				texte += "\n\n" ;
				}
				break ;
			case "/nl/" :
				texte += "    Voor alle verdere inlichtingen," ; 
				texte += "\n  Onjuistheden in deze lijst," ; 
				texte += "\n  Vragen in verband met een produkt, " ; 
				texte += "\n  opmerkingen, voorstellen, kritieken, etc. " ; 
				texte += "\n  dit venster laat u toe een e-mail te versturen." ; 
				texte += "\n\n" ; 
				texte += "    U kan ons eveneens contacteren op het nummer " ; 
				texte += "\n  Tele-aankoop: " ; 
				texte += "\n\n" ;
				if ( numTime > 1 ) {
				texte += "    Deze boodschap zal slechts " + numTime + " maal verschijnen." ; 
				texte += "\n\n" ; 
				}
				break ;
			case "/en/" :
				texte += "    For more informations," ;
				texte += "\n  if you have found problems in this list," ;
				texte += "\n  questions, comments upon a product, " ;
				texte += "\n  remarks, observations, suggestions, etc. : " ;
				texte += "\n  This box allows you to send an e-mail." ;
				texte += "\n\n" ;
				texte += "    Also, you can call us via our phone number " ;
				texte += "\n  Tele Sales : " ;
				texte += "\n\n" ;
				if ( numTime > 1 ) {
				texte += "    This message will just appear " + numTime + " times." ;
				texte += "\n\n" ;
				}
				break ;
			default :
				texte += "This language is not supported." ;
		}
		if (confirm(texte)) {
			boolReturn = true ;
		}
		else {
			boolReturn = false ;
		}
		kc_PFBEMail++ ;
	}
	else {
		boolReturn = true ;
	}
	// Return the stade.
	if ( boolReturn ) {
		return true ;
	} 
	else {
		return false ;
	}
}

function KC_DisplayLowImage(imgName,cW,cH,maxW,maxH){
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// *** Eval the new size of a passed image.
	// imgName : the name of the concerned image
	// cW : The current width of the image
	// cH : The current height of the image
	// maxW : The maximum width desired for the new size of the image
	// maxH : The maximum height desired for the new size of the image
	// ex. <img onClick="KC_DisplayLowImage(this.name,this.width,this.height,150,150)" name="myimage" src="path"></img>

	// This function return a string or "".
	// to be executed, this string must to be used with eval() function, at the end of the document. 
	// for ( each image in document ) {
	// 	strEval += KC_DisplayLowImage(image) ;
	// }
	// if ( strEval != "" ) {
	//  eval(strEval) ;
	// }

	strReturn = "" ;
	
	if ( imgName != "" ) {
		Q = maxW / maxH ;
		q = cW / cH ;
		if ( Q == 1 ) {
			if ( q > 1 ) {
				if ( cW <= maxW ) {
					nW = cW ;
					nH = cH ;
				}
				else {
					nW = maxW ;
					nH = Math.floor((maxW/cW)*cH) ;
				}
			}
			else {
				if ( cH <= maxH ) {
					nW = cW ;
					nH = cH ;
				}
				else {
					nW = Math.floor((maxH/cH)*cW) ;
					nH = maxH
				}
			}
		}
		// Q < 1 and q > 1
		else if ( Q < 1 ) {
			if ( q > 1 ) {
				if ( cW <= maxW ) {
					nW = cW ;
					nH = cH ;
				}
				else {
					nW = maxW ;
					nH = Math.floor((maxW/cW)*cH) ;
				}
			}
			// Q < 1 and q <= 1
			else {
				// Q > q
				if ( Q > q ) {
					if ( cH > maxH ) {
						nW = Math.floor((maxH/cH)*cW) ;
						nH = maxH ;
					}
					else {
						nW = cW ;
						nH = cH ;
					}
				}
				// Q < q
				else if ( Q < q ) {
					if ( cW > maxW ) {
						nW = maxW ;
						nH = Math.floor((maxW/cW)*cH) ;
					}
					else {
						nW = cW ;
						nH = cH ;
					}
				}
				// Q == q
				else {
					if ( cW > maxW ) {
						nW = maxW ;
						nH = maxH ;
					}
					else {
						nW = cW ;
						nH = cH ;
					}
				}
			}
		}
		// Q > 1 and q > 1
		else if ( Q > 1 ) {
			if ( q > 1 ) {
				// Q > q
				if ( Q > q ) {
					if ( cH > maxH ) {
						nW = Math.floor((maxH/cH)*cW) ;
						nH = maxH ;
					}
					else {
						nW = cW ;
						nH = cH ;
					}
				}
				// Q < q
				else if ( Q < q ) {
					if ( cW > maxW ) {
						nW = maxW ;
						nH = Math.floor((maxW/cW)*cH) ;
					}
					else {
						nW = cW ;
						nH = cH ;
					}
				}
				// Q == q
				else {
					if ( cW > maxW ) {
						nW = maxW ;
						nH = maxH ;
					}
					else {
						nW = cW ;
						nH = cH ;
					}
				}
			}
			// Q > 1 and q <= 1
			else {
				if ( cH <= maxH ) {
					nW = cW ;
					nH = cH ;
				}
				else {
					nW = Math.floor((maxH/cH)*cW) ;
					nH = maxH
				}
			}
		}
		strReturn += "window.document." + imgName + ".width = " + nW + " ;" ;
		strReturn += "window.document." + imgName + ".height = " + nH + " ;" ;
	}
	else {
		strReturn += "" ;
	}
	return strReturn ;
}

function KC_MSSQLNum(strNum){
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// Retourne un string représentant un nombre formaté au type numeric de MS-SQL Server
	// J'ai pris l'option de garder soit le dernier point, soit la dernière virgule de la chaîne strNum
	// et de retirer tous les autres caractères, points ou virgule, restants.
	// Return a string is formating in the SQL format numeric.
	// I have take the option to keep the last coma or point of the strNum value
	// and take out each other characters, point or coma.
	// return for a number like 123,456,789.123 the number 123456789.123
	// ex. KC_MSSQLNum(this.value) ;
	if (strNum != "" && strNum.indexOf("undefined") == -1) {
		// On nettoie d'abord le string en en enlevant tous les espaces.
		// Clean up the strNum by take off all spaces.
		if (strNum.indexOf(" ") > -1){  // On vérifie la présence dans strNum.
			newpref = "" ;
			newprefarr = strNum.split(" ") ; // On en enlève toutes les instances de strNum.
			for (ele in newprefarr) {
				newpref += newprefarr[ele] ;
			}
			strNum = newpref ;
		}
		// On cherche, soit le dernier point, soit la dernière virgule.
		// Search the last point or coma and catch it for the suffixe part of the string. 
		if ( strNum.lastIndexOf(",") > -1 ){ poscoma = strNum.lastIndexOf(",") ; } else { poscoma = 0 ; }
		if ( strNum.lastIndexOf(".") > -1 ){ posdot = strNum.lastIndexOf(".") ; } else { posdot = 0 ; }
		if ( poscoma != 0 || posdot != 0) {
			if ( poscoma > posdot ){ rightposition = poscoma; } else { rightposition = posdot ; }
			prefixe = strNum.substring(0,rightposition) ;
			suffixe = strNum.substring(rightposition+1,strNum.length) ;
			if (suffixe == "") { suffixe = "00" ; }
			if (suffixe.length == 1) { suffixe += "0" ; }
		}
		else{
			prefixe = strNum ;
			suffixe = "00" ;
		}
		// Liste des caractères à enlever du préfixe s'ils existent.
		// La barre verticale "|" est élément de séparation.
		// List of the characters to verify the presence in prefixe, and take it off.
		// The character "|" is there to separate
		strCharacter = ",|." ; // coma and point...
		arrChar = strCharacter.split("|") ;
		for ( eachEle in arrChar ) { // Pour chaque caratère...
			if (prefixe.indexOf(arrChar[eachEle]) > -1){  // On vérifie sa présence dans le prefixe.
				newpref = "" ;
				newprefarr = prefixe.split(arrChar[eachEle]) ; // On en enlève toutes ses instances de prefixe.
				for (ele in newprefarr) {
					newpref += newprefarr[ele] ;
				}
				prefixe = newpref ;
			}
		}
		strNum = prefixe + "." + suffixe ;
		return strNum ;
	}
	else {
		return "" ;
	}
}

function KC_AddStringAtPath(strString,strPath,Where){
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// FOR THE FAMOUS /BE !!!
	// Add the string strString at the begining of the path strPath if strBeginEnd aqual to BEGIN
	// Add the string strString at the end of the path strPath if strBeginEnd aqual to END
	// ex. KC_AddStringAtPath("/be",this.value,"BEGIN") ; 
	// Add "/be" at the beginning of "this.value" if not exist yet.
	// Ajoute "/be" au début de "this.value" s'il n'y est pas déjà.
	if (Where.toLowerCase() == "begin" || Where.toLowerCase() == "end") { Where = Where.toLowerCase(); } else { Where = "begin" ; }
	if (strPath != ""){
		if (strString != "") {
			if (Where == "begin") {
				if (strPath.indexOf(strString) == -1 || strPath.indexOf(strString) > 0) {
					strPath = strString + strPath ;
				}
			}
			else if (Where == "end") {
				if (strPath.lastIndexOf(strString) > -1 || strPath.lastIndexOf(strString) < (strPath.length - strstring.length)) {
					strPath = strPath + strString ;
				}
			}
		}
	}	
	return strPath ;
}

function KC_HighLightFormField(strForm,strField,strDisplayed){
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// *** Give the focus to the specified form field, for a log in page for example.
	// strForm : the name of the form
	// strField : the name of the field
	// strDisplayed : the text you want to appears in the field
	if(strForm == ""){strForm = "form1" ;}
	if(strField == ""){strField = "textfield" ;}
	if(strDisplayed == ""){strDisplayed = "user_account" ;}
	cond = "" ;
	cond += "document." + strForm + "." + strField + ".value ;" ;
	cond = eval(cond) ; //alert(cond) ;
	text = "" ;
	if (cond == "") {
		text += "document." + strForm + "." + strField + ".value = \"" + strDisplayed + "\"; " ;
	}
	else {
		text += "document." + strForm + "." + strField + ".value ;" ;
	}
	text += "document." + strForm + "." + strField + ".select() ; " ;
	text += "document." + strForm + "." + strField + ".focus() ; " ;
	eval(text) ;
}

function KC_FilePath_With_EndSlach(strPath) {
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// *** this function control and return a string path with a slach at the begining and the end of it.
	// strName is the name of the current object; ex. this.name strPath is a string path.

	V = "" ; 
	V += strPath ;
	// Devlopment.
	// texte = "V = " + V + "\nV.length = " + V.length + "\nV.indexOf(\"/\") = " + V.indexOf("/") + "\nV.lastIndexOf(\"/\") = " + V.lastIndexOf("/") ;	
	if ( V.length > 0 ) {
		if ( V.indexOf("/") > 0 && V.lastIndexOf("/") != V.length-1 ) {
			FilePath = "\/" + V + "\/" ; 
		}
		if ( V.indexOf("/") == 0 && V.lastIndexOf("/") != V.length-1 ) {
			FilePath = V + "\/" ; 
		}
		if ( V.indexOf("/") > 0 && V.lastIndexOf("/") == V.length-1 ) {
			FilePath = "\/" + V; 
		}
		if ( V.indexOf("/") == 0 && V.lastIndexOf("/") == V.length-1 ) {
			FilePath = V ; 
		}
	}
	else {
		FilePath = "" ;
	}
	// Devlopment.
	// texte += "\nFilePath = " + FilePath + "\n" ;
	// alert(texte) ;
	return FilePath ; // this return is a string.
}


function KC_FilePath_Without_EndSlach(strPath) {
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// *** This function control and return a string path with a slach at the beginning and not at its end.
	// str is a string that indicate the Path to be return.

	V = "" ; 
	V += strPath ;
	// Devlopment.
	// texte = "V = " + V + "\nV.length = " + V.length + "\nV.indexOf(\"/\") = " + V.indexOf("/") + "\nV.lastIndexOf(\"/\") = " + V.lastIndexOf("/") ;	
	if ( V.length > 0 ) {
		if ( V.indexOf("/") > 0 && V.lastIndexOf("/") != V.length-1 ) {
			FilePath = "\/" + V  ; 
		}
		if ( V.indexOf("/") == 0 && V.lastIndexOf("/") != V.length-1 ) {
			FilePath = V  ; 
		}
		if ( V.indexOf("/") > 0 && V.lastIndexOf("/") == V.length-1 ) {
			FilePath = "\/" + V.substring(0, V.length-1) ; 
		}
		if ( V.indexOf("/") == 0 && V.lastIndexOf("/") == V.length-1 ) {
			FilePath = V.substring(0, V.length-1) ; 
		}
	}
	else {
		FilePath = "" ;
	}
	// Devlopment.
	// texte += "\nFilePath = " + FilePath + "\n" ;
	// alert(texte) ;
	return FilePath ; // this return is a string.
}


// © 2004 Chrysalide-graphique --> New version on 25/09/2003.
function KC_TransferPathValue(strFormName,strEleName,strCurrentPath,strFuturePath,intWhere,intChangeOriginal){
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// *** Transfer the content of a form field to another field after transform the current string field.
	// ex. KC_TransferPathValue("form1","/techinfo/document/","",-1, 1);
	// or  KC_TransferPathValue("form1",this.value,KC_FilePath_With_EndSlach(this.value),-1,1);
	// or  KC_TransferPathValue("form1",this.value,KC_AddStringAtPath("/be",this.value,"BEGIN"),-1,1);
	// or  KC_TransferPathValue(this.form.name,options[selectedIndex].value,KC_FilePath_With_EndSlach(options[selectedIndex].value),-1,0);
	fm = ""; elm = "" ; V = "" ; V1 = "" ; V2 = 0 ; V3 = 0 ;
	fm += strFormName ;
	elm += strEleName ;	
	V += strCurrentPath ; // is the original string of the Path.
	V1 += strFuturePath ; // is the New Path to be transfered in the choosed field value of the form.
	V2 += intWhere ; // is an integer value where you want to put the content of strPath; 0 to don't move, -1 change the value of the previous field.
	V3 += intChangeOriginal ;// is an integer specify to change the value of the original field too. 0 or 1 to change it.
	
	eval("nb_element = document." + fm + ".length ;") ;// Nombre total d'elements ds le formulaire partant de zero
	ele_name = new Array() ;
	ele_value = new Array() ; 
	// alert('nb_element = ' + nb_element) ; // Pour les tests.
	for ( i=0; i<nb_element-1; i++ ){
		eval("ele_name[i] = document."+fm+".elements[i].name ;") ; // Lecture et récupération du nom des champs texte
		eval("ele_value[i] = document."+fm+".elements[i].value ;") ; // Lecture et récupération de la valeur des champs texte
		if ( V == ele_value[i] && elm == ele_name[i] ){
			// Assignation des nouvelles valeurs
			if ( V3 != 0 ) {
				eval("document."+fm+".elements[i].value = V1 ;") ;
			}
			eval("document."+fm+".elements[i+V2].value = V1 ;") ;
			break ;
		}
	}
}

// © 2004 Chrysalide-graphique --> Adaptation from function above at 27/05/2004.
function KC_TrStrOptionsValues(strFormName,strSelectName,strJoinChar,intWhere){
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// *** Transfer the content of a form select options array to another field after transform this array with the passed character.
	// ex. KC_TrStrOptionsValues("form1","select1","",-1);
	// or  KC_TrStrOptionsValues(this.form.name,this.name," | ",-1);
	strReturn = "" ;
	fm = ""; elm = "" ; V = "" ; V1 = "" ; V2 = 0 ; V3 = 0 ; chr = "," ;
	fm += strFormName ; // As the form name.
	elm += strSelectName ; // As the form element name.
	if ( strJoinChar != chr && strJoinChar != "" ) {
		chr = strJoinChar ; // The assembling character is a coma "," by default.
	}	
	V2 += intWhere ; // AS an integer value where you want to put the content of strPath; 0 to don't move, -1 change the value of the previous field.
	
	eval("nb_element = document." + fm + ".length ;") ;// Nombre total d'elements ds le formulaire partant de zero
	ele_name = new Array() ;
	ele_value = new Array() ; 
	// alert('nb_element = ' + nb_element) ; // Pour les tests.
	for ( i=0; i<=nb_element; i++ ){
		eval("ele_name[i] = document."+fm+".elements[i].name ;") ; // Lecture et récupération du nom des champs texte
		// strReturn += "ele_name["+i+"] = " + ele_name[i] + "\n" ; // DEV
		if ( elm == ele_name[i] ){
			// ele_options = new Object() ;
			eval("ele_options = new Object(document."+fm+".elements[i].options) ;") ;
			for ( j=0; j<ele_options.length; j++ ) {
				if ( ele_options[j].selected ) {
					if ( strReturn != "" ) {
						strReturn += chr + ele_options[j].value ;
					} 
					else {
						strReturn += ele_options[j].value ;
					}
				}
			}
			// Assignation des nouvelles valeurs
			if ( V2 != 0 ) {
				eval("document."+fm+".elements[i+V2].value = strReturn ;") ;
			}
			break ; // exit for
		}
	}
	// alert(strReturn) ; // DEV
}


function KC_WindowOpen(strWinUrl,strWinName,valLeft,valTop,valWidth,valHeight){
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// *** This function open a window at x=20 px, y=20 px, width=300 px, height=150 px by default when you type :
	// KC_WindowOpen("a stringURL","a stringName","","","","") ;
	// KC_WindowOpen("a stringURL","a stringName",20,20,300,150) ;
	if (valLeft == "") {valLeft = 20;}
	if (valTop == "") {valTop = 20;}
	if (valWidth == "") {valWidth = 300;}
	if (valHeight == "") {valHeight = 150;}
	kc_window = window.open(strWinUrl, strWinName, "left="+valLeft+", top="+valTop+", screenX="+valLeft+", screenY="+valTop+", width="+valWidth+", height="+valHeight+", scrollbars=yes, status=no, toolbar=no, location=no, menubar=no, resizable=yes, titlebar=no, alwaysRaised=yes, dependent=yes") ;
	kc_window.focus() ;
	if ( strWinName.indexOf("popup") > -1 ) {
		kc_window.opener.focus() ;
	}
}

function KC_CountCharacter(strValue, intValue) {
	// © 2004 Chrysalide-graphique http://www.chrysalide-graphique.com/
	// *** Limit the number of characters in a textarea input form type.
	// strValue : capt the string of characters
	// intValue : the limit of the character number.
	// ex. KC_CountCharacter(this.value, intValue) ;
	if (strValue.length > intValue-1) {
		return false ;
	}
	else{
		return true ;
	}
}
// ==========================
// End of JavaScript Document.
//-->
