function getElementPosition(offsetTrail){
	var offsetLeft = 0;
        var offsetTop = 0;
        while(offsetTrail) {
        	offsetLeft += offsetTrail.offsetLeft;
                offsetTop += offsetTrail.offsetTop;
                offsetTrail = offsetTrail.offsetParent;
        }
        return { left:offsetLeft, top:offsetTop }
}

function hideFootnotes() {
	var div = document.getElementById('current_footnote');
        div.className = 'footnote_new';
        div.style.display = 'none';
        return false;
}

function showFootnote(evt, id) {

	var winWidth = document.body.clientWidth;
       var evt = evt || window.event;
       var o = evt.target || evt.srcElement;
       var div = document.getElementById('current_footnote');
       var coords = getElementPosition(o);
       div.innerHTML = '' + document.getElementById(id).innerHTML + '';
	   
       div.className = 'footnote_new_active';
	  
       div = document.getElementById('current_footnote');
	   
       var w = 200;
       div.style.top = (coords.top + o.offsetHeight) + 'px';
	  
       if((winWidth - coords.left) < w) 
       		div.style.left = (coords.left  - 10 - (w - (winWidth - coords.left)))+ 'px';
       else
	       div.style.left = coords.left + 'px';
       div.style.display = 'none';
       div.style.display = 'block';
       evt.cancelBubble = true;
       return false;
}


function showFootnote1(evt, id) {
   
var coords = getElementPosition(h1main);


   document.getElementById('h1').style.position="absolute";
 document.getElementById('h1').style.top = coords.top + 'px';
 document.getElementById('h1').style.left = coords.left + 'px';

//   document.getElementById('h1').style.top = yWithScroll;
//	document.getElementById('h1').style.top-margin = yWithScroll;
   document.getElementById('h1').style.color ='#333333';
document.getElementById('h1').style.bgcolor ='#ffffff';
//document.getElementById('h1').style.width ='800px';
//document.getElementById('h1').style.height ='0px';
document.getElementById('h1').style.border ='1';
document.getElementById('h1').style.align='center';

  // document.getElementById('h1').style.zIndex ='1';
}


function showFootnote12(evt, id) {
      if (window.innerHeight && window.scrollMaxY)
    {// Firefox         
	yWithScroll = window.innerHeight + window.scrollMaxY;         
	xWithScroll = window.innerWidth + window.scrollMaxX;    
	 }
	  else if (document.body.scrollHeight > document.body.offsetHeight){ 
	  // all but Explorer Mac         
	  yWithScroll = document.body.scrollHeight;     
	  xWithScroll = document.body.scrollWidth;  
	     }
		  else { 
		  // works in Explorer 6 Strict, Mozilla (not FF) and Safari         
		  yWithScroll = document.body.offsetHeight;        
		   xWithScroll = document.body.offsetWidth;      
		    } 

}
