function gosearch()
{
var base="http://map.maponair.com?client=11899&lang=F";
var cas = 0;
if ((document.localise.ville.value == "")&&(document.localise.code.value == "")) errorZip(document.localise.ville, "Veuillez indiquer une ville ou un NPA");
if ((document.localise.ville.value != "")&&(document.localise.code.value == "")) var cas = 1;
if ((document.localise.ville.value == "")&&(document.localise.code.value != "")) var cas = 2;
if ((document.localise.ville.value != "")&&(document.localise.code.value != "")) var cas = 2;
if (cas == 1)
	{
	var extention="&city="+document.localise.ville.value;
    variable = base+extention;
    window.open(variable,null,'height=680,width=620,scrollbars,statusbar=1,resizable=yes').focus();
	}
if (cas == 2)
	{
        var flag="1";
		var test1 = document.localise.code.value;
        if ((test1.length < 4 )||(isNaN(test1)))
		{
		 errorZip(document.localise.code,"le NPA indiqu&eacute; doit &ecirc;tre compos&eacute; de 4 chiffres");
		 var flag="0";
		}
        if (test1>=1900)
		{
		 errorZip(document.localise.code, "Il n y a pas de Bancomat BCV dans la zone recherch&eacute;e");
		 var flag="0";
		}
        if (flag == "1")
		{
		var extention="&zip="+document.localise.code.value;
        variable = base+extention;
   		window.open(variable,null,'height=680,width=620,statusbar=1,scrollbars,resizable=yes').focus();
		}
	}
}

function errorZip(elem, text)
{
  window.alert(text);
  elem.select();
  elem.focus();
}
