function getXhr(){
var xhr = null;
if(window.XMLHttpRequest)
xhr = new XMLHttpRequest();
else if(window.ActiveXObject){ 
try {
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
}
else {
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
xhr = false;
}
return xhr;
}
function charger(){
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('ville').innerHTML =xhr.responseText;
}
}
xhr.open("POST","form/recherche/charger.php",true);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
sel = document.getElementById('region');
idregion = sel.options[sel.selectedIndex].value;
xhr.send("idregion=" + idregion);
}
function charger1(){

var xhr = getXhr();

xhr.onreadystatechange = function(){
//&& typeof(xhr)!="undefined"

if(xhr.readyState == 4 && xhr.status == 200 ){	// 
document.getElementById('div_page').innerHTML =xhr.responseText;
}else{
	document.getElementById('div_page').innerHTML="<center><br><br><img  src='images/Loading.gif'/><br><br>Loading ...</center>";//"Loading ...";
	}
}
xhr.open("POST","form/recherche/charger2.php",true);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
sel = document.getElementById('statut');
statut = sel.options[sel.selectedIndex].value;
sel = document.getElementById('villee');
villee = sel.options[sel.selectedIndex].value;
sel = document.getElementById('region');
region = sel.options[sel.selectedIndex].value;
var obj = document.getElementById('nom');
//nom = sel.options[sel.selectedIndex].value;
nom=obj.value;
xhr.send("statut=" + statut + "/" + villee + "/" + nom + "/" + region);
}
function charger11(){
var xhr = getXhr();
xhr.onreadystatechange = function(){

if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('div_page').innerHTML =xhr.responseText;
}else{
document.getElementById('div_page').innerHTML="<center><br><br><img  src='images/Loading.gif'/><br><br>Loading ...</center>";
}
}
xhr.open("POST","form/recherche/charger2.php",true);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
statut=0;
for (i=0;i<2;i++){
if (document.recherche.comptable[i].checked==true){
statut=document.recherche.comptable[i].value;
}
}
if(statut==''){
	statut=0;
	}
/*var obj1=document.getElementById('_nom');
nom=obj1.value;*/
nom=document.getElementById('_nom').value;

xhr.send("statutt=" + statut + "/" + nom);
//alert(2222);
}
///////////////////////////////////////////////////////////
function charger_detail(pagee){
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('div_page').innerHTML =xhr.responseText;
}
}
xhr.open("GET","form/recherche/session.php?pagee=" + pagee,true);
//alert(1111);
xhr.send(null);
}
////////////////////////

function charger2(page){
var xhr = getXhr();
xhr.onreadystatechange = function(){
	
if(xhr.readyState == 4 && xhr.status == 200 && typeof(xhr.responseText)!='undefined'){
		document.getElementById('div_page').innerHTML=xhr.responseText;
}

if (xhr.readyState != 4 ){
document.getElementById('div_page').innerHTML="<center><br><br><img src='images/Loading.gif'/><br><br>Loading ...</center>";//"Loading ...";
//alert(1111);
}
}
xhr.open("GET","form/recherche/charger2.php?page=" + page,true);
xhr.send(null);
}

////////////////////////////////////////////////////////////
function charger3(id){
var xhr = getXhr();
xhr.onreadystatechange = function(){
	
				//document.location.hash="#?" + id;
if(xhr.readyState == 4 && xhr.status == 200){
	//alert(222);
document.getElementById('div_page').innerHTML =xhr.responseText;
document.getElementById('page').innerHTML =xhr.responseText;
//alert(111);
}else{
document.getElementById('div_page').innerHTML="<center><br><br><img src='images/Loading.gif'/><br><br>Loading ...</center>";//"Loading ...";
document.getElementById('page').innerHTML="<center><br><br><img src='images/Loading.gif'/><br><br>Loading ...</center>";//"Loading ...";
}
}
//alert(2222222222);
//alert(typeof(id)+ id);

xhr.open("GET","form/recherche/detail.php?id=" + id,true);
xhr.send(null);
//hash_en_cours = "#?" + id;
}
function destroy(){
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('div_page').innerHTML =xhr.responseText;
}
}
num=1;
xhr.open("GET","form/recherche/session.php?num=" + num,true);
//alert(1111);
xhr.send(null);
}
function session_destroy(){
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('div_page').innerHTML =xhr.responseText;
}
}
num=1;
xhr.open("GET","form/recherche/session_destroy.php",true);
//alert(1111);
xhr.send(null);
}

function session_destroy_1(){
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
//document.getElementById('div_page').innerHTML =xhr.responseText;
}
}
xhr.open("GET","form/recherche/session_destroy_1.php",true);
//alert(1111);
xhr.send(null);
}
///lien_article//////
/*function lien_article(id_page){
alert(222);
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('div_page').innerHTML =xhr.responseText;
}
}
num=1;
xhr.open("GET",id_page,true);
//alert(1111);
xhr.send(null);

}*/
///////////////////// 
function suivant(page){
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('div_page').innerHTML =xhr.responseText;
}else{
document.getElementById('div_page').innerHTML="<center><br><br><img  src='images/Loading.gif'/><br><br>Loading ...</center>";//"Loading ...";
}
}
if(page==-2){
page=-2;
}else if(page==-1){
page=-1;
}
xhr.open("GET","form/recherche/charger2.php?page="+page,true);
xhr.send(null);
}
///////////////////////////////
//on recupere le hash de depart
		hash_en_cours = document.location.hash;
		//Si on a un hash au chargement on met a jour la page en concequence
		if (hash_en_cours != "") {
			chargePage(hash_en_cours,false);
		}
		
		function chargePage(page,changeHash) {
			//alert(111111);
			//Si le 2eme argument vaut TRUE on change le hash sinon on se contente de mettre a jour la page
			if (changeHash)
				document.location.hash=page;
			//ici un chargement web2, par exemple...
			pa=page.substr(1,page.length);
			charger_detail(pa);
			//alert('pa:  '+pa);
			
			//destroy();
			if(pa==""){
			document.getElementById("div_page").innerHTML=charger2(1);
			//alert("aaaa");
			//destroy();
			}else if(pa!=""){
			//alert(pa);
			document.getElementById("div_page").innerHTML=charger2(pa);
			//alert(77777777);
			//alert(pa);
			}
			
			//on met a jour le hash en cours pour que la fonction dans l'intervale puisse continuer a fonctionner normalement
			hash_en_cours = page;
			//alert('page'+page);
		}
		//hash_en_cours="#1";
		
		/*function demarer(){
		var p1;
		var a=1;	
		window.setInterval(function () {
					//alert(hash_en_cours);			
					//hash_en_cours=document.location.hash;
			//vérifie s'il n'y a pas un changement de hash
			
			
				
			if (hash_en_cours != document.location.hash) {
				//alert(88888);
				//alert(2000000000);
				//en cas de changement récupere le nouveau hash et rapelle chargePage
					p1=document.location.hash;
				
				//alert(document.location.hash);
				
				pa=p1.substr(1,p1.length);
				pa1=p1.substr(1,1);
				if(pa<32 && p1.length<4){
					chargePage(document.location.hash,false);
					}
					
				if(pa1=="?"){
					pa2=p1.substr(2,p1.length);
					charger3(pa2);
					}
					if(p1.length>=4 && pa1!="?"){
						//alert(2000000000);
						
						tab=p1.split("?");
						id1=tab[0];
						id1=id1.substr(1,id1.length);
						id2=tab[1];
						id3=tab[2];
						/*alert(page);
						alert("id1 " + id1);
						alert("id2 " + id2);					
							ajax(id1,id2,id3);
							if(id3!='77'){
							menu(id3);	
								}
							
							document.location.hash="#" + id1 + "?" + id2 + "?" + id3 + "";
						}
						p1=""+document.location.hash;
					
				//alert(444444);
			}
			clearInterval();
		},1)
		}*/
			/*}
		/*window.setInterval(function () {
			//vérifie s'il n'y a pas un changement de hash
			if (hash_en_cours != document.location.hash) {
					page=document.location.hash;
				pa=page.substr(1,page.length);
				if(pa>32){
					charger3(pa);
					}
				//en cas de changement récupere le nouveau hash et rapelle chargePage
				
				//alert(444444);
			}
			clearInterval();
		},1)*/

///////////////////////////////
function htmlspecialchars(ch) {
   ch = ch.replace(/&/g,"&amp;")
   ch = ch.replace(/\"/g,"&quot;")
   ch = ch.replace(/\'/g,"&#039;")
   ch = ch.replace(/</g,"&lt;")
   ch = ch.replace(/>/g,"&gt;")
   ch = ch.replace(/�/g,"11111111111111") 
   return ch
}
function conversionUnicode(texte) {
 s= texte;
 retour= s.replace(/(\w|\W)/g,
  function(s, n) {
   c= n.charCodeAt(0);
   return((c >= 65533)? '&#'+c+';' : n).replace('&#'+c+';','&eacute;');
   /*return((c > 127)? '&#'+c+';' : n); - si pas besoin de remplacer & par &amp;*/
  }
 );
 return(retour);
}
//es fiscaux et l�slatifs 
  // é : 195169
  // è : 195168
  // ê : 195170
  // à : 195160
  // ç : 195167

function rep(txt){
	
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
//document.getElementById('txt_replace').innerHTML=xhr.responseText;
alert(xhr.responseText);	 
//alert(conversionUnicode(xhr.responseText).replace("&#239;&#191;&#189;","&eacute;"));	 
//document.getElementById('ville').innerHTML =xhr.responseText;
}
}
xhr.open("POST","form/rep.php",true);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xhr.send("txt_rep=" + txt);
}
function ajax(id,itemid,id3){
var xhr = getXhr();
//if(hash_en_cours!="#nav?" + id + "?" + itemid + ""){
	
	//}
xhr.onreadystatechange = function(){
	//document.location.hash="#" + id + "%" + itemid + "%" + id3 + "";
if(xhr.readyState == 4 && xhr.status == 200){
//v=document.getElementById('contenu1');
//alert(xhr.responseText);
//v.style.display='none';
//v.innerHTML=xhr.responseText;
//v.style.display='none';
//document.getElementById('txt_aa').value=xhr.responseText;
//document.getElementById('show').innerHTML=xhr.responseText;
//alert(document.getElementById('show1').innerHTML);
//alert(document.getElementById('page1').innerHTML);

//alert(conversionUnicode("é").replace("&#239;&#191;&#189;","&eacute;"));
tmp=xhr.responseText.split("AAAAAAAAAA");
//var menu=tmp[1].replace("?","111111");

//rep(tmp[1]);

//alert(tmp[1].replace("&#65533;","111111111111"));


//a=conversionUnicode(tmp[1]).replace("&#239;&#191;&#189;","&eacute;").replace("&#65533","&eacute");
//menu=conversionUnicode(tmp[1]).replace("&#239;&#191;&#189;","&eacute;").replace("&#65533","&eacute");
//contenu=conversionUnicode(tmp[3]).replace("&#65533","&eacute");
//alert(menu);
//alert(tmp[1]);

//var msg=conversionUnicode(tmp[1]);
//alert("eee"+msg);
//var rep_msg=msg.replace("o","2222222222222222");
//alert("fff33333333333"+rep_msg);

//alert(tmp[3]);

//alert(conversionUnicode(tmp[3]));

//document.getElementById('val').value=tmp[3];
//alert(document.getElementById('val').getElementsByTagName('script'));
//var allscript = document.getElementById('val').getElementsByTagName('script');

//for(var i=0;i< allscript.length;i++){
//alert(allscript[1].text);
//}
//alert("bbbbb"+document.getElementById('val').value);

//alert(tmp[3]);
tmp[3]=tmp[3].replace("/@/","@");
tmp[3]=tmp[3].replace("/@/","@");
tmp[3]=tmp[3].replace("/@/","@");
tmp[3]=tmp[3].replace("/@/","@");
tmp[3]=tmp[3].replace("/@/","@");
tmp[3]=tmp[3].replace("/@/","@");
tmp[3]=tmp[3].replace("/@/","@");
tmp[3]=tmp[3].replace("/@/","@");
aff();
charger_detail(id + "sep" + itemid + "sep" + id3);
document.getElementById('show').innerHTML=tmp[1];
//unescape(escape(tmp[1]));
//alert(unescape(escape(tmp[1])).replace("�","1111"));
//contenu_page=rep(tmp[3]);
document.getElementById('page').innerHTML=tmp[3];
//document.getElementById('contenu1').style.display='none';
}else{
aff();
document.getElementById('show').innerHTML="<center><br><br><br><br><img  src='images/Loading.gif'/><br><br>Loading ...</center>";
document.getElementById('page').innerHTML="<center><br><br><br><br><br><img  src='images/Loading.gif'/><br><br>Loading ...</center>";
}
}
//alert(id + "&Itemid=" + itemid);

if(itemid==107){
	xhr.open("GET","index2.php?option=com_content&task=blogcategory&id=" + id + "&Itemid=" + itemid,true);
}else{
	xhr.open("GET","index2.php?option=com_content&task=view&id=" + id + "&Itemid=" + itemid,true);
}
if(id==0 && itemid==0){
	//alert(3333333333"");
	
		xhr.open("GET","index2.php?option=com_registration&task=lostPassword",true);
}
if(id==1 && itemid==0){
		xhr.open("GET","index2.php?option=com_registration&task=register",true);
}
////////////////deconection
/*if(id!=24 && itemid!=43){
		//location.href="index.php?option=logout#" + id + "sep" + itemid + "sep" + id3 + "";	
		alert(11111);
		document.logout.submit();
}*/
////////////////
//xhr.open("GET","index2.php?option=com_content&task=view&id=12&Itemid=28&nb=5",true);
//xhr.open("GET","form/menu.php",true);
//document.getElementById('contenu').style.display='none';
//alert(window.location.href);
xhr.send(null);
//hash_en_cours = "#" + id + "n" + itemid + "n" + id3 + "";
}
//-------------------------------------------------------------------------------------
function affiche_puce(td,img)
{

etat=document.getElementById(''+td+'').style.display;

document.getElementById(''+td+'').style.display='none';

document.getElementById(''+td+'').style.display=(etat=='none')?'':'none';

if (etat=='none')
document.getElementById(''+img+'').src="templates/tpl_oec/images/puce_moin.gif";
else
document.getElementById(''+img+'').src="templates/tpl_oec/images/puce_plus.gif";
}
function verif_value(lan) {
	if ( document.recherche._nom.value=='' && lan=='Chercher un membre' ) {
document.recherche._nom.value='Chercher un membre';	}
	if ( document.recherche._nom.value=='' && lan=='Member Search' ) {
	document.recherche._nom.value='Member Search';	
	}
}
function verif_value_focus() {
	if ( document.recherche._nom.value=='Chercher un membre'  || document.recherche._nom.value=='Member Search') {
document.recherche._nom.value='';	}

}

function verif_value1(lan) {
	
	if ( document._recherche.nom.value=='' && lan=='Chercher un membre' ) {
	document._recherche.nom.value='Chercher un membre';	
	}
	
	if ( document._recherche.nom.value=='' && lan=='Member Search' ) {
	document._recherche.nom.value='Member Search';	
	}
	
}

function verif_value_focus1() {
	
	if ( document._recherche.nom.value=='Chercher un membre' || document._recherche.nom.value=='Member Search') {
document._recherche.nom.value='';	}

}



function display_show(){
document.getElementById('show').style.display='none';
}
function aff(){
	document.getElementById('recherche_a').style.display='none';
	document.getElementById('page').style.display='';
	document.getElementById('show').style.display='';
}
function isASpace(b)
	{	
		//alert("hehe");
		var i=0;
		var a=b;
		var es=0;
		var c=0;
		var mess='';
		
		while (i<a.length)
			{
				if (a.charAt(i)==' ')
					es++;
				i++;
			}
		if ((a.length==es)||(a.length==0))
			{
				
				if (c=='1') 
					{
						alert(mess);						
					}
				return 1;
			}
		else
			return 0;
		
	}
/*function verif_email(email) {
	var arobase = email.indexOf("@"); 
	var point = email.lastIndexOf(".")
	if((arobase < 3)||(point + 2 > email.length)||(point < arobase+3)) 
	return false;
	else
	return true;
}	*/
function verif_email(email) {
            var arobase = email.indexOf("@"); 
            var point = email.lastIndexOf(".");
            if((arobase < 3)||(point + 2 > email.length)||(point < arobase+3)){
            return false;
			}else{
            return true;
			}
}

function test_t(){
	
      if(isASpace(document.frm_contact.nom.value)) {
         alert("Le champ 'NOM' est requis !"); document.frm_contact.nom.focus(); return false
         }
	  if(isASpace(document.frm_contact.ste.value)) {
         alert("Le champ 'SOCIETE' est requis !"); document.frm_contact.ste.focus(); return false
         }
	  if(document.frm_contact.secteur.value=="0") {
         alert("Le champ 'SECTEUR D'ACTIVITE' est requis !"); document.frm_contact.secteur.focus(); return false
         }
		 
      if(isASpace(document.frm_contact.tel.value)) {
         alert("Le champ 'TEL' est requis !"); document.frm_contact.tel.focus(); return false
         }		      
		 
		  if(isASpace(document.frm_contact.txtemail.value)) {
         alert("Le champ 'E-mail' est requis !");document.frm_contact.txtemail.focus(); return false
         }		 
		 
	  if (!verif_email(document.frm_contact.txtemail.value)) {
			  alert("Adresse E-mail invalide !"); document.frm_contact.txtemail.focus(); return false
      }
	  
	  if(document.frm_contact.demande.value=="0") {
         alert("Le champ 'VOTRE DEMANDE' est requis !"); document.frm_contact.demande.focus(); return false
         }
	}
///////////////////
function test_t_ang(){
	
      if(isASpace(document.frm_contact.nom.value)) {
         alert("Please enter your last name"); document.frm_contact.nom.focus(); return false
         }
	  if(isASpace(document.frm_contact.ste.value)) {
         alert("Please enter your company"); document.frm_contact.ste.focus(); return false
         }
	  if(document.frm_contact.secteur.value=="0") {
         alert("The field 'ACTIVITY SECTOR' is required !"); document.frm_contact.secteur.focus(); return false
         }
		 
      if(isASpace(document.frm_contact.tel.value)) {
         alert("Please enter your telephone number"); document.frm_contact.tel.focus(); return false
         }		      
		 
	  if (!verif_email(document.frm_contact.txtemail.value)) {
			  alert("Please enter your e-mail address"); document.frm_contact.txtemail.focus(); return false
      }
	  
	  if(document.frm_contact.demande.value=="0") {
         alert("The field 'REQUEST' is required !"); document.frm_contact.demande.focus(); return false
         }
	}
///////////////////
function test_modif(){

      if(isASpace(document.frm_modif.nom.value)) {
         alert("Le champ 'NOM' est requis !"); document.frm_modif.nom.focus(); return false
         }
	  /*if(document.frm_modif.statut.value==-1) {
         alert("Le champ 'STATUT' est requis !"); document.frm_modif.statut.focus(); return false
         }*/
		 if(isASpace(document.frm_modif.login.value)) {
         alert("Le champ 'LOGIN' est requis !"); document.frm_modif.login.focus(); return false
         }
	  if(isASpace(document.frm_modif.ancien.value)) {
         alert("Le champ 'ANCIEN MOT DE PASSE' est requis !"); document.frm_modif.ancien.focus(); return false
         }
      if(isASpace(document.frm_modif.nouveau.value)) {
         alert("Le champ 'NOUVEAU MOT DE PASSE' est requis !"); document.frm_modif.nouveau.focus(); return false
         }
		  if(document.frm_modif.nouveau.value.length<6) {
			  ee="caractère";
			  ee=ee.replace('Ã¨','è');
         alert("Le champ 'NOUVEAU MOT DE PASSE' doit avoir plus que '6 CARACTERES' !"); document.frm_modif.nouveau.focus(); return false
         }
		if(document.frm_modif.nouveau.value!=document.frm_modif.confirme.value) {
         alert("Veuillez confirmer votre mote de passe !"); document.frm_modif.confirme.focus();document.frm_modif.confirme.value=''; return false
         } 
		  /*if(isASpace(document.frm_modif.email.value)) {
         alert("Le champ 'Email' est requis !"); document.frm_modif.email.focus(); return false
         }*/
	}

///////////////////

function test_modif1(){

      if(isASpace(document.frm_modif.nom.value)) {
         alert("The 'Name' field is required !"); document.frm_modif.nom.focus(); return false
         }
	  /*if(document.frm_modif.statut.value==-1) {
         alert("Le champ 'STATUT' est requis !"); document.frm_modif.statut.focus(); return false
         }*/
		 if(isASpace(document.frm_modif.login.value)) {
         alert("The field 'LOGIN' is required !"); document.frm_modif.login.focus(); return false
         }
	  if(isASpace(document.frm_modif.ancien.value)) {
         alert("The field Old password is required !"); document.frm_modif.ancien.focus(); return false
         }
      if(isASpace(document.frm_modif.nouveau.value)) {
         alert("The field 'NEW PASSWORD' is required !"); document.frm_modif.nouveau.focus(); return false
         }
		  if(document.frm_modif.nouveau.value.length<6) {
			  ee="caractère";
			  ee=ee.replace('Ã¨','è');
         alert("The field 'NEW PASSWORD' must have more than CHARACTERS 6 !"); document.frm_modif.nouveau.focus(); return false
         }
		if(document.frm_modif.nouveau.value!=document.frm_modif.confirme.value) {
         alert("Please confirm your password mote !"); document.frm_modif.confirme.focus();document.frm_modif.confirme.value=''; return false
         } 
		  /*if(isASpace(document.frm_modif.email.value)) {
         alert("Le champ 'Email' est requis !"); document.frm_modif.email.focus(); return false
         }*/
	}






///////////////////
function test_login(lang){

		 if(isASpace(document.getElementById('mod_login_username').value) && lang!='Logout') {
         alert("Le champ 'Login' est requis !"); document.getElementById('mod_login_username').focus(); return false
         }
	  if(isASpace(document.getElementById('mod_login_password').value) && lang!='Logout') {
         alert("Le champ 'Mot de passe' est requis !"); document.getElementById('mod_login_password').focus(); return false
         }	
		
			if(isASpace(document.getElementById('mod_login_username').value)  && lang=='Logout') {
         alert("The Login field is required !"); document.getElementById('mod_login_username').focus(); return false
         }
	  if(isASpace(document.getElementById('mod_login_password').value)  && lang=='Logout') {
         alert("The Password field is required !"); document.getElementById('mod_login_password').focus(); return false
         }	
			
			}


function test_news(){
      if(!verif_email(document.getElementById('email_news').value)) {
         alert("Adresse E-mail invalide !"); document.getElementById('email_news').focus(); return false
         }
	}
function test_news1(){
      if(!verif_email(document.getElementById('email_news').value)) {
         alert("Please enter your e-mail address !"); document.getElementById('email_news').focus(); return false
         }
	}	
	
	
function menu(num){
//alert(1111111);
for(i=1;i<=7;i++){
	if(i==num && document.getElementById("menu0_" + i + "").name =="ang" ){	
			//document.getElementById("menu0_" + i + "").src="templates/tpl_oec/images/menu" + i + ".jpg";
			document.getElementById("menu0_" + i + "").src="templates/tpl_oec/images/menu" + i + "_ang" + ".jpg";	
	}else if(i!=num && document.getElementById("menu0_" + i + "").name =="ang"){
			//document.getElementById("menu0_" + i + "").src="templates/tpl_oec/images/menu_" + i + ".jpg";
			document.getElementById("menu0_" + i + "").src="templates/tpl_oec/images/menu_" + i + "_ang" + ".jpg";
	}
	
    if(i==num && document.getElementById("menu0_" + i + "").name =="fr" ){	
			document.getElementById("menu0_" + i + "").src="templates/tpl_oec/images/menu" + i + ".jpg";
			//document.getElementById("menu0_" + i + "").src="templates/tpl_oec/images/menu" + i + "_ang" + ".jpg";	
	}else if(i!=num && document.getElementById("menu0_" + i + "").name =="fr"){
			document.getElementById("menu0_" + i + "").src="templates/tpl_oec/images/menu_" + i + ".jpg";
			//document.getElementById("menu0_" + i + "").src="templates/tpl_oec/images/menu_" + i + "_ang" + ".jpg";
	}
	
}
}	



function num_menu(num){
	//alert(1111);
	var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
//document.getElementById('div_page').innerHTML =xhr.responseText;
}
}

xhr.open("GET","form/session_num.php?num=" + num,true);

xhr.send(null);
	}
	
function logoutt(){
	if(document.logout!=null){
		document.logout.submit();
		}
	
	}

function redirect(){
	if(document.logout!=null){
		document.location.hash='#24sep43';
		}
	}
////////////////////////////
function PromptMe() {
	var stateVar = "nothin'", displayDiv = document.getElementById("HistoryState");
	this.promtForNew = function(newVal) {
		/*tab_newval=newVal.split('#');
		newVal=tab_newval[1];
		newVal=tab_newval[2];
		newVal=tab_newval[3];*/
		
		unFocus.History.addHistory(newVal);
	};
	this.historyListener = function(historyHash) {
		stateVar = historyHash;
		//alert(document.location.hash);
		//p1=document.location.hash;
		
		//alert(document.location.hash);
		////////////
		
		p1=document.location.hash;
		pa2=p1.substr(1,p1.length-1);
		if(pa2<=32 && p1.length<=3){
			//alert("pa2 : " + pa2);
			chargePage(document.location.hash,false);
			}
			p2=document.location.hash;

			pa3=p2.substr(1,2);
			idd=p2.substr(3,p2.length-1);
			if(pa3=='1a'){
				//alert(1111111);
				charger3(idd);
				}
		//pa1=p1.substr(1,1);
			if(p1.length>=4 && pa3!='1a'){
						//alert(2000000000);
						
						tab=p1.split("sep");
						id1=tab[0];
						id1=id1.substr(1,id1.length);
						id2=tab[1];
						id3=tab[2];
						if(id3!=77){
							menu(id3);
						}
						ajax(id1,id2,id3);
						
						if(((id1<24 || id1>29) &&  (id2 <43 || id2>48)) && document.logout!=null ){
							document.logout.submit();
						}
						
			}
		////////////

displayDiv.innerHTML = "Current History: " + historyHash;
		//document.title = "unFocus History Keeper - Current History: " + historyHash;
	};
	unFocus.History.addEventListener('historyChange', this.historyListener);
	this.historyListener(unFocus.History.getCurrent());
};

var demoApp;



	

