<!--
// ----- Specific global values
var imagepopupv_offsets={left:0,top:0};
var numimagesurvol=0;
var image=new Array(); 
var imagetxt=new Array(); 

function imagesuivante()
	{
	//global mumimagesurvol;
	//global image;
  var obj = document.getElementById('imagepopupimg');
  var obj2 = document.getElementById('imagepopuptxt');
	numimagesurvol+=1;
	if (numimagesurvol==image.length)
		numimagesurvol=1;
	while (image[numimagesurvol]=='')
		{
		numimagesurvol+=1;
		if (numimagesurvol==image.length)
			numimagesurvol=1;
		}
//	alert (image[numimagesurvol]+'aa'+numimagesurvol+'bb'+image.length);

	obj.src=	image[numimagesurvol];
	obj2.innerHTML=imagetxt[numimagesurvol];
	}
function imageprecedente()
	{
	//global mumimagesurvol;
	//global image;
  var obj = document.getElementById('imagepopupimg');
  var obj2 = document.getElementById('imagepopuptxt');
	numimagesurvol+=-1;
	if (numimagesurvol==0)
		numimagesurvol=image.length-1;
	while (image[numimagesurvol]=='')
		{
		numimagesurvol+=-1;
		if (numimagesurvol==0)
			numimagesurvol=image.length-1;
		}
	obj.src=	image[numimagesurvol];
	obj2.innerHTML=imagetxt[numimagesurvol];
	}

		



//function imagessurvol(clickobjectid,hauteur,largeur,image['1'],image['2'],image['3'],image['4'],image['5'],image['6'],image['7'],image['8'],image['9'],image['10'])
function imagessurvol()
{
var clickobjectid=arguments[0];
var hauteur=eval(arguments[2]);
var largeur=eval(arguments[1]);
var ok=false;
imagepopupInternalClosePopup();
image.length=0;
//	alert (arguments.lenght);
j=1;
for (i=10;i<arguments.length-1;i+=2)
	{
	image[j]=arguments[i];
	imagetxt[j]=arguments[i+1];
	if (image[j]!='') ok=true;
//	alert (image[j]+'aa'+j);
	j++;
	}
if (ok==false)
	{
	//alert ('aa'+i);
		return;
	}

  // ----- Select the ilayer
//	if (!document.getElementById('imagepopupdiv'))
//		imagepopupGeneratePopup();
  var obj = document.getElementById('imagepopupdiv');
  var obj2 = document.getElementById('imagepopuptdimg');
  var obj3 = document.getElementById('imagepopupframe');
  var obj4 = document.getElementById('imagepopupimg');
  var obj5 = document.getElementById('imagepopuphaut');
	var objleft;
	var objtop;

//--fg 24 01 07
//if (!imagepopupv_offsets.top) imagepopupv_offsets = imagepopupccInternalGetAbsolutePosition(obj);
//	alert (clickobjectid);
//  var v_pos = imagepopupccInternalGetAbsolutePosition(document.getElementById(clickobjectid));
  var v_pos = imagepopupccInternalGetAbsolutePosition(document.getElementById(clickobjectid));
  var text_offsets = imagepopupccInternalGetAbsolutePosition(document.getElementById('texte'));
  var v_height = document.getElementById(clickobjectid).offsetHeight;
 // v_pos.top+=-imagepopupccInternalGetAbsolutePosition(document.getElementById('texte')).top;

  // ----- Set the popup position
//if (navigator.appName!='Microsoft Internet Explorer')
obj.style.top='50%'; 
objtop=imagepopupccInternalGetAbsolutePosition(obj).top-hauteur/2;
if (document.documentElement.scrollTop) 
	objtop+=document.documentElement.scrollTop;
else if (document.body.scrollTop) 
		objtop+=document.body.scrollTop;
if (objtop<=0) objtop=0;
obj.style.top=objtop+'px';
obj.style.left='50%'; 
objleft=imagepopupccInternalGetAbsolutePosition(obj).left-largeur/2;
if (document.documentElement.scrollLeft) 
	objleft+=document.documentElement.scrollLeft;
else if (document.body.scrollLeft) 
		objleft+=document.body.scrollLeft;
if (objleft<=0) objleft=0;
obj.style.left=objleft+'px'
obj.style.height=35+hauteur+'px';
obj.style.width=20+largeur+'px';
obj5.style.width=18+largeur+'px';
obj2.style.height=hauteur+'px';
obj2.style.width=largeur+'px';
obj3.style.height=hauteur+31+'px';
obj3.style.width=largeur+18+'px';
numimagesurvol=0;
imagesuivante();
//alert (obj.style.top+' '+document.getElementById(clickobjectid).style.OffsetHeight);
  obj.style.visibility = "visible";
}


function imagepopupccInternalGetAbsolutePosition(p_object)
{
  var v_left;
  var v_top;
  var v_position = {left:0,top:0};

  // ----- Get the object relative position
  v_position.left = p_object.offsetLeft;
  v_position.top = p_object.offsetTop;

  // ----- Get the parent absolute position
  if (p_object.offsetParent != null) {
    var v_parent_position = {left:0,top:0};
    v_parent_position=imagepopupccInternalGetAbsolutePosition(p_object.offsetParent);
    v_position.left += v_parent_position.left;
    v_position.top += v_parent_position.top;
  }

  return v_position;
}
// -----------------------------------------------------------------------------

// ----- Close function for color chooser without selection
function imagepopupInternalClosePopup()
{
  // ----- Select the ilayer
  var obj = document.getElementById('imagepopupdiv');

  // ----- Close the ilayer
  obj.style.visibility = "hidden";
 // obj.style.display = "none";
}

// ----- Close function for color chooser with selection


// ----- Internal color selection


// ----- Popup window creator
function imagepopupGeneratePopup()
{
  // ----- Generate the div tag 
  document.write("<div id='imagepopupdiv'   style='z-index:99;position:absolute;  overflow:hidden; left:50%;top:50%; width:1px; height:1px; padding:0px;margin:0px;border: 0px solid #000000;background-color: none;'><div style='z-index:12;position:absolute;top:Opx;left:0px;background-color:#ffffff;border: 1px solid #000000;  overflow:hidden; '> ");
//  document.write("<div id='imagepopupdiv'   style='z-index:12;position:position:absolute;left:50%;top:50%;margin-left:-380px;margin-top:-225px;  overflow:hidden; width:1; height:1; padding:0px;border: 0px solid #000000;background-color: none;'><div style='z-index:12;position:absolute;top:O;left:0;background-color:#888888;border: 1px solid #000000;  overflow:hidden; '> ");
	 document.write("<table  id='imagepopuphaut' style=' width:100%;  padding:0px;border 1px solid #000000;background-color:#ce7813;color:#ffffff;z-index:12;'>");
  document.write("<tr><td  style='border: none;height:13px;width:13px'><a onClick='imageprecedente()'><</a></td><td   style='border:none;text-align:center' id='imagepopuptxt'></td><td   style='border:none;width:25px'><a onClick='imagesuivante()'>></a></td><td   style='border:0px solid #000000;padding:0px margin:0px;width:13px'> ");
//  document.write("<div align=right 1px solid #888888;><font face='Verdana, Arial, Helvetica, sans-serif' color='#000000' size='2'><b><a onClick='imagepopupInternalClosePopup()'>x</a></b></font></div>");
  document.write("<font face='Verdana, Arial, Helvetica, sans-serif' color='#000000' size='2'><b><a onClick='imagepopupInternalClosePopup()'>x</a></b></font>");
  document.write("</td></tr></table>");
  document.write("<table style=' width:100%;margin:auto;  padding:0px;border 0px solid #000000;background-color: none;'><tr> <td   style='border: none;'></td> ");
//  document.write("<form id=pcjscolorchooserform name=pcjsform method=post action='../admin/menu/sauvecouleur.php'>");
 
     document.write("<td id='imagepopuptdimg'  style='border: none;width:100px,height:100px;text-align:center;margin:auto'><img id='imagepopupimg' src=''  ></td>");

  // ----- Basic color selection
  document.write("</td><td height=1 width=5></td></tr>");
// document.write("<tr><td colspan=3 id='imagepopuptxt'>aalkjskj</td></tr>");
 // document.write("<tr height=1><td height=1 width=5></td><td height=1></td><td height=1 width=5></td></tr>");
 document.write("</table></div>")
 document.write ("<iframe id='imagepopupframe' src='' style='width:1px;height:1px;z-index:10;position:absolute;top:Opx;left:0px;background-color:none;padding:0px;margin:0px;' frameborder='0' ></iframe>");
	document.write("</div>");
//--fg 24 01 07
  var orig = document.getElementById('imagepopupdiv');
  //imagepopupv_offsets = imagepopupccInternalGetAbsolutePosition(orig);
	//imagepopupv_offsets =0;
}


-->
