function a5_getEleLeft(element){
	// allow the use of horizontal dropdown menus in a browser window with the document centered instead of lleft justified
	// my document is 800px wide and the menu starts aprox 175px from the left edge of the document
	// so my document is centered always 1/2 of the window width if the window is larger than the 800px document size
	// so everytime that you call this routine it must 1) subtract the menu offset and remove 1/2 of the offset due to centering
	// to maitain the same relation to the parent element	
	// if the window is less than or equal to  the size of the document then only subtract the menu offset


	var winwidth = new Number();	
	winwidth = document.body.clientWidth; // this is the width of the browser at this time
	var mymenuoffset = new Number();
	var mydocwidth = new Number();
	myoffset = 175;  /// this is the location of the left side of the horizontal menu		
	mydocwidth = 800; // the size of  my document 
	var left_pos = element.offsetLeft;
	var parElement = element.offsetParent;

	while (parElement != null)
		{		
		left_pos += parElement.offsetLeft;		
		parElement = parElement.offsetParent;			
		}	

	if (winwidth > mydocwidth)
		{
		left_pos = left_pos+(400-(winwidth/2))- myoffset; // this will allow the menu to track in a browser window that has the page centered at all times
		}
		else
		{
		left_pos -= myoffset;// the browser window width is equal to or smaller than the current document width
		}

	return left_pos;
}

function a5_getEleTop(element){
	var top_pos = element.offsetTop;
	var parElement = element.offsetParent;
	while (parElement != null){
		top_pos += parElement.offsetTop;
		parElement = parElement.offsetParent;
	}
	return top_pos;
}

function a5_setObjPos(parentObj,childObj,posTypeNum,mainOffNum,subOffNum){
	var parentTopNum = new Number();
	var parentLeftNum = new Number();
	var parentWidthNum = new Number();
	var parentHeightNum = new Number();
	var childWidthNum = new Number();
	var childHeightNum = new Number();

	parentTopNum = a5_getEleTop(parentObj);
	parentLeftNum = a5_getEleLeft(parentObj);
	parentWidthNum = parentObj.offsetWidth;
	parentHeightNum = parentObj.offsetHeight;
	childWidthNum = childObj.offsetWidth;
	childHeightNum = childObj.offsetHeight;
	//alert("MAinoffNUM---|" + mainOffNum);
	switch(posTypeNum){
		case(1):
			childObj.style.left = (parentLeftNum-childWidthNum-mainOffNum)+'px'
			childObj.style.top = (parentTopNum-childHeightNum-subOffNum)+'px'
		break
		case(2):
			childObj.style.left = (parentLeftNum+subOffNum)+'px'
			childObj.style.top = (parentTopNum-childHeightNum-mainOffNum)+'px'
		break
		case(3):
			childObj.style.left = (parentLeftNum+(parentWidthNum-childWidthNum)-subOffNum)+'px'
			childObj.style.top = (parentTopNum-childHeightNum-mainOffNum)+'px'
		break
		case(4):
			childObj.style.left = (parentLeftNum+parentWidthNum+mainOffNum)+'px'
			childObj.style.top = (parentTopNum-childHeightNum-subOffNum)+'px'
		break
		case(5):
			childObj.style.left = (parentLeftNum-childWidthNum-mainOffNum)+'px'
			childObj.style.top = (parentTopNum+subOffNum)+'px'
		break
		case(6):
			childObj.style.left = (parentLeftNum+subOffNum)+'px'
			childObj.style.top = (parentTopNum+mainOffNum)+'px'
		break
		case(7):
			childObj.style.left = (parentLeftNum+parentWidthNum-childWidthNum-subOffNum)+'px'
			childObj.style.top = (parentTopNum+mainOffNum)+'px'
		break
		case(8):
			childObj.style.left = (parentLeftNum+parentWidthNum+mainOffNum)+'px'
			childObj.style.top = (parentTopNum+subOffNum)+'px'
		break
		case(9):
			childObj.style.left = (parentLeftNum-childWidthNum-mainOffNum)+'px'
			childObj.style.top = (parentTopNum-(childHeightNum-parentHeightNum)-subOffNum)+'px'
		break
		case(10):
			childObj.style.left = (parentLeftNum+subOffNum)+'px'
			childObj.style.top = (parentTopNum-(childHeightNum-parentHeightNum)-mainOffNum)+'px'
		break
		case(11):
			childObj.style.left = (parentLeftNum+parentWidthNum-childWidthNum-subOffNum)+'px'
			childObj.style.top = (parentTopNum-(childHeightNum-parentHeightNum)-mainOffNum)+'px'
		break
		case(12):
			childObj.style.left = (parentLeftNum+parentWidthNum+mainOffNum)+'px'
			childObj.style.top = (parentTopNum-(childHeightNum-parentHeightNum)-subOffNum)+'px'
		break
		case(13):
			childObj.style.left = (parentLeftNum-childWidthNum-mainOffNum)+'px'
			childObj.style.top = (parentTopNum+parentHeightNum+subOffNum)+'px'
		break
		case(14):
			childObj.style.left = (parentLeftNum+subOffNum)+'px'
			childObj.style.top = (parentTopNum+parentHeightNum+mainOffNum)+'px'
		break
		case(15):
			childObj.style.left = (parentLeftNum+(parentWidthNum-childWidthNum)-subOffNum)+'px'
			childObj.style.top = (parentTopNum+parentHeightNum+mainOffNum)+'px'
		break
		case(type=16):
			childObj.style.left = (parentLeftNum+parentWidthNum+mainOffNum)+'px'
			childObj.style.top = (parentTopNum+parentHeightNum+subOffNum)+'px'
		break
	}
}
