// Selection Achat
var selection; // 0 : no selection ; 1 = achat; 2 = location

function selectionGL(type_sel)																					 
{
	
	selection = type_sel;
	
	if (selection == 1) // selection achat
	{
		$("#tabs-2").tabs().click(1);
		sendVariablesAchat (1); 
	}
	else if (selection == 2) // selection location
	{
		$("#tabs-2").tabs().click(2);
		sendVariablesLoc (1); 
	}
	
}


function home()																					 
{
	/*
		if(selection == 1)
		{
			document.getElementById("id_achat").style.display='none';
			$("#id_home").fadeIn();
			document.getElementById("achat_link").className= '';
			document.getElementById("home_link").className= 'current';
		}
		else 
			if (selection == 2)
			{
				$("#id_loc").fadeOut("fast", function(){$("#id_home").fadeIn("fast");});
				document.getElementById("loc_link").className= '';
				document.getElementById("home_link").className= 'current';
			}
	*/
	
}

// Affiche tous les biens de la section Achat dès qu'on arrive sur la page
function initAchat()
{
	var page = "scripts/xmlHttpRequest_achat.php";
	var variables = "typeBien=none"+"&nbrPieces="+"&localisation="+"&surface=0"+"&criteresPlus=none"+"&sel=0";

	loadXMLPosDocAchat(page,variables);
	
}

// Affiche tous les biens de la section Achat dès qu'on arrive sur la page
function initLoc()
{
	var page = "scripts/xmlHttpRequest_loc.php";
	var variables = "typeBien=none"+"&nbrPieces="+"&localisation="+"&loyer=0"+"&criteresPlus=none"+"&sel=0";
	
	loadXMLPosDocLoc(page,variables);
	
}

// Affiche tous les biens de la section Local Commercial dès qu'on arrive sur la page
function initCommercial()
{
	var page = "scripts/xmlHttpRequest_commercial.php";
	var variables = "locaux_commerciaux=on"+"&locaux_indus=on"+"&bureaux=on"+"&fonciers=on"+"&type_commerce=none"+"&localisation="+"&surface_min=0"+"&surface_max="+"&budget_min=0"+"&budget_max="+"&criteresPlus=";
	
	loadXMLPosDocCommercial(page,variables);
	
}
