<!--
var mafenetre;
function launchwin(winurl,winname,winWidth,winHeight)
	{
	var ns4 = (document.layers)? true:false;			//NS 4
	var ie4 = (document.all)? true:false;			//IE 4
	var dom = (document.getElementById)? true:false;	//DOM
	var xMax, yMax, xOffset, yOffset;

	if (ie4 || dom)
		{
		xMax = screen.width;
		yMax = screen.height;
		}
	else if (ns4)
		{
		xMax = window.outerWidth;
		yMax = window.outerHeight;
		}
	else
		{
		xMax = 800;
		yMax = 600;
		}
	xOffset = (xMax - winWidth)/2;
	yOffset = (yMax - winHeight)/2;
	mafenetre = window.open(winurl,winname,'width='+winWidth+',height='+winHeight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',menubar=no,scrollbars=yes,resizable=no,status=no,toolbar=no');
	setTimeout('mafenetre.focus();',250);
}

function launchwinnoscroll(winurl,winname,winWidth,winHeight)
	{
	var ns4 = (document.layers)? true:false;			//NS 4
	var ie4 = (document.all)? true:false;			//IE 4
	var dom = (document.getElementById)? true:false;	//DOM
	var xMax, yMax, xOffset, yOffset;

	if (ie4 || dom)
		{
		xMax = screen.width;
		yMax = screen.height;
		}
	else if (ns4)
		{
		xMax = window.outerWidth;
		yMax = window.outerHeight;
		}
	else
		{
		xMax = 800;
		yMax = 600;
		}
	xOffset = (xMax - winWidth)/2;
	yOffset = (yMax - winHeight)/2;
	mafenetre = window.open(winurl,winname,'width='+winWidth+',height='+winHeight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',menubar=no,scrollbars=no,resizable=no,status=no,toolbar=no');
	setTimeout('mafenetre.focus();',250);
}


function infos_legales() {	
	launchwinnoscroll('infos_legales.html','infoslegales',450,500);
}

var therules;
function reglement() {
	launchwin('reglement.html','infoslegales',820,500);
	<!--therules = window.open('reglement.html','reglement','width=820,height=500,,top=10,left=10,menubar=no,scrollbars=yes,resizable=no,status=no,toolbar=no');-->
}


function gagnants() {
	launchwin('gagnants.html','gagnants',820,600);
}
//function inscription(codeoffre) {
//	launchwin('inscription.php3?from=cofidis_rien&offre_comm='+codeoffre,'jeuconcours',820,500);
//}


// réinitialiser le formulaire....
function form_reset() {
	document.form_identite.reset();
}

function test_radio(btradio) {
	var tmp = false;
	for (i=0; i<btradio.length; i++) {
		if (btradio[i].checked == true)
			tmp = true;
	}
	return tmp;
}







// vérifier les infos du formulaire avant envoi.
function check_inscription() {
	var tmprep = '';
	var tmprepq = '';
	
	if (document.form_identite.reglement.checked) {
		var themail = document.form_identite.email.value;
		if (document.form_identite.civilite.value == '0')
			tmprep += "\n- Civilité ";
		if (document.form_identite.nom.value == '')
			tmprep += '\n- Nom';
		if (document.form_identite.prenom.value == '')
			tmprep += '\n- Prénom';
		if (  (document.form_identite.jour_naissance.value == '0')
			||(document.form_identite.mois_naissance.value == '0')
			||(document.form_identite.annee_naissance.value == '0') ) 
			tmprep += '\n- Date de naissance';
		if ( document.form_identite.adresse.value == '' )
			tmprep += '\n- Adresse';
		if (document.form_identite.codepostal.value == '')
			tmprep += '\n- Code Postal';
		if (document.form_identite.ville.value == '')
			tmprep += '\n- Ville';	
		//alert(themail);
		if ( (themail == '') || (verifMail(themail) == false) ){
			tmprep += '\n- email';
		}
			
		// si tout est ok c'est parti !		
		if (tmprep != '') {
			message = 'Veuillez remplir/verifier les informations suivantes : '+tmprep;
			alert(message);
		} else {
			document.formcheckmail.mailcheck.value = document.form_identite.email.value;
			document.formcheckmail.submit();
		}
	} else {
		alert('Vous devez cocher la case \'J\'ai pris connaissance du règlement\'');
	}
}

// vérifier un mail
function verifMail(a) {
	testm = false ;
	if ( (a.length > 5) && (a.length < 255) ) {
		for (var j=1 ; j<(a.length) ; j++) {
			if (a.charAt(j)=='@') {
				if (j<(a.length-4)){
					for (var k=j ; k<(a.length-2) ; k++) {
						if (a.charAt(k)=='.') testm = true;
					}
				}
			}
		}
	}
	return testm ;
}

//tag xiti
function xt_flash(typefl,page) {
	Xt_r = document.referrer;
	Xt_h = new Date();
	xt_img = new Image();
	Xt_i = 'http://logi7.xiti.com/hit.xiti?s=170817&s2=6';
	Xt_i += '&p='+page+'&type='+typefl+'&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
	if (parseFloat(navigator.appVersion)>=4) {
		Xiti_s=screen;Xt_i += '&r=' + Xiti_s.width + 'x' + Xiti_s.height + 'x' + Xiti_s.pixelDepth + 'x' + Xiti_s.colorDepth;
	}
	Xt_i += '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$');
	xt_img.src = Xt_i;
	return;
}

//-->