
function onResizeHanlder()
{
	var collImages = document.body.getElementsByTagName("IMG");
	if (collImages != null){
		if (collImages.length != null){
			for (i = 0; i < collImages.length; i++){
				collImages[i].fireEvent("onload");
			}
		}		
	} 
}
//
// returns an array objet of two elements containing the top and the left absolute position 
// of an object in the window independently of its containers
function getAbsolutePosition(obj)
{	
	var position = new Array(2);
	
	position[0]=0;
	position[1]=0;
		
	do {
		position[0] += obj.offsetTop;
		position[1] += obj.offsetLeft;			
	} while ( (obj = obj.offsetParent)!=null );
	
	return position;
}

function writeAllParentsWithPos(obj)
{		
	do {
		document.write("obj.tagName = " + obj.tagName + " / obj.offsetTop = " + obj.offsetTop + " / obj.offsetLeft = " + obj.offsetLeft + "<br\>");		
	} while ( (obj = obj.offsetParent)!=null );
}
// params: ObjImg: id of an image object
// 		   ObjLine: id a division (visibility='hidden') containing an horizontal line object (HR)
//		   iMode: 0 to put the line at the middle of the image (=striketrough), 
//			      1 to put the line at the bottom of the image (=underlined).
function doPosition(ObjImg,ObjLine,iMode) 
{	
	var imgPos = getAbsolutePosition(ObjImg);
	
	if (iMode==0)
	{
		ObjLine.style.top = imgPos[0] + ObjImg.offsetHeight/2;				
		ObjLine.style.left = imgPos[1]+1;
	}
	else
	{
		ObjLine.style.top = imgPos[0] + ObjImg.offsetHeight;			
		ObjLine.style.left = imgPos[1];
	}	
	
	ObjLine.style.width = ObjImg.offsetWidth;
	ObjLine.style.visibility="visible";		
}

window.onresize=onResizeHanlder;
