function MM_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=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function pviiW3Cbg(obj, pviiColor) { //v1.1 by Project VII
	obj.style.backgroundColor=pviiColor
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function cache_tout() {
MM_showHideLayers('actuel','','hide','champ','','hide','lnr','','hide','lesclub','','hide','competit','','hide','lerugby','','hide','cache3','','hide','cache2','','hide','cache1','','hide');
}

function MM_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 MM_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=MM_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 nirvana_positionWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function replaceCharacters(html) {

	// Special characters and their HTML equivelent
	var set = [
		["€","‘","’","’","“","”","–","—","¡","¢","£","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ü","ý","þ","ÿ"],
		["&euro;","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","&ndash;","&mdash;","&iexcl;","&cent;","&pound;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","­","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;"]
	];

	// Replace each instance of one of the above special characters with it's HTML equivelent
	if (html) {
		for(var j = 0; j < set[0].length; j++){
			html = html.replace(eval("/"+set[0][j]+"/g"),set[1][j]);
		}
	}

	// Return the HTML or an empty string if no HTML was supplied
	return html || "";
}

function mail_ami() {
titre = replaceCharacters(document.pu.mail_ami.value);
MM_openBrWindow('/mail_ami/test.asp', 'mail','width=400,height=344,resizable=no,location=no,toolbar=no,scrollbars=no,status=no')
}

var NAV=navigator.appName;
if ( (NAV.indexOf('Netscape') >=0) && (parseInt(NAV.appVersion) <= 4) && (parseInt(NAV.appVersion) > 6) ) {
document.write('<link rel="stylesheet" type="text/css" href="/OMM/Site/commun/ns-style.css">'); 
}
else {
document.write('<link rel="stylesheet" type="text/css" href="/OMM/Site/commun/style.css">')
}

function minute(param) {
toto = window.open("http://www.lnr.fr/commentaires/fr_commentaire.asp?aff=" + param ,  "param", "scrollbars=0,toolbar=0,menubar=no,resizable=0,height=450,width=350");
toto.moveTo(24, 200);
toto.focus();
}

function openlive() { window.open("http://www.sudradio.fr/public/sr/html/fr/general/enlive.php",'TVRadio','top=50,left=50,screenx=50,screeny=50,scrollbars=no,width=245,height=275'); 
}

function joueurmois(clepoll) {
toto = window.open("/client/joueurdumois/index.asp?clepoll=" + clepoll ,  "param", "scrollbars=0,toolbar=0,menubar=no,resizable=0,height=680,width=480");
toto.moveTo(0,0);
toto.focus();
}

function sitemois(clepoll) {
toto = window.open("/client/webprix/index.asp?id=" + clepoll ,  "param", "scrollbars=1,toolbar=0,menubar=no,resizable=1,height=710,width=600");
toto.moveTo(0,0);
toto.focus();
}

function test_mail(champ) { 	
var car = 'non'; 	
for (var i = 0; i < champ.value.length; i++) { 		
	var ch = champ.value.substring(i, i + 1);				
	if (ch == '@') {					
		for (var j = i+1; j < champ.value.length; j++) {        				
			var ch2 = champ.value.substring(j, j + 1);		    				
			if (ch2 == '.') {car='oui';}			
		}
	}
}	
if (car!='oui') {    	
	alert('Votre adresse e-mail semble erronée.');champ.focus(); return 'non';	} 
	return 'ok';
}		
	
function test_vide(champ,libelle) {		
if (champ.value.length == 0) {return 'non';}    		
if (champ.value.length > 0) {        			
	var tout_espaces='oui';    				
	for (var i = 0; i < champ.value.length; i++) {			
	if (champ.value.substring(i, i + 1) != ' ') {				
	tout_espaces='non';}}      				
	if (tout_espaces=='oui') {return 'non';}}    			
	return 'ok';}				

function verification(form) {			
if (test_vide(form.nom) != 'ok') {alert('Le champ nom est obligatoire.');return 'non'}			
if (test_vide(form.email) != 'ok') {alert('Le champ email est obligatoire.');return 'non'}			
if (test_mail(form.email) != 'ok') {return 'non'}			
if (test_vide(form.tel) != 'ok') {alert('Le champ telephone est obligatoire.');return 'non'}			
if (test_vide(form.adresse1) != 'ok') {alert('Veuillez indiquer votre adresse');return 'non'}		
if (test_vide(form.cp) != 'ok') {alert('Le champ Code Postal est obligatoire.');return 'non'}		
if (test_vide(form.ville) != 'ok') {alert('Le champ Ville est obligatoire.');return 'non'}		
if (test_vide(form.qt) != 'ok') {alert('Le champ Quantite est obligatoire.');return 'non'}
if (form.cgv.checked == false) {alert('Vous devez prendre connaissance des conditions de vente.');return 'non'}		
return 'ok';}		

function dvd() { 			
window.open('','bdcdvd','toolbar=0,location=0,status=0,menubar=1, scrollbars=0,resizable=0,width=470,height=650')	}		

function valide() {		
	if (verification(document.f)=='ok') { 	
		dvd(); document.f.submit(); 
	}	else return false;
}