var version=navigator.appVersion.split(";");
//alert(version[1]);
if (version[1]!=" MSIE 7.0"  )
{


var oddObjArray = new Array(); //tracks all child nodes in article for odd sized type and images

var line_height = font_size*LINE_HEIGHT_MOD; // column hieghts are deteremined by the line height, this is the critical variable
var column_position = 0; // page position
var column_height_total = 0; // ??

var bodyNode; // body tag id should fix this and id the body by getElementsByTagName

var viewer_height = null; // height of the text viewer
allImagePositions = new Array();
allParagraphPositions = new Array();

// short for getElementById
function gId(o){return document.getElementById(o);}

// this is work around a bug in early version of the Mozilla engine(in Netscape 6.0)
// the bug does not track object offsets properly
// this method should be called when the fonts are resized, or any other
// event which would affect offsets
function st_imageCount()
	{
	var obj = gId("at0");
	var allImages = obj.getElementsByTagName("img");
	
	for (var imgCounter = 0; imgCounter < allImages.length; imgCounter++)
		{
		allImagePositions[imgCounter] = Math.abs(allImages[imgCounter].offsetTop);
		}
	
	for (var colCounter = 0; colCounter < COLUMN_NUM; colCounter++)
		{
		var obj = gId("at"+colCounter);
		var allImages = obj.getElementsByTagName("img");
		
		for (var imgCounter = 0; imgCounter < allImages.length; imgCounter++)
			{
			allImages[imgCounter].style.height = "0px";
			}
		
		}
	
	}

	
//these two functions are used to get hieght or width
function getWidth(obj)	{ if (obj.offsetWidth) return obj.offsetWidth; }
function getHeight(obj)	{ if (obj.offsetHeight) return  
obj.offsetHeight; }

	
	
//places positions of paragraphs into an array
function st_paragraphCount()
	{
	var obj = gId("at0");
	var allParagraphs = obj.getElementsByTagName("p");
	
	nsFix = 0;
	
	for (var pCounter = 0; pCounter < allParagraphs.length; pCounter++)
		{
		//Netscape 6.01(and probably lower) starts the first paragraph out at a number other than
		//0, although it should be 0, this is a fix for that problem
		if (pCounter == 0) nsFix = Math.abs(allParagraphs[pCounter].offsetTop);
		allParagraphPositions[pCounter] = Math.abs(allParagraphs[pCounter].offsetTop)-nsFix;
		}
	}	
	
function gID(o)
	{
	return document.getElementById(o);
	}
	
// controls display of images	
function st_displayImages()
	{
	if (navigator.appName!="Microsoft Internet Explorer")
	{
	//var imgOut = ""; //this string contains the HTML the be written out to create the images
	
	var obj = gId("at0");
	var allImages = obj.getElementsByTagName("img");
	
	
	var start = Math.abs(-1*(viewer_height*(column_position)));
	var end = Math.abs((viewer_height*(COLUMN_NUM+column_position)));
	var imgOut = "";//start+" | "+end+"<br><br>";

	for (var imgCounter = 0; imgCounter < allImages.length; imgCounter++)
		{	
			var tempTop = allImagePositions[imgCounter];
			var imgObj = allImages[imgCounter];
			
			/*
			This is a fix for mozilla, but appears to have been fixed in Mozilla version .9.4 (or earlier)
			Since the offsetTop seems to be adjusted based also on the parent's position
			*/
			
			var comment = start+" | "+end+" | "+tempTop;
			
			window.status = comment +" "+(tempTop >= start && tempTop <= end);
			//alert('ok');
			//an image has been found
			if (tempTop >= start && tempTop <= end)
				{
			
				if (!IMG_INLINE)
					{
					var reduction_largeur=0;
					var reduction_hauteur=0;
					var reduction = 0;
					
					if (navigator.appName!="Microsoft Internet Explorer")
					{
					//you will want to alter this to fit your layout needs
					var reduction_largeur=180/document.images.namedItem('image'+imgCounter).width;
					var reduction_hauteur=180/document.images.namedItem('image'+imgCounter).height;
					// Choix du "bon" facteur de réduction
					var reduction = Math.min(reduction_hauteur, reduction_largeur);
					
					// Calcul des paramètres à renvoyer
					var largeur = 180;
					var hauteur = Math.round(document.images.namedItem('image'+imgCounter).height*reduction_largeur);
					}
					else
					{
					/*var images = document.all.tags("img");
					//you will want to alter this to fit your layout needs
					var reduction_largeur=180/images[imgCounter].width;
					var reduction_hauteur=180/images[imgCounter].height;
					// Choix du "bon" facteur de réduction
					var reduction = Math.min(reduction_hauteur, reduction_largeur);
					
					// Calcul des paramètres à renvoyer
					var largeur = 180;
					var hauteur = Math.round(images[imgCounter].height*reduction_largeur);*/
					var largeur=0;
					var heuteur=0;
					}
					var parametre="height=\""+parseInt(hauteur)+"\" width=\""+parseInt(largeur)+"\"";
					var txtOut = gId(IMG_VIEWER).innerHTML;
					txtOut = txtOut.replace("DIV", "div");
					txtOut_tab = txtOut.split("<div>");
					imgOut += "<div><img src=\""+allImages[imgCounter].src+"\" "+parametre+"><br>"+allImages[imgCounter].getAttribute('custom')+"</div>";
					//alert(imgOut);
					}
				if (IMG_INLINE)
					{
					allImages[imgCounter].style.width="100px";
					allImages[imgCounter].style.height="100px";
					}
				}
		}
	// draw the images
	if (!IMG_INLINE && !FIRST_TIME && !txtOut)
		{
		var txtOut = gId(IMG_VIEWER).innerHTML;
		txtOut_tab = txtOut.split("<div>");
		gId(IMG_VIEWER).innerHTML = txtOut_tab[0];
		gId(IMG_VIEWER).style.display = "block"
		}
	else if (!IMG_INLINE && !FIRST_TIME)
		{
		gId(IMG_VIEWER).innerHTML = txtOut_tab[0]+imgOut;
		gId(IMG_VIEWER).style.display = "block"
		}
	else if (!IMG_INLINE)
		{
		var txtOut = gId(IMG_VIEWER).innerHTML;
		//alert(txtOut);
		gId(IMG_VIEWER).innerHTML += imgOut;
		gId(IMG_VIEWER).style.display = "block"
		FIRST_TIME = false;
		}
	}
	}

// makes sure that a paragraph starts on the first line, to be flush with the top
// this currently is buggy in layouts with more than 2 columns

function st_alignParagraphs()
	{
	var paragraphOffset = 0;
	for (var c = 0; c < COLUMN_NUM; c++)
		{
		
		var column = gId("at"+c);
		//alert (document.getElementById('at1').style.margin);
		var allParagraphs = column.getElementsByTagName("p");
		
		// offset the column for any previous out of alignment paragraphs
		column.style.top =  (parseInt(column.style.top)-paragraphOffset)+"px";
		
		var start = Math.abs(-1*(viewer_height*(c+column_position)))+1-paragraphOffset;
		var end = start+line_height;

		for (var pCounter = 0; pCounter < allParagraphs.length; pCounter++)
			{	
				var pTop = allParagraphPositions[pCounter]-paragraphOffset;//Math.abs(allImages[imgCounter].offsetTop);
				var imgObj = allParagraphs[pCounter];
				
				//a paragraph is within the range
				if (pTop >= start && pTop <= end)
					{
					//adjust the top of the active column
					column.style.top = ((parseInt(column.style.top)-line_height))+"px";
					
					// increase the global paragraphOffset
					paragraphOffset = paragraphOffset+line_height;
					
					// for debugging
					//allParagraphs[pCounter].style.color = "#FF0000";					
					}
			} 
		}
	
		
	}

/* returns the height, in pixels of object */

function st_getHeight(o)
	{
	if (o == "w") 
		{
		o = gId("bodyNode")
		if (window.innerHeight) return window.innerHeight
		else return parseInt(o.offsetHeight)
		}
	else
	{
	o = gId(o);
	if (o.offsetHeight) return o.offsetHeight;
	}}


/* setup 
	creates the columns

*/	
	
function st_columnSetup()
	{
	p = gId(VIEWER);
	p.innerHTML = "";
	column_position = 0;
	
	var o = gId(CONTENTS)
	
	for (i=0; i < COLUMN_NUM; i++)
		{
		
		var aT = document.createElement("div");
		aT.setAttribute("id","at"+i)
		aT.setAttribute("className","stText");
		aT.setAttribute("class","stText");
		aT.innerHTML = o.innerHTML;
		//suppresion du texte clickable pour donner accès au lien dans le texte
		/*if (document.all) var cur = "hand"
		else  var cur = "pointer"
		if (i == 0 || i == COLUMN_NUM-1)	
			{
			aT.style.cursor = cur;
			aT.onclick = st_columnClick;
			aT.onmouseover = st_columnOver;
			aT.onmouseout = st_columnOut;
			}*/
		
		aT.style.display = "block";
		p.appendChild(aT);
		}
	}
	
/* creates a div for printing
this is a cludge for now since a pure css solution is not working on both moz and safari */

function st_printColumnSetup()
	{
	
	var o = gId(CONTENTS)
	
	var aT = document.createElement("div");
	aT.setAttribute("id","printPane")
	aT.innerHTML = o.innerHTML;				
	
	// if you don't have a body node named bodyNode, change the below
	gId("bodyNode").appendChild(aT);

	}


/* 
	lays out the columns 
	this is fired when ever the type faces change, "pages" turned, or window resized
*/	
	
function st_columnLayout()
	{	
	viewer_height = st_getHeight(VIEWER);
		
	for (var i = 0; i < COLUMN_NUM; i++)
		{				
		o = gId("at"+i);
		st_moveColumnLeftPosition(i);
		if (viewer_height > 2*line_height) o.style.top = -1*(viewer_height*(i+column_position))+"px";
		}
	tC = column_height_total/viewer_height; 
	tP = Math.ceil(tC); 
	tPos = (column_position+COLUMN_NUM)/COLUMN_NUM; 
	o = gId("P")
	//o2 = gId("P2")
	st_alignParagraphs();
	
	// if the current page is > than the total pages
	if ((Math.round(tPos)) > (Math.ceil(tP/COLUMN_NUM)))
		{
		st_screenPrevious();
		}
	//customize you page number here
	o.innerHTML = ""+(Math.round(tPos))+":"+(Math.ceil(tP/COLUMN_NUM));
	//o2.innerHTML = ""+(Math.round(tPos))+":"+(Math.ceil(tP/COLUMN_NUM));
	
	
	}
	

// adjust the column height to the line height to avoid cropping a column mid line

function st_columnSnapHeight(m) 
	{
	if (m == null) m =0;
	
	var h = st_getHeight("w");
	/*
	A bug is occuring with ART_HEIGHT_MIN and MAX
	if(h < ART_HEIGHT_MIN) h = ART_HEIGHT_MIN;
	if(h > ART_HEIGHT_MAX && ART_HEIGHT_MAX > ) h = ART_HEIGHT_MAX;
	*/
	
	s = line_height*Math.round((h-m)/line_height)
	
	if (s < line_height*1) s = line_height*1
	return s;
	}
	
	
function st_columnSetHeight()
	{
	if (COLUMN_NUM > 1)
	{
	if (gId(CONTENTS) != null)
		{
		gId(VIEWER).style.height = st_columnSnapHeight(NAVIGATION_AREA)+"px";
		column_height_total = st_getHeight("at1");	viewer_height = st_getHeight(CONTENTS)
		while ((viewer_height*(column_position+COLUMN_NUM-1)) > column_height_total && column_position > 0)column_position= column_position-1
			st_columnLayout();
			
			}
	}}
	
	
function st_screenNext()
	{
	viewer_height = st_getHeight(VIEWER)
	if ((viewer_height*(column_position+COLUMN_NUM)) < column_height_total)column_position= column_position+COLUMN_NUM;
	st_columnLayout();
	st_displayImages();
	}
	
function st_screenPrevious()
	{
	column_position= column_position-COLUMN_NUM;
	if (column_position < 0) column_position = 0
	st_columnLayout();
	st_displayImages();
	}

//returns the event object
function st_getEventObj(e) {
	if (e == null) e = event;
	if (e.srcElement) obj = e.srcElement;
	else obj = e.target;

	var count = 0;
	do {
	obj = obj.parentNode;
	} 
	while ((obj.id == null || obj.id == "") && count++ < 2); //work around for Moz
	 
	return obj;
	}


// for interface highlighting
// you will want to customize these two method
function st_over(direction)
	{
	obj = document.getElementById("page"+direction);
	obj.style.color = "#464646"
	}
	
function st_out(direction)
	{
	obj = document.getElementById("page"+direction);
	obj.style.color = "#000000"
	
	}

// called when the mouse is over the column
// add events like navigation button changes here
function st_columnOver(e)
	{
	// if there is more than one column
	if (COLUMN_NUM > 1)
		{
		var cur = document.all ? "hand" : "pointer";
		obj = st_getEventObj(e);
		if (obj.id.indexOf("0") > -1) // if the first column is moused over
			{
			var hilite = (column_position > 0);
			obj.style.cursor = hilite ? cur : "default";
			if (hilite) 
				try {st_over("previous");}
				catch(error){}
			}

		if (obj.id.indexOf(COLUMN_NUM-1) > -1) //if the last column is moused over
			{
			var hilite = ((viewer_height*(column_position+COLUMN_NUM)) <
			column_height_total);
			obj.style.cursor = hilite ? cur : "default";
			if (hilite) 
				try {st_over("next");}
				catch(error){};
			}
		}
	}
	
	
function st_columnOut(e)
	{
	// if there is more than one column
	if (COLUMN_NUM > 1)
		{
		
		obj = st_getEventObj(e);
		if (obj.id.indexOf("0") > -1) // if the first column is moused out
			{
			try {st_out("previous");}
				catch(error){}
			}

		if (obj.id.indexOf(COLUMN_NUM-1) > -1) //if the last column is moused out
			{
	   		try {st_out("next");}
				catch(error){}
	   		}
  		}
	}


// called when a column has been clicked on
// routes event to appropriate method, or cancles if user is clicking a link or copying text

function st_columnClick(e)
	{
	if (e != null) event = e;
		if (event.srcElement) obj = event.srcElement;
		else obj = event.target;
	
	if (obj.nodeName.toLowerCase() == "a" || obj.parentNode.nodeName.toLowerCase() == "a")
		{
		// route to the link; //
		if (obj.nodeName.toLowerCase() == "a") document.location = obj.getAttribute("href");
		if (obj.parentNode.nodeName.toLowerCase() == "a") document.location = obj.parentNode.getAttribute("href");
		}
		
	// object clicked is not a link
	
	else
		{
		//parse through the parent objects looking for an object with an id
		// this needs to be improbed to detect only objects with an id of "at"
		var tcounter = 0;
		if (obj.id == null || obj.id == "")
			{
			do {
				obj = obj.parentNode;
				}			
			while ((obj.id == null || obj.id == "") && tcounter < 10);
			}
		
		// if there is more than one column		
		if (COLUMN_NUM > 1)
			{
			// if the first column is clicked
			if (obj.id.indexOf("0") != -1) st_screenPrevious();
			
			//if the last column is clicked
			if (obj.id.indexOf(COLUMN_NUM-1) != -1) st_screenNext();
			}
		
		// different method will need to be used for single column mode
		
		if (COLUMN_NUM == 1)
			{
			
			}
		}
	}



//moves the column into horizontal position
function st_moveColumnLeftPosition(i)
	{
	o = gId("at"+i)
	o.style.left = (i*(parseInt(o.offsetWidth)+10))+"px"
	}



var loop_counter = 0; //used to check for possible infinite loop 

function st_fontSetSize(TEMP_LINE_HEIGHT_MOD)
	{
	line_height = Math.round(font_size+(LINE_HEIGHT_MOD*font_size));
	
	// st_getHeight("aT0")/line_height should be an integer
	// otherwise you will get an offset error	
	
	for (var i = 0; i < COLUMN_NUM; i++) 
		{ 
		o = gId("at"+i);
		o.style.fontSize = font_size+"px";
		o.style.lineHeight = line_height+"px" 
		}
	
	//set paragraph margins
	tObject = gId(VIEWER);
	
	var o = gId("stStyle");
	
	//ie version
	if (document.styleSheets[0].addRule != null)
		{
		document.styleSheets[1].rules.item(0).style.marginBottom =  line_height+"px";
		}
	else if (o.sheet != null)
		{
		o.sheet.cssRules[0].style.marginBottom = line_height+"px";
		}
	else //no stylesheet found
		{
		var o = gId(VIEWER);
		allParagraphs = o.getElementsByTagName("p");
		for (var i= 0; i < allParagraphs.length; i++)
			{
			allParagraphs[i].style.marginBottom = line_height+"px";
			}
		}
	
	// if there is a rounding error in the line height then adjust the LINE_HEIGHT_MOD

	while ((st_getHeight("at0")/line_height) - Math.round(st_getHeight("at0")/line_height) != 0)
		{
		loop_counter++;
		if (loop_counter > 10) 
			{
			//alert("loop_error");
			break;
			}
	
		LINE_HEIGHT_MOD = LINE_HEIGHT_MOD+.1;
		if (LINE_HEIGHT_MOD > MAX_LINE_HEIGHT) LINE_HEIGHT_MOD = ORIGINAL_LINE_HEIGHT_MOD;
		st_fontSetSize();
		}
		
	st_paragraphCount();		
	st_imageCount();

	st_columnSetHeight();
	
	}
	
function st_fontLarger()
	{
	font_size = font_size+2;
	if (font_size > font_size_MAX) {font_size = font_size_MAX;}
	st_fontSetSize();
	}
	
function st_fontSmaller()
	{
	font_size = font_size-2;
	if (font_size < font_size_MIN) font_size = font_size_MIN;
	st_fontSetSize();
	}

function st_init()
	{
//initialisation du menu déroulant...
	if (jp_canDOM){
		if(jp_parentID && document.getElementById(jp_parentID)){
			jp_alluls=document.getElementById(jp_parentID).getElementsByTagName('UL');
			jp_alllis=document.getElementById(jp_parentID).getElementsByTagName('LI');
		}else{
			jp_alluls=document.getElementsByTagName('UL');
			jp_alllis=document.getElementsByTagName('LI');
		}
		for(i=0;i<jp_alllis.length;i++){
			jp_islink=jp_alllis[i].getElementsByTagName('A')[0];
			if(jp_islink){
				jp_addimg = document.createElement('img');
				jp_addimg.src=jp_blankpic;
				jp_addimg.className='node';
				jp_addimg.alt='';
				jp_addimg.onclick=function() {jp_ex(this,null);return false;};
				jp_alllis[i].getElementsByTagName('A')[0].onkeypress=inputKeyHandler;
				jp_alllis[i].getElementsByTagName('A')[0].onfocus=function() {jp_ex(this,0);};
				jp_alllis[i].insertBefore(jp_addimg,jp_alllis[i].firstChild);
			}
		}

		for(i=0;i<jp_alluls.length;i++){
			jp_subul=jp_alluls[i];
			if(jp_subul.parentNode.tagName=='LI'){
				// Do not collapse when there is a strong element in the list.
				jp_highlight=jp_subul.parentNode.getElementsByTagName('strong').length==0?true:false;
				jp_disp=jp_highlight?'none':'block';
				var jp_picaltonoff=jp_highlight?jp_picalt+jp_strDeplier:jp_picalt+jp_strReplier;
				jp_pic=jp_highlight?jp_onpic:jp_offpic;
				// End  highlight change
				jp_childs=jp_subul.getElementsByTagName('LI').length
				jp_momimg=jp_subul.parentNode.getElementsByTagName('IMG')[0]
				if(jp_momimg){
					jp_momimg.setAttribute('title',jp_picaltonoff+jp_subul.parentNode.getElementsByTagName('A')[0].innerHTML);
					jp_momimg.setAttribute('alt',jp_picaltonoff+jp_subul.parentNode.getElementsByTagName('A')[0].innerHTML);
					jp_momimg.src=jp_pic;
					jp_momimg.style.cursor =  'pointer';
					jp_momimg.style.marginLeft='-10px';
					jp_momimg.style.width="1px";
					jp_momimg.style.height="1px";
					jp_subul.style.display='block';
					jp_subul.style.display=jp_disp;
				}
			}
		}

		// Suppresion des images qui ne sont pas des plus ou moins
		for(i=0;i<jp_alllis.length;i++){
			jp_momimg=jp_alllis[i].getElementsByTagName('IMG')[0];
			if(jp_momimg){
				if (jp_momimg.src.indexOf(jp_blankpic)!=-1) {
					// remove link and image
					jp_momimg.parentNode.getElementsByTagName('A')[0].onfocus=function() {return true;};
					jp_momimg.parentNode.getElementsByTagName('A')[0].onkeypress=function() {return true;};
					jp_momimg.parentNode.removeChild(jp_momimg);
				}					
			}
		}
	}
//fin d'initialisation du menu déroulant
//Picture diaporama
if (document.getElementById('picture'))
{
if (document.images.namedItem('picture').width>180)
{
//you will want to alter this to fit your layout needs
var reduction_largeur=180/document.images.namedItem('picture').width;
var reduction_hauteur=180/document.images.namedItem('picture').height;

// Choix du "bon" facteur de réduction
var reduction = Math.min(reduction_hauteur, reduction_largeur);

// Calcul des paramètres à renvoyer
var largeur = 180;
var haut = Math.round(document.images.namedItem('picture').height*reduction_largeur);


document.getElementById('picture').style.height=haut+'px';
document.getElementById('picture').style.width='180px';
//Fin Picture diaporama	
}
}
if (document.createElement != null)
		{
		bodyNode = gId("bodyNode");
	
		if (gId(CONTENTS) != null)
			{
			//Mac IE like CONTESTS to have the stText style
			gId(CONTENTS).setAttribute("class","stText");
			gId(CONTENTS).setAttribute("className","stText");
			
			
			st_printColumnSetup();
			st_columnSetup();
	
			st_columnSetHeight();
			
			st_fontSetSize(); 
			
			st_columnLayout();
			st_displayImages();
			//modified this line on 14.12.2004 to support printing
			gId(CONTENTS).setAttribute("class","stHidden");
			
			gId(CONTENTS).setAttribute("display","none");
			
			}
		
		document.onmousemove = st_NetscapeFix;
		
		
		window.onresize = function()
			{
			st_columnSetHeight();
			st_displayImages();
			}
		}
	try	
		{
		try {
		gID("navbar").onmouseover = showHomePage;
		gID("navbar").onmouseout = hideHomePage;
		gID("navbar").onclick = goNavLink;
		}
	catch(err){}
	
		}
	catch(error)
		{
		}



	}
	

/* netscape fix  */	
	
function st_NetscapeFix()
	{
	st_columnSetHeight();
	document.onmousemove = null;
	}

// adds a new style to hide the source text
function st_preload()
	{
	document.writeln("<style type=\"text/css\">");
	document.writeln("#"+CONTENTS+" {display:none}");
	//set images to 0 in size in the VIEWER
	document.writeln("#"+VIEWER+" img {	display:inline; 	height:0px; 	width:0px;");
	document.writeln("</style>");
	}

st_preload();

window.onload = st_init; 
}
else
{
function st_init1()
	{
//initialisation du menu déroulant...
	if (jp_canDOM){
		if(jp_parentID && document.getElementById(jp_parentID)){
			jp_alluls=document.getElementById(jp_parentID).getElementsByTagName('UL');
			jp_alllis=document.getElementById(jp_parentID).getElementsByTagName('LI');
		}else{
			jp_alluls=document.getElementsByTagName('UL');
			jp_alllis=document.getElementsByTagName('LI');
		}
		for(i=0;i<jp_alllis.length;i++){
			jp_islink=jp_alllis[i].getElementsByTagName('A')[0];
			if(jp_islink){
				jp_addimg = document.createElement('img');
				jp_addimg.src=jp_blankpic;
				jp_addimg.className='node';
				jp_addimg.alt='';
				jp_addimg.onclick=function() {jp_ex(this,null);return false;};
				jp_alllis[i].getElementsByTagName('A')[0].onkeypress=inputKeyHandler;
				jp_alllis[i].getElementsByTagName('A')[0].onfocus=function() {jp_ex(this,0);};
				jp_alllis[i].insertBefore(jp_addimg,jp_alllis[i].firstChild);
			}
		}

		for(i=0;i<jp_alluls.length;i++){
			jp_subul=jp_alluls[i];
			if(jp_subul.parentNode.tagName=='LI'){
				// Do not collapse when there is a strong element in the list.
				jp_highlight=jp_subul.parentNode.getElementsByTagName('strong').length==0?true:false;
				jp_disp=jp_highlight?'none':'block';
				var jp_picaltonoff=jp_highlight?jp_picalt+jp_strDeplier:jp_picalt+jp_strReplier;
				jp_pic=jp_highlight?jp_onpic:jp_offpic;
				// End  highlight change
				jp_childs=jp_subul.getElementsByTagName('LI').length
				jp_momimg=jp_subul.parentNode.getElementsByTagName('IMG')[0]
				if(jp_momimg){
					jp_momimg.setAttribute('title',jp_picaltonoff+jp_subul.parentNode.getElementsByTagName('A')[0].innerHTML);
					jp_momimg.setAttribute('alt',jp_picaltonoff+jp_subul.parentNode.getElementsByTagName('A')[0].innerHTML);
					jp_momimg.src=jp_pic;
					jp_momimg.style.cursor =  'pointer';
					jp_momimg.style.marginLeft='-10px';
					jp_momimg.style.width="1px";
					jp_momimg.style.height="1px";
					jp_subul.style.display='block';
					jp_subul.style.display=jp_disp;
				}
			}
		}

		// Suppresion des images qui ne sont pas des plus ou moins
		for(i=0;i<jp_alllis.length;i++){
			jp_momimg=jp_alllis[i].getElementsByTagName('IMG')[0];
			if(jp_momimg){
				if (jp_momimg.src.indexOf(jp_blankpic)!=-1) {
					// remove link and image
					jp_momimg.parentNode.getElementsByTagName('A')[0].onfocus=function() {return true;};
					jp_momimg.parentNode.getElementsByTagName('A')[0].onkeypress=function() {return true;};
					jp_momimg.parentNode.removeChild(jp_momimg);
				}					
			}
		}
	}
//fin d'initialisation du menu déroulant
//Picture diaporama
if (document.getElementById('picture'))
{
if (document.images.namedItem('picture').width>180)
{
//you will want to alter this to fit your layout needs
var reduction_largeur=180/document.images.namedItem('picture').width;
var reduction_hauteur=180/document.images.namedItem('picture').height;

// Choix du "bon" facteur de réduction
var reduction = Math.min(reduction_hauteur, reduction_largeur);

// Calcul des paramètres à renvoyer
var largeur = 180;
var haut = Math.round(document.images.namedItem('picture').height*reduction_largeur);


document.getElementById('picture').style.height=haut+'px';
document.getElementById('picture').style.width='180px';
//Fin Picture diaporama	
}
}
}


window.onload = st_init1; 
}

//POP-UP IMAGE

// ouverture d'une fenêtre pour afficher une image
function photo(photo, titre, larg, haut, larg_fen, haut_fen)
{
var contenu="<html><head><title>"+titre+"</title></head><body topmargin='0' leftmargin='0' bgcolor='#BCBCBC'><p><a href='javascript:self.close()'><img border='0' src='"+photo+"' width='"+larg+"' height='"+haut+"' style='margin:10px;'></a><div id='Layer1' style='position:absolute; z-index:1; left: 2; top: 2; background-color:#000; padding:5px;'><a href='javascript:window.close();'  style='text-decoration:none;'><font size='1' color='white' face='verdana,Arial'>"+titre+"</font></a></div></p></body></html>";
var left = (screen.availWidth-larg)/3;
var top = (screen.availHeight-haut)/3;
var fenetre = open("","","title="+titre+",resizable=no,scrollbars=no, width="+larg_fen+", height="+haut_fen+"");
fenetre.document.write(contenu);
}


//PROTECT MAIL
function dolink(ad){
   link = 'mailto:' + ad.replace(/\.\..+t\.\./,"@"); 
   return link;
}
function diapo(image, largeur, hauteur, titre)
{




document.getElementById('picture').src='http://www.comblainaupont.be/'+image;
if (largeur>180)
{
//you will want to alter this to fit your layout needs
var reduction_largeur=180/largeur;
var reduction_hauteur=180/hauteur;
// Choix du "bon" facteur de réduction
var reduction = Math.min(reduction_hauteur, reduction_largeur);

// Calcul des paramètres à renvoyer

var haut = Math.round(hauteur*reduction_largeur);
document.getElementById('picture').style.height=haut+'px';
document.getElementById('picture').style.width='180px';
}
else
{
document.getElementById('picture').style.height=hauteur+'px';
document.getElementById('picture').style.width=largeur+'px';
}

largeur_fenetre=parseInt(largeur) + 20;
hauteur_fenetre=parseInt(hauteur) + 100;

document.getElementById('lien_image').href='javascript:photo("'+image+'", "'+titre+'", "'+largeur+'", "'+hauteur+'", "'+largeur_fenetre+'", "'+hauteur_fenetre+'" )'; 
document.getElementById('img_txt').innerHTML = titre;
}

