function openNewWindow(theURL,winName,features) {   window.open(theURL,winName,features);}function swap(img,src){		document.images[img].src=src;}function submitPrix(action){	document.prix.action=action;	document.prix.submit();}function doSubmit(formName,param){	eval("document."+formName).action=param;	eval("document."+formName).submit();	}function displayDiv(div0,div1){		var field0 = document.getElementById(div0);	var field1 = document.getElementById(div1);			if (field0.style.display==''){field0.style.display='block';}			if (field0.style.display=='block'){		field0.style.visibility='hidden';		field0.style.display='none';		field1.style.visibility='visible';		field1.style.display='block';		return;		}			if (field0.style.display=='none'){		field1.style.visibility='hidden';		field1.style.display='none';		field0.style.visibility='visible';		field0.style.display='block';		return;	}}//****************************************//*******   FONCTIONS GLOSSARY   *********//****************************************function checkThemes(){	with(document.content){		if (txt_themes.value==""){			alert("Please fill the theme field !");			txt_themes.focus();			return false		}	}	return true;}function checkUser(edit){	with(document.content){				if (usern.value==""){			alert("Please fill the username field !");			usern.focus();			return false		}else if (realName.value==""){			alert("Please fill the name field !");			realName.focus();			return false		}else if (company.value==""){			alert("Please fill the company field !");			company.focus();			return false		}else if (email.value==""){			alert("Please fill the email field !");			email.focus();			return false		}else if (elementSelected.value==""){			alert("Please select a source, mini 'General'!");			email.focus();			return false		}else if (pass1.value=="" && edit=='no'){			alert("Please fill the password field !");			pass1.focus();			return false		}else if (pass2.value=="" && edit=='no'){			alert("Please fill the password confirmation field !");			pass2.focus();			return false		}else if (pass1.value!=pass2.value){			alert("Passwords are not similar !");			return false		}	}	return true;}function checkWords(){	with(document.content){		var rP=recordPictures.value;		var pos=rP.indexOf(".jpg", 0);				if (recordFrench.value=="" && recordEnglish.value==""){			alert("Please fill the French or English field!");			recordFrench.focus();			return false		}else if (elementSelected.length<1){			alert("Please select themes in the left list and move it into the right list!");			elementList.focus();			return false		}else if ((rP!="")&&(pos==-1)){			alert("The picture must be a JPEG format!");			recordPictures.focus();			return false		}	}	return true;}function checkAllThemes(){	var i;	var val="";	with(document.content){				for(i=0;i<elementSelected.length;i++){				val=val+elementSelected[i].value+";";			}			themesadded.value=val;	}	}function checkThemesAffectation(way){	with(document.content){				switch(way){			case "add"	:				var no = elementList.selectedIndex;				if (no==-1) {					alert("Please select a theme to add !");					return false				}				break;			case "del" :				var no = elementSelected.selectedIndex;				if (no==-1){ 					alert("Please select a theme to remove !");					return false				}				break;			}	}			return true;}function themeAffectation(way){//fonction abandonnee car non compatible Mozilla	with(document.glossary){				switch(way){			case "add"	:				var no = sel_themes1[sel_themes1.selectedIndex].value;				var nom = sel_themes1[sel_themes1.selectedIndex].text;				var oOption = document.createElement("OPTION");				sel_themes2.options.add(oOption);				oOption.innerText = nom;				oOption.value = no;				sel_themes1.remove(sel_themes1.selectedIndex);				break;			case "del" :				var no = sel_themes2[sel_themes2.selectedIndex].value;				var nom = sel_themes2[sel_themes2.selectedIndex].text;				var oOption = document.createElement("OPTION");				sel_themes1.options.add(oOption);				oOption.innerText = nom;				oOption.value = no;				sel_themes2.remove(sel_themes2.selectedIndex);				break;			}	}			}function controlSearch(nowords){	with(document.glossary){		var bgOn="cccccc";		var bgOff="F3F3F3";				switch(nowords){			case 1	:					findFrench.style.backgroundColor=bgOff;					findEnglish.style.backgroundColor=bgOn;					findJKanji.style.backgroundColor=bgOn;					findChineseSC.style.backgroundColor=bgOn;					findChineseTC.style.backgroundColor=bgOn;					findKorean.style.backgroundColor=bgOn;					findThai.style.backgroundColor=bgOn;					findEnglish.value="";					findJKanji.value="";					findChineseSC.value="";					findChineseTC.value="";					findKorean.value="";					findThai.value="";				break;		  case 2 : 					findFrench.style.backgroundColor=bgOn;					findEnglish.style.backgroundColor=bgOff;					findJKanji.style.backgroundColor=bgOn;					findChineseSC.style.backgroundColor=bgOn;					findChineseTC.style.backgroundColor=bgOn;					findKorean.style.backgroundColor=bgOn;					findThai.style.backgroundColor=bgOn;					findFrench.value="";					findJKanji.value="";					findChineseSC.value="";					findChineseTC.value="";					findKorean.value="";					findThai.value="";				break;			case 3 : 					findFrench.style.backgroundColor=bgOn;					findEnglish.style.backgroundColor=bgOn;					findJKanji.style.backgroundColor=bgOff;					findChineseSC.style.backgroundColor=bgOn;					findChineseTC.style.backgroundColor=bgOn;					findKorean.style.backgroundColor=bgOn;					findThai.style.backgroundColor=bgOn;					findFrench.value="";					findEnglish.value="";					findChineseSC.value="";					findChineseTC.value="";					findKorean.value="";					findThai.value="";				break;			case 4 : 					findFrench.style.backgroundColor=bgOn;					findEnglish.style.backgroundColor=bgOn;					findJKanji.style.backgroundColor=bgOn;					findChineseSC.style.backgroundColor=bgOff;					findChineseTC.style.backgroundColor=bgOn;					findKorean.style.backgroundColor=bgOn;					findThai.style.backgroundColor=bgOn;					findFrench.value="";					findEnglish.value="";					findJKanji.value="";					findChineseTC.value="";					findKorean.value="";					findThai.value="";				break;				case 5 : 					findFrench.style.backgroundColor=bgOn;					findEnglish.style.backgroundColor=bgOn;					findJKanji.style.backgroundColor=bgOn;					findChineseSC.style.backgroundColor=bgOn;					findChineseTC.style.backgroundColor=bgOff;					findKorean.style.backgroundColor=bgOn;					findThai.style.backgroundColor=bgOn;					findFrench.value="";					findEnglish.value="";					findJKanji.value="";					findChineseSC.value="";					findKorean.value="";					findThai.value="";				break;				case 6 : 					findFrench.style.backgroundColor=bgOn;					findEnglish.style.backgroundColor=bgOn;					findJKanji.style.backgroundColor=bgOn;					findChineseSC.style.backgroundColor=bgOn;					findChineseTC.style.backgroundColor=bgOn;					findKorean.style.backgroundColor=bgOff;					findThai.style.backgroundColor=bgOn;					findFrench.value="";					findEnglish.value="";					findJKanji.value="";					findChineseSC.value="";					findChineseTC.value="";					findThai.value="";				break;				case 7 : 					findFrench.style.backgroundColor=bgOn;					findEnglish.style.backgroundColor=bgOn;					findJKanji.style.backgroundColor=bgOn;					findChineseSC.style.backgroundColor=bgOn;					findChineseTC.style.backgroundColor=bgOn;					findKorean.style.backgroundColor=bgOn;					findThai.style.backgroundColor=bgOff;					findFrench.value="";					findEnglish.value="";					findJKanji.value="";					findChineseSC.value="";					findChineseTC.value="";					findKorean.value="";				break;			}				}	}//***************************************//*******     FONCTIONS PKDB    *********//***************************************function controlSearchPKDB(){	document.PKDB.searchQuery.value="";	document.PKDB.searchQuery.style.backgroundColor="#FFFFFF";	}function selectSubject() {	var subjectOiddSelected = document.forms["content"].elements["subjectSelect"].value;	var categoryValue = eval("catValueSub" + subjectOiddSelected);		// This element is an array.	var categoryLabel = eval("catLabelSub" + subjectOiddSelected);		// This element is an array.	// Initialize category select object.	var catListLength = categoryValue.length;	var catSelectObj = document.forms["content"].elements["elementList"];		// Remove all options from select object.	while(catSelectObj.options.length) {		catSelectObj.options[0] = null;	}		// Add new category options for form select object.	for(var i = 0; i < catListLength; i++) {	var newOption = new Option(categoryLabel[i], categoryValue[i], true, true);catSelectObj.options[catSelectObj.length] = newOption;		}}function selectElement() {	var selectedElementObj = document.forms["content"].elementSelected;	var allElementObj = document.forms["content"].elementList;	var elementListLength = allElementObj.length;	for (var index = 0; index < elementListLength; index ++){		if (allElementObj.options[index].selected && !isElementSelected(allElementObj.options[index].value)) {			var newElementSelected = new Option(allElementObj.options[index].text, allElementObj.options[index].value, true, true);      selectedElementObj.options[selectedElementObj.length] = newElementSelected;		}	}	selectedElementObj.selectedIndex = selectedElementObj.length - 1;}function deselectElement() {	var selectedElementObj = document.forms["content"].elementSelected;	var selectedElementLength = selectedElementObj.length;	var elementToRemove = new Array();	for (var index = 0; index < selectedElementLength; index ++){		if (selectedElementObj.options[index].selected)			elementToRemove.push(index);	}	while (elementToRemove.length > 0){		var remover = elementToRemove.pop();		selectedElementObj.options[remover] = null;	}}function isElementSelected(element) {	var selectedElementObj = document.forms["content"].elementSelected;	var selectedElementLength = selectedElementObj.length;	for (var i = 0; i < selectedElementLength; i ++){		if(selectedElementObj.options[i].value == element)			return true;	}	return false;}
