
// fonctions qui permettent d'ouvrir des fenêtres
// Utilisé pour Contacts et Mentions Légales



function open_mentions()
{
	window.open('mentionslegales.php3?id_article=61', '', 'height=380, width=480, top=0, left=0, scrollbars=no , dependent=yes') ;

}

function open_langue(lg)
{
    lurl = location.href ;
    
    // detection de lang= dans le querystring
    // cas 4
    if( lurl.indexOf("&lang=") != -1 ) {
     lurl_2 = lurl.substring(0,lurl.indexOf("&lang="));
     lurl = lurl_2 + '&lang=' + lg ; 
     location.href = lurl ;   
    }
    // cas 2
    else if (lurl.indexOf("?lang=") != -1 ) {
     location.search = 'lang=' + lg ;
    }
    // cas 3
    else if (lurl.indexOf("?") != -1 && lurl.indexOf("lang=") == -1  ) {
     lurl += '&lang=' + lg ;
     location.href = lurl ;
   }
    // cas 1
    else if ( lurl.indexOf("?") == -1 ) {
     location.search = 'lang=' + lg ;
    }
    
   //alert(lurl);
 
}

function open_francais()
{
   
   open_langue('fr');

}

function open_anglais()
{
   
   open_langue('en') ;

}

function open_cout()
{
	window.open('coutspam.php3', '', 'height=500, width=520, top=30, left=30, scrollbars=no , dependent=yes') ;
}


function open_contacts()
{
	window.open('contacts.php3?id_article=60', '', 'height=380, width=480, top=30, left=30, scrollbars=no , dependent=yes') ;
}

function temoins(url)
{
	window.open(url, '', 'height=500, width=480, top=120, left=30, scrollbars=no , dependent=yes') ;
}

// function il_ltrim(chaine,caractere) {
function il_ltrim(chaine) {

   var newchaine = chaine.substr(0,10) ;
   var i ;
   for(i=40;i<50;i++) {
     if(chaine.substr(i,1) == " ") {
       break ;
     }
     else {
       newchaine += chaine.substr(i,1) ;
     }
   }
   return newchaine;
  
}
