/* function to either get the x or y position of an element, or to set the height of two elements equal*/
/* TK Pratum 2004 - 2008 */
/* modified based on WHS site so that it sets either element to the other, depending on which one is "higher"*/
function get_position(id,postyp,id2)
	{
	 var posx=0;
	 var posy=0;
	 var posz=0;
	 var i=0,obj,objtxt;
	 if (document.all) 
	    {
	     obj=document.all[id];
	     objtxt='o:'+obj.tagName;
	     if (postyp == 'x')
	     	{
	     	while(obj.offsetParent)
	     	{
				i++;
				posx += obj.offsetLeft;
				obj = obj.offsetParent;
				/*objtxt=objtxt+'(' + posx + '):o:'+ obj.tagName;*/
				
	     	 }
	     	 if(obj)
	     	 	{
	     	 	 posx += obj.offsetLeft;
				 objtxt=objtxt+'(' + posx + '):o:';
	     	 	}
	     	 /*alert('posx is '+ posx + ' number of objects ' + i + ' ' + objtxt);*/
	     	 return posx;
	     	 }
	     else if (postyp == 'y')
	     	{
	     	while(obj.offsetParent)
	     	{
				i++;
				if(i == 1)
					posy += obj.offsetTop + obj.offsetHeight;
				else
					posy += obj.offsetTop;
				obj = obj.offsetParent;
				/*objtxt=objtxt+'(' + posy + '):o:'+ obj.tagName;*/
				
	     	 }
	     	 if(obj)
	     	 	{
	     	 	 posy += obj.offsetTop;
				 objtxt=objtxt+'(' + posy + '):o:';
	     	 	}
	     	 /*alert('posy is '+ posy + ' number of objects ' + i + ' ' + objtxt);*/
	     	 return posy;
	     	 }
	      else
	      	{
	      	 	posz = obj.offsetHeight;
	     	    /*alert(objtxt+ ' ' + id + ' ' + postyp + '=' + posz);*/
	     	    document.all[id2].style.height = (posz - 0) + 'px';
	     	    return posz;
	     	    }
	    }
	 else if (document[id])
	    {
	     if (postyp == 'x')
	     	return document[id].offsetLeft;
	     else if (postyp == 'y')
	     	return (document[id].offsetTop + document[id].offsetHeight);
	    }
	 else
	    {
	     obj=document.getElementById(id);
	     objtxt='o:'+obj;
	     if (postyp == 'x')
	     	{
	     	 while(obj.offsetParent)
	     	 {
				i++;
				posx += obj.offsetParent.offsetLeft;
				obj = obj.offsetParent;
				objtxt=objtxt+':o:'+obj;
	     	 }
	     	 if(obj)
	     	 	{
	     	 	 posx += obj.offsetLeft;
	     	 	}
	     	 /*alert(objtxt+ ' ' + postyp + ' x=' + posx + ' i=' + i);*/
	     	 return posx;
	     	 }
	     else if (postyp == 'y')
	     	{
	     	 while(obj.offsetParent)
	     	 {
				i++;
				if(i == 1)
					posy += obj.offsetTop + obj.offsetHeight;
				else
					posy += obj.offsetTop;
				obj = obj.offsetParent;
	     	 }
	     	 if(obj)
	     	 	{
	     	 	 posy += obj.offsetTop;
	     	 	}
	     	 return posy;
	     	 }
	     else
	     	{
	     		posz = obj.offsetHeight;
	     	    /*alert(objtxt+ ' ' + id + ' ' + postyp + '=' + posz + '-' + document.getElementById(id2).offsetHeight);*/
	     	    if(document.getElementById(id2).offsetHeight < posz)
	     	    	{
	     	    	document.getElementById(id2).style.height = (posz + 3) + 'px';
	     	    	}
	     	    else if(posz < document.getElementById(id2).offsetHeight )
	     	    	{
	     	    	document.getElementById(id).style.height = (document.getElementById(id2).offsetHeight - 3) + 'px';
	     	    	}
	     	    return posz;
	     	 }
	    }
	}

/* other miscellaneous functions */
function hide_all_but(id,numid)
	{var i,idtmp;
		for(i=1; i<numid; i++)
			{idtmp='i' + i;
			 if(idtmp != id)
			 	hide_image(idtmp);}
		}

var tid=0;


/*the following function is used on the fpa pages*/
function get_position2(id,postyp)
	{if (document.all) 
	    {
	     if (postyp == 'x')
	     	return document.all[id].offsetLeft;
	     else if (postyp == 'y')
	     	return document.all[id].offsetTop;
	    }
	 else if (document[id])
	    {
	     if (postyp == 'x')
	     	return document[id].offsetLeft;
	     else if (postyp == 'y')
	     	return document[id].offsetTop;
	    }
	 else
	    {
	     if (postyp == 'x')
	     	return document.getElementById(id).offsetLeft;
	     else if (postyp == 'y')
	     	return document.getElementById(id).offsetTop;
	    }
	}

