function changerImageMenuBOL()
 { 
  var str= (new String (window.location)).toLowerCase();
  //alert(str);

  if(str.match("/presentation/")!=null)
       document.getElementById('PresentationGroupe').src="/Style%20Library/Images/Custom/Menu/presentationON.gif";
       
  if(str.match("/devenirclient/")!=null)
       document.getElementById('DevenirClient').src="/Style%20Library/Images/Custom/Menu/DevenirClientON.gif";
       
  if(str.match("/analysesetconseils/")!=null)
       document.getElementById('Analysesetconseils').src="/Style%20Library/Images/Custom/Menu/AnalysesetconseilsON.gif";

  if(str.match("/opcvm/")!=null)
       document.getElementById('OPCVM').src="/Style%20Library/Images/Custom/Menu/OPCVMON.gif";

  if(str.match("/aujourdhuienbourse/")!=null)
       document.getElementById('Aujourdhuienbourse').src="/Style%20Library/Images/Custom/Menu/AujourdhuiEnBourseON.gif";

  if(str.match("/informationboursiere/")!=null)
       document.getElementById('Informationboursiere').src="/Style%20Library/Images/Custom/Menu/InfoBoursiereON.gif";

         
}

function loadTicker(){

document.getElementById('tickerT').innerHTML='<EMBED style="WIDTH: 754px; HEIGHT: 36px" src=http://bourse.gbp.ma/media/ticker.swf width=754 type=application/x-shockwave-flash allowscriptaccess="always" allowfullscreen="true" heitgh="30px"></EMBED>';
}

function ShowMeMe(div,img)
{
 var children = document.getElementById(div).parentNode.childNodes;
 for (var i=0;i<children.length;i++) 
 {
     if (children[i].nodeName =="DIV") 
     {
       if(children[i].id == div)  
          children[i].style.display='block';
       else
          children[i].style.display='none';  
       }
  }
  var root = document.getElementById(img).parentNode.parentNode.childNodes;
   var children;
   
   for (var j=0;j<root.length;j++) 
    {
      children=root[j].childNodes;
      for (var i=0;i<children.length;i++) 
        {
            if (children[i].nodeName =="DIV") 
              {
    
                    if(children[i].id == img)  
                          { 
                            children[i].className="menu_active";
        
                          }
                     else
                          {
                            children[i].className="menu1";
                            
                           }
              }
        }
    }
  
}

function ShowMeAccordin(lay)
{
    var var1=lay;
    if(var1=='' || var1==null)
    {
        if(document.location.href.split('?var=')[1])
            var1=document.location.href.split('?var=')[1];
        else
            var1='pro1';
    }
	 var d1 = document.getElementById(var1);
	 if (d1 && d1.style.display =='none') 
	 {
	 	for(i=1;i<=5;i++)
		 {
		   var d = document.getElementById('pro'+i);
		   d.style.display='none';
		 }
		
		 d1.style.display='block';
	}
	else
	{
		d1.style.display='none';
	}
}
function Retour()
{
    var var1= document.location.href.split('?var=')[1];
    if(var1)
    {
       var Url ='http://'+document.location.href.split('/')[2]+'/Analysesetconseils/Pages/Conseilsetrecommandations.aspx?var='+var1;
       window.location=Url; 
    }
    else
    {
        history.back();
    }
}
// JScript source code

/*function test()
{  
hu = window.location.search.substring(1);
var x=querySt("indice");
if(x=1)
document.Epriva.location.href = 'https://bpbourse.gbp.ma/cgi-bin/cgipat.exe?synthese=1';
if(x=2)
document.Epriva.location.href = 'https://bpbourse.gbp.ma/cgi-bin/cgipat.exe?synthese=1';
}



function querySt(ji) {
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i=0;i<gy.length;i++) {
ft = gy[i].split("=");
if (ft[0] == ji) {
return ft[1];
}
}
}


function testAut(chemin)
{
alert(document.cookie);
if(LireCookie('actiocookie')==null) window.location="/"+chemin; 
else 
  window.location="/Pages/Espaceclient.aspx?indice=1";
}

*/
function CheckAuth(chemin)
{     
   if(LireCookie('actiocookie')!=null && LireCookie('actiocookie')!="undefined")
   {
   
   if(document.getElementById('Epriva')!=null)
     document.getElementById('Epriva').src=chemin;
   }
   
  // document.Epriva.location.href =chemin;
 
}
function SetURLEspacePrive(chemin)
{
  
   if(document.getElementById('Epriva')!=null)
    document.getElementById('Epriva').src=chemin;
    //document.Epriva.location.href =chemin;
 
}

function testerConnexion(chemin)
{
//alert(document.cookie);
if(LireCookie('actiocookie')!=null && LireCookie('actiocookie')!="undefined" ) 
{

window.location=chemin;
}
else 
{
window.location="/Pages/Espaceclient.aspx"; 
}

}

function LireCookie(nom)
{
var arg=nom+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i<clen)
{
var j=i+alen;
if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
i=document.cookie.indexOf(" ",i)+1;
if (i==0) break;

}
return null
}

function getCookieVal(offset)
{
//alert(offset);
var endstr=document.cookie.indexOf (";", offset);
if (endstr==-1) endstr=document.cookie.length;
 
return unescape(document.cookie.substring(offset, endstr));
}

function ShowMe(id)
{
  
  
  var children = document.getElementById(id).parentNode.childNodes;
 
  for (var i=0;i<children.length;i++) 
  {
   if (children[i].nodeName =="DIV") 
   {
   
      if(children[i].id == id)  
       
        children[i].style.display='block';
      else
        children[i].style.display='none';  
   }
  

  }
  

}

function ShowMe2(div,img)
{
  //alert(img + div);
  //document.getElementById(img).setAttribute("src","remainder");

  var children = document.getElementById(div).parentNode.childNodes;
 
  for (var i=0;i<children.length;i++) 
  {
   if (children[i].nodeName =="DIV") 
   {
   
      if(children[i].id == div)  
       
        children[i].style.display='block';
      else
        children[i].style.display='none';  
   }
  
  }
  
   var root = document.getElementById(img).parentNode.parentNode.childNodes;
   var children;
   
   for (var j=0;j<root.length;j++) 
    {
      children=root[j].childNodes;
      for (var i=0;i<children.length;i++) 
        {
            if (children[i].nodeName =="IMG") 
              {
    
                    if(children[i].id == img)  
                          { 
                            children[i].className="activeInter";
        
                          }
                     else
                          {
                            children[i].className="NoneInter";
                            
                           }
              }
        }
    }
  
   }
/*sssss*/



   
function createCookie(name,val)
{
 
   alert(document.cookie);
   var argv=createCookie.arguments;
   var argc=createCookie.arguments.length;
   var expires=(argc > 2) ? argv[2] : null;
   var path=(argc > 3) ? argv[3] : null;
   var domain=(argc > 4) ? argv[4] : null;
   var secure=(argc > 5) ? argv[5] : false;
document.cookie=name+"="+escape(val)+
((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
((path==null) ? "" : ("; path="+path))+
((domain==null) ? "" : ("; domain="+domain))+
((secure==true) ? "; secure" : "");
   
}
function getvaleur(para)
{ 
  var NbrR ;
  var NbrQ;
  var Point=0;
  var hevn;
  var d = document.getElementById('ResultatFinal');
  if(para=='Para2')
  {
    loy = "R1";
    NbrQ = document.getElementById('hay1').value; 
    hevn = "Resultat1";
  }
  if(para=="Para3")
  {
    loy = "R2";
    NbrQ = document.getElementById('hay2').value;
    hevn = "Resultat2";
  }
  if(para=="ParaF")
  {
    loy = "R3";
    NbrQ = document.getElementById('hay3').value;
    hevn = "Resultat3";
  }
  var Count1;
  var Count2=0;
  for(i=1;i<=NbrQ;i++)
  {
    lay ='ctl00$ctl00$g_01de098a_f8de_45c4_a7c6_780e00924e3a$ctl00$'+i+loy;
    NbrR = document.getElementById('NombreReponse' + NbrQ + loy).value;
    Count1=0;
    for(j=0;j<NbrR;j++)
    {
        if(eval("document.getElementsByName('"+lay+"')["+j+"].checked==true"))
        {
            Count1++;
            Point = Point + parseInt(document.getElementsByName(lay)[j].value);
        }
    }
    if(Count1!=0)
    {
        Count2++;
    }
  }
  if(Count2==NbrQ)
  {
    ShowMe(para);
    if(hevn=='Resultat3')
    {
    
        d.value =(parseInt(document.getElementById('Resultat1').value)+parseInt(document.getElementById('Resultat2').value)+ parseInt(Point));
        GetProfil(d.value);
    }
    else
    {
       document.getElementById(hevn).value = Point; 
    }
  }
  else
  {
    alert('Merci de repondre à toutes les questions')
  }
}
function ShowMeProfil(lay)
{ 
	for(var i=1;i<=3;i++)
	 {
	 	var d = document.getElementById('Para'+i);
		d.style.display='none';
	 }
	var d1 = document.getElementById(lay);
	d1.style.display='block';
}
function ShowMeTimeLine(lay,pro)
{ 
    var TJV = parseInt(document.getElementById('NbrTotal').value);
    for(i=1;i<=TJV;i++)
	 {
		var d = document.getElementById('reg'+i);
    	d.style.display='none';
    	document.getElementById('reg'+i).style.display="none";
     }
	var d1 = document.getElementById(lay);
    if (d1 && d1.style.display =='none') 
		d1.style.display='block';
	else
		d1.style.display='none';
}
function GetProfil(lay)
{ 
    var NmrProfilScor = document.getElementById('NombreScor').value;
    var minscor;
    var maxscor;
    var typescor;
	for(var i=1;i<=NmrProfilScor;i++)
	 {
        minscor  = document.getElementById('Scor'+i).value.split('-')[1];
        maxscor  = document.getElementById('Scor'+i).value.split('-')[2];
        typescor = document.getElementById('Scor'+i).value.split('-')[0];
     	if( ( parseInt(lay) >= parseInt(minscor))  && (parseInt(lay) <= parseInt(maxscor)) )
	 	{
	 	    document.getElementById('ResultatFinal').value = typescor;
	 	    document.getElementById('ShowProfile'+i).style.display="block";
	 	    document.getElementById('PresentionProfileInvesisseur').style.display="none";
	 	    
	 	}
	 }
}


