// JavaScript Document
function remplir(a,b){
	if (a.value==""){
		a.value=b;
	}
}
function effacer(a,b){
	if (a.value==b){
		a.value="";
	}
}

// JavaScript Document

function process_keypress(event) {


    // Compatibilité IE / Firefox
    if(!event && window.event) {
        event = window.event;
		
    }
    // IE
    if(event.keyCode == 13) {
        event.returnValue = false;
        event.cancelBubble = true;
		
    }
    // DOM
    if(event.which == 13) {
        event.preventDefault();
        event.stopPropagation();
		
    }
}


function checkmontant(){
var montant=document.form2.montant.value;
document.getElementById('cemontant').style.display='block';
if(montant.length >2)
	{
		document.getElementById('finadea').style.display='none';
			document.getElementById('CDGP').style.display='none';
			
			document.getElementById('sofinco').style.display='none';
			document.getElementById('Mediatis-reserve').style.display='none';
			document.getElementById('Mediatis-pret').style.display='none';
			document.getElementById('sofinco-reserve').style.display='none';
			document.getElementById('cofinoga-pret').style.display='none';
			document.getElementById('complicio').style.display='none';
			//document.getElementById('monabanq-pret').style.display='none';
		
	 if (montant <150000 || montant == "150000") {
			if (montant >25000 || montant == "25000") {
			document.getElementById('finadea').style.display='block';
			}
			
		if (montant <60000 || montant == "60000")
		{
			
			
			
			if (montant <50000 || montant == "50000"){
				if (montant >3000 || montant == "3000") {
				document.getElementById('Mediatis-pret').style.display='block';
				}
			
			
			if (montant <40000 || montant == "40000"){
				if (montant >4000 || montant == "4000") {
				document.getElementById('sofinco').style.display='block';
				}}
			
			
				
				//if (montant <30000 || montant == "30000"){
				//if (montant >3000 || montant == "3000") {
				//document.getElementById('monabanq-pret').style.display='block';
				//}}
			
			
			if (montant <5000 || montant == "5000")
				{
					if (montant >500 || montant == "500") {
						document.getElementById('complicio').style.display='block';
					
					}
						if (montant <21500 || montant == "21500")
						{
							if (montant >150 || montant == "150")
							{document.getElementById('sofinco-reserve').style.display='block';
								
								}
							
							if (montant <10000 || montant == "10000")
							{
						
							if (montant >500 || montant == "500") {document.getElementById('Mediatis-reserve').style.display='block';}
								if (montant <6000 || montant == "6000")
								{
									
									
									
										if (montant <4000 || montant == "4000")
										{
											document.getElementById('CDGP').style.display='block';
											
											
										}
										
								}
							}
						}
				}
		}
	}
	}
	}
else {alert('Veuillez saisir un montant minimum de 100 euros.');}
		
}

function donner_focus(chp)
{
document.getElementById(chp).focus();
}

function afficheId(baliseId)
  {
  if (document.getElementById && document.getElementById(baliseId) != null)
    {
    document.getElementById(baliseId).style.visibility='visible';
    document.getElementById(baliseId).style.display='block';
    }
  }

function cacheId(baliseId)
  {
  if (document.getElementById && document.getElementById(baliseId) != null)
    {
    document.getElementById(baliseId).style.visibility='hidden';
    document.getElementById(baliseId).style.display='none';
    }
  }
  
// layer ad

var tmr;
var t;
var obj;

function sFa() {
	obj = gObj();
	sLft();
	shw(true);
	t = 0;
	setTimeout("sTmr()", 800);
}

function hFa() {
	t = -100;
	sTmr();
	return false;
}

function sTmr() {
	tmr = setInterval("fd()",20);
}

function fd() {
	var amt = Math.abs(t+=10);
	if(amt == 0 || amt == 100) clearInterval(tmr);
	amt = (amt == 100)?99.999:amt;
  	
	obj.style.filter = "alpha(opacity:"+amt+")";
	obj.style.KHTMLOpacity = amt/100;
	obj.style.MozOpacity = amt/100;
	obj.style.opacity = amt/100;
	
	if(amt == 0) shw(false);
}

function sLft() {
	var w = 170;	// set this to 1/2 the width of the faw div defined in the style sheet 
			// there's not a reliable way to retrieve an element's width via javascript!!
					
	var l = (document.body.innerWidth)? document.body.innerWidth / 2:document.body.offsetWidth / 2;

	obj.style.left = (l - w)+"px";
}

function gObj() {
	return document.getElementById("faw");	
}

function shw(b) {
	(b)? obj.className = 'show':obj.className = '';	
}

function verif_champs()
{
	if(document.contact.prenom.value == "")
	{
		alert("Veuillez entrer votre prénom SVP");
		document.contact.prenom.focus();
		return false;
	}
	if(document.contact.email.value == "")
	{
		alert("Veuillez saisir votre adresse email svp");
		document.contact.email.focus();
		return false;
	}
	if(document.contact.email.value.indexOf('@', '.') == -1) 

	{
		alert("Adresse Email invalide! Certains caractères sont manquants");
		document.contact.email.focus();
		return false;
	}
	if(document.contact.email.value.length <7)
	{
		alert("Adresse Email invalide!");
		document.contact.email.focus();
		return false;
	}
	
	
}

 function ScanCookie(variable)
     {
     cook = document.cookie;
     variable += "=";
     place = cook.indexOf(variable,0);
     if (place <= -1)
     return("0");
     else
     {
     end = cook.indexOf(";",place)
     if (end <= -1)
     return(unescape(cook.substring(place+variable.length,cook.length)));
     else
     return(unescape(cook.substring(place+variable.length,end)));
     }
     }
    
	function fenetreCent(url,nom,largeur,hauteur,options) {
		var haut=(screen.height-hauteur)/2;
		var Gauche=(screen.width-largeur)/2;
		fencent=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
		fencent.blur()
		window.focus();
		}
     function CreationCookie(nom,valeur,permanent)
     {
     if(permanent)
     {
     dateExp = new Date(2020,01,01);
     dateExp = dateExp.toGMTString();
     ifpermanent = '; expires=' + dateExp + ';';
     }
     else
     ifpermanent = '';
     document.cookie = nom + '=' + escape(valeur) + ifpermanent;
     }
     function click()
     {
    
     if(ScanCookie("dejapopup")==0)
     {
    
     popunder = fenetreCent('http://www.faire-un-credit.fr/offre-du-moment.html','fencent',900,600,'menubar=yes,scrollbars=yes,statusbar=yes');
     
     
    
    
    
     CreationCookie("dejapopup","oui",false)
     }
     }
     //-->
	 //document.onclick=click;
	 
	 
	