var zipzip = [];

	var for_sale;
	var get_type;
	function afficheCarte(nature, forsale, typeNature){ $("#carteSlide2").hide(); $("#carteSlide").hide(); for_sale = forsale; get_type = typeNature; $("#whatCardBox").html(nature); $("#carteSlide").show("slide");}
	function afficheCarte2(){$("#carteSlide2").hide(); $("#carteSlide").hide(); $("#carteSlide2").show("slide");}
/*
function validationCarte(lang, num)
{
	var departement = num;
	window.location.href ='listing.php?lang='+lang+'&departement='+departement+"&for_sale="+for_sale+"&type="+get_type; 
}
*/
function validationCarte(dep, lang, num){

	var departement = num;
	var namedep = $('#'+dep).attr( "alt");
	
	if(lang== "fr"){

		if (get_type == "1") window.location.href ='appartements,'+namedep+'-'+departement+',0.html'; 
		else if  (get_type == "2") window.location.href ='maisons,'+namedep+'-'+departement+',0.html'; 
		else if  (get_type == "3") window.location.href ='terrains,'+namedep+'-'+departement+',0.html'; 
		else if  (get_type == "0,4,5,6,7,8") window.location.href ='commerces,'+namedep+'-'+departement+',0.html'; 
		else window.location.href ='locations,'+namedep+'-'+departement+',0.html'; 

	}
	
	else window.location.href ='listing.php?departement='+departement+"&for_sale="+for_sale+"&type="+get_type;
	
}


function show_c(carte) {
	var e = document.getElementById(carte).className; 
	if (e == 'off') document.getElementById(carte).className  = 'on';
	
}
function hide_c(carte) {
	var e = document.getElementById(carte).className; 
	if (e == 'on')	document.getElementById(carte).className  = 'off';
}

function active_c(carte, num) {

	if (jQuery.inArray(num, zipzip) != -1)
		{
			zipzip.splice( $.inArray(num, zipzip), 1 );
			$('#departement').val(zipzip);
		}
	else
		{
			zipzip.push(num);
			$('#departement').val(zipzip);
		}

	if (document.getElementById(carte).className != 'active') document.getElementById(carte).className  = 'active';
	else document.getElementById(carte).className  = 'off';
}
