nav = navigator.appName.substring(0,3);
ver = navigator.appVersion.substring(0,1)
function addFav()
	{
	if (nav == "Mic" && ver >= 4)
		{
		url_site="http://www.portesdux.com";
		titre_site = "Les portes du x";
		document.write('<A HREF="#" onClick="window.external.AddFavorite(url_site, titre_site);return(false);" class="lien5" onMouseOver="window.status=\'Portes du x en favoris\';return(true);" onMouseOut="return(true);">Portesdux en favoris</A>')
		}
	else
		{
		document.write('Favoris Ctrl + D')
		}
	}

function AfficheHomePage()
	{
	if (document.all && document.getElementById)
		{
		document.write('<A HREF="#" onClick="HomePage(this);return(false);" class="lien5"  onMouseOver="window.status=\'Portes du x en page accueil\';return(true);" onMouseOut="return(true);">Portesdux en page accueil</A>');
		}
	}
function HomePage(obj)
	{
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage('http://www.portesdux.com');
	}

function copy2Clipboard(obj)
	{
  	var textRange = document.body.createTextRange();
  	textRange.moveToElementText(obj);
  	textRange.execCommand("Copy");
	}

function VerifSearch() {

     valid=true;

     if (valid)
     if(search.mots.value == "") {
       alert("La recherche ne peu etre vide");
       document.search.mots.focus();
       valid=false;
     }

     if (valid) document.search.submit();

}

function popupcentree(page,largeur,hauteur,options)
{
var top=(screen.height-hauteur)/2;
var left=(screen.width-largeur)/2;
window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function VerifChat() {

     valid=true;

     if (valid)
     if(chat.nick.value == "") {
       alert("Vous devez entrer un pseudo");
       document.chat.nick.focus();
       valid=false;
     }

     if (valid) document.chat.submit();

}

//variable pour l'effacement du texte dans le moteur de recherche
var erased_annu = 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 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; }
}

window.defaultStatus='Les portes du x - Votre annuaire du sexe';
