//variable pour l'effacement du texte dans le moteur de recherche
var erased_annuaire = false;
var erased_annuaire1 = false;
var erased_annuaire2 = false;
var erased_annuaire3 = false;
var erased_annuaire4 = false;
var erased_annuaire5 = false;
var erased_annuaire6 = false;
var erased_annuaire7 = false;
//on enleve les erreurs eventuelles
function no_error()
{ return true; }
window.onerror = no_error;

function open_popup(page,hauteur,largeur)
//ouvre une popup
{ window.open(page,"Popup","status=no,scrollbars=yes,resizable=no,height="+hauteur+",width="+largeur+",top=0,left=0"); }

function confirm_delete(page, texte)
//demande une confirmation avant de supprimer un site ou une categorie
{
	confirmation = confirm('Etes vous sur de vouloir supprimer '+texte+' ? ');
	if(confirmation)
		window.location.replace(page);
}
function aide(page, texte)
//aide
{
	confirmation = alert(''+texte+'  ');
	if(confirmation)
		window.location.replace(page);
}
function message_annu_status(message)
//affiche un texte dans la barre de statut du navigateur
{ window.status = message; }

function check_id_cat()
//verifie si on a bien selectionner une categorie dans la liste deroulante
{
	if (document.form2submit.id_cat.value == 0)
	{
		alert('Veuillez sélectionner une catégorie !');
		return false;
	}
	else
	{ return true; }
}

function open_ext_link()
{
	var liens = document.getElementsByTagName('a');
	for (var i = 0 ; i < liens.length ; ++i)  {
		if (liens[i].className == 'lien_ext')  {
			liens[i].title = 'S\'ouvre dans une nouvelle fenetre';
			liens[i].onclick = function()  {
				window.open(this.href);
				return false; 
			};
		}
	}
}
window.onload = open_ext_link;


//------------------------------------------------------------------------------
function addEngine(name,ext,cat,pid)
{
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
    window.sidebar.addSearchEngine(
      "http://mycroft.mozdev.org/installos.php/" + pid + "/" + name + ".xml",
      "http://mycroft.mozdev.org/installos.php/" + pid + "/" + name + "."+ ext, name, cat );
  } else {
    alert("You will need a browser which supports Sherlock to install this plugin.");
  }
}
//------------------------------------------------------------------------------

function addOpenSearch(name,ext,cat,pid,meth)
{
  if ((typeof window.external == "object") && ((typeof window.external.AddSearchProvider == "unknown") || (typeof window.external.AddSearchProvider == "function"))) {
    if ((typeof window.external.AddSearchProvider == "unknown") && meth == "p") {
      alert("This plugin uses POST which is not currently supported by Internet Explorer's implementation of OpenSearch.");
    } else {
      window.external.AddSearchProvider(
        "http://mycroft.mozdev.org/installos.php/" + pid + "/" + name + ".xml");
    }
  } else {
    alert("You will need a browser which supports OpenSearch to install this plugin.");
  }
}
	
	
function chrono()
{ 
	if (document.getElementById)
	{
		dix--; 
		if (dix < 0) {dix=9;sc--}
		if (sc < 0) {sc=59;mn--}
		time=mn+" mn "+sc+" s "+dix;

			document.getElementById("comptarebour").innerHTML=time;
			if (mn==5&sc==0&dix==0)
			{alert('Le temps imparti est terminé !')}
			if (mn==1&sc==0&dix==0)
			{alert('Le temps imparti est terminé 1!')}
			decompte= setTimeout('chrono()', 100);
	}
		
	
			
}

	function clk_resa(id)
	{
		(new Image()).src="../hotel/goto_logis.php?id="+id;
		return true;
	}


function simplePreload()

{ 

  var args = simplePreload.arguments;

  document.imageArray = new Array(args.length);

  for(var i=0; i<args.length; i++)

  {

    document.imageArray[i] = new Image;

    document.imageArray[i].src = args[i];

  }

}
