var url = document.location.href.split("?");
if(url.length>1)
{
	var getandanchor = url[1];
	var get = (getandanchor.indexOf('#')>0)?getandanchor.substring(0,getandanchor.indexOf('#')):getandanchor;
}


function goToGet(rxp,val)
{
	var v = val.split('=');
	if(get.indexOf(v[0]+'=')>=0)
	{
		var regExp = new RegExp(rxp,"g");
		document.location.href = "?" + get.replace(regExp,val);
	}
	else
	{
		document.location.href = "?" + get + '&' + val;
	}
}


function in_array(value,array)
{
	var o = 0;
	var output = new Array();
	for(i=0; i<(array.length); i++)
	{
		if(value == array[i])
		{
			output[o] = i;
			o++;
		}
	}
	return output;
}

function confirmThis(action,destination)
{
	if(confirm("Etes-vous certain(e) de vouloir "+action+" cet élément ?"))
	{
		location.href = destination;
	}
}

/*var nbSearch=0;

function findInPage(str)
{
var txt, i, found;
if ((str=="")||(str=="...")) return false;

if((document.layers)||(window.sidebar))
{
if(!window.find(str))
{
	alert("Fin de page atteinte.\n"+'"'+str+'" trouvé '+nbSearch+" fois.");
	while(window.find(str, false, true)){nbSearch++;}
} 
else
	nbSearch++;
	if(nbSearch == 0)
		alert('"'+str+'" est introuvable');
	}

  if(document.all){
	txt = window.document.body.createTextRange();
	for(i = 0; i <= nbSearch && (found = txt.findText(str)) != false; i++){
	  txt.moveStart("character", 1);
	  txt.moveEnd("textedit");
	}
	if(found){
	  txt.moveStart("character", -1);
	  txt.findText(str);
	  txt.select();
	  txt.scrollIntoView(true);
	  nbSearch++;
	}else{
	  if(nbSearch > 0){
		  alert("Fin de page atteinte.\n"+'"'+str+'" trouvé '+nbSearch+" fois.");

		nbSearch = 0;
		findInPage(str);
	  }else{ 
		alert('"'+str+'" est introuvable');
	  }
	}
  }

  return false;
}*/

var nbSearch=0;
function findInPage(str)
{
	var txt, i, found;
	if ((str=="")||(str=="...")) return false;

	if((document.layers)||(window.sidebar))
	{
		if(!window.find(str))
		{
			alert("Fin de page atteinte.\n"+'"'+str+'" trouvé '+nbSearch+" fois.");
			while(window.find(str, false, true)){nbSearch++;}
		}
	}
	else
	{
		nbSearch++;
		if(nbSearch == 0)
		alert('"'+str+'" est introuvable');
	}

	if(document.all)
	{
		txt = window.document.body.createTextRange();
		
		for(i = 0; i <= nbSearch && (found = txt.findText(str)) != false; i++)
		{
			txt.moveStart("character", 1);
			txt.moveEnd("textedit");
		}
		
		if(found)
		{
			txt.moveStart("character", -1);
			txt.findText(str);
			txt.select();
			txt.scrollIntoView(true);
			nbSearch++;
		}
		else
		{
			if(nbSearch > 0)
			{
				alert("Fin de page atteinte.\n"+'"'+str+'" trouvé '+nbSearch+" fois.");

				nbSearch = 0;
				findInPage(str);
			}
			else
			{ 
				alert('"'+str+'" est introuvable');
			}
		}
	}

	return false;
}

