// JavaScript Document





/***********************************************

* DEBUT js page contact

***********************************************/



var selectedtablink=""

var tcischecked=false



function handlelink(aobject){

selectedtablink=aobject.href

tcischecked=(document.tabcontrol && document.tabcontrol.tabcheck.checked)? true : false

if (document.getElementById && !tcischecked){

var tabobj=document.getElementById("tablist")

var tabobjlinks=tabobj.getElementsByTagName("A")

for (i=0; i<tabobjlinks.length; i++)

tabobjlinks[i].className=""

aobject.className="current"

document.getElementById("tabiframe").src=selectedtablink

return false

}

else

return true

}



function handleview(){

tcischecked=document.tabcontrol.tabcheck.checked

if (document.getElementById && tcischecked){

if (selectedtablink!="")

window.location=selectedtablink

}

}

/***********************************************

* FIN js page contact

***********************************************/





/***********************************************

* DEBUT js calcul herbergement

***********************************************/

function ChangeDom(ValueDom){
	var valdom = document.getElementById("valuedom");
	valdom.value= ValueDom;
	if(valdom.value == "oui"){
	document.getElementById('saisidom').style.display = "block";
	document.getElementById('nomdomok').style.display = "block";
	document.getElementById('nomdomno').style.display = "none";
	}else if(valdom.value == "non"){
	  document.getElementById('saisidom').style.display = "block";
	  document.getElementById('nomdomok').style.display = "none";
	  document.getElementById('nomdomno').style.display = "block";
	}else{
		document.getElementById('saisidom').style.display = "none";
		document.getElementById('nomdomok').style.display = "none";
	    document.getElementById('nomdomno').style.display = "none";
		document.getElementById('showmontant').style.display = "none";
	}
}


function returndiambar(valeur){
	var valdome = document.getElementById("valuedom");
	var saisidom = document.getElementById("domainename");
	var seldom = document.getElementById("dom");
	var selemail = document.getElementById("adrssemail");
	var typherb = document.getElementById("type_herg");
	var montant = document.getElementById("montant");
	var asstechn = document.getElementById("asstechn");
	
	if(valeur == 201){
	  tval = "<p style='text-align:center'><strong>Nous vous proposons le pack suivant : </strong></p><p><ul><li><strong>Nom de domaine :</strong> <br>";
	tval+= saisidom.value + seldom.value;
	tval+="</li><li>Un nombre d\'adresses mail illimité<br>Consultation : webmail / Outlook</li><li><strong>5 </strong>Go d\'espace web (html, php, CGI) </li><li><strong>25 </strong>Go d\'espace email </li><li><strong>10 </strong>Bases de données MySQL, PHP MyAdmin </li><li>Statistiques détaillées</li><li><strong> Pack(249 500)</strong></li><li><strong> + domaine en .sn(30 000)</strong></li>";
	if(asstechn.checked){
		     tval+="<li><strong> + Assistance technique (25 000) </strong></li></ul> </p><br><p>Montant : <strong>";
			 tval+= 249500 + 30000 + 25000;
	   }else{
		   
		   tval+="</ul> </p><p>Montant : <strong>";
			 tval+= 249500 + 30000;
	   }
	
	tval+=" FCFA HT / AN</strong></p>";
	document.getElementById("showmontant").style.display='block';
	return tval;
	}else if(valeur == 202){
	  tval = "<p style='text-align:center'><strong>Nous vous proposons le pack suivant : </strong></p><p><ul><li><strong>Nom de domaine :</strong> <br>";
	tval+= saisidom.value + seldom.value;
	tval+="</li><li>Un nombre d\'adresses mail illimité<br>Consultation : webmail / Outlook</li><li><strong>5 </strong>Go d\'espace web (html, php, CGI) </li><li><strong>25 </strong>Go d\'espace email </li><li><strong>10 </strong>Bases de données MySQL, PHP MyAdmin </li><li>Statistiques détaillées</li><li><strong> Pack(249 500)</strong></li>";
	
	if(asstechn.checked){
		     tval+="<li><strong> + Assistance technique (25 000) </strong></li></ul> </p><br><p>Montant : <strong>";
			 tval+= 249500 + 25000;
	   }else{
		   
		   tval+="</ul> </p><p>Montant : <strong>";
			 tval+= 249500;
	   }
	   
	   tval+=" FCFA HT / AN</strong></p>";
	   document.getElementById("showmontant").style.display='block';
	return tval;
	}
}

function returnpack(nomdom,nbremails,espaceweb,espacemail,typesite,typedom,montant){
	 document.getElementById("montant").value = montant;
	var asstechn = document.getElementById("asstechn");
	 
	if(espacemail == ''){
	  tval = "<p style='text-align:center'><strong>Nous vous proposons le pack : </strong></p><p><ul><li><strong>Nom de domaine :</strong> <br>"+ nomdom +"</li><li><strong>"+  espaceweb + "</strong> Go d\'espace web (html) </li>";
	   if(nbremails == 1){
		  tval+="<li><strong>1 </strong> compte email (1 Go) personnalisé<br>Consultation : webmail / Outlook</li>";
		  tval+="<li><strong>Pack(49 500) </strong></li>";
	  }else{
		  tval+="<li>Consultation : webmail / Outlook</li>";
		  tval+="<li><strong>Pack(49 500) </strong></li>";
		  tval+="<li><strong> + "+  nbremails + " comptes mails(50 000)</strong></li>";
	  }
	  
	  if(typesite == 'dynamique'){
		  tval+="<li><strong> + Site "+  typesite + "(50 000)</strong></li>";
	  }
	  if(typedom == '.sn'){
		  tval+="<li><strong> + domaine en "+  typedom + "(30 000)</strong></li>";
	  }
	   if(asstechn.checked){
		     tval+="<li><strong> + Assistance technique (25 000) </strong></li>";
			 
	   }
	 tval+="</ul> </p><p>Montant : <strong>" +  montant +" FCFA HT / AN</strong></p>";
	 document.getElementById("showmontant").style.display='block';
	return tval;
	}else{
		tval = "<p style='text-align:center'><strong>Nous vous proposons le pack: </strong></p><p><ul><li><strong>Nom de domaine :</strong> <br>"+ nomdom +"</li><li><strong>" + espaceweb + "</strong> Go d\'espace web (html) </li><li><strong>"+ espacemail +"</strong> Go d\'espace mail (2Go/mail) </li>";
		if(nbremails == 10){
		   tval+="<li><strong>10 </strong> comptes emails personnalisés<br>Consultation : webmail / Outlook</li>";
		   tval+="<li><strong>Pack(129 500) </strong></li>";
	  }else{
		    tval+="<li>Consultation : webmail / Outlook</li>";
		    tval+="<li><strong>Pack(129 500) </strong></li>";
		    tval+="<li><strong> + "+  nbremails + " comptes mails(50 000)</strong></li>";
	  }
		if(typesite == 'dynamique'){
		  tval+="<li><strong> + Site "+  typesite + "(50 000)</strong></li>";
	  }
	  if(typedom == '.sn'){
		  tval+="<li><strong> + domaine en "+  typedom + "(30 000)</strong></li>";
	  }
	  if(asstechn.checked){
		     tval+="<li><strong> + Assistance technique (25 000) </strong></li>";
	   }
		tval+="</ul> </p><p>Montant : <strong>" +  montant +" FCFA HT / AN</strong></p>";
		document.getElementById("showmontant").style.display='block';
	return tval;
	}
	
}

function calculherb(){ 
	var valdome = document.getElementById("valuedom");
	var saisidom = document.getElementById("domainename");
	var seldom = document.getElementById("dom");
	var selemail = document.getElementById("adrssemail");
	var typherb = document.getElementById("type_herg");
	var affmontant = document.getElementById("showmontant");
	 var asstechn = document.getElementById("asstechn");
	document.getElementById("showmontant").style.display='none';
	
	document.getElementById("coordone").style.display='none';
	
	if(saisidom.value == "" && valdome.value == 'oui'){
	    alert('Veuillez saisir votre nom de domaine svp !!!');
		saisidom.focus();
		return false;
	}else if(saisidom.value == "" && valdome.value == 'non'){
		
		alert('Veuillez saisir le nom de domaine que vous souhaitez svp !!!');
		saisidom.focus();
		return false;
	}else if(saisidom.value != "" && seldom.value == ''){
	  alert('Sélectionnez une extension pour votre nom de domaine !!!');
		seldom.focus();
		return false;
	}
	document.getElementById('selherberg').style.display='block';
	if(selemail.value == ""){
		alert('Sélectionnez le nombre de mail que vous souhaitez !!!');
		selemail.focus();
	}else if(selemail.value == 1){affmontant.style.display = 'block';
		if(typherb.value == ''){
			alert("Sélectionnez le type d'hebergement que vous désirez !!!");
		    typherb.focus();
		}else if(typherb.value == 'dynamique'){
			if(seldom.value == '.sn'){
				//affmontant.innerHTML = 'jokko' + '50000(base de données) + 30000(.sn)';
			   if(asstechn.checked){
				   t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'154 500');
			   }else{
				  t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'129 500'); 
				   
			   }
	
				
				affmontant.innerHTML = t;
			}else{
				//affmontant.innerHTML = 'jokko' + '50000(base de données)';
				if(asstechn.checked){
				   t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'154 500');
			   }else{
				  t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'124 500'); 
				   
			   }
				
				affmontant.innerHTML = t;
				
			}
			
		}else if(typherb.value == 'statique'){
			if(seldom.value == '.sn'){
				//affmontant.innerHTML = 'jokko + 30000(.sn)';
				if(asstechn.checked){
				   t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'74 500');
			   }else{
				 t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'49 500');
				   
			   }
				affmontant.innerHTML = t;
			}else{
				//affmontant.innerHTML = 'jokko' ;
				
				affmontant.innerHTML = t;
			}
		}
		
	}else if(selemail.value == 5){affmontant.style.display = 'block';
		if(typherb.value == ''){
			alert("Sélectionnez le type d'hebergement que vous désirez !!!");
		    typherb.focus();
		}else if(typherb.value == 'dynamique'){
			if(seldom.value == '.sn'){
				//affmontant.innerHTML = 'jokko + 50000(email)' + '50000(base de données) + 30000(.sn)';
				if(asstechn.checked){
				  t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'204 500');
			   }else{
				 t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'179 500');
			   }
				
				affmontant.innerHTML = t;
			}else{
				
				  if(asstechn.checked){
				 t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'174 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'149 500');
			   }
				
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'jokko + 50000(email)' + '50000(base de données)';
			}
			
		}else if(typherb.value == 'statique'){
			if(seldom.value == '.sn'){
				
				 if(asstechn.checked){
				t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'154 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'129 500');
			   }
				
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'jokko + 50000(email) + 30000(.sn)';
			}else{
				
				if(asstechn.checked){
				t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'124 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,1,'',typherb.value,seldom.value,'99 500');
			   }
				
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'jokko + 50000(email)' ;
			}
		}
		
	}else if(selemail.value == 10){affmontant.style.display = 'block';
		if(typherb.value == ''){
			alert("Sélectionnez le type d'hebergement que vous désirez !!!");
		    typherb.focus();
		}else if(typherb.value == 'dynamique'){
			if(seldom.value == '.sn'){
				
				if(asstechn.checked){
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'234 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'209 500');
			   }
				
				
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'biddew' + '50000(base de données) + 60000(.sn)';
			}else{
				if(asstechn.checked){
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'324 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'299 500');
			   }
				
				
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'biddew' + '50000(base de données)';
			}
			
		}else if(typherb.value == 'statique'){
			if(seldom.value == '.sn'){
				
				if(asstechn.checked){
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'184 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'159 500');
			   }
				
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'biddew + 30000(.sn)';
			}else{
				
				  if(asstechn.checked){
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'154 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'129 500');
			   }
				
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'biddew' ;
			}
		}
		
	}else if(selemail.value == 15){affmontant.style.display = 'block';
		if(typherb.value == ''){
			alert("Sélectionnez le type d'hebergement que vous désirez !!!");
		    typherb.focus();
		}else if(typherb.value == 'dynamique'){
			if(seldom.value == '.sn'){
				 if(asstechn.checked){
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'284 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'259 500');
			   }
				
				affmontant.innerHTML = t;
	//affmontant.innerHTML = 'biddew + 50000(email)' + '50000(base de données) + 30000(.sn)';
			}else{
				
				   if(asstechn.checked){
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'254 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'229 500');
			   }
				
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'biddew + 50000(email)' + '50000(base de données)';
			}
			
		}else if(typherb.value == 'statique'){
			if(seldom.value == '.sn'){
				
				if(asstechn.checked){
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'234 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'209 500');
			   }
				
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'biddew + 50000(email) + 30000(.sn)';
			}else{
				
				if(asstechn.checked){
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'204 500');
			   }else{
				t=returnpack(saisidom.value + seldom.value,selemail.value,2,20,typherb.value,seldom.value,'179 500');
			   }
			   
				
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'biddew + 50000(email)' ;
			}
		}
		
	}else if(selemail.value == 20 || selemail.value == 'plus'){
		affmontant.style.display = 'block';
		document.getElementById('selherberg').style.display='none';
		
		if(seldom.value == '.sn'){
			    t = returndiambar(201);
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'Diambar + 30000(.sn)';
			}else{
				t = returndiambar(202);
				affmontant.innerHTML = t;
				//affmontant.innerHTML = 'Diambar';
			}
	}
}


function reinit(){
	var selemail = document.getElementById("adrssemail");
	var typherb = document.getElementById("type_herg");
	var affmontant = document.getElementById("showmontant");
	
	document.getElementById("selherberg").style.display='block';
	selemail.value = ''; 
	typherb.value = '';
	affmontant.style.display = 'none';
	
}
/***********************************************

* FIN js calcul herbergement

***********************************************/



function demandeplan(ObjetType){

	//alert(ObjetType);

	if(ObjetType=="webplan"){

		for(i=1;i<15;i++){

			document.getElementById('webpro'+i).checked=false;

		}

		document.getElementById('showwebplan').style.display = 'block';

		document.getElementById('showwebpro').style.display = 'none';

		document.getElementById('enrg').style.display = 'block';

	}else if(ObjetType=="webpro"){

		for(i=1;i<3;i++){

			document.getElementById('webplan'+i).checked=false;

		}

	  document.getElementById('showwebplan').style.display = 'none';

		document.getElementById('showwebpro').style.display = 'block';

		document.getElementById('enrg').style.display = 'block';

	}

}





function Localpopup(CarteLink)

{ 

	var t = (screen.availHeight/2) - (600/2);

	var l = (screen.availWidth/2) - (800/2);

	var emailWin = window.open(CarteLink, "emailWin", "scrollbars=yes,toolbar=1,statusbar=0,width=800,height=600,top="+t+",left="+l);

}





/*******************************************************************************

 DEBUT Script pour gérer le code image de vérification (captcha)

*******************************************************************************/



var hex_chr = "0123456789abcdef";

function rhex(num)

{

  str = "";

  for(j = 0; j <= 3; j++)

    str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) +

           hex_chr.charAt((num >> (j * 8)) & 0x0F);

  return str;

}



/*

 * Convert a string to a sequence of 16-word blocks, stored as an array.

 * Append padding bits and the length, as described in the MD5 standard.

 */

function str2blks_MD5(str)

{

  nblk = ((str.length + 8) >> 6) + 1;

  blks = new Array(nblk * 16);

  for(i = 0; i < nblk * 16; i++) blks[i] = 0;

  for(i = 0; i < str.length; i++)

    blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * 8);

  blks[i >> 2] |= 0x80 << ((i % 4) * 8);

  blks[nblk * 16 - 2] = str.length * 8;

  return blks;

}



/*

 * Add integers, wrapping at 2^32. This uses 16-bit operations internally 

 * to work around bugs in some JS interpreters.

 */

function add(x, y)

{

  var lsw = (x & 0xFFFF) + (y & 0xFFFF);

  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);

  return (msw << 16) | (lsw & 0xFFFF);

}



/*

 * Bitwise rotate a 32-bit number to the left

 */

function rol(num, cnt)

{

  return (num << cnt) | (num >>> (32 - cnt));

}



/*

 * These functions implement the basic operation for each round of the

 * algorithm.

 */

function cmn(q, a, b, x, s, t)

{

  return add(rol(add(add(a, q), add(x, t)), s), b);

}

function ff(a, b, c, d, x, s, t)

{

  return cmn((b & c) | ((~b) & d), a, b, x, s, t);

}

function gg(a, b, c, d, x, s, t)

{

  return cmn((b & d) | (c & (~d)), a, b, x, s, t);

}

function hh(a, b, c, d, x, s, t)

{

  return cmn(b ^ c ^ d, a, b, x, s, t);

}

function ii(a, b, c, d, x, s, t)

{

  return cmn(c ^ (b | (~d)), a, b, x, s, t);

}



/*

 * Take a string and return the hex representation of its MD5.

 */

function MD5(str)

{

  x = str2blks_MD5(str);

  var a =  1732584193;

  var b = -271733879;

  var c = -1732584194;

  var d =  271733878;

 

  for(i = 0; i < x.length; i += 16)

  {

    var olda = a;

    var oldb = b;

    var oldc = c;

    var oldd = d;



    a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);

    d = ff(d, a, b, c, x[i+ 1], 12, -389564586);

    c = ff(c, d, a, b, x[i+ 2], 17,  606105819);

    b = ff(b, c, d, a, x[i+ 3], 22, -1044525330);

    a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);

    d = ff(d, a, b, c, x[i+ 5], 12,  1200080426);

    c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);

    b = ff(b, c, d, a, x[i+ 7], 22, -45705983);

    a = ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);

    d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);

    c = ff(c, d, a, b, x[i+10], 17, -42063);

    b = ff(b, c, d, a, x[i+11], 22, -1990404162);

    a = ff(a, b, c, d, x[i+12], 7 ,  1804603682);

    d = ff(d, a, b, c, x[i+13], 12, -40341101);

    c = ff(c, d, a, b, x[i+14], 17, -1502002290);

    b = ff(b, c, d, a, x[i+15], 22,  1236535329);    



    a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);

    d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);

    c = gg(c, d, a, b, x[i+11], 14,  643717713);

    b = gg(b, c, d, a, x[i+ 0], 20, -373897302);

    a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);

    d = gg(d, a, b, c, x[i+10], 9 ,  38016083);

    c = gg(c, d, a, b, x[i+15], 14, -660478335);

    b = gg(b, c, d, a, x[i+ 4], 20, -405537848);

    a = gg(a, b, c, d, x[i+ 9], 5 ,  568446438);

    d = gg(d, a, b, c, x[i+14], 9 , -1019803690);

    c = gg(c, d, a, b, x[i+ 3], 14, -187363961);

    b = gg(b, c, d, a, x[i+ 8], 20,  1163531501);

    a = gg(a, b, c, d, x[i+13], 5 , -1444681467);

    d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);

    c = gg(c, d, a, b, x[i+ 7], 14,  1735328473);

    b = gg(b, c, d, a, x[i+12], 20, -1926607734);

    

    a = hh(a, b, c, d, x[i+ 5], 4 , -378558);

    d = hh(d, a, b, c, x[i+ 8], 11, -2022574463);

    c = hh(c, d, a, b, x[i+11], 16,  1839030562);

    b = hh(b, c, d, a, x[i+14], 23, -35309556);

    a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);

    d = hh(d, a, b, c, x[i+ 4], 11,  1272893353);

    c = hh(c, d, a, b, x[i+ 7], 16, -155497632);

    b = hh(b, c, d, a, x[i+10], 23, -1094730640);

    a = hh(a, b, c, d, x[i+13], 4 ,  681279174);

    d = hh(d, a, b, c, x[i+ 0], 11, -358537222);

    c = hh(c, d, a, b, x[i+ 3], 16, -722521979);

    b = hh(b, c, d, a, x[i+ 6], 23,  76029189);

    a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);

    d = hh(d, a, b, c, x[i+12], 11, -421815835);

    c = hh(c, d, a, b, x[i+15], 16,  530742520);

    b = hh(b, c, d, a, x[i+ 2], 23, -995338651);



    a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);

    d = ii(d, a, b, c, x[i+ 7], 10,  1126891415);

    c = ii(c, d, a, b, x[i+14], 15, -1416354905);

    b = ii(b, c, d, a, x[i+ 5], 21, -57434055);

    a = ii(a, b, c, d, x[i+12], 6 ,  1700485571);

    d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);

    c = ii(c, d, a, b, x[i+10], 15, -1051523);

    b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);

    a = ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);

    d = ii(d, a, b, c, x[i+15], 10, -30611744);

    c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);

    b = ii(b, c, d, a, x[i+13], 21,  1309151649);

    a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);

    d = ii(d, a, b, c, x[i+11], 10, -1120210379);

    c = ii(c, d, a, b, x[i+ 2], 15,  718787259);

    b = ii(b, c, d, a, x[i+ 9], 21, -343485551);



    a = add(a, olda);

    b = add(b, oldb);

    c = add(c, oldc);

    d = add(d, oldd);

  }

  return rhex(a) + rhex(b) + rhex(c) + rhex(d);

}





function Aff_Captcha()



{ 

var rand = randomInt(0, 10000);

//alert(rand);



var md = MD5(rand+'acbgf');


	 var im = "captcha/inc/function.cp.php?session="+md ;

	document.getElementById('sess').value = md; 

	document.getElementById('sp_code').value = "";

	codediv('');

document.getElementById('img_captcha').src = im; 




}



 function GetXmlHttpObject() {

      if( window.XMLHttpRequest )

         objXMLHttp = new XMLHttpRequest();

      else if( window.ActiveXObject )

         objXMLHttp = new ActiveXObject( "Microsoft.XMLHTTP" );

      return objXMLHttp;

   }

 

   function rechargerPage() {

      objXMLHttp = GetXmlHttpObject();

      if (objXMLHttp == null) {

         alert("Votre navigateur ne supporte pas les requêtes HTTP.");

         return false;

      }

 

      var url = "http://ns39040.ovh.net/jobseekers/captcha/inc/function.cp.php?session=d41dcd98f00b204e9800998ecf8427e"; 	// le script à appeller

      objXMLHttp.open( "GET", url, true );	//envoi en POST asynchrone

      // fonction à exécuter dès réception de la réponse

      objXMLHttp.onreadystatechange = function() {

         if( objXMLHttp.readyState == 4) {

            var tmp = objXMLHttp.responseText;

			alert(tmp);

            document.getElementById('img_captcha').src = tmp;

            //visible();

         }	

      }

      objXMLHttp.send( null );

   }

	

function randomReal(low, high)

// Given  : low <= high

// Given  : a random real number in the range [low, high)


{

    return Math.random()*(high-low) + low;

}



function randomInt(low, high)

// Given  : low <= high

// Given  : a random real integer in the range [low, high]

{

    return Math.floor(Math.random()*(high-low+1)) + low;

}



function randomChar(str)

// Given  : str is a nonempty string

// Returns: a random character from the string

{

        return str.charAt(randomInt(0, str.length-1));

}



function randomItem(list)

// Given  : list is a nonempty list (array)

// Returns: a random item from the list

{

        return list[randomInt(0, list.length-1)];

}


function file(fichier)

     {//alert(fichier);

     if(window.XMLHttpRequest) // FIREFOX

          xhr_object = new XMLHttpRequest(); 

     else if(window.ActiveXObject) // IE

          xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 

     else 

          return(false); 

     xhr_object.open("GET", fichier, false); 

     xhr_object.send(null); 

     if(xhr_object.readyState == 4) return(xhr_object.responseText);

     else return(false);

     }


function codediv(texte)

     {

     document.getElementById('code').innerHTML = texte;

     }


function verifCode(code)

     { 
	 
     if(code != '') 

               {
			  var session = document.getElementById('sess').value;
			  var temoin = document.getElementById('temoinverif');
			  temoin.value = "";

         texte = file('captcha/action.php?sp_code='+escape(code)+'&session='+escape(session))


          if(texte == 1 && code.length==5){

               /*codediv('<span style="color:red;font-size=10;font-face=arial"><b>'+code+' :</b> Le code saisi est incorrect !</span>');*/
			   temoin.value = "";
		  }else if(texte == 2 && code.length==5){

              /* codediv('<span style="color:green;font-size=10;font-face=arial"><b>'+code+' :</b> Le code saisi est correct !</span>');*/
			   temoin.value = 2;

		  }else

               codediv('');

                         }

              


     }
