function banned(idBanned) {
	var bool = false;
	var i = 0;
	
	while ((bool == false) && (i < bannis.length)) {
		if (bannis[i].idSite == ring[idBanned].idSite) {
			bool = true;
		} else {
			i++;
		}
	}
	
	return bool;
}

function prec() {
	var val = ID;
	var OK = false;
	
	while (OK == false) {
		if (val != 1)
			val--;
		else
			val = ring.length;
		if (banned(val-1) == false)
			OK = true;
	}
	open(ring[val-1].lien);
}

function suiv() {
	var val = ID;
	var OK = false
	
	while (OK == false) {
		if (val < ring.length)
			val++;
		else
			val = 1;
		if (banned(val-1) == false)
			OK = true;
	}
	open(ring[val-1].lien);
}

function liste() {
	var i, toto = "";
	toto += "<html><head><title>La liste des sites de la WebRing du char à voile</title></head>";
	toto += "<body bgcolor=#FFD7AA text=navy link=firebrick alink=firebrick vlink=firebrick><table border=1 cellpadding=10 cellspacing=0 width=100%>";
	for (i=0; i<ring.length; i++) {
		if (banned(i) == false) {
			toto += "<tr><td><div style='font-size:12pt;'>";
			toto += ring[i].titre + " : <a href=" + ring[i].lien + " target=_blank>" + ring[i].lien + "</a><br>" + ring[i].desc;
			toto += "</div></td><tr>";
		}
	}
	toto += "</table></body></html>";

	var newWindow = window.open("","","toolbar=no,menubar=no,scrollbars=yes,resizable=no,left=10,top=10,width=700,height=400");
	newWindow.document.write(toto);
}

function alea() {
	var val = ID;
	while ((val == ID) || (banned(val-1) == true)) {
		val = (parseInt(Math.random()*ring.length) + 1);
	}
	open(ring[val-1].lien);
}

function inscrire() {
	var toto = "";
	toto += "<html><head><title>S'inscrire à la WebRing du Char à Voile</title>";
	toto += "<style type=\"text/css\">body{background-color:#FFD7AA;color:navy;font-size:12pt;font-weight:bold;}a{font-size:14pt;color:firebrick;font-weight:bold;text-decoration:none;}a:active{font-size:14pt;color:firebrick;font-weight:bold;text-decoration:none;}a:visited{font-size:14pt;color:firebrick;font-weight:normal;text-decoration:none;}a:hover{font-size:14pt;color:firebrick;font-weight:bold;text-decoration:underline overline;}div.titre{font-size:14pt;color:navy;font-weight:bold;text-align=center;text-decoration:underline;}</style>";
	toto += "<script type=\"text/javascript\" language=\"JavaScript1.2\">function ValideForm(){document.formulaire.submit();window.close();}</script></head>";
	toto += "<body><div class=titre>Formulaire d'inscription à la WebRing de Char &agrave; Voile.</div>";
	toto += "<form name=\"formulaire\" action=\"mailto:bertrand@ccvra.fr.st?cc=webmaster@ccvra.fr.st&subject=inscription à la WebRing\" method=\"post\" enctype=\"text/plain\">";
	toto += "e-mail de r&eacute;ponse : <input name=\"email\" size=20 maxlength=100><br><br>";
	toto += "titre du site : <input name=\"titre\" size=30 maxlength=100>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adresse du site : <input name=\"adresse\" size=30 maxlength=100 value=\"http://\"><br><br>";
	toto += "description du site :<br><textarea name=\"description\" rows=5 cols=80></textarea>";
	toto += "<br><br><div align=center><a href=\"javascript:ValideForm()\">s'inscrire</a></div>";
	toto += "</form></body></html>";

	var newWindow = window.open("","","toolbar=no,menubar=no,scrollbars=yes,resizable=no,left=10,top=10,width=750,height=320");
	newWindow.document.write(toto);
}
