function getVar(nomVariable) {

if (document.location.href != "") {var infos = document.location.href;}
else {var infos = window.location.href;}

if (infos.indexOf(nomVariable)!=-1) {return true;}
else {return false;}}

if (getVar("goto") == false && getVar("vote") == false && getVar("commentaires") == false) {

if(window.parent.length!=0) {window.top.location.replace(document.location.href);}}

var GB_ROOT_DIR = "http://" + location.host + "/greybox/";

if(!document.getElementById){if(document.all){document.getElementById=function(){if(typeof document.all[arguments[0]]!="undefined"){return document.all[arguments[0]]}else{return null}}}else if(document.layers){document.getElementById=function(){if(typeof document[arguments[0]]!="undefined"){return document[arguments[0]]}else{return null}}}}

if (getVar("centre-de-gestion-agree") != false) {
window.onload=function(){
enableTooltips("annuaire-centre-de-gestion-agree_--","1");
enableTooltips("annuaire-centre-de-gestion-agree-","1");
enableTooltips("my-glider","0");
if (document.getElementById("map1")) {initialize();}};
}
else if (getVar("association-gestion-comptabilite") != false) {
window.onload=function(){
enableTooltips("annuaire-association-gestion-comptabilite_--","1");
enableTooltips("annuaire-association-gestion-comptabilite-","1");
enableTooltips("my-glider","0");
if (document.getElementById("map1")) {initialize();}};
}
else if (getVar("association-de-gestion-agree") != false) {
window.onload=function(){
enableTooltips("annuaire-association-de-gestion-agree_--","1");
enableTooltips("annuaire-association-de-gestion-agree-","1");
enableTooltips("my-glider","0");
if (document.getElementById("map1")) {initialize();}};
}
else if (getVar("expert-comptable-en-ligne") != false) {
window.onload=function() {
enableTooltips("guide-expert-comptable_--","1");
enableTooltips("guide-expert-comptable-","1");
enableTooltips("my-glider","0");
if (document.getElementById("map1")) {initialize();}};
}
else if (getVar("comptable-en-ligne") != false) {
window.onload=function(){
enableTooltips("guide-comptable_--","1");
enableTooltips("guide-comptable-","1");
enableTooltips("my-glider","0");
if (document.getElementById("map1")) {initialize();}};
}
else if (getVar("commissariat-aux-comptes") != false) {
window.onload=function(){
enableTooltips("annuaire-commissaires-aux-comptes_--","1");
enableTooltips("annuaire-commissaires-aux-comptes-","1");
enableTooltips("my-glider","0");
if (document.getElementById("map1")) {initialize();}};
}


var z = "1";
function superr(whichLayer) {

$('#'+ whichLayer).fadeIn('slow');

if (document.getElementById)
{var style2 = document.getElementById(whichLayer).style;}
else if (document.all)
{var style2 = document.all[whichLayer].style;}
else if (document.layers)
{var style2 = document.layers[whichLayer].style;}
style2.display = "block";
style2.zIndex = z++;}


if ( document.all )
{
	function blink_show()
	{
blink_tags  = document.all.tags('blink');
blink_count = blink_tags.length;
for ( i = 0; i < blink_count; i++ )
{
	blink_tags[i].style.visibility = 'visible';
}

window.setTimeout( 'blink_hide()', 700 );
	}
	
	function blink_hide()
	{
blink_tags  = document.all.tags('blink');
blink_count = blink_tags.length;
for ( i = 0; i < blink_count; i++ )
{
	blink_tags[i].style.visibility = 'hidden';
}

window.setTimeout( 'blink_show()', 250 );
	}
	
	window.onload = blink_show;
}

function experts(id) {

$('#'+ id).fadeIn('slow');

if (document.getElementById(id)) 
{if (document.getElementById(id).style.display == 'none' || document.getElementById(id).style.visibility=='hidden') {document.getElementById(id).style.display='block';
  document.getElementById(id).style.visibility='visible';}
else
{document.getElementById(id).style.display='none';
  document.getElementById(id).style.visibility='hidden';}}}

function expert(id) {

$('#'+ id).fadeOut('slow');

if (document.getElementById(id)) 
{if (document.getElementById(id).style.display == 'block' || document.getElementById(id).style.visibility=='visible') {  document.getElementById(id).style.display='none';
  document.getElementById(id).style.visibility='hidden';}
else
{document.getElementById(id).style.display='block';
  document.getElementById(id).style.visibility='visible';}}}


function experto(id,number) {

$('#'+ id + number).fadeIn('slow');

if (document.getElementById(id + "" + number)) 
{if (document.getElementById(id + "" + number).style.display == 'none' || document.getElementById(id + "" + number).style.visibility=='hidden') {document.getElementById(id + "" + number).style.display='block';
  document.getElementById(id + "" + number).style.visibility='visible';}
else
{document.getElementById(id + "" + number).style.display='block';
  document.getElementById(id + "" + number).style.visibility='visible';}}

for (i=1; i<=5; i++) {
if (i  != number) {expertos(id,i); }
}}

function expertos(id,number) { 

$('#'+ id + number).fadeOut('slow');

if (document.getElementById(id + "" + number)) 
{if (document.getElementById(id + "" + number).style.display == 'block' || document.getElementById(id + "" + number).style.visibility=='visible') {  document.getElementById(id + "" + number).style.display='none';
  document.getElementById(id + "" + number).style.visibility='hidden';}
else
{document.getElementById(id + "" + number).style.display='none';
  document.getElementById(id + "" + number).style.visibility='hidden';}}
}

function montre_chat_ec_droit () {document.write('<tr><td style="border:1px solid black;background:white;"><b>CONTACT DIRECT AVEC UN INTERVENANT DE CE CABINET EXPERT COMPTABLE</b></td></tr><tr><td><center><object type="application/x-shockwave-flash" id="plugoo" data= "http://www.plugoo.com/plug.swf?go=D36QQGOTBRCBSCL&nickname=Entrez votre nom ICI&msg=Posez votre question ICI&topic=titre du message" width="225" height="260"> <param name="movie" value= "http://www.plugoo.com/plug.swf?go=D36QQGOTBRCBSCL&nickname=Entrez votre nom ICI&msg=Posez votre question ICI&topic=titre du message" /> <param name="allowScriptAccess" value="always" /> <param name="wmode" value="transparent" /> </object></center></td></tr>');}


/*function expertises_comptables() {document.write('<br><div align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="740" height="70" id="experts-comptables" align="middle"><param name="allowScriptAccess" value="samedomain" /><param name="movie" value="experts-comptables.swf?xml=http://www.centre-de-gestion-agree.net/experts-comptables.xml" /><param name="quality" value="high" /><embed src="http://www.centre-de-gestion-agree.net/experts-comptables.swf?xml=http://www.centre-de-gestion-agree.net/experts-comptables.xml" quality="high" width="740" height="70" name="experts-comptables" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object></div>'); }*/




/* image rool over du bas
comptabilite_en_ligne_fr= new Image( );
centre_de_gestion_agree_net= new Image( );
association_de_gestion_agree_net= new Image( );
comptable_en_ligne_net= new Image( );
expert_comptable_en_ligne_net= new Image( );
commissariat_aux_comptes_net= new Image( );
comptable_agree_net= new Image( );
centre_de_gestion_agree_fr= new Image( );
expert_comptable_agree_net= new Image( );
commissariatauxcomptes_eu= new Image( );
association_de_gestion_agree_fr= new Image( );
moteur_comptable_fr = new Image( );
moteur_recherche_xpert_comptable_fr = new Image( );
moteur_comptable_com = new Image( );
moteur_comptable_net = new Image( );

comptabilite_en_ligne_fr.src='../comptabilite-en-ligne.frr.gif';
centre_de_gestion_agree_net.src='../centre-de-gestion-agree.netr.gif';
association_de_gestion_agree_net.src='../association-de-gestion-agree.netr.gif';
comptable_en_ligne_net.src='../comptable-en-ligne.netr.gif';
expert_comptable_en_ligne_net.src='../expert-comptable-en-ligne.netr.gif';
commissariat_aux_comptes_net.src='../commissariat-aux-comptes.netr.gif';
comptable_agree_net.src='../comptable-agree.net.gif';
centre_de_gestion_agree_fr.src='../centre-de-gestion-agree.fr.gif';
expert_comptable_agree_net.src='../expert-comptable-agree.net.gif';
commissariatauxcomptes_eu.src='../commissariatauxcomptes.eu.gif';
association_de_gestion_agree_fr.src='../association-de-gestion-agree.fr.gif';
moteur_comptable_fr.src='../moteur-comptable.frr.gif';
moteur_recherche_xpert_comptable_fr.src='../moteur-recherche-xpert-comptable.frr.gif';
moteur_comptable_com.src='../moteur-comptable.comr.gif';
moteur_comptable_net.src='../moteur-comptable.netr.gif';

function o(id) {var bob = "";
var reg=new RegExp("(_)", "g");
var reg1=new RegExp("(_fr)", "g");
var reg2=new RegExp("(_eu)", "g");
var reg3=new RegExp("(_net)", "g");
var reg4=new RegExp("(e_com)", "g");

bob11 = id.replace(reg4, "e.com");
bob = bob11.replace(reg1, ".fr");
bob1 = bob.replace(reg2, ".eu");
bob2 = bob1.replace(reg3, ".net");
bob3 = bob2.replace(reg, "-");

document[id].src= '../' + bob3 + 'r.gif';}

function oo(id) {var bob = "";
var reg=new RegExp("(_)", "g");
var reg1=new RegExp("(_fr)", "g");
var reg2=new RegExp("(_eu)", "g");
var reg3=new RegExp("(_net)", "g");
var reg4=new RegExp("(e_com)", "g");

bob11 = id.replace(reg4, "e.com");
bob = bob11.replace(reg1, ".fr");
bob1 = bob.replace(reg2, ".eu");
bob2 = bob1.replace(reg3, ".net");
bob3 = bob2.replace(reg, "-");
document[id].src= '../' + bob3 + '.gif';}*/


function thu(path) {
/*path1=path.split("/"); 
if (path1[0] !="") {*/document.write('<img src="http://open.thumbshots.org/image.aspx?url=' + path + '" width="150" style="border:1px solid black;">');/*}  path1[0] */

}


//Détermine le navigateur, nous avons seulement de ceci pour Internet Explorer
if (navigator.appName == "Microsoft Internet Explorer") {

//Array (Tableau) d'éléments devant ętre remplacé
var arrElements = new Array(3);
arrElements[0] = "object";
arrElements[1] = "embed";
arrElements[2] = "applet";


//Faire une boucle sur le types d'élément
for (n = 0; n < arrElements.length; n++) {

//mettre l'objet pour la concision
replaceObj = document.getElementsByTagName(arrElements[n]);

//faire une boucle sur les objets de l'élément retourné
for (i = 0; i < replaceObj.length; i++ ) {

//mettre l'objet parent pour la concision
parentObj = replaceObj[i].parentNode;

//saisir l'html dans l'élément avant de le supprimer du DOM
newHTML = parentObj.innerHTML;

//supprimez l'élément du DOM
parentObj.removeChild(replaceObj[i]);

//coller l'élément dans la page, mais comme un nouvel objet
parentObj.innerHTML = newHTML;

}}}

function cob() {

if (getVar("association-de-gestion-agree") == true) {var bub = 1;}
else {var bub = 2;}

for (i = bub; i <= 117; i++) {if ($('#pub_contextuelle'+i).val() != undefined) {interstitiel($('#pub_contextuelle'+i).val());i = 117;}}}

function interstitiel(url) {

if (getVar("centre-de-gestion-agree") != false) {
$("#avanti").insertBefore("#annuairecentredegestionagree");
$("#apresi").insertAfter("#annuairecentredegestionagree");
var largeur_divs = $("#annuairecentredegestionagree").width();
}
else if (getVar("association-gestion-comptabilite") != false) {
$("#avanti").insertBefore("#annuaireassociationgestioncomptabilite");
$("#apresi").insertAfter("#annuaireassociationgestioncomptabilite");
var largeur_divs = $("#annuaireassociationgestioncomptabilite").width();
}
else if (getVar("association-de-gestion-agree") != false) {
$("#avanti").insertBefore("#annuaireassociationdegestionagree");
$("#apresi").insertAfter("#annuaireassociationdegestionagree");
var largeur_divs = $("#annuaireassociationdegestionagree").width();
}
else if (getVar("expert-comptable-en-ligne") != false||getVar("expertcomptableenligne") != false) {
$("#avanti").insertBefore("#guideexpertcomptable");
$("#apresi").insertAfter("#guideexpertcomptable");
var largeur_divs = $("#guideexpertcomptable").width();
}
else if (getVar("comptable-en-ligne") != false||getVar("comptableenligne") != false) {
$("#avanti").insertBefore("#guidecomptable");
$("#apresi").insertAfter("#guidecomptable");
var largeur_divs = $("#guidecomptable").width();
}
else if (getVar("commissariat-aux-comptes") != false||getVar("commissariatauxcomptes") != false) {
$("#avanti").insertBefore("#annuairecommissairesauxcomptes");
$("#apresi").insertAfter("#annuairecommissairesauxcomptes");
var largeur_divs = $("#annuairecommissairesauxcomptes").width();
}

if( typeof( window.innerWidth ) == 'number' ) {myWidth = window.innerWidth;
myHeight = window.innerHeight;

var larg_dispo = (myWidth - largeur_divs);
larg_dispo = parseInt((larg_dispo - 2 - 18) / 2);}//14
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;

var larg_dispo = (myWidth - largeur_divs);
larg_dispo = parseInt((larg_dispo - 2) / 2);}
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;

var larg_dispo = (myWidth - largeur_divs);
larg_dispo = parseInt((larg_dispo - 2 - 2) / 2);}

var haut_dispo = parseInt(myHeight * 3);

if (larg_dispo < 0) {larg_dispo = 0;var css ='';}
else if (larg_dispo < 50) {larg_dispo = 50;var css ='<style type="text/css">body {width:1254px;}</style>';}
else {var css ='';}


if ($("body").css("background-repeat") =="repeat") {
if (url.indexOf("expert-comptable-en-ligne.fr")!=-1) {
txt_de_la_pub = "VOTRE expert comptable en ligne, cabinet d expertise comptable, comptabilité sur internet et CONSEILS... Devis Gratuit...";
css = css +  '<style type="text/css">body {background-image:url(http://www.expert-comptable-en-ligne.fr/comptabilite-en-ligne/i/fd-votre.png);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment: fixed;}</style>';}
else if (url.indexOf("expert-comptable-en-ligne.com")!=-1) {
txt_de_la_pub = "VOTRE expert comptable en ligne, cabinet d expertise comptable pour les BNC / Agent commerciaux... Devis Gratuit";
css = css +  '<style type="text/css">body {background-image:url(http://www.expert-comptable-en-ligne.com/comptabilite-en-ligne/i/fd-votre-bnc.png);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment: fixed;}</style>';}
else if (url.indexOf("comptable-en-ligne.fr")!=-1) {
txt_de_la_pub = "MON Comptable en ligne, cabinet d expertise comptable, comptabilité sur internet et CONSEILS... Devis gratuit...";
if (Math.random() <= 0.5) {css = css +  '<style type="text/css">body {background-image:url(http://www.comptable-en-ligne.fr/comptabilite-en-ligne/i/fd-monbis.png);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment: fixed;}</style>';}
else {css = css +  '<style type="text/css">body {background-image:url(http://www.comptable-en-ligne.fr/comptabilite-en-ligne/i/fd-mon.png);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment: fixed;}</style>';}}
else if (url.indexOf("compta247.fr")!=-1) {
if (larg_dispo == 50) {txt_de_la_pub = "Compta 247, logiciel de comptabilité en ligne 100% gratuit, 100% technologique...";
css = css +  '<style type="text/css">body {background-image:url(http://www.compta247.fr/g/fd-c247-b.jpg);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment:fixed;}</style>';}
else {txt_de_la_pub = "Compta 247, logiciel de comptabilité en ligne 100% gratuit, 100% technologique...";
css = css +  '<style type="text/css">body {background-image:url(http://www.compta247.fr/g/fd-c247.jpg);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment:fixed;}</style>';}
}}

css = css + '<style type="text/css">#apresi, #avanti {width:'+larg_dispo+'px;}</style>';

document.getElementById('avanti').innerHTML = css +"<a href='"+url+"?in="+i+"' title='"+txt_de_la_pub+"'><img src='http://"+ location.host +"/images/blank.gif' width='"+ larg_dispo +"' height='"+ haut_dispo +"' alt='"+txt_de_la_pub+"'></a>";
document.getElementById('apresi').innerHTML = "<a href='"+url+"?in="+i+"' title='"+txt_de_la_pub+"'><img src='http://"+ location.host +"/images/blank.gif' width='"+ larg_dispo +"' height='"+ haut_dispo +"' alt='"+txt_de_la_pub+"'></a>";


}


var x= (1*3); 

function shw() 
{ 
//document.getElementById('r').innerHTML='reste '+parseInt(x/60)+'minun'+parseInt(x%60)+'secon'; 
x--; 
if (x<0) {
$.ajax({
	type: "POST",
	url: "../search_key.php",
	data:"time="+x,
	success: function(data){
	}
});
x=1*3; 
} 
else setTimeout('shw();',1000); 
} 




function over(text,touch){
$("#r").empty();
shw(); 

var leng = text.length;
var len=$("#autoSuggestionsList li").length;
var div_h = $("#suggestions").height();
var list_h = $("#autoSuggestionsList").height();
var div_suggestions = document.getElementById("suggestions");
var text1="";
if(text.indexOf(" ")>0){
var tab = text.split(" ");
text2 = tab[tab.length-1];
for(var t=0;t<tab.length-1;t++){
text1+=tab[t]+" ";
}
}
else{
text2=text;
}
if(text.length == 0) {
// Hide the suggestion box.
$('#suggestions').hide();
	} else {
if(touch==40 && len>1){
 var m = n-1;
   $("#autoSuggestionsList li:nth-child("+n+")").focus();
   	    div_suggestions.scrollTop = li_h;
   	    if(n<len-1){
   	    li_h= li_h + $("#autoSuggestionsList li:nth-child("+n+")").height();
   	    }
   $("#autoSuggestionsList li:nth-child("+n+")").css("background-color","#a0b64b");
   $("#autoSuggestionsList li:nth-child("+m+")").css("background-color","");
   n++;
   if(n>=len){
   	n=len;
   }
}
else if(touch==38 && len>1){
	 n = n-1;
	 if(n<=1){
 n = 1;
	 }
	 var l = n+1;
    	$("#autoSuggestionsList li:nth-child("+n+")").focus();
    	$("#autoSuggestionsList li:nth-child("+n+")").css("background-color","#a0b64b");
    	$("#autoSuggestionsList li:nth-child("+l+")").css("background-color","");  
    	li_h= li_h - $("#autoSuggestionsList li:nth-child("+n+")").height();
    	div_suggestions.scrollTop = li_h;
    	if(n==1){
    div_suggestions.scrollTop = 0;
    li_h = 0;
    	}
 }
else if(touch==13 && len>1){
	 for(var i=1;i<=len;i++){
var color= $("#autoSuggestionsList li:nth-child("+i+")").attr("style");
if(color == "background-color: rgb(160, 182, 75);"){
	var value = $("#autoSuggestionsList li:nth-child("+i+")").text();
	var c = value.indexOf(" ");
	var tab1 = value.substr('0',c);
	var tab2 = value.substr(c); 
	affiche_num(tab1+"_"+tab2);
}
	 }
	 div_suggestions.scrollTop = 0;
	    	 li_h = 0;
	}
	else{

if (getVar("centre-de-gestion-agree") != false) {var dom = "cga";}
else if (getVar("association-de-gestion-agree") != false) {var dom = "aga";}
else if (getVar("association-gestion-comptabilite") != false) {var dom = "agc";}
else if (getVar("expert-comptable-en-ligne") != false) {var dom = "expert";}
else if (getVar("comptable-en-ligne") != false) {var dom = "comptable";}
else if (getVar("commissariat-aux-comptes") != false) {var dom = "commissaire";}
else {var dom = "global";}

$.ajax({
	type: "POST",
	url: "../search_key.php",
	data:"text="+text2+"&leng="+leng+"&text1="+text1+"&dom="+dom,
	success: function(data){
if(data.length >0) {
$('#suggestions').show();
$('#autoSuggestionsList').html(data);
}
	}
});
n=1;
div_suggestions.scrollTop = 0;
li_h = 0;
}
}
$(document).click(function(evt){var evt = window.event?window.event:evt,target=evt.srcElement||evt.target;if(target.id != "my_text"){$('#suggestions').hide();}n=1;div_suggestions.scrollTop = 0;li_h = 0;});}

function affiche_in(thisValue,text1){$("#my_text").val("");$("#my_text").val(text1+thisValue);

if (document.recherche_comptable) {document.recherche_comptable.submit();}
else if (document.recherche_expert) {document.recherche_expert.submit();}
else if (document.recherche_commissaire) {document.recherche_commissaire.submit();}
else if (document.recherche_agc) {document.recherche_agc.submit();}
else if (document.recherche_cga) {document.recherche_cga.submit();}
else if (document.recherche_aga) {document.recherche_aga.submit();}
}

function ringbas(id_affich){$("#bas").children().each(function(){if($(this).attr("id") == id_affich) {$(this).fadeIn();}else if ($(this).attr("id") != "") {$(this).css("display","none");}})}
