function affich_help(page,url,largeur,hauteur,barre) {
	var top=100;
	var left=((screen.width-largeur)/2)-10;
	fen=window.open(url,page,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+",menubar=0,status=0,resizable=0,scrollbars="+barre+",location=0, toolbar=0")
}
function popupApalof()
{
	window.open ("recuperation/recup_pseudo_Apalof.asp","pop","menubar=0,status=0,resizable=0,scrollbars=0,location=0,width=450,height=300,top=0,left=0")
}

/*************** PAGE D'ACCUEIL ********************/
function popup(){
	window.open ("recuperation/recup_pseudo.asp","pop","menubar=0,status=0,resizable=0,scrollbars=0,location=0,width=450,height=300,top=0,left=0")
}
/*************** PAGE CONTACT ********************/
function popup2(){
	window.open ("../recuperation/recup_pseudo.asp","pop","menubar=0,status=0,resizable=0,scrollbars=0,location=0,width=450,height=300,top=0,left=0")
}

function validmrh()
{
if((document.mdlog.numord.value=='') || isNaN(document.mdlog.numord.value))
{
 alert("veuillez renseigner un numéro de devis valide, ex : -123456 ");
 document.mdlog.numord.focus();
 return false;
}
if( (document.mdlog.daten1.value=='') || isNaN(document.mdlog.daten1.value) || (document.mdlog.daten2.value=='') || isNaN(document.mdlog.daten2.value)
	|| (document.mdlog.daten3.value=='') || isNaN(document.mdlog.daten3.value)
	|| (document.mdlog.daten1.value > 32) || (document.mdlog.daten2.value > 13))
{
 alert("veuillez renseigner une date de naissance valide");
 document.mdlog.daten1.focus();
 return false;
}

return true;

}

function getElement(id) {
	if (!document.getElementById) { return; }

	if (document.all) {
		return eval("document.all." + id)
	} else {
		return document.getElementById(id)
	}
}
function DisplayS(id) {
	getElement('syn'+id).style.display = (getElement('syn'+id).style.display == "none" ? "" : "none");
}
/*************** FORUM_THEMATIQUE.ASP ********************/
function navigation(liste){
	if (liste.value == 0 ) {
		//location.href = "http://dlaserver/nouveau"
	} else {
		location.href = "forum-locapass-pass-travaux.asp?idthem="+liste.value
	}
}

/*************** MEDIA.ASP **********************************/
/* deja présents
function getElement(id) {
	if (!document.getElementById) { return; }

	if (document.all) {
		return eval("document.all." + id)
	} else {
		return document.getElementById(id)
	}
}
function DisplayS(id) {
	getElement('syn'+id).style.display = (getElement('syn'+id).style.display == "none" ? "inline" : "none");
}
*/
function affich_media(page,url,largeur,hauteur,barre) {
	var top=100;
	var left=((screen.width-largeur)/2)-10;
	media=window.open(url,page,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+",menubar=0,status=0,resizable=0,scrollbars="+barre+",location=0, toolbar=0")
}

function calculmensu(capital, duree, taux)
{
	var C,n,t,x = 0;
	C = Number(capital);
	n = Number(duree);
	t = Number(taux);

	a = 1+(t/12)/100;

	x = Math.pow(a,n)*(a-1)*C /(Math.pow(a,n)-1);
	return Math.round(x*100)/100;
}
 
function calcultotal(mensualite, duree, taux )
{
	var C,n,t,l = 0;
	
	
	n = Number(duree);
	t = Number(taux);
	t = t/1200+1;
	m = Number(mensualite);
	
	l = -m/(1-t);
	x = -l/Math.pow(t,n)+l;
	return Math.round(x*100)/100;

}

function calculduree(capital, mensualite, taux)
{
	var C,a,t,l, temp1, tampA = 0;
	
	C = Number(capital);
	t = Number(taux);
	a = 1+(t/12)/100;
	m = Number(mensualite);
	
	l = Math.round(m/(1-a));
	temp1 = Math.round(l+C);
	temp1 = l/(C+l);
	temp1 = Math.log(temp1)
	tempA = Math.log(a);
	x = temp1/tempA; 
	return Math.round(x);	
}

