function afficheTab(idTab,T_option){
if(proveanceFicheStatic == 1){
		proveanceFicheStatic = 0;
		document.location="../";
		return;
	}
	var nbronglet = 5;
	var nomTAb ='';
	var i;
  var OngletNavig=new Array();
 	OngletNavig[1] = "navigFormEntreprise";
 	OngletNavig[2] = "navigFormBodacc";
 	OngletNavig[3] = "navigFormBalo";
 	OngletNavig[4] = "navigFormComptes";
 //	OngletNavig[5] = "navigFormPresse";

  var DateNavig=new Array();
 	//DateNavig[1] = "Entreprise";
 	//DateNavig[2] = "Bodacc";
 //	DateNavig[3] = "Balo";
// 	DateNavig[5] = "Presse";

 	var tabInterface=new Array();
 	tabInterface[1] = "Fiche";
 	tabInterface[2] = "Bodacc";
 	tabInterface[3] = "Balo";
 	tabInterface[4] = "Comptes";
// 	tabInterface[5] = "Presse";

	var executeSearch = false;
	for(var i=1; i < nbronglet; i++) {
		//console.log(i+' '+idTab);
		if(i==idTab){
			document.getElementById('tab_'+i).className='on';
			document.getElementById(OngletNavig[i]).style.display='block';
			//document.getElementById("contentSelectDossier").style.display='none';
			interfaceActuel = tabInterface[i];

			if(DateNavig[i]!= undefined){
				initdate(DateNavig[i]);
				initcalendar(DateNavig[i]);

			}
			//permet d'executé directement un recherche kan on clic sur un onglet
			if(lastsearch!= "" && T_option!= "NoRech"){
				var formname = tabInterface[i];
				if(formname == "Fiche")
					formname = "Entreprise";
				var editform = "document.Form"+formname+".motcle";
				eval(editform).value = lastsearch;
				if(T_option == "rcs")
					var editexecute = "recherche"+formname+"('"+T_option+"');";
				else
					var editexecute = "recherche"+formname+"();";
				executeSearch = true;
			}

		}else{
			document.getElementById('tab_'+i).className='off';
			document.getElementById(OngletNavig[i]).style.display='none';
		}
		//lance la recherche

		/*	if(idTab!=1)
				document.getElementById("Contentselectdossier").style.display='block';*/
	}
	if(executeSearch)
	{
		eval(editexecute);
		//console.log(editexecute);
	}

}

var ntab = 1;

function ongletRechPresse(motcle,datedebut,datefin,listesources,T_option){
	var resultRech="";
	var divaction = document.getElementById("divaction");
	divaction.style.display='none';
	SelectTabContainer();
	clearInfoResultat();
	var tabresult = document.getElementById("contentTable");
	tabresult.innerHTML='<table border="0" id="tableRech" class="listline"><div id="sablier"><img src="../img/sablier.gif" alt="Recheche en cours" title="Recheche en cours"/></div></table>';
	dojo.io.bind({
			url:'../presse/resultcontentPresse.php?motcle='+motcle+'&datedebut='+datedebut+'&datefin='+datefin+'&listesources='+listesources+'&to_do=rechPresse&T_option='+T_option,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
				if(datas["error"] < 0)
						SessionEnd();
					else{
						if((datas["result"]["count"]["TOTAL"] == 0 && T_option != 'approx') || datas["result"]==null){
							//SecondChoix(motcle,'Presse');
							PasDeResultat(motcle,datas["nomen"]);
							tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
						//	SelectTabContainer();
						}
						else{
							divaction.style.display='block';
							if(T_option!="approx"){
    						var PageResult = document.getElementById("mainContentPageResult");
								if(datas["result"]["count"]["TOTAL"] > maxdocrech)
									resultRech = maxdocrech+"/"+datas["result"]["count"]["TOTAL"];
								else
									resultRech = datas["result"]["count"]["TOTAL"];
								PageResult.innerHTML='<span class="result">Recherche : <span class="request">'+motcle+'</span> (<span class="number">'+resultRech+'</span> réponses)</span><span class="clear-left"></span>';
							}
							tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
							initTablistePresse(datas["result"]);
						}
					}
				}
			});
}
function ongletRechPresseFiche(EntSiren,t_option){
	if(t_option == undefined)
		t_option = '';
	var divaction = document.getElementById("divaction");
	divaction.style.display='none';
	var tabresult = document.getElementById("contentTable");
	tabresult.innerHTML='<table border="0" id="tableRech" class="listline"><div id="sablier"><img src="../img/sablier.gif" alt="Recheche en cours" title="Recheche en cours"/></div></table>';
	dojo.io.bind({
			url:'../presse/resultcontentPresse.php?to_do=PresseFiche'+t_option+'&EntSiren='+EntSiren,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
				if(datas["error"] < 0)
						SessionEnd();
					else{
						divaction.style.display='block';
						var PageResult = document.getElementById("mainContentPageResult");
						PageResult.innerHTML ='<div class="imgPosition"><img src="img/EDD_Prem_log_moyen.jpg" alt="Premedd" title="Premedd"/></div><div class="clear"></div>';
						tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
						initTablistePresse(datas["result"]);
					}
				}
			});
}

function Printdoc(utltmp){
	dojo.io.bind({
			url: utltmp,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
				alert(datas);
			}
	});
}

function ongletVisuDoc(urldoc, docTitre, provenance){
/*if(Ispaye == "Encours")
{
	alert("Vous avez déja une transaction en cours. Merci de la terminer ou de fermer l'onglet, pour une nouvelle transaction.");
	return;
}
Ispaye ="Encours";*/
	var tabContainer = dojo.widget.getWidgetById("mainTabContainer");
	var id = "article_"+ntab++;
	tabContainer.addTab({label:'<span class=doc>'+docTitre+'...</span>',type:'<span class=ent>'+provenance+'</span>',insertpos:1,closable:true,id:id});
tabContainer.selectChild(tabContainer.children[tabContainer.children.length-1]);
		var BindUrl = '../fun/visudoc.php?to_do=visuDoc&url='+urldoc+'&provenance='+provenance+'&divid='+id;
 		dojo.io.bind({
			url: BindUrl,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
						var div = dojo.byId(id);
						if(datas["facture"]=="OK"){
							var BindUrltmp =BindUrl+"&mode=print&provenance="+provenance;
							div.innerHTML = "<div id=\"table"+provenance+"\">"+datas["doc"]+"</div>";
						}
						else
							div.innerHTML = "Impossible de visualiser ce document";
						tabContainer.selectChild(tabContainer.children[tabContainer.children.length-1]);
				}
			});
	//rafraichissement de la pub
	refreshPub();
	refreshXiti(provenance);
}
function ongletVisuDocFiche(docTitre, provenance,docnod,docbas,docdav){
	 var BindUrl = '../fun/visudoc.php?to_do=visuDocFiche&nod='+docnod+'&bas='+docbas+'&dav='+docdav;
 		dojo.io.bind({
			url: BindUrl,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
						var tabContainer = dojo.widget.getWidgetById("mainTabContainer");
						var id = "article_"+ntab++;
						tabContainer.addTab({label:'<span class=doc>'+docTitre+'...</span>',type:'<span class=ent>'+provenance+'</span>',insertpos:1,closable:true,id:id});
						var div = dojo.byId(id);
						if(datas["facture"]=="OK")
							div.innerHTML = '<div id="table'+provenance+'">'+datas["doc"]+"</div>";
						else
							div.innerHTML = "La visulisation des docs est payante";
						tabContainer.selectChild(tabContainer.children[tabContainer.children.length-1]);
				}
			});

}
/**
* Visu de plusieur docs
**/
function ongletVisuDocs(ListeSelected,provenance){
	for (i=0; i < ListeSelected.length; i++) {
		var docTitre = ListeSelected[i]["TITREAFFICHE"];
		ongletVisuDoc(ListeSelected[i]["SWISHDOCPATH"], docTitre.substring(0,15)+'...', provenance);
	}
}



function ongletRechBalo(motcle,datedebut,datefin,listesources,typrech,T_option){
	var resultRech="";
	SelectTabContainer();
	clearInfoResultat();

	var tabresult = document.getElementById("contentTable");
	tabresult.innerHTML='<table border="0" id="tableRech" class="listline"><div id="sablier"><img src="../img/sablier.gif" alt="Recheche en cours" title="Recheche en cours"/></div></table>';
	var divaction = document.getElementById("divaction");
	divaction.style.display='none';
	dojo.io.bind({
			url:'../balo/resultcontentBalo.php?motcle='+motcle+'&datedebut='+datedebut+'&datefin='+datefin+'&listesources='+listesources+'&typrech='+typrech+'&to_do=rechBalo&T_option='+T_option,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
					if(datas["error"] < 0)
						SessionEnd();
					else{
					//	var tabresult = document.getElementById("tableRech");
						if(datas["result"]["count"]["TOTAL"] == 0 && T_option != 'approx'){
							//SecondChoix(motcle,'Balo');

							PasDeResultat(motcle);
							tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
							SelectTabContainer();
						}
						else{
							divaction.style.display='block';
							if(datas["result"]["count"]["TOTAL"] > maxdocrech)
									resultRech = maxdocrech+" / "+datas["result"]["count"]["TOTAL"];
								else
									resultRech = datas["result"]["count"]["TOTAL"];
							if(T_option!="approx"){
    						var PageResult = document.getElementById("mainContentPageResult");
								PageResult.innerHTML=datas["divhaut"]+'<span class="result">Recherche : <span class="request">'+motcle+'</span> (<span class="number">'+resultRech+'</span> réponses)</span><span class="clear-left"></span>';
							}
							tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
							initTablisteBalo(datas["result"]);
						}
					}
				}
			});
	refreshPub();
	refreshXiti("rechBalo");
}

function ongletRechBaloFiche(EntSiren){
		var tabresult = document.getElementById("contentTable");
	tabresult.innerHTML='<table border="0" id="tableRech" class="listline"><div id="sablier"><img src="../img/sablier.gif" alt="Recheche en cours" title="Recheche en cours"/></div></table>';
	var divaction = document.getElementById("divaction");
	divaction.style.display='none';
dojo.io.bind({
			url:'../balo/resultcontentBalo.php?to_do=BaloFiche&EntSiren='+EntSiren,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
					if(datas["error"] < 0)
						SessionEnd();
					else{
						var PageResult = document.getElementById("mainContentPageResult");
						PageResult.innerHTML ="";
							divaction.style.display='block';
							tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
							initTablisteBalo(datas["result"]);
					}
				}
			});
}

function ongletRechBodacc(motcle,datedebut,datefin,listesources,typrech,T_option){
var resultRech;
SelectTabContainer();
clearInfoResultat();
var tabresult = document.getElementById("contentTable");
	tabresult.innerHTML='<table border="0" id="tableRech" class="listline"><div id="sablier"><img src="../img/sablier.gif" alt="Recheche en cours" title="Recheche en cours"/></div></table>';
	var divaction = document.getElementById("divaction");
	divaction.style.display='none';
	dojo.io.bind({
			url:'../bodacc/resultcontentBodacc.php?motcle='+motcle+'&datedebut='+datedebut+'&datefin='+datefin+'&listesources='+listesources+'&typrech='+typrech+'&to_do=rechBodacc',
			mimetype :"text/json",
			load: function(type,datas,Evt) {
					if(datas["error"] < 0)
						SessionEnd();
					else{
						if((datas["result"]["count"]["TOTAL"] == 0 && T_option != 'approx') || datas["result"]=='null'){
								//tabresult.innerHTML="<li>Pas de resultats";
								//SecondChoix(motcle,'Bodacc');
								PasDeResultat(motcle);
								tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
								SelectTabContainer();
							}
							else{
								divaction.style.display='block';
								if(datas["result"]["count"]["TOTAL"] > maxdocrech)
									resultRech = maxdocrech+" / "+datas["result"]["count"]["TOTAL"];
								else
									resultRech = datas["result"]["count"]["TOTAL"];
								if(T_option!="approx"){
	    						var PageResult = document.getElementById("mainContentPageResult");
									PageResult.innerHTML=datas["divhaut"]+'<span class="result">Recherche : <span class="request">'+motcle+'</span> (<span class="number">'+resultRech+'</span> réponses)</span><span class="clear-left"></span>';
								}
								tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
								initTablisteBodacc(datas["result"]);
							}
						}
				}
			});
refreshPub();
refreshXiti("rechBodacc");
}
function ongletRechBodaccFiche(EntSiren){
SelectTabContainer();
clearInfoResultat();
	var divaction = document.getElementById("divaction");
	divaction.style.display='none';
	var tabresult = document.getElementById("contentTable");
	tabresult.innerHTML='<table border="0" id="tableRech" class="listline"><div id="sablier"><img src="../img/sablier.gif" alt="Recheche en cours" title="Recheche en cours"/></div></table>';
	dojo.io.bind({
			url:'../bodacc/resultcontentBodacc.php?to_do=BodaccFiche&EntSiren='+EntSiren,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
						divaction.style.display='block';
						tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
						initTablisteBodacc(datas["result"]);
				}
			});
}



function ongletRechEntreprise(motcle,codpos,T_option,checkdirigeant){
var resultRech;
SelectTabContainer();
	var tabresult = dojo.byId("contentTable");
	tabresult.innerHTML='<table border="0" id="tableRech" class="listline"><div id="sablier"><img src="../img/sablier.gif" alt="Recheche en cours" title="Recheche en cours"/></div></table>';
	clearInfoResultat();
	var divaction = document.getElementById("divaction");
	divaction.style.display='none';

	dojo.io.bind({
			url:'/entreprise/resultcontentEntreprise.php?motcle='+motcle+'&codpos='+codpos+'&to_do=rechEnte&checkdirigeant='+checkdirigeant,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
				var tabresult = document.getElementById("contentTable");
				if(datas["error"] < 0)
						SessionEnd();
					else{
						if(datas["result"] == null){
							PasDeResultat(motcle);
							tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
							SelectTabContainer();
						}else{
							if((datas["result"]["count"]["TOTAL"] == 0 && T_option != 'approx')){
								//SecondChoix(motcle,'Entreprise');
								PasDeResultat(motcle);
								tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
								SelectTabContainer();
							}
							else{
								divaction.style.display='block';
								if(datas["result"]["count"]["TOTAL"] > maxdocrech)
									resultRech = maxdocrech+" / "+datas["result"]["count"]["TOTAL"];
								else
									resultRech = datas["result"]["count"]["TOTAL"];
								if(T_option!="approx"){
	    						var PageResult = document.getElementById("mainContentPageResult");
									PageResult.innerHTML=datas["divhaut"]+'<span class="result">Recherche : <span class="request">'+motcle+'</span> (<span class="number">'+resultRech+'</span> réponses)</span><span class="clear-left"></span>';
								}
								tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
								initTablisteEntreprise(datas["result"]);
							}
						}
					}
				}
			});
refreshPub();
refreshXiti("rechEntreprise");
}

function ongletVisuFiche(Siren, Ent, provenance){
	viewfiche(Siren, Ent, provenance);
	updateTitle();
	//rafraichissement de la pub
	refreshPub();
	refreshXiti('fiche_entreprise');
}

function viewfiche(siren, docTitre, provenance) {
	dojo.io.bind({
     url:'../fun/visufiche.php?siren='+siren+'&provenance='+provenance,
     mimetype:"text/json",
		load: function(type,datas,evt){
			if(datas["error"] < 0)
				SessionEnd();
			else{
				var tabContainer = dojo.widget.getWidgetById("mainTabContainer");
				var id = "article_"+ntab++;

				tabContainer.addTab({label:'<span class=doc>'+datas["entname"]+'</span>',type:'<span class=ent>'+provenance+'</span>',insertpos:1,closable:true,id:id});
				var div = dojo.byId(id);
				div.innerHTML = datas["result"];
				tabContainer.selectChild(tabContainer.children[tabContainer.children.length-1]);
			}
		}
	});
}
function updateTitle(){
	document.title = "Bilan - Bilans gratuits - société - entreprise - registre du Commerce - bilans.lesechos.fr";
}

function ongletRechComptes(motcle,codpos,T_option,checkdirigeant){
	var resultRech;
	var tabresult = dojo.byId("contentTable");
	tabresult.innerHTML='<table border="0" id="tableRech" class="listline"><div id="sablier"><img src="../img/sablier.gif" alt="Recheche en cours" title="Recheche en cours"/></div></table>';
	var divaction = document.getElementById("divaction");
	divaction.style.display='none';
	clearInfoResultat();
	SelectTabContainer();
	dojo.io.bind({
			url:'../comptes/resultcontentComptes.php?motcle='+motcle+'&codpos='+codpos+'&to_do=rechBila&T_option='+T_option+'&checkdirigeant='+checkdirigeant,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
				/*if(datas["result"] == null)
					alert("PB du serveur");*/
					if(datas["error"] < 0)
						SessionEnd();
					else{
						if((datas["result"]["count"]["TOTAL"] == 0 && T_option != 'approx') || datas["result"] == 'null'){
								//SecondChoix(motcle,'Comptes');
							PasDeResultat(motcle);
							tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
							SelectTabContainer();
						}
						else{
							divaction.style.display='block';
							if(datas["result"]["count"]["TOTAL"] > maxdocrech)
									resultRech = maxdocrech+" / "+datas["result"]["count"]["TOTAL"];
								else
									resultRech = datas["result"]["count"]["TOTAL"];
							if(T_option!="approx"){
	    					var PageResult = document.getElementById("mainContentPageResult");
								PageResult.innerHTML=datas["divhaut"]+'<span class="result">Recherche : <span class="request">'+motcle+'</span> (<span class="number">'+resultRech+'</span> réponses)</span><span class="clear-left"></span>';
							}
							tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
							initTablisteComptes(datas["result"]);
						}
					}
				}
			});
refreshPub();
refreshXiti("rechComptes");
}

function ongletVisuCompte(typcmpt,siren,millesime){
var tabContainer = dojo.widget.getWidgetById("mainTabContainer");
var id = "article_"+ntab++;
tabContainer.addTab({label:'<span class=doc>'+siren+'...</span>',type:'<span class=ent>Comptes</span>',insertpos:1,closable:true,id:id});
	dojo.io.bind({
			url:'../comptes/visucontentComptes.php?typcmpt='+typcmpt+'&siren='+siren+'&millesime='+millesime,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
						var div = dojo.byId(id);
						if(datas["facture"]=="OK")
							div.innerHTML = '<div class="action"> <a href="javascript:GoPrint();" class="print">Imprimer</a></div><div id="tableCompte">'+datas["doc"]+"</div></div>";
						else
							div.innerHTML = "Impossible de visualiser ce document";
					tabContainer.selectChild(tabContainer.children[tabContainer.children.length-1]);
				}
			});
}

function ongletVisuDossier(idDossier){
	var tabresult = document.getElementById("contentTable");
	tabresult.innerHTML='<table border="0" id="tableRech" class="listline"><img src="../img/sablier.gif" alt="Recheche en cours" title="Recheche en cours" id="sandglass"/></table>';
	var PageResult = document.getElementById("mainContentPageResult");
	PageResult.innerHTML="";
	var divaction = document.getElementById("divaction");
	divaction.style.display='none';
	document.getElementById("contentSelectDossier").style.display='none';
	dojo.io.bind({
			url:'../dossiers/visucontentDossiers.php?iddossier='+idDossier,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
	//		console.dir(datas);
						divaction.style.display='block';
						tabresult.innerHTML='<table border="0" id="tableRech" class="listline"></table>';
						initTablisteDossiers(datas);
					//	montre();
				}
			});
}

function ongletVeiller(siren,denomination){
	dojo.io.bind({
		url :'../veilles/actionVeilles.php?siren='+siren+'&denomination='+denomination+'&todo_veille=new_veille',
		mimetype :"text/json",
		load: function(type,datas,Evt) {
						alert(datas);
			},
		error: function(type, error){
		//alert("Probleme technique");
		}
		});
}

function ongletGetSurveillance(){
	dojo.io.bind({
		url :'../veilles/actionVeilles.php?todo_veille=get_veille',
		mimetype :"text/json",
		load: function(type,datas,Evt) {
				var listeSurveillance = document.getElementById("mainUserPage");
				listeSurveillance.innerHTML = datas["renduSurveillance"];
			},
		error: function(type, error){
//alert("Probleme technique");
}
		});
}

function ongletSuppSurveillance(ListeSelected){
	dojo.io.bind({
		url :'../veilles/actionVeilles.php?ListeSelected='+ListeSelected+'&todo_veille=supp_veille',
		mimetype :"text/json",
		load: function(type,datas,Evt) {
				var listeSurveillance = document.getElementById("mainUserPage");
				listeSurveillance.innerHTML = datas["renduSurveillance"];
			},
		error: function(type, error){
//alert("Probleme technique");
}
		});
}


function SecondChoix(motcle,provenance){
	dojo.io.bind({
			url:'../commun/resultcontentApprochant.php?motcle='+motcle+'&provenance='+provenance,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
					var PageResult = document.getElementById("mainContentPageResult");
					PageResult.innerHTML=datas["html"];
					var tabContainer = dojo.widget.getWidgetById("mainTabContainer");
					tabContainer.selectChild(tabContainer.children[tabContainer.children.length-1]);
				/*	if(provenance == "Entreprise")
						ongletRechEntreprise(datas["result"],'','approx');
					else if(provenance == "Bodacc")
						ongletRechBodacc(datas["result"],'','','','','approx');
					else if(provenance == "Presse"){
						ongletRechPresse(datas["result"],document.FormPresse.date_debut.value,document.FormPresse.date_fin.value,'ALL','approx');
					}
					else if(provenance == "Balo")
						ongletRechBalo(datas["result"],'','','','','approx');
					else if(provenance == "Comptes")
						ongletRechComptes(datas["result"],'','approx');*/
				},
			error: function(type, error){  }
			});
}
function PasDeResultat(motcle,Toption){
	var PageResult = document.getElementById("mainContentPageResult");
	if(Toption)
		PageResult.innerHTML='<span class="result">Recherche : <span class="request">'+motcle+'</span> (<span class="number">0</span> réponses) <span> Essayer la recherche : <a href="javascript:recherchePresse(\''+Toption+'\')">'+Toption+'</a></span></span>';
	else
		PageResult.innerHTML='<span class="result">Recherche : <span class="request">'+motcle+'</span> (<span class="number">0</span> réponses)</span>';
}

function clearInfoResultat(){
	var PageResult = document.getElementById("mainContentPageResult");
	PageResult.innerHTML='';
}

function OngletVisuMentions(){
 var BindUrl = '../commun/mentions.php';
 w = window.open( BindUrl , 'displayWindow', 'width=750,height=500,resizable=no,directories=no,location=no,scrollbars=yes,status=no,toolbar=no,menubar=no' );
 w.focus();
}
function OngletVisuContact(){
 var BindUrl = '../commun/contact.php';
 w = window.open( BindUrl , 'displayWindow', 'width=750,height=500,resizable=no,directories=no,location=no,scrollbars=yes,status=no,toolbar=no,menubar=no' );
 w.focus();
}


function GoPrint() {
// w = window.open( urlprint , 'displayWindow', 'width=750,height=500,resizable=no,directories=no,location=no,scrollbars=yes,status=no,toolbar=no,menubar=no' );
 //w.focus();
window.print();
}

function OngletVisuAccueil(){
	var BindUrl = '../commun/accueil.php';
 		dojo.io.bind({
			url: BindUrl,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
						var tabContainer = dojo.widget.getWidgetById("mainTabContainer");
						var tabresult = dojo.byId("contentTable");
						clearInfoResultat();
						var divaction = document.getElementById("divaction");
						divaction.style.display='none';
						tabresult.innerHTML='<table border="0" id="tableRech" class="listline"><div id="tableaccueil">'+datas+'</div></table>';


					/*	var id = "article_"+ntab++;
						tabContainer.addTab({label:'<span class=result>Accueil</span>',type:'',insertpos:1,closable:true,id:id});
						var div = dojo.byId(id);
						div.innerHTML = '<div id="tableaccueil">'+datas+'</div>';*/
						tabContainer.selectChild(tabContainer.children[tabContainer.children.length-1]);
				}
			});
}

function OngletVisuAlert(){
/*	ongletVisuCompte(datas["typcmpt"],datas["siren"],datas["millesime"]);*/
	var BindUrl = '../Alerte/visuAlerte.php';
 		dojo.io.bind({
			url: BindUrl,
			mimetype :"text/json",
			load: function(type,datas,Evt) {
					if(datas["typveille"]=="Comptes")
						VisuCompte(datas["typcmpt"],datas["siren"],datas["millesime"],'');
					else if(datas["typveille"]=="Bodacc")
						ongletVisuDoc(datas["urldoc"], datas["docTitre"], datas["provenance"]);
					else if(datas["typveille"]=="Presse")
						ongletVisuDoc(datas["urldoc"], datas["docTitre"], datas["provenance"]);
					else if(datas["typveille"]=="Balo")
						ongletVisuDoc(datas["urldoc"], datas["docTitre"], datas["provenance"]);

				}
			});
}


function SelectTabContainer(){
var mainTabContainer = dojo.widget.getWidgetById("mainTabContainer");
	mainTabContainer.selectChild(mainTabContainer.children[1]);
}

