function checkFormRegister()
{
var pass = getId('passwordR').value.trim();
if (getId('loginR').value.isEmpty()) { alert("L'identifiant ne convient pas."); return false;}
if (getId('firstname').value.isEmpty()) { alert("Le prénom est obligatoire."); return false;}
if (getId('lastname').value.isEmpty()) { alert("Le nom est obligatoire."); return false;}
if (getId('passwordR').value.isEmpty()) { alert("Le mot de passe ne convient pas."); return false;}
if (pass.length<6) { alert("Le mot de passe est trop court."); return false;}
if (getId('passwordR').value!=getId('password2').value) { alert("Vos mots de passe ne correspondent pas."); return false;}
if (getId('email').value.isEmpty()) { alert("L'adresse email ne convient pas."); return false;}
if (getId('title').value.isEmpty()) { alert("Le titre ne convient pas."); return false;}
if (getId('category1').selectedIndex==0 || getId('category2').selectedIndex==0) { alert("Les catégories doivent être selectionnées."); return false;}
if (getId('category1').selectedIndex==getId('category2').selectedIndex) { alert("Les catégories doivent être différentes."); return false;}
if (getId('tac').value.isEmpty()) { alert("Le code secret ne convient pas."); return false;}
if (getId('cg').checked!=true) { alert("Vous devez accepter les conditions générales."); return false;}
getId('formRegister').submit();
}
function createMarker(point,ville,map) {
ville = ville.toUpperCase();
var marker = new GMarker(point,{title:"Zoom sur "+ville});
GEvent.addListener(marker, "click", function() { map.setCenter(point,8); marker.openInfoWindowHtml(ville + "
Lien vers le blog "); });
GEvent.addListener(marker, "infowindowclose", function() { map.setCenter(point,0) });
return marker;
}
function loadGMap() {
if (!$('maps')) return;
if (GBrowserIsCompatible()) {
this.map = new GMap2($('maps'));
this.map.addControl(new GSmallMapControl());
this.map.addControl(new GMapTypeControl());
//var cities_name = $A(cities_name);
for (var city in cities_name){
if (typeof cities[cities_name[city]] == 'undefined') continue;
latlng = new GLatLng(cities[cities_name[city]][0], cities[cities_name[city]][1]);
this.map.setCenter(latlng);
marker = createMarker(latlng,cities_name[city],this.map);
this.map.addOverlay(marker);
}
}
}