/************************************************************************************************************
Ajax dynamic list
Copyright (C) September 2005  DTHMLGoodies.com, Alf Magne Kalleland

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.

Alf Magne Kalleland, 2006
Owner of DHTMLgoodies.com
	
************************************************************************************************************/	

function showYpsilonTip(title,text,alink,linktext,iconid){
	
	var obj  = document.getElementById('bubble_ypsilon');
	var obj2 = document.getElementById('bubble_tooltip_content');
	var obj3 = document.getElementById('bubble_tooltip_title');	
	var obj4 = document.getElementById('bubble_tooltip_link');		
	var e    = document.getElementById('ypsilon_net_ballon_target');	
	
	
	
	obj.style.display = 'block';
	obj2.innerHTML = text;
	if(iconid!="" && iconid!=null) obj3.innerHTML = '<table><tr><td><img src="images/icon_'+iconid+'.gif"/></td><td><strong>' + title + '</strong></td></tr></table>';
	else           obj3.innerHTML = title; 
	if(alink!="" && alink !=null && linktext !="" && linktext !=null ) obj4.innerHTML = "<a href='"+alink+"'>"+linktext+"</a>";
	else                           obj4.style.visibility = 'hidden';

        updateYpsilonTipPosition();	
	
	
}	

function hideYpsilonTip()
{
	document.getElementById('bubble_ypsilon').style.display = 'none';	
}

function updateYpsilonTipPosition(){

	  var obj  = document.getElementById('bubble_ypsilon');
	  var obj2 = document.getElementById('bubble_tooltip_content');

	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }	


	  var scrOfX = 0, scrOfY = 0;
	  if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	  }
	 
	 var text = obj2.innerHTML;
	 var addlines = Math.ceil(text.length/28)-1;
	 if(addlines<0) addlines = 0;
	 
	 obj.style.left = ( myWidth + scrOfX - 220 ) + 'px';
	 obj.style.top  = ( myHeight + scrOfY - 110 - 18*addlines ) + 'px';


}

