<!--//
// Ajoute la fonction trim comme méthode de l'objet String.
String.prototype.trim = function()
{ return this.replace(/(^\s*)|(\s*$)/g, ""); }

// Ajoute la fonction string comme méthode de l'objet String.
String.prototype.string = function(nb)
{ var tmp=""; for(var i=1;i<=nb;i++) tmp+=this; return tmp; }

var adresse = new String ("");
var details = new String("");
var largeur = new String("");
var hauteur = new String("");
var leftpos = 0;
var toppos = 0;

function ouvre (adresse,largeur, hauteur) {

//Calcul position fenêtre
leftpos = (screen.width - largeur) / 2;
leftpos = parseInt(leftpos,10);
toppos = (screen.height - hauteur) / 2;
toppos = parseInt(toppos,10);

if (leftpos < 0) {leftpos = 0};
if (toppos < 0) {toppos = 0};

details = ",status=no,resizable=yes,scrollbars=yes";
details = details + ",width=" + largeur + ",height=" + hauteur + ",top=" + toppos + ",left=" + leftpos;

var fenetre = window.open (adresse,'',details);
}
function photo (adresse,largeur, hauteur) {

leftpos = (screen.width - largeur) / 2;
toppos = (screen.height - hauteur) / 2;

leftpos = parseInt(leftpos,10);
toppos = parseInt(toppos,10);

if (leftpos < 0) {leftpos = 0};
if (toppos < 0) {toppos = 0};

details = ",status=no,resizable=yes";
details = details + ",width=" + largeur + ",height=" + hauteur + ",top=" + toppos + ",left=" + leftpos;

var fenetre = window.open(adresse,'',details);
fenetre.focus();
}
function ouvre_fenetre(variable) {
  var page = open('','agrandissement','status=no,resizable=yes,width=565,height=430,top=100,left=100');
  page.document.open();
  page.document.write(variable);
  page.document.close();
}
var indexS = 0;
var strChoix = new String ("");
function change(formulaire){
	indexS = formulaire.choix.options.selectedIndex;
	strChoix = formulaire.choix.options[indexS].value;
	formulaire.nom.value = strChoix;
	formulaire.index.value = indexS;
	formulaire.action = formulaire.nomfichier.value;
	formulaire.submit();
return true;
}
function change2(formulaire){
	index1 = formulaire.choix1.options.selectedIndex;
	index2 = formulaire.choix2.options.selectedIndex;
	strChoix1 = formulaire.choix1.options[index1].value;
	strChoix2 = formulaire.choix2.options[index2].value;
	formulaire.mois.value = strChoix1;
	formulaire.annee.value = strChoix2;	
	formulaire.index1.value = index1;
	formulaire.index2.value = index2;	
	formulaire.action = formulaire.nomfichier.value;
	formulaire.submit();
return true;
}
function change3(formulaire){
	index1 = formulaire.choix1.options.selectedIndex;
	index2 = formulaire.choix2.options.selectedIndex;
	index3 = formulaire.choix3.options.selectedIndex;
	strChoix1 = formulaire.choix1.options[index1].value;
	strChoix2 = formulaire.choix2.options[index2].value;
	strChoix3 = formulaire.choix3.options[index3].value;
	formulaire.mois.value = strChoix1;
	formulaire.annee.value = strChoix2;	
	formulaire.theme.value = strChoix3;	
	formulaire.index1.value = index1;
	formulaire.index2.value = index2;	
	formulaire.index3.value = index3;	
	formulaire.action = formulaire.nomfichier.value;
	formulaire.submit();
return true;
}
function fn_change_mois(formulaire){
	indexS = formulaire.choix_mois.options.selectedIndex;
	strChoix = formulaire.choix_mois.options[indexS].value;
	formulaire.nommois.value = strChoix;
	return true;
}
function fn_change_annee(formulaire){
	indexS = formulaire.choix_annee.options.selectedIndex;
	strChoix = formulaire.choix_annee.options[indexS].value;
	formulaire.nomannee.value = strChoix;
	return true;
}
function fn_change_couleur(formulaire){
	indexS = formulaire.choix_couleur.options.selectedIndex;
	strChoix = formulaire.choix_couleur.options[indexS].value;
	//alert ("Choix couleur fond titre : " + strChoix);
	formulaire.fond_titre.value = strChoix;
	return true;
}
function fn_checkbox(tcheckbox){
var valeur = 0;
	if (tcheckbox.checked == true) {
		valeur = 1;
		}
		else {
		valeur = 0;
		}
	return valeur;
}
function presence_frame()
{
if(!(parent.frames["fond1.htm"]))
{
location.replace("index.php");
}
}
function affiche_c(texte1,texte,nom,prestataire,style,titre)
{
var tg="<";
var arob="@";
var sub="?sub";
document.write(texte1+tg+"a hr"+"ef=mai"+"lto:"+nom);
document.write(arob+prestataire+sub+"ject=");
document.write(titre+" class=" + style + ">"+texte+tg+"/a><br />");
}
function affiche_cligne(texte1,texte,nom,prestataire,style,titre)
{
var tg="<";
var arob="@";
var sub="?sub";
document.write(texte1+"<br />"+tg+"a hr"+"ef=mai"+"lto:"+nom);
document.write(arob+prestataire+sub+"ject=");
document.write(titre+" class=" + style + ">"+texte+tg+"/a><br />");
}

function clickOnItem(lienItem, texteItem) 
{ 
/*window.location.href=indexItem;  */
document.write('<a href="' + lienItem + '" target="_blank" rel="noindex,nofollow" class="apropos">' + texteItem + '</a> ');
}
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;
//-->
