IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);

var newWin=null;

function popup2(loc, name, width, height) {
        var _params = 
"width="+width+",height="+height+",resizable=no,status=no,scrollbars=yes";
        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-width) >>1 );
                 _top = ( (screen.height-height) >>1 );
        } else {
                 _left = ( (800-width) >>1 );
                 _top = ( (600-height) >>1 );
        }
        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + 
_top;
        newWin = window.open(loc, name, _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus();
}

function validation() {
	var subtyp = document.getElementById("subtyp");
	var subtype = document.getElementById("subtype");
	var neuf = document.getElementById("neuf");
	var fourchettePrix = parseInt(document.getElementById("prix").value);

	document.getElementById("min_prix").value = (fourchettePrix == -1)?"":fourchettePrix*100000;
	document.getElementById("max_prix").value = (fourchettePrix == -1 || fourchettePrix == 5)?"":100000 + (fourchettePrix*100000);

		if (subtyp.value == '1') 
		{
			neuf.value = '!1';
			subtype.value ='2|'
		}
		if (subtyp.value == '2') 
		{
			neuf.value = '!1';
			subtype.value ='1|'
		}
		if (subtyp.value == '3') 
		{
			neuf.value = '!1';
			subtype.value ='3|'
		}
		if (subtyp.value == '4') 
		{
			neuf.value = '1';
			subtype.value =''
		}
		document.mini.submit();
}
