/* AUTEUR: Info Gaspésie */
/* DATE DE CREATION: 01-05-30 */
var nb_col = 0
var max_col = 0
var rangees = 3
var rangee2 = false
var largeur = new Array ('100%', '50%', '33%')
var nom_categorie = new Array ('ACTIVITÉS', 'HÉBERGEMENT', 'CAMPING', 'ACTIVITÉS CULTURELLES', 'RESTAURANTS, AGROTOURISME')
var param_categorie = new Array (false, false, false, false, false)
var pos_categorie = 0
var couleur_barre = '#990000'
var espace = false
var deja_vide = false

function ouvre_annonceur(activites, hebergement, camping, culture, restaurants) {
var i = 0
// titre
document.write ('<TABLE WIDTH=100% BORDER=0 CELLSPACING=0><TR><TD VALIGN="MIDDLE" BGCOLOR="#FFCC66"><IMG SRC="../../../icones/triangle.gif" BORDER=0 WIDTH=8 HEIGHT=15></TD><TD BGCOLOR="#FFCC66" WIDTH="100%" VALIGN="MIDDLE"><FONT class="titre">Attraits et services</FONT></TD></TR></TABLE>')
// calcul nombre colonnes et rangees
for (i=0;i<5;i++)
  {param_categorie[i] = ouvre_annonceur.arguments[i]
   if (param_categorie[i])
     {nb_col++}
  }
if (nb_col > 3)
  {max_col = 3
   rangees = 5}
else
  {max_col = nb_col}
// entete de colonnes
// 1re rangee vide
document.write ('<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>')
for (i=1;i<=max_col;i++)
  {document.write ('<TD WIDTH=', largeur[max_col-1].value, ' ALIGN="LEFT" VALIGN="TOP"><IMG SRC="/vide.gif" BORDER=0 WIDTH=1 HEIGHT=4></TD>')
   if (i != max_col)
     {document.write ('<TD ROWSPAN=', rangees, '><IMG SRC="/vide.gif" BORDER=0 WIDTH=4 HEIGHT=1></TD><TD><IMG SRC="/vide.gif" BORDER=0 WIDTH=2 HEIGHT=1></TD><TD ROWSPAN=', rangees, '><IMG SRC="/vide.gif" BORDER=0 WIDTH=4 HEIGHT=1></TD>')
	 }
  }
document.write ('</TR><TR>')
//2e rangee titres
for (i=1;i<=max_col;i++)
  {document.write ('<TD WIDTH=', largeur[max_col-1], ' ALIGN="LEFT" VALIGN="TOP"><FONT class="titrecategorie">')
   while (!param_categorie[pos_categorie])
     {pos_categorie++}
   document.write (nom_categorie[pos_categorie],'</FONT></TD>')
   pos_categorie++
   if ( i != max_col)
     {document.write ('<TD BGCOLOR="', couleur_barre, '" ROWSPAN=', rangees-1, '><IMG SRC="/vide.gif" BORDER=0 WIDTH=2 HEIGHT=1></TD>')
	 }
  }
document.write ('</TR>')
// debut des donnees
document.write ('<TD WIDTH=', largeur[max_col-1], ' ALIGN="LEFT" VALIGN="TOP"><UL TYPE=DISC>')
}

function ecrire_categorie (nom_categorie){
if (espace)
  {document.write ('<BR><BR>')}
else
  {espace = true}
document.write ('<FONT class="soustitrecategorie">', nom_categorie, '</FONT>')
}

function ecrire_annonceur (nom_annonceur, lien_annonceur){
document.write ('<LI><A HREF="', lien_annonceur, '.php?cat=', categorie, '&dev=', dev, '" TARGET="_top" TITLE="Cliquez ici" class="annonceur">', nom_annonceur, '</A>')
}

function change_colonne (){
document.write ('</UL></TD><TD WIDTH=', largeur[max_col-1], ' ALIGN="LEFT" VALIGN="TOP"><UL TYPE=DISC>')
espace = false
}

function colonne_vide (){
if (!deja_vide)
  {document.write ('</UL></TD>')}
document.write ('<TD WIDTH="33%">&nbsp;</TD>')
deja_vide = true
}

function change_rangee (){
document.write ('</UL></TD></TR><TR>')
for (i=4;i<=nb_col;i++)
  {document.write ('<TD WIDTH=33% ALIGN="LEFT" VALIGN="TOP"><FONT class="titrecategorie"><BR>')
   while (!param_categorie[pos_categorie])
     {pos_categorie++}
   document.write (nom_categorie[pos_categorie],'</FONT></TD>')
   pos_categorie++
  }
i=nb_col
while (i < 6)
  {document.write ('<TD WIDTH=33% ALIGN="LEFT" VALIGN="TOP">&nbsp;</TD>')
   i++
  }
document.write ('</TR><TR><TD WIDTH=33% ALIGN="LEFT" VALIGN="TOP"><UL TYPE=DISC>')
espace = false
}

function ferme_annonceurs (){
if (!deja_vide)
  {document.write ('</UL></TD>')}
document.write ('</TR></TABLE><BR>')
}
