function IndexationValidator(myform) {
	if (myform) {
		url = myform.action;
		nbrFormElements = myform.elements.length;
		lastCriteria = false;
		i = 1;
		request = "";
		
		if (myform.hiddenCriteria.value) {
			hiddenCriteria = myform.hiddenCriteria.value;
		}
		else {
			hiddenCriteria = "";
		}
		
		while (i<nbrFormElements && !lastCriteria) {
			mycriteria = eval("myform.critere"+i);
			myoperator = eval("myform.operateur"+i);
			myvalue = eval("myform.valeur"+i);
			if (mycriteria) {
				request += mycriteria.value+"/";
				if (myoperator) request += myoperator.value;
				request += "/";
				if (myvalue) {
					if (myvalue.options) {
						request += myvalue.options[myvalue.selectedIndex].value;
					}
					else request += myvalue.value;
				}
				request += "/"
				i++;
			}
			else lastCriteria = true;
		}
		
		window.location = url+"?request="+hiddenCriteria+request;
		//alert(url+"?request="+request);
		
	}
}

function writeShowListContentNav(page,nbrElementPage,nbrElementSelect,request,url,previews,next) {
	strHtml = "";
	if (page > 0 && nbrElementPage > 0 && nbrElementSelect > 0) {
		maxipage = Math.ceil(nbrElementSelect/nbrElementPage);
		if (maxipage > 1) {
			strHtml += '<table cellpadding="0" cellspacing="0" width="100%" border="0">';
			strHtml += '<tr><td align="right" class="indexationNavigation">';
			if (page != 1) {
				strHtml += '<a href ="'+url+'?request='+request+'&page='+(parseInt(page)-1)+'" alt="previous page"><img src="/images/front/commun/fl_calendar_gauche.gif" border="0" width="12" height="9" vspace="0" hspace="2" alt="'+previews+'"/></a> ';
			}
			for(i=1;i<=maxipage;i++) {
				if (i > 1) strHtml += "| ";
				if (i == page) strHtml += i+" ";
				else strHtml += '<a href ="'+url+'?request='+request+'&page='+i+'" class="indexationNavigation">'+i+'</a> ';
			}
			if (page != maxipage) {
				strHtml += '<a href ="'+url+'?request='+request+'&page='+(parseInt(page)+1)+'" alt="next page"><img src="/images/front/commun/fl_calendar_droit.gif" border="0" width="12" height="9" vspace="0" hspace="2" alt="'+next+'"/></a> ';
			}
			strHtml += '</td></tr>';
			strHtml += '</table>';
		}
	}
	document.write(strHtml);
}

function redirection(myselect,redirect) {
	choix = myselect.options[myselect.selectedIndex].value;
	if (choix) {
		if (choix.indexOf("http://")==-1)
		{
			if (choix.indexOf("popup_")==-1) 
			{
				if (redirect != null && redirect.length > 0) {
					top.location = redirect+"?nextpage="+choix;
				}
				else {
					top.location = choix;
				}
			}
			else 
			{
				choix=choix.substring(6,choix.length);
				//alert("choix="+choix);
				//newwin(choix,461,500);			
				//awin = window.open(choix,'popupcountry','resizable=yes,scrollbars=yes,toolbar=no,width=478,height=500');
				//awin.focus();
				document.location = choix;
			}
		}
		else
		{
			window.open (choix, "");
		}
	}
	else {
		myselect.options[0].selected=true;
	}
}

function writeIndexationChoice(_request) {
	strHtml = "";
	if (_request && _request.length > 0) {
		if (document.forms.length > 0) {
			trouve = false;
			i = 0;
			while (!trouve && i < document.forms.length) {
				if (document.forms[i].name.indexOf("critereForm") == 0) {
					//trouve = true;
					j=1;
					lastCriteria = false;
					myform = document.forms[i];
					while (j<=myform.length && !lastCriteria) {
						mycriteria = eval("myform.critere"+j);
						myoperator = eval("myform.operateur"+j);
						myvalue = eval("myform.valeur"+j);
						if (mycriteria) {
							critrequest = mycriteria.value+"/"+myoperator.value+"/";
							position = _request.indexOf(critrequest);
							if (position >= 0) {
								critval = (_request.substring(position+critrequest.length)).substring(0,(_request.substring(position+critrequest.length)).indexOf("/"));
								if (myvalue.options) {
									for(k=0;k<myvalue.options.length;k++) {
										if (myvalue.options[k].value == critval) {
											if (strHtml.length > 0 && critval && critval.length > 0) strHtml += '- ';
											//else strHtml += '<span class="libraryHeaderText">found for&nbsp;</span>';
											else strHtml += '&nbsp;';
											if (critval && critval.length > 0) strHtml += myvalue.options[k].text+' ';
										}
									}
								}
							}
						}
						else lastCriteria = true;
						j++;
					}
				}
				i++;
			}
		}
	}
	if (strHtml.length == 0) strHtml += '&nbsp;';
	document.write(strHtml);
}