/*
	Fichier				script.js
	Description		Fonctions qui gèrent les listes 'menus'
*/

  function swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  }

  function preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
      var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
      if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  }

  function findObj(n, d) { //v4.0
    var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
    if(!x && document.getElementById) x=document.getElementById(n); return x;
  }

  function swapImage() { //v3.0
    var i,j=0,x,a=swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
     if ((x=findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  }


function scrollit(){
  if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
    document.cmarquee01.document.cmarquee02.top-=speed
    setTimeout("scrollit()",100)
  } else {
		document.cmarquee01.document.cmarquee02.top=marqueeheight
		scrollit()
  }
}


function rechercheGoogle() {
  document.write('&nbsp;');
  //document.write('<table border=0 cellspacing=0 cellpadding=0><tr>');
  //document.write('<form NAME=f Method=GET action=http://www.google.com/custom>');
  //document.write('<td align=right><img src=/utils/smile/images/trt_recherche.gif width=65 height=20></td>');
  //document.write('<td valign=baseline align=right>');
  //document.write('<input type=text NAME=q maxlength=255 size=10 style="width=150px">');
  //document.write('<input type=hidden NAME=domains value=www.smile.fr>');
  //document.write('<input type=hidden NAME=hl value=fr>');
  //document.write('<INPUT type=hidden NAME=cof VALUE="LW:140;ALC:#CC3300;L:http://www.smile.fr/utils/smile/images/logo_smile1.gif;LC:#2B384E;LH:50;BGC:#FFFFFF;AH:left;VLC:#2B384E;GL:0;AWFID:c2eb508f1cbdb552;">');
  //document.write('<input type=hidden NAME=sitesearch value=www.smile.fr>');
  //document.write('</td><td width=35 valign=baseline align=left>');
  //document.write('<input VALUE="Google Search" NAME=sa type=image src="/utils/smile/images/trt_ok.gif" width=25 height=20 border=0>');
  //document.write('</td></form></tr></table>');  
}

  function makeTextChange( text ){	
	if (text != ""){
		while (text != text.replace ("à", "&agrave;")) { text = text.replace("à", "&agrave;");	}
		while (text != text.replace ("â", "&acirc;")) { text = text.replace("â", "&acirc;");	}		
		while (text != text.replace ("é", "&eacute;")) { text = text.replace("é", "&eacute;"); }
		while (text != text.replace ("è", "&egrave;")) { text = text.replace("è", "&egrave;");	}
		while (text != text.replace ("ê", "&ecirc;")) { text = text.replace("ê", "&ecirc;");	}		
		while (text != text.replace ("î", "&icirc;")) { text = text.replace("î", "&icirc;");	}
		while (text != text.replace ("ï", "&iuml;")) { text = text.replace("ï", "&iuml;");	}		
		while (text != text.replace ("ô", "&ocirc;")) { text = text.replace("ô", "&ocirc;");	}		
		while (text != text.replace ("ù", "&ugrave;")) { text = text.replace("ù", "&ugrave;");	}
		while (text != text.replace ("û", "&ucirc;")) { text = text.replace("û", "&ucirc;");	}		
		while (text != text.replace ("ç", "&ccedil;")) { text = text.replace("ç", "&ccedil;");	}
	 }
	 return text
	}

function changeSearchText() {
	document.rech1.searchstring.value = makeTextChange(document.rech1.searchstring2.value);
}

