/************************************************************************************************************
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
	
************************************************************************************************************/

var obj,obj2,st,leftPos;
var cssAltId = "cssChangeAlt";

function hideToolTip(){
	document.getElementById("bubble_tooltip").style.display = "none";
}

function moveToolTipL(e,cssIdL,cssUrl,text){
	obj = document.getElementById("bubble_tooltip");
	obj2 = document.getElementById("bubble_tooltip_content");
	obj2.innerHTML = text;

	setOpacity(obj);
	
	if(text == ""){
		obj.style.display = "none";
	}
	else{
		obj.style.display = "block";
	}
	
	if(navigator.userAgent.toLowerCase().indexOf("msie") >= 0){
		replace_css_for_IE(cssIdL,cssAltId);
		replace_css_for_IE(cssAltId,cssIdL);
	}
	else{
		replace_css(cssIdL,cssUrl);
	}
	
	if(document.all){
		e = event;
	}
	
	st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	sl = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
	
	leftPos = e.clientX - 181;
	obj.style.left = leftPos + 5 + sl + "px";
	obj.style.top = e.clientY - obj.offsetHeight -1 + st + "px";
}

function moveToolTipR(e,cssIdR,cssUrl,text){
	obj = document.getElementById("bubble_tooltip");
	obj2 = document.getElementById("bubble_tooltip_content");
	obj2.innerHTML = text;

	setOpacity(obj);
	if(text == ""){
		obj.style.display = "none";
	}
	else{
		obj.style.display = "block";
	}
	
	if(navigator.userAgent.toLowerCase().indexOf("msie") >= 0){
		replace_css_for_IE(cssAltId,cssIdR);
		replace_css_for_IE(cssIdR,cssAltId);
	}
	else{
		replace_css(cssIdR,cssUrl);
	}
	
	if(document.all){
		e = event;
	}
	
	st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	sl = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
	
	leftPos = e.clientX - 28;
	obj.style.left = leftPos + 5 + sl + "px";
	obj.style.top = e.clientY - obj.offsetHeight -1 + st + "px";
}

function setOpacity(el){
	el.style.filter = "alpha(opacity:100)";
	el.style.KHTMLOpacity = "1";
	el.style.MozOpacity = "1";
	el.style.opacity = "1";
}

function replace_css(id,url){
  if(!document.getElementById) return false;
  var element = document.getElementById(id);
  if(!element || !element.cloneNode) return false;
  var new_node = element.cloneNode(true);
  new_node.href = url;
  element.parentNode.replaceChild(new_node,element);
  return true;
}

function replace_css_for_IE(id,id2){
  document.getElementById(id).disabled = false;
  document.getElementById(id2).disabled = true;
}

function AddCss(cssUrl)
{
	var l = document.createElement("link");
	l.setAttribute("type","text/css");
	l.setAttribute("rel","stylesheet");
	l.id = cssAltId;
	l.setAttribute("href",cssUrl);
	l.setAttribute("media","screen");
	document.getElementsByTagName("head")[0].appendChild(l);
}

if(navigator.userAgent.toLowerCase().indexOf("msie") >= 0){
	AddCss("css/bubble-tooltip-l.css");
}
