

function check_all(checkall,currentarea,frm)
{
var checkbox_value;
    for (i=0;i<frm.s_prd_Localisation_check.length;i++)
    {
		checkbox_value = '|' + frm.s_prd_Localisation_check[i].value;
		current_area = '|' + currentarea;
		
        if (checkall.checked && checkbox_value.indexOf(current_area) > -1)
        {
			frm.s_prd_Localisation_check[i].checked=true;
		}
        else
        {
			frm.s_prd_Localisation_check[i].checked=false;
		}
    }
    check_localisation(frm);
}


function drop_natures(page,frm)
{
   
    if (page == 'shome' || page=='agy') document.getElementById('s_prd_Prices_temp').style.visibility='hidden';
    if (page == 'shome' || page=='agy') document.getElementById('s_prd_Chambres').style.visibility='hidden';
    if (page == 'shome') document.getElementById('localisation_principale').style.visibility='hidden';
    /*if (page == 'start')
    {
        document.getElementById('localisation_principale').style.visibility='hidden';
        if (document.frmprdsearch.localisation_principale[document.frmprdsearch.localisation_principale.selectedIndex].value != '0')
        {
            document.getElementById(document.frmprdsearch.localisation_principale[document.frmprdsearch.localisation_principale.selectedIndex].value).style.visibility='hidden';
        }
    }*/
    if (frm.__typetransac[0].checked)
    {
        document.getElementById('drop_select_immobilier').style.display='';
    }
    if (frm.__typetransac[1].checked)
    {
        document.getElementById('drop_select_commerce').style.display='';
    }
	try
	{
		document.getElementById('select_tri_prd').style.visibility='hidden';
    }
    catch(e){}
}

function clean_natures(transac,frm)
{
    
	if (frm==document.frmprdsearch) {
	    
		if (transac==1)
		{
		 
			frm.s_prd_Nature[7].checked=false;
			frm.s_prd_Nature[8].checked=false;
			frm.s_prd_Nature[9].checked=false;
			frm.s_prd_Nature[10].checked=false;
			frm.s_prd_Nature[11].checked=false;
			frm.s_prd_Nature[12].checked=false;
			frm.s_prd_Nature[13].checked=false;
			frm.s_prd_Nature[14].checked=false;
			frm.s_prd_Nature[15].checked=false;
			frm.s_prd_Nature[16].checked=false;
			frm.s_prd_Nature[17].checked=false;
			frm.s_prd_Nature[18].checked=false;
			frm.s_prd_Nature[19].checked=false;
			frm.s_prd_Nature[20].checked=false;
			frm.s_prd_Nature[21].checked=false;
			frm.s_prd_Nature[22].checked=false;
		}
		if (transac==2) {
		 
			frm.s_prd_Nature[0].checked=false;
			frm.s_prd_Nature[1].checked=false;
			frm.s_prd_Nature[2].checked=false;
			frm.s_prd_Nature[3].checked=false;
			frm.s_prd_Nature[4].checked=false;
			frm.s_prd_Nature[5].checked=false;
			frm.s_prd_Nature[6].checked=false;
		}
	}
	else {
	    
		if (transac==1)
		{
			frm._demande_type[7].checked=false;
			frm._demande_type[8].checked=false;
			frm._demande_type[9].checked=false;
			frm._demande_type[10].checked=false;
			frm._demande_type[11].checked=false;
			frm._demande_type[12].checked=false;
			frm._demande_type[13].checked=false;
			frm._demande_type[14].checked=false;
			frm._demande_type[15].checked=false;
			frm._demande_type[16].checked=false;
			frm._demande_type[17].checked=false;
			frm._demande_type[18].checked=false;
			frm._demande_type[19].checked=false;
			frm._demande_type[20].checked=false;
			frm._demande_type[21].checked=false;
			frm._demande_type[22].checked=false;
		}
		if (transac==2)
		{
			frm._demande_type[0].checked=false;
			frm._demande_type[1].checked=false;
			frm._demande_type[2].checked=false;
			frm._demande_type[3].checked=false;
			frm._demande_type[4].checked=false;
			frm._demande_type[5].checked=false;
			frm._demande_type[6].checked=false;
		}
	}
	try
	{
		document.getElementById('select_tri_prd').style.visibility='visible';
    }
    catch(e){}
    lstnatures = '';
    frm.temp_type.value='Choisissez le type de bien';
}



function hide_natures(page)
{
    if (page == 'shome' || page == 'agy') document.getElementById('s_prd_Prices_temp').style.visibility='visible';
    if (page == 'shome' || page == 'agy') document.getElementById('s_prd_Chambres').style.visibility='visible';
    if (page == 'shome') document.getElementById('localisation_principale').style.visibility='visible';
    /*
    if (page == 'start')
    {
        document.getElementById('localisation_principale').style.visibility='visible';
        if (document.frmprdsearch.localisation_principale[document.frmprdsearch.localisation_principale.selectedIndex].value != '0')
        {
            document.getElementById(document.frmprdsearch.localisation_principale[document.frmprdsearch.localisation_principale.selectedIndex].value).style.visibility='visible';
        }
    }*/
	try
	{
		document.getElementById('select_tri_prd').style.visibility='visible';
    }
    catch(e){}
    document.getElementById('drop_select_immobilier').style.display='none';
    document.getElementById('drop_select_commerce').style.display='none';
}


                function drop_localisation(what,frm)
                {
                    // masquer tous les div : 
                    hide_natures('start');
                    for (i=0;i<subareadivs.length;i++)
                    {
                        document.getElementById(subareadivs[i]).style.display='none';
                    }
                    //vider précédentes sélections si on change de région principale : 
                    if (what=='changer')
                    {
                        for (i=0;i<frm.s_prd_Localisation_check.length;i++)
                        {
                            frm.s_prd_Localisation_check[i].checked=false;
                        }
                        if (frm==document.frmprdsearch) frm.s_prd_Localisation.value='';
						else frm._demande_localisation.value='';
						frm.temp_localisation.value='';
                    }
                    //afficher div sélectionné
                    if (frm.localisation_principale[frm.localisation_principale.selectedIndex].value > 0)
                    {
                        document.getElementById(frm.localisation_principale[frm.localisation_principale.selectedIndex].value).style.display='';
                   		try
                   		{
							document.getElementById('select_pages').style.visibility='hidden';
				        }
				        catch(e){}
                    }
                    else {}
                }

                function hide_localisation(div)
                {
                    for (i=0;i<subareadivs.length;i++)
                    {
                        document.getElementById(subareadivs[i]).style.display='none';
                   		try
                   		{
							document.getElementById('select_pages').style.visibility='visible';
				        }
				        catch(e){}
                    }
                }


function check_localisation(frm)
{

var lstlocalisations='';
var lstlocalisationsid='';
var temp;
if (frm==document.frmprdsearch)
{
	frm.temp_localisation.value='';
	frm.s_prd_Localisation.value='';

    for (i=0;i<frm.s_prd_Localisation_check.length;i++)
	{
		if (frm.s_prd_Localisation_check[i].checked)
		{

		    temp = new Array();
            temp = (frm.s_prd_Localisation_check[i].value).split('§');

            //alert(temp[0]);
            //alert(temp[1]);

			if (lstlocalisationsid=='') lstlocalisationsid=lstlocalisationsid + temp[0];
			else lstlocalisationsid=lstlocalisationsid + ',' + temp[0];
			if (lstlocalisations=='') lstlocalisations=lstlocalisations + temp[1];
			else lstlocalisations=lstlocalisations + ', ' + temp[1];

		}
	}
	var MonReg=/_/g;//
	frm.temp_localisation.value=lstlocalisations.replace(MonReg,'\'');
	frm.s_prd_Localisation.value=lstlocalisationsid;
	//alert(frm.temp_localisation.value);
	//alert(frm.s_prd_Localisation.value);
}
else
{
	frm.temp_localisation.value='';
	frm._demande_localisation.value='';

    for (i=0;i<frm.s_prd_Localisation_check.length;i++)
	{
		if (frm.s_prd_Localisation_check[i].checked)
		{

		    temp = new Array();
            temp = (frm.s_prd_Localisation_check[i].value).split('§');

            //alert(temp[0]);
            //alert(temp[1]);

			if (lstlocalisationsid=='') lstlocalisationsid=lstlocalisationsid + temp[0];
			else lstlocalisationsid=lstlocalisationsid + ',' + temp[0];
			if (lstlocalisations=='') lstlocalisations=lstlocalisations + temp[1];
			else lstlocalisations=lstlocalisations + ', ' + temp[1];

		}
	}
	var MonReg=/_/g;//
	frm.temp_localisation.value=lstlocalisations.replace(MonReg,'\'');
	frm._demande_localisation.value=lstlocalisationsid;
}
}

var lstnatures='';
function type_natures(choix,frm) 
{
    lstnatures='';
    frm.temp_type.value='';
    
    
    if (frm==document.frmprdsearch)
    {
    	for (i=0;i<frm.s_prd_Nature.length;i++)
		{
			if (frm.s_prd_Nature[i].checked)
			{
				if (i==0) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Maison';
					else lstnatures=lstnatures+', Maison';
				}
				if (i==1) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Appartement';
					else lstnatures=lstnatures+', Appartement';
				}
				if (i==2) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Ferme';
					else lstnatures=lstnatures+', Ferme';
				}
				if (i==3) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Immeuble';
					else lstnatures=lstnatures+', Immeuble';
				}
				if (i==4) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Plateau à aménager';
					else lstnatures=lstnatures+', Plateau à aménager';
				}
				if (i==5) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Terrain';
					else lstnatures=lstnatures+', Terrain';
				}
				if (i==6) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Garage';
					else lstnatures=lstnatures+', Garage';
				}
				if (i==7) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar';
					else lstnatures=lstnatures+', Bar';
				}
				if (i==8) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar/hôtel';
					else lstnatures=lstnatures+', Bar/hôtel';
				}
				if (i==9) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar/hôtel/restaurant';
					else lstnatures=lstnatures+', Bar/hôtel/restaurant';
				}
				if (i==10) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar/PMU';
					else lstnatures=lstnatures+', Bar/PMU';
				}
				if (i==11) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar/restaurant';
					else lstnatures=lstnatures+', Bar/restaurant';
				}
				if (i==12) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar/tabacs';
					else lstnatures=lstnatures+', Bar/tabacs';
				}
				if (i==13) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Boulangerie/pâtisserie';
					else lstnatures=lstnatures+', Boulangerie/pâtisserie';
				}
				if (i==14) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Hôtels';
					else lstnatures=lstnatures+', Hôtels';
				}
				if (i==15) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Locaux commerciaux';
					else lstnatures=lstnatures+', Locaux commerciaux';
				}
				if (i==16) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Pressing';
					else lstnatures=lstnatures+', Pressing';
				}
				if (i==17) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Prêt-à-porter';
					else lstnatures=lstnatures+', Prêt-à-porter';
				}
				if (i==18) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Restaurants/auberges';
					else lstnatures=lstnatures+', Restaurants/auberges';
				}
				if (i==19) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Tabacs';
					else lstnatures=lstnatures+', Tabacs';
				}
				if (i==20) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Tabacs/presse';
					else lstnatures=lstnatures+', Tabacs/presse';
				}
				if (i==21) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Terminal de cuisson';
					else lstnatures=lstnatures+', Terminal de cuisson';
				}
				if (i==22) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Autres commerces';
					else lstnatures=lstnatures+', Autres commerces';
				}
			}
		}
	}
	else 
	{
    	for (i=0;i<frm._demande_type.length;i++)
		{
			if (frm._demande_type[i].checked)
			{
				if (i==0) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Maison';
					else lstnatures=lstnatures+', Maison';
				}
				if (i==1) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Appartement';
					else lstnatures=lstnatures+', Appartement';
				}
				if (i==2) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Ferme';
					else lstnatures=lstnatures+', Ferme';
				}
				if (i==3) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Immeuble';
					else lstnatures=lstnatures+', Immeuble';
				}
				if (i==4) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Plateau à aménager';
					else lstnatures=lstnatures+', Plateau à aménager';
				}
				if (i==5) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Terrain';
					else lstnatures=lstnatures+', Terrain';
				}
				if (i==6) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Garage';
					else lstnatures=lstnatures+', Garage';
				}
				if (i==7) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar';
					else lstnatures=lstnatures+', Bar';
				}
				if (i==8) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar/hôtel';
					else lstnatures=lstnatures+', Bar/hôtel';
				}
				if (i==9) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar/hôtel/restaurant';
					else lstnatures=lstnatures+', Bar/hôtel/restaurant';
				}
				if (i==10) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar/PMU';
					else lstnatures=lstnatures+', Bar/PMU';
				}
				if (i==11) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar/restaurant';
					else lstnatures=lstnatures+', Bar/restaurant';
				}
				if (i==12) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Bar/tabacs';
					else lstnatures=lstnatures+', Bar/tabacs';
				}
				if (i==13) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Boulangerie/pâtisserie';
					else lstnatures=lstnatures+', Boulangerie/pâtisserie';
				}
				if (i==14) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Hôtels';
					else lstnatures=lstnatures+', Hôtels';
				}
				if (i==15) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Locaux commerciaux';
					else lstnatures=lstnatures+', Locaux commerciaux';
				}
				if (i==16) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Pressing';
					else lstnatures=lstnatures+', Pressing';
				}
				if (i==17) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Prêt-à-porter';
					else lstnatures=lstnatures+', Prêt-à-porter';
				}
				if (i==18) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Restaurants/auberges';
					else lstnatures=lstnatures+', Restaurants/auberges';
				}
				if (i==19) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Tabacs';
					else lstnatures=lstnatures+', Tabacs';
				}
				if (i==20) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Tabacs/presse';
					else lstnatures=lstnatures+', Tabacs/presse';
				}
				if (i==21) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Terminal de cuisson';
					else lstnatures=lstnatures+', Terminal de cuisson';
				}
				if (i==22) 
				{
					if (lstnatures=='') lstnatures=lstnatures+'Autres commerces';
					else lstnatures=lstnatures+', Autres commerces';
				}
			}
		}
    }
    
	frm.temp_type.value=lstnatures;
}



function lancer(type) // ACCUEIL, AGENCE - RECHERCHE PRODUITS
{
if (document.frmprdsearch.s_prd_Reference != null && document.frmprdsearch.s_prd_Reference.value!='')
{
    var reftemp = document.frmprdsearch.s_prd_Reference.value;
    document.frmprdsearch.reset();
    document.frmprdsearch.s_prd_Reference.value=reftemp;
    document.frmprdsearch.submit();
}
else 
{
    if (type != 'agy') var mainloc=document.frmprdsearch.localisation_principale[document.frmprdsearch.localisation_principale.selectedIndex].value;
    if (type != 'agy' && mainloc != 0 && mainloc != '')
    {  
		var secloc = 0;
        try
		{
			secloc=eval('document.frmprdsearch.'+'localisation_'+mainloc+'[document.frmprdsearch.'+'localisation_'+mainloc+'.selectedIndex].value');
		}
		catch(e){}
    }
    if (type != 'agy')
    {
        if ((document.frmprdsearch.s_prd_Localisation.value == '') && (mainloc != 0) && secloc!=0 && secloc!='')
        {
            document.frmprdsearch.s_prd_Localisation.value = secloc;
        }
	    else if ((document.frmprdsearch.s_prd_Localisation.value == '') && (mainloc != 0))
	    {
		    document.frmprdsearch.s_prd_Localisation.value = mainloc+"|0";
	    }
    }
    if (getSelected(document.frmprdsearch.s_prd_Nature) == '')
	{
	    if (document.frmprdsearch.__typetransac[1].checked)
	    {
            for (i=0;i<document.frmprdsearch.s_prd_Nature.length;i++)
            {
                if (i >= 7) {document.frmprdsearch.s_prd_Nature[i].checked = true; }
            }
        }   
	    else
	    {
	        for (i=0;i<document.frmprdsearch.s_prd_Nature.length;i++)
	        {    
	            if (i< 7) {document.frmprdsearch.s_prd_Nature[i].checked = true;}
            }
        }
        document.frmprdsearch.__hidenature.value = 1;
	}
        if (document.frmprdsearch.s_prd_Prices_temp.selectedIndex==8) 
        {
            document.frmprdsearch.s_prd_Price1_min.value=document.frmprdsearch.s_prd_Prices_temp.options[8].value;
            document.frmprdsearch.s_prd_Price1_max.value='';
        }
        else 
        {
            document.frmprdsearch.s_prd_Price1_min.value='';
            document.frmprdsearch.s_prd_Price1_max.value=document.frmprdsearch.s_prd_Prices_temp.options[document.frmprdsearch.s_prd_Prices_temp.selectedIndex].value;
        }
    if (type != 'shome' && type != 'agy')
    {
    if(isNaN(document.frmprdsearch.s_prd_Surface_min.value)) document.frmprdsearch.s_prd_Surface_min.value='';
    if(isNaN(document.frmprdsearch.s_prd_Surface_max.value)) document.frmprdsearch.s_prd_Surface_max.value=''; 
    /*if(isNaN(document.frmprdsearch.s_prd_Price1_min.value)) document.frmprdsearch.s_prd_Price1_min.value='';
    if(isNaN(document.frmprdsearch.s_prd_Price1_max.value)) document.frmprdsearch.s_prd_Price1_max.value='';*/
    }
    document.frmprdsearch.prd_Model.value = '';
    
    //alert(document.frmprdsearch.s_prd_Localisation.value);
    
    document.frmprdsearch.submit();
    }
}




function init()
{
	try {
		document.frmprdsearch.localisation_principale.selectedIndex = 0;
		document.frmprdsearch.s_prd_Localisation.value = '';
		document.frmprdsearch.temp_localisation.value = 'Choisissez votre sous-secteur';
		}
	catch (e) {}
}

function init_prdloc()
{
    if (document.frmprdsearch.localisation_principale.selectedIndex != 0)
    {
        document.getElementById(document.frmprdsearch.localisation_principale[document.frmprdsearch.localisation_principale.selectedIndex].value).style.display = "";
        document.frmprdsearch.temp_localisation.value = 'Choisissez votre sous-secteur';
        document.getElementById('tt_ville').style.display="";
        //document.getElementById('tt_proxi').style.display="";
    }
}

function change_libelle_slocalisation(frm)
{
if (frm.localisation_principale[frm.localisation_principale.selectedIndex].value=='1083' || frm.localisation_principale[frm.localisation_principale.selectedIndex].value=='1079' || frm.localisation_principale[frm.localisation_principale.selectedIndex].value=='1084')
{
document.getElementById('tt_ville').innerHTML='Quartier';
}
else document.getElementById('tt_ville').innerHTML='Ville';
}

function selectRegion(champ,principal)
{
var choix = '';
	try
	{
		for (i=0;i<champ.length;i++)
		{
			if (champ.options[i].selected)
			{
				if (choix == '') choix = champ.options[i].value;
				else choix = choix + "," + champ.options[i].value;
			}
		}
		document.frmprdsearch.s_prd_Localisation.value=choix;
		if (document.frmprdsearch.s_prd_Localisation.value == '')
		{
		document.frmprdsearch.s_prd_Localisation.value=principal+"|0";
		}
	}
	catch(e){}
}


function check()
{
    var frm = document.frmsendmail;
	if (frm._nom.value=='')
	{
		alert('Veuillez renseigner votre nom');
		frm._nom.focus();
		return;
	}
	if (frm._email.value=='')
	{
		alert('Veuillez renseigner votre adresse e-mail');
		frm._email.focus();
		return;
	}
    if (frm.champ_cv != null)
    {
        var cv = frm.champ_cv.value;
    	if (frm.champ_cv.value == '' || (cv.indexOf('.pdf') == -1 && cv.indexOf('.PDF') == -1 && cv.indexOf('.doc') == -1 && cv.indexOf('.DOC') == -1))
	    {
	        alert('Veuillez joindre votre CV au format PDF ou WORD');
		    return;
	    }
	}
	if (frm.champ_lettremotivation != null)
	{
    	var lettre = frm.champ_lettremotivation.value;
    	if (frm.champ_lettremotivation.value == '' || (lettre.indexOf('.pdf') == -1 && lettre.indexOf('.PDF') == -1 && lettre.indexOf('.doc') == -1 && lettre.indexOf('.DOC') == -1))
	    {
	        alert('Veuillez joindre votre lettre de motivation au format PDF ou WORD');
	        return;
	    }
	}

document.getElementById('div_frm').style.display='none';
document.getElementById('div_wait').style.display='';
frm.submit();
}

function favoris()
{
	browserName = navigator.appName;
	browserVer = parseInt(navigator.appVersion);
	if (browserName == "Microsoft Internet Explorer" & browserVer >= 4) 
	{
		window.external.AddFavorite('http://www.gti-immobilier.fr/', 'gti-immobilier.fr');
	}
} 


var wnd;
function imagedetail_submit(before,mediaid,height,width) {
if (before) {
document.frmmedia.target="_mediapopup";
document.frmmedia.media_Model.value="imageseule";
wnd=window.open('', '_mediapopup', 'menubar=no,resizable=no,status=no,titlebar=no,scrollbars=no,width='+width+',height='+height);
			}
else wnd.focus(); 
}

function getSelected(opt)
{
	var selected;
	selected = '';
	for (var intLoop = 0; intLoop < opt.length; intLoop++)
	{
		if ((opt[intLoop].selected) || (opt[intLoop].checked))
		{
		if (selected != '') selected += ', ';
			selected += opt[intLoop].value;
		}
	}
	return selected;
}

function rechercher(){
	
	var frmFrame	= parent.mapframe.document.frmMapSearch;
	var frm			= document.frmprdsearch;
	var mainloc		= 0;
	var secloc		= 0;
	
	
	if (frm.__select_proxi.checked)
	{ 
		googlemap();
		return;
	}

	frmFrame.sType.value		= getSelected(frm.s_prd_Nature);
	if (frmFrame.sType.value == '')
	{
	    if (frm.__typetransac[1].checked)
	        frmFrame.sType.value = '211, 212, 213, 214, 215, 216, 253, 27, 28, 254, 108, 218, 217, 106, 107, 201'
	    else
	        frmFrame.sType.value = '2, 1, 36, 62, 251, 31, 41'    
	}
	frmFrame.sPieces.value		= getSelected(frm.s_prd_Pieces);
	
	if (frm.s_prd_Prices_temp.selectedIndex==8) 
    {
        frm.s_prd_Price1_min.value=frm.s_prd_Prices_temp.options[8].value;
        frm.s_prd_Price1_max.value='';
    }
    else 
    {
        frm.s_prd_Price1_min.value='';
        frm.s_prd_Price1_max.value=frm.s_prd_Prices_temp.options[frm.s_prd_Prices_temp.selectedIndex].value;
    }
    
    frmFrame.sPriceMin.value	= frm.s_prd_Price1_min.value;
	frmFrame.sPriceMax.value	= frm.s_prd_Price1_max.value;
	frmFrame.sSurfMin.value		= frm.s_prd_Surface_min.value;
	frmFrame.sChambresMin.value	= frm.s_prd_Chambres_min.value;
	frmFrame.sTerrainMin.value	= frm.s_prd_Terrain_min.value;
	frmFrame.forceZoom.value	= 1;
	
	//frmFrame.sRef.value			= frm.s_prd_Reference.value;
	
	try{mainloc = document.frmprdsearch.localisation_principale[document.frmprdsearch.localisation_principale.selectedIndex].value;}catch(e){}
	try{secloc = getSelected(eval('document.frmprdsearch.'+'localisation_'+mainloc));}catch(e){}
	
	if ((document.frmprdsearch.s_prd_Localisation.value == '') && (mainloc != 0) && secloc!=0 && secloc!='')
	{
		document.frmprdsearch.s_prd_Localisation.value = secloc;
	}
	else if ((document.frmprdsearch.s_prd_Localisation.value == '') && (mainloc != 0))
	{
		document.frmprdsearch.s_prd_Localisation.value = mainloc+"|0";
	}
	//alert(frm.s_prd_Localisation.value);return
	frmFrame.sLoc.value	= frm.s_prd_Localisation.value;
	
	frmFrame.submit();
}

function hideElement(id) {
	document.getElementById(id).style.display = 'none';
}

function numbersonly(e, decimal) {
var key;
var keychar;

if (window.event) {
key = window.event.keyCode;
}
else if (e) {
key = e.which;
}
else {
return true;
}
keychar = String.fromCharCode(key);

if ((key==null) || (key==0) || (key==8) ||  (key==9) || (key==13) || (key==27) ) {
return true;
}
else if ((("0123456789").indexOf(keychar) > -1)) {
return true;
}
else if (decimal && (keychar == ".")) { 
return true;
}
else
return false;
}

function rss(){
	
	var frmRss	= document.frmsendmail;
	var mainloc	= 0;
	
	try{mainloc = frmRss.localisation_principale[document.frmsendmail.localisation_principale.selectedIndex].value;}catch(e){}
	if ((frmRss._demande_localisation.value == '') && (mainloc != 0))
	{
		frmRss._demande_localisation.value = mainloc+"|0";
	}
	
	frmRss.submit();
	
}	



