function openWin(url,l,h,scroll) {
    winpeople=window.open(url,'freequestostats','scrollbars='+scroll+',menubar=no,status=no,resizable=yes,location=no,toolbar=no,width='+l+',height='+h);
}

function checkFormGroup(name) {
	ischecked=false;
	for (idx=0 ; idx<document.freequest.maxi.value ; idx++) {
		eval("val = document.freequest."+name+""+idx+".checked");
	    if (val) {
			ischecked=true;
			break;
		}
	}
    if (ischecked) openWin("",400,350,true);
	return ischecked;
}

function checkForm(msg) {
	//alert(document.freequest.type_echelle.value);

	//correction d'un bug sous IE5.5. type_echelle garde une ancienne valeur qd reload
	if (document.freequest.itemgroup==undefined)
		document.freequest.type_echelle.value = 5
	else
		document.freequest.type_echelle.value = 0
		
	switch (document.freequest.type_echelle.value) {
		case '5' : // coche multi
		  	retour=true;
			groupname = 'itemgroup';
			if (!checkFormGroup(groupname)) {
				retour=false;
			}
			break;
		case '0' :
		  	retour=false;
			for (idx=0 ; idx<document.freequest.maxi.value ; idx++) {
				if (document.freequest.itemgroup[idx].checked) 
					retour = true;
			}
			break;
	}
	if (!retour) {
		alert(msg);
	}
  if (retour) openWin("",400,350,1);
  return retour;
}

document.freequest.website.value=document.domain;