/********************
* 
* locate position of image and align next to it
*
***************************/
genRef = []
contRef = []

imgPositioning = function(id, cont, imgOffX, imgOffY) {
	var d = document
	ie = d.all ? 1 : 0
	ns4 = d.layers ? 1 : 0
	dom = d.getElementById ? 1 : 0
	if(typeof genRef[id] != 'object') genRef[id] = dom ? d.getElementById(id) : ie ? d.all[id] : d.layers[id]
		lenkX = findiPosX(genRef[id])
		lenkY = findiPosY(genRef[id])
		lenkX = eval(lenkX +"+"+ imgOffX)
		lenkY = eval(lenkY +"+"+ imgOffY)
	if(typeof contRef[cont] != 'object') contRef[cont] = dom ? d.getElementById(cont) : ie ? d.all[cont] : d.layers[cont]
		contRef[cont].style.top = ns4 ? lenkY : lenkY + "px"
		contRef[cont].style.left = ns4 ? lenkX : lenkX + "px"
}

function findiPosX(obj) {
	var curleft = 0;
	if (document.getElementById || document.all) {
		while (obj.offsetParent) {
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}else if (document.layers)
		curleft += obj.x;
	return curleft;
}

function findiPosY(obj) {
	var curtop = 0;
	if (document.getElementById || document.all) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}else if (document.layers)
		curtop += obj.y;
	return curtop;
}
