// Script by Fran&ccedil;ois de Dardel
 var windowHandle = null;
 var globalImage = null;
 var globalImageWidth = null;
 var globalImageHeight = null;
 var globalCaption = null;

function myOpen(localImage,localCaption,imageWidth,imageHeight)
{
	globalImage = localImage;
	globalCaption = localCaption;
	globalImageWidth = imageWidth;
	globalImageHeight = imageHeight;
	windowWidth = imageWidth + 34;
	 if (imageHeight > screen.height - 140)		
	 	windowHeight = screen.height - 50
	 else
		windowHeight = imageHeight + 110;
	 posX = screen.width/2 - imageWidth/2 - 20;
	windowHandle = 
window.open('photo.html','windowName','toolbar=no,location=no,status=no, scrollbars=yes,resizable=no,width='+ windowWidth +',height='+ windowHeight +',top=0,left='+ posX );
windowHandle.moveTo(posX,0);
}

// ------------------------------------------------
//myOpen2: Version for simple window with text only
//Window width is 600 unless another value is given

function myOpen2(localImage,imageWidth)
	{
	globalImage = localImage;
	if (isNaN(imageWidth))
		imageWidth = 600;
	posX = screen.width/2 - imageWidth/2 - 20;		
	windowWidth = imageWidth + 34;
	windowHandle = window.open(globalImage,'popup','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width='+ windowWidth +', copyhistory=no, top=0, left='+posX );
	}

// --------------------------------------------------------------------------------------
//myOpen3: Version for simple window with text only, for elements of the Mendeleyev table
function myOpen3(localImage){
	posX = screen.width/2 - 230;
	globalImage = localImage;
	windowHandle = window.open('element.html', 'popup', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=500, height=150' +', top=0, left='+posX );
	}

// --------------------------------------------------------------------------------------
function changeIt(MyImage1, MyImage2) { 
if (document.images) { document[MyImage1].src = MyImage2; } ;
} 

NewImg = new Array ();
			NewImg[0] = "images/demin_s.jpg";
			NewImg[1] = "images/BidonsJaunes_s.jpg";
			NewImg[2] = "images/resins_s.jpg";			
			NewImg[3] = "images/robinet_s.jpg";			
			NewImg[4] = "images/processes_s.jpg";			
			NewImg[5] = "images/Amberpack_s.jpg";			
// All images must have same size !!!

var output;
var		ImgNum=Math.floor(Math.random() * NewImg.length); // length = number of images you got -1
	
function Random_Image() {
			output = '<IMG SRC='+NewImg[ImgNum]+' NAME="slideshow" WIDTH=145 HEIGHT=100>';
			document.write(output);
}

<!-- Begin
// All images must have same size !!!

var ImgLength = NewImg.length - 1;

//Time delay between Slides in milliseconds
var delay = 4000;
var run;

function chgImg() {
			if (document.images) {
						ImgNum = ImgNum + 1;
						if (ImgNum > ImgLength) {
									ImgNum = 0;
						}
			document.slideshow.src = NewImg[ImgNum];
			}
}

function loadIt(ImgNum) {
			if (document.images) {
			document.slideshow.src = NewImg[ImgNum];
			}
}
	

function chgAuto() {
						run = setInterval("chgImg()", delay);
}
// end -->

// --------------------------------------------------------------------------------------
//  newUntil ()
//  Dynamic News
//  Written by Jerry Aman, Optima System, Aug 31, 1996. 
//  Part of the PageSpinner distribution.
//  Input:	year, month (1-12) and day (1-31)   
// 	Until the last day the new image should be displayed
// -----------------------------------------------------

function N_Until_img (year, month, day)
{
	now = new Date();
	expire = new Date (year, month-1, day, 
		now.getHours(), now.getMinutes(), now.getSeconds()+1 );

	if ( expire.getTime()  >=  now.getTime())
		document.write(	
	'<IMG SRC="images/New1.gif" ALIGN="TOP" ALT="NEW!">' );
}


function updateUntil_img (year, month, day)
{
	now = new Date();
	expire = new Date (year, month-1, day, 
		now.getHours(), now.getMinutes(), now.getSeconds()+1 );

	if ( expire.getTime()  >=  now.getTime())
		document.write(	
	'<IMG SRC="images/Updated.gif" ALIGN="TOP" ALT="Updated!">' );
}

function updateUntil_txt (year, month, day)
{
	now = new Date();
	expire = new Date (year, month-1, day, 
		now.getHours(), now.getMinutes(), now.getSeconds()+1 );

	if ( expire.getTime()  >=  now.getTime())
		document.write(	'<FONT color="#000099"><B> (Updated) </B></FONT>');
}

function N_Until (year, month, day)
{
	now = new Date();
	expire = new Date (year, month-1, day, 
		now.getHours(), now.getMinutes(), now.getSeconds()+1 );

	if ( expire.getTime()  >=  now.getTime())
		document.write(	'<FONT color="#000099"><B> (N) </B></FONT>');
}

