// mediatix.com rs 16/07/2007
/*
function convertClick() {
	if (verifValeurs()) {
		monnaie=1-monnaie;
		coeff=(monnaie==1)?1/pariteEuro:pariteEuro;
		document.frm.montant.value=inttostr(strtoint(document.frm.montant.value)*coeff);
		ongletClick(onglet);
	}
	return false;
}
function ongletClick(ong) {
	if (verifValeurs()) {
		l="index.php?client="+client+"&tpl="+template+"&ong="+ong+"&mnn="+monnaie;
		l+="&mnt="+strtoint(document.frm.montant.value);
		l+="&det="+document.frm.detail.value;
		if ((onglet==1)||(onglet==9)) {
			l+="&lie="+document.frm.lieu.selectedIndex+"&typ="+document.frm.type.selectedIndex+"&nbr="+document.frm.nombre.selectedIndex;
		} else {
			l+="&lie="+document.frm.lieu.value+"&typ="+document.frm.type.value+"&nbr="+document.frm.nombre.value;
		}
		
		if (document.getElementById('simuID')) {
			l += "&etatBien=" + document.frm.type.value + "&simuID="+document.frm.simuID.value+"&urlSF="+document.frm.urlSF.value
		}
		
		location=l;
	}
	return false;
}

function calcClick() {
	return ongletClick((onglet==9)?9:(onglet+1));
}
function detailClick() {
 document.frm.detail.value=1-document.frm.detail.value;
 return ongletClick(onglet);
}
*/
function verifValeurs() {
	var verifValeurs=0;
	if (strtoint(document.frm.montant.value)<=0)
		alert("Veuillez indiquer le montant de l'achat");
	else
		verifValeurs=1;
	return verifValeurs;
}

function ongletClick(ong) {
	if ((onglet==1)||(onglet==4)) {
		l="index.php?id_apporteur="+document.frm.id_apporteur.value+"&param="+document.frm.param.value+
				"&mnt="+strtoint(document.frm.montant.value)+/*"&mnn="+document.frm.monnaie.value+*/
				"&lieu="+document.frm.lieu.selectedIndex+"&type="+document.frm.type.value+
				"&ong="+ong+"&detail="+document.frm.detail.value+"&nombre="+document.frm.nombre.selectedIndex;
	} 
	else {
		l="index.php?id_apporteur="+document.frm.id_apporteur.value+"&param="+document.frm.param.value+
				"&mnt="+document.frm.montant.value+/*"&mnn="+document.frm.monnaie.value+*/
				"&lieu="+document.frm.lieu.value+"&type="+document.frm.type.value+"&ong="+ong+
				"&detail="+document.frm.detail.value+"&nombre="+document.frm.nombre.value;
	}

	if (document.getElementById('simuID')) {
		l += "&etatBien=" + document.frm.type.value +"&simuID="+document.frm.simuID.value+"&urlSF="+document.frm.urlSF.value
	}
	
	location=l;
	return false;
}
function printClick() {
	bn	= navigator.appName;
	bv	= navigator.appVersion;
	nsv	= parseFloat(bv);
	iev	= bv.substring(bv.indexOf('MSIE ')+5);
	iev	= parseFloat(iev);
	if ((bn=="Netscape" && nsv >=4) || (bn=="Microsoft Internet Explorer" && iev >=5))
		print();
	else
		alert("Cette fonction nécessite Microsoft Internet Explorer 5 ou Netscape Navigator 4!");
}

function convertClick() {
	monnaie	= 1-document.frm.monnaie.value;
	document.frm.monnaie.value=monnaie;
	coeff	= (monnaie==1)?1/pariteEuro:pariteEuro;
	document.frm.montant.value=Math.round(strtoint(document.frm.montant.value)*coeff);
	return ongletClick(onglet);
}

function calcClick() {
	if (onglet==1)
		return ongletClick(2)
	else
		return ongletClick(onglet);
}

function detailClick() {
	document.frm.detail.value=1-document.frm.detail.value;
	return ongletClick(onglet);
}

function affice_habitation(){
	
	if (document.frm.type.value == "NEUF"){
		//alert(document.frais_notaire.nature_bien.value);
		document.getElementById("nom_habitation").style.visibility = "visible";
		document.getElementById("nom_habitation").style.display = "block";
	}
	else{
		document.getElementById("nom_habitation").style.visibility = "hidden";
		document.getElementById("nom_habitation").style.display = "none";
	}
}
function retourSF () {
	document.form_retourSF.submit();
}
