
//Définition des popups
//window.onload=montre;

function affichage_popup(nom_de_la_page, nom_interne_de_la_fenetre)
{
	window.open (nom_de_la_page, nom_interne_de_la_fenetre, 'height=600, width=900, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes, location=no, directories=yes, status=yes');
}

//Définition des popups
//affiche les images depuis Free
function affichageImage(NomImage)
{
	var pageURL="images/avendre/"+NomImage;
	window.open (pageURL, 'Image', 'height=600, width=900, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');
}

function showhideSSMenu(id) {

	var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display= 'none';}
	}
	if (d) {d.style.display='block';}
}




	var ie=document.all
	var ns6=document.getElementById&&!document.all

	function ietruebody(){
		return (document.compatMode!="BackCompat")? document.documentElement : document.body
	}

	function zoom2(which, e, topH ){
		
		if (ie||ns6){
			
		crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage;
		// ICI POUR REGLER LA POSITION DE LA LOUPE PAR RAPPORT A LA PAGE
		crossobj.style.left=80+"px";
		crossobj.style.top=topH+"px";
		
		//crossobj.innerHTML='<table id="dragbar" class="txt-bold" ><tr><td><table width="100%"><tr><td align="left" width="80%" id="dragbar">&nbsp;<img src="images/trombonne.gif" border="0" id="dragbar" >&nbsp;</td><td align="right" width="20%"><span id="closetext" onClick="closepreview()">&raquo; Fermer</span></td></tr></table></td></tr><tr><td><img src="'+which+'"></td></tr></table>';
		crossobj.innerHTML='<div align="left" id="dragbar" class="txt-bold"><div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">&raquo; Fermer&nbsp;&nbsp;</span></div><img  src="'+which+'" border="0" id="dragbar"></div>';
		//crossobj.innerHTML='<div align="right" id="dragbar" class="txt-bold"><div align="left">&nbsp;<img src="images/trombonne.gif" border="0" id="dragbar" >&nbsp;</div><span id="closetext" onClick="closepreview()">&raquo; Fermer</span></div><img src="'+which+'">';
		crossobj.style.visibility="visible";
		//alert("tt");
		return false;
	}
	
		
	else //if NOT IE 4+ or NS 6+, affiche image ds le navigateur en pleine page
		return true
	}

	function zoomAide(which, e, topH ){
		//var pageUrl="<?php include('aides/axies-allies-aide1.htm'); ?>";
		if (ie||ns6){
		crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage;
		// ICI POUR REGLER LA POSITION DE LA LOUPE PAR RAPPORT A LA PAGE
		crossobj.style.left=80+"px";
		crossobj.style.top=topH+"px";

		//crossobj.innerHTML='<div align="right" id="dragbar" class="txt-bold" ><span id="closetext" onClick="closepreview()">&raquo; Fermer</span></div>'
				crossobj.innerHTML='<table id="dragbar" ><tr><td><table width="100%"><tr><td align="left" width="80%" id="dragbar">&nbsp;<img src="images/trombonne.gif" border="0" id="dragbar" >&nbsp;</td><td align="right" width="20%"><span id="closetext" onClick="closepreview()">&raquo; Fermer</span></td></tr></table></td></tr><tr><td><iframe name="test" src="'+which+'" width="550" height="400"></iframe></td></tr></table>';
		//+"<iframe name='test' src='"+which+"' width='550' height='400'></iframe>";
		crossobj.style.visibility="visible";
		
		return false;
		}
			
		else //if NOT IE 4+ or NS 6+, affiche image ds le navigateur en pleine page
		return true;

	}		
	
	function closepreview(){
		crossobj.style.visibility="hidden";
	}

	function drag_drop(e){
	if (ie&&dragapproved){
		crossobj.style.left=tempx+event.clientX-offsetx+"px";
		crossobj.style.top=tempy+event.clientY-offsety+"px";
	}
	else if (ns6&&dragapproved){
		crossobj.style.left=tempx+e.clientX-offsetx+"px";
		crossobj.style.top=tempy+e.clientY-offsety+"px";
	}
		return false;
	}

	function initializedrag(e){
	if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
	offsetx=ie? event.clientX : e.clientX;
	offsety=ie? event.clientY : e.clientY;
	
	tempx=parseInt(crossobj.style.left);
	tempy=parseInt(crossobj.style.top);
	
	dragapproved=true;
	document.onmousemove=drag_drop;
	}
	}
	
	document.onmousedown=initializedrag;
	document.onmouseup=new Function("dragapproved=false");
