   /************************************************************************************************************ 
   (C) www.dhtmlgoodies.com, October 2005 
    
   This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.    
    
   Terms of use: 
   You are free to use this script as long as the copyright message is kept intact. However, you may not 
   redistribute, sell or repost it without our permission. 
    
   Update log: 
    
      March, 15th: Fixed problem with sliding in MSIE 
    
   Thank you! 
    
   www.dhtmlgoodies.com 
   Alf Magne Kalleland 
    
   ************************************************************************************************************/    
var expandFirstItemAutomatically = 0;   // Expand first menu item automatically ? 
var initMenuIdToExpand = 'primeiro';   // Id of menu item that should be initially expanded. the id is defined in the <li> tag. 
var expandMenuItemByUrl = true;   // Menu will automatically expand by url - i.e. if the href of the menu item is in the current location, it will expand 


var initialMenuItemAlwaysExpanded = true;   // NOT IMPLEMENTED YET 

var dhtmlgoodies_slmenuObj; 
var divToScroll = false; 
var ulToScroll = false;    
var divCounter = 1; 
var otherDivsToScroll = new Array(); 
var divToHide = false; 
var parentDivToHide = new Array(); 
var ulToHide = false; 
var offsetOpera = 0; 
if(navigator.userAgent.indexOf('Opera')>=0)offsetOpera=1;    
var slideMenuHeightOfCurrentBox = 0; 
var objectsToExpand = new Array(); 
var initExpandIndex = 0; 
var alwaysExpanedItems = new Array(); 
    
function popMenusToShow() 
{ 
   var obj = divToScroll; 
   var endArray = new Array(); 
   while(obj && obj.tagName!='BODY'){ 
      if(obj.tagName=='DIV' && obj.id.indexOf('slideDiv')>=0){ 
         var objFound = -1; 
         for(var no=0;no<otherDivsToScroll.length;no++){ 
            if(otherDivsToScroll[no]==obj){ 
               objFound = no;       
            }                
         }    
         if(objFound>=0){ 
            otherDivsToScroll.splice(objFound,1);    
         }       
      }    
      obj = obj.parentNode; 
   }    
} 

function showSubMenu(e,inputObj) 
{ 

   if(this && this.tagName)inputObj = this.parentNode; 
   if(inputObj && inputObj.tagName=='LI'){ 
      divToScroll = inputObj.getElementsByTagName('DIV')[0]; 
      for(var no=0;no<otherDivsToScroll.length;no++){ 
         if(otherDivsToScroll[no]==divToScroll)return; 
      }          
   } 
   hidingInProcess = false; 
   if(otherDivsToScroll.length>0){ 
      if(divToScroll){             
         if(otherDivsToScroll.length>0){ 
            popMenusToShow(); 
         } 
         if(otherDivsToScroll.length>0){    
            autoHideMenus(); 
            hidingInProcess = true; 
         } 
      }    
   }       
   if(divToScroll && !hidingInProcess){ 
      divToScroll.style.display=''; 
      otherDivsToScroll.length = 0; 
      otherDivToScroll = divToScroll.parentNode; 
      otherDivsToScroll.push(divToScroll);    
      while(otherDivToScroll && otherDivToScroll.tagName!='BODY'){ 
         if(otherDivToScroll.tagName=='DIV' && otherDivToScroll.id.indexOf('slideDiv')>=0){ 
            otherDivsToScroll.push(otherDivToScroll); 
                            
         } 
         otherDivToScroll = otherDivToScroll.parentNode; 
      }          
      ulToScroll = divToScroll.getElementsByTagName('UL')[0]; 
      if(divToScroll.style.height.replace('px','')/1<=1)scrollDownSub(); 
   }    
    

} 



function autoHideMenus() 
{ 
   if(otherDivsToScroll.length>0){ 
      divToHide = otherDivsToScroll[otherDivsToScroll.length-1]; 
      parentDivToHide.length=0; 
      var obj = divToHide.parentNode.parentNode.parentNode; 
      while(obj && obj.tagName=='DIV'){          
         if(obj.id.indexOf('slideDiv')>=0)parentDivToHide.push(obj); 
         obj = obj.parentNode.parentNode.parentNode; 
      } 
      var tmpHeight = (divToHide.style.height.replace('px','')/1 - slideMenuHeightOfCurrentBox); 
      if(tmpHeight<0)tmpHeight=0; 
      if(slideMenuHeightOfCurrentBox)divToHide.style.height = tmpHeight  + 'px'; 
      ulToHide = divToHide.getElementsByTagName('UL')[0]; 
      slideMenuHeightOfCurrentBox = ulToHide.offsetHeight; 
      scrollUpMenu();       
   }else{ 
      slideMenuHeightOfCurrentBox = 0; 
      showSubMenu();          
   } 
} 


function scrollUpMenu() 
{ 

   var height = divToHide.offsetHeight; 
   height-=15; 
   if(height<0)height=0; 
   divToHide.style.height = height + 'px'; 

   for(var no=0;no<parentDivToHide.length;no++){    
      parentDivToHide[no].style.height = parentDivToHide[no].getElementsByTagName('UL')[0].offsetHeight + 'px'; 
   } 
   if(height>0){ 
      setTimeout('scrollUpMenu()',5); 
   }else{ 
      divToHide.style.display='none'; 
      otherDivsToScroll.length = otherDivsToScroll.length-1; 
      autoHideMenus();          
   } 
}    

function scrollDownSub() 
{ 
   if(divToScroll){          
      var height = divToScroll.offsetHeight/1; 
      var offsetMove =Math.min(15,(ulToScroll.offsetHeight - height)); 
      height = height +offsetMove ; 
      divToScroll.style.height = height + 'px'; 
       
      for(var no=1;no<otherDivsToScroll.length;no++){ 
         var tmpHeight = otherDivsToScroll[no].offsetHeight/1 + offsetMove; 
         otherDivsToScroll[no].style.height = tmpHeight + 'px'; 
      }          
      if(height<ulToScroll.offsetHeight)setTimeout('scrollDownSub()',5); else { 
         divToScroll = false; 
         ulToScroll = false; 
         if(objectsToExpand.length>0 && initExpandIndex<(objectsToExpand.length-1)){ 
            initExpandIndex++; 
             
            showSubMenu(false,objectsToExpand[initExpandIndex]); 
         } 
      } 
   } 
} 
    
function initSubItems(inputObj,currentDepth) 
{       
   divCounter++;       
   var div = document.createElement('DIV');   // Creating new div       
   div.style.overflow = 'hidden';    
   div.style.position = 'relative'; 
   div.style.display='none'; 
   div.style.height = '1px'; 
   div.id = 'slideDiv' + divCounter; 
   div.className = 'slideMenuDiv' + currentDepth;       
   inputObj.parentNode.appendChild(div);   // Appending DIV as child element of <LI> that is parent of input <UL>       
   div.appendChild(inputObj);   // Appending <UL> to the div 
   var menuItem = inputObj.getElementsByTagName('LI')[0]; 
   while(menuItem){ 
      if(menuItem.tagName=='LI'){ 
         var aTag = menuItem.getElementsByTagName('A')[0]; 
         aTag.className='slMenuItem_depth'+currentDepth;    
         var subUl = menuItem.getElementsByTagName('UL'); 
         if(subUl.length>0){ 
            initSubItems(subUl[0],currentDepth+1);                
         } 
         aTag.onclick = showSubMenu;             
      }          
      menuItem = menuItem.nextSibling;                   
   }       
} 

function initSlideDownMenu() 
{ 
   dhtmlgoodies_slmenuObj = document.getElementById('dhtmlgoodies_slidedown_menu'); 
//   dhtmlgoodies_slmenuObj.style.visibility='visible';
   dhtmlgoodies_slmenuObj.style.visibility='visible';
   var mainUl = dhtmlgoodies_slmenuObj.getElementsByTagName('UL')[0];       
   var mainMenuItem = mainUl.getElementsByTagName('LI')[0]; 
   mainItemCounter = 1; 
   while(mainMenuItem){          
      if(mainMenuItem.tagName=='LI'){ 
         var aTag = mainMenuItem.getElementsByTagName('A')[0]; 
         aTag.className='slMenuItem_depth1';    
         var subUl = mainMenuItem.getElementsByTagName('UL'); 
         if(subUl.length>0){ 
            mainMenuItem.id = 'mainMenuItem' + mainItemCounter; 
            initSubItems(subUl[0],2); 
            aTag.onclick = showSubMenu; 
            mainItemCounter++; 
         }             
      }          
      mainMenuItem = mainMenuItem.nextSibling;    
   }       
    
   if(location.search.indexOf('mainMenuItemToSlide')>=0){ 
      var items = location.search.split('&'); 
      for(var no=0;no<items.length;no++){ 
         if(items[no].indexOf('mainMenuItemToSlide')>=0){ 
            values = items[no].split('='); 
            showSubMenu(false,document.getElementById('mainMenuItem' + values[1]));    
            initMenuIdToExpand = false;             
         } 
      }          
   }else if(expandFirstItemAutomatically>0){ 
      if(document.getElementById('mainMenuItem' + expandFirstItemAutomatically)){ 
         showSubMenu(false,document.getElementById('mainMenuItem' + expandFirstItemAutomatically)); 
         initMenuIdToExpand = false; 
      } 
   } 

   if(expandMenuItemByUrl) 
   { 
      var aTags = dhtmlgoodies_slmenuObj.getElementsByTagName('A'); 
      for(var no=0;no<aTags.length;no++){ 
         var hrefToCheckOn = aTags[no].href;		
        /* if(location.href.indexOf(hrefToCheckOn)>=0 && hrefToCheckOn.indexOf('#')<hrefToCheckOn.length-1){*/ 
		// if(location.href.indexOf(hrefToCheckOn)>=0 && location.href==hrefToCheckOn && hrefToCheckOn.indexOf('#')<hrefToCheckOn.length-1){	
		 if(location.href.indexOf(hrefToCheckOn)>=0 && location.href==hrefToCheckOn){			 
		 	if (hrefToCheckOn.indexOf('#')>0)
				location.href = hrefToCheckOn.substr(0,hrefToCheckOn.indexOf('#'));
            initMenuIdToExpand = false; 
            var obj = aTags[no].parentNode; 
            while(obj && obj.id!='dhtmlgoodies_slidedown_menu'){ 
               if(obj.tagName=='LI'){                      
                  var subUl = obj.getElementsByTagName('UL'); 
                  if(initialMenuItemAlwaysExpanded)alwaysExpanedItems[obj.parentNode] = true; 
                  if(subUl.length>0){                         
                     objectsToExpand.unshift(obj); 
                  } 
               } 
               obj = obj.parentNode;    
            } 
            showSubMenu(false,objectsToExpand[0]); 
            break;                
         }          
      } 
   } 
          
   if(initMenuIdToExpand) 
   { 
      objectsToExpand = new Array(); 
      var obj = document.getElementById(initMenuIdToExpand) 
      while(obj && obj.id!='dhtmlgoodies_slidedown_menu'){ 
         if(obj.tagName=='LI'){ 
            var subUl = obj.getElementsByTagName('UL'); 
            if(initialMenuItemAlwaysExpanded)alwaysExpanedItems[obj.parentNode] = true; 
            if(subUl.length>0){                   
               objectsToExpand.unshift(obj); 
            } 
         } 
         obj = obj.parentNode;    
      } 
       
      showSubMenu(false,objectsToExpand[0]); 

   }
	

		
}
   	/***********************************************************************************************
	
	Copyright (c) 2005 - Alf Magne Kalleland post@dhtmlgoodies.com
	
	UPDATE LOG:
	
	March, 10th, 2006 : Added support for a message while large image is loading
	
	Get this and other scripts at www.dhtmlgoodies.com
	
	You can use this script freely as long as this copyright message is kept intact.
	
	***********************************************************************************************/ 
   	
	var displayWaitMessage=true;	// Display a please wait message while images are loading?
  	
   		
	var activeImage = false;
	var imageGalleryLeftPos = false;
	var imageGalleryWidth = false;
	var imageGalleryObj = false;
	var maxGalleryXPos = false;
	var slideSpeed = 0;
	var imageGalleryCaptions = new Array();
	var imageGalleryCaptions2 = new Array();
	function startSlide(e)
	{
		if(document.all)e = event;
		var id = this.id;
		this.getElementsByTagName('IMG')[0].src = 'Assets/images/' + this.id + '_over.gif';			
		if(this.id=='arrow_right'){
			slideSpeedMultiply = Math.floor((e.clientX - this.offsetLeft) / 5);
			slideSpeed = -1*slideSpeedMultiply;
			slideSpeed = Math.max(-10,slideSpeed);
		}else{			
			slideSpeedMultiply = 10 - Math.floor((e.clientX - this.offsetLeft) / 5);
			slideSpeed = 1*slideSpeedMultiply;
			slideSpeed = Math.min(10,slideSpeed);
			if(slideSpeed<0)slideSpeed=10;
		}
	}
	
	function releaseSlide()
	{
		var id = this.id;
		this.getElementsByTagName('IMG')[0].src = 'Assets/images/' + this.id + '.gif';
		slideSpeed=0;
	}
		
	function gallerySlide()
	{
		if(slideSpeed!=0){
			var leftPos = imageGalleryObj.offsetLeft;
			leftPos = leftPos/1 + slideSpeed;
			if(leftPos>maxGalleryXPos){
				leftPos = maxGalleryXPos;
				slideSpeed = 0;				
			}
			if(leftPos<minGalleryXPos){
				leftPos = minGalleryXPos;
				slideSpeed=0;
			}			
			imageGalleryObj.style.left = leftPos + 'px';
		}
		setTimeout('gallerySlide()',20);		
	}
	
	function showImage()
	{
		if(activeImage){
			activeImage.style.filter = 'alpha(opacity=50)';	
			activeImage.style.opacity = 0.5;
		}	
		this.style.filter = 'alpha(opacity=100)';
		this.style.opacity = 1;	
		activeImage = this;	
	}
	
	function initSlideShow(nivel)
	{
		document.getElementById('arrow_left').onmousemove = startSlide;
		document.getElementById('arrow_left').onmouseout = releaseSlide;
		document.getElementById('arrow_right').onmousemove = startSlide;
		document.getElementById('arrow_right').onmouseout = releaseSlide;
			
		imageGalleryObj = document.getElementById('theImages');
		imageGalleryLeftPos = imageGalleryObj.offsetLeft;
		imageGalleryWidth = document.getElementById('galleryContainer').offsetWidth - 80;
		maxGalleryXPos = imageGalleryObj.offsetLeft; 
		minGalleryXPos = imageGalleryWidth - document.getElementById('slideEnd').offsetLeft;
		var slideshowImages = imageGalleryObj.getElementsByTagName('IMG');
		for(var no=0;no<slideshowImages.length;no++){
			slideshowImages[no].onmouseover = showImage;
		}
		
		for(var no=0;no<legenda.length;no++){
				imageGalleryCaptions[imageGalleryCaptions.length] = legenda[no];
		}
		
		for(var no=0;no<imagemTexto.length;no++){
				imageGalleryCaptions2[imageGalleryCaptions2.length] = imagemTexto[no];
		}
		var divs = imageGalleryObj.getElementsByTagName('DIV');
		for(var no=0;no<divs.length;no++){
			if(divs[no].className=='imageCaption'){
				imageGalleryCaptions[imageGalleryCaptions.length] = divs[no].innerHTML;
			}else{ 
				if(divs[no].className=='imageTexto')
					imageGalleryCaptions2[imageGalleryCaptions2.length] = divs[no].innerHTML;
			}
		}
		
		gallerySlide();
		var teste = document.getElementById('previewPane').getElementsByTagName('IMG');
		var img2 = document.createElement('IMG');		
		var img3 = document.createElement('IMG');
		img2 = teste[0];
		if (nivel == 4) {			
			img3 = teste[1];
		}		
		if (img2.width > 176){
					document.getElementById('tab').width = 272;
					document.getElementById('barraS').background ='Assets/images/BarraSL.gif';
					document.getElementById('barraI').background ='Assets/images/BarraIL.gif';
					document.getElementById('barraE').background ='Assets/images/BarraEL.gif';
					document.getElementById('barraD').background ='Assets/images/BarraDL.gif';
		}else{
					document.getElementById('tab').width = 176;
					document.getElementById('barraS').background ='Assets/images/BarraS.gif';
					document.getElementById('barraI').background ='Assets/images/BarraI.gif';
					document.getElementById('barraE').background ='Assets/images/BarraE.gif';
					document.getElementById('barraD').background ='Assets/images/BarraD.gif';
		}
		
		if (nivel == 4) {
					if (img3.width > 176){
								document.getElementById('tab2').width = 272;
								document.getElementById('barraS2').background ='Assets/images/BarraSL.gif';
								document.getElementById('barraI2').background ='Assets/images/BarraIL.gif';
								document.getElementById('barraE2').background ='Assets/images/BarraEL.gif';
								document.getElementById('barraD2').background ='Assets/images/BarraDL.gif';
					}else{
								document.getElementById('tab2').width = 176;
								document.getElementById('barraS2').background ='Assets/images/BarraS.gif';
								document.getElementById('barraI2').background ='Assets/images/BarraI.gif';
								document.getElementById('barraE2').background ='Assets/images/BarraE.gif';
								document.getElementById('barraD2').background ='Assets/images/BarraD.gif';
					}
		}
	}
	
//	function showPreview(imagePath, imageIndex, imageBig, path, nivel, id, imagem){
	function showPreview2(imagePath, imageIndex, nivel, id, imagem, imagem_seg, imagePath2){	
		var subImages = document.getElementById('previewPane').getElementsByTagName('IMG');
		var bigImages = document.getElementById('previewPane').getElementsByTagName('A');
		if(subImages.length==0){
			var img = document.createElement('IMG');
			var bigImg = document.createElement('A');
			document.getElementById('previewPane').appendChild(img);
			document.getElementById('previewPane').appendChild(bigImg)
		}else {
			img = subImages[0];
			bigImg = bigImages[0];
			
			if (nivel==4){
				img2 = subImages[1];
				bigImg2 = bigImages[1];
			}
		}
		if(displayWaitMessage){
			document.getElementById('waitMessage').style.display='inline';
		}		
				
		if (document.getElementById('largeImageCaption')!=null)
			document.getElementById('largeImageCaption').style.display='none';
		if (nivel == 1)
			document.getElementById('scroll0Content').style.display='none';
		
		if (nivel == 4)
			img2.onload = function() { hideWaitMessageAndShowCaption(imageIndex-1, nivel); };
		else
			img.onload = function() { hideWaitMessageAndShowCaption(imageIndex-1, nivel); };
					
		bigImg.href = 'javascript:window.open("image.php?id='+ id + '&img='+ imagem +'","imagem","resizable=yes,toolbar=no,status=no,scrollbars=auto"); history.go(9);';
		if (document.all){
			img.style.filter="blendTrans(duration=CrossFadeDuration)";
			img.style.filter="blendTrans(duration=CrossFadeDuration)";
			img.filters.blendTrans.Apply();
		}
		img.src = imagePath;
		if (document.all)
			img.filters.blendTrans.Play();
		
		if (nivel==4){
			bigImg2.href = 'javascript:window.open("image.php?id='+ id + '&img='+ imagem_seg +'","imagem","resizable=yes,toolbar=no,status=no,scrollbars=auto"); history.go(9);';
			//img2.src = imagePath2
			if (document.all){
				img2.style.filter="blendTrans(duration=CrossFadeDuration)";
				img2.style.filter="blendTrans(duration=CrossFadeDuration)";
				img2.filters.blendTrans.Apply();
			}
			img2.src = imagePath2;
			if (document.all)
				img2.filters.blendTrans.Play();
		}
	}
	
	function showPreview(imagePath, imageIndex, nivel, id, imagem){	
		var subImages = document.getElementById('previewPane').getElementsByTagName('IMG');
		var bigImages = document.getElementById('previewPane').getElementsByTagName('A');
		if(subImages.length==0){
			var img = document.createElement('IMG');
			var bigImg = document.createElement('A');
			document.getElementById('previewPane').appendChild(img);
			document.getElementById('previewPane').appendChild(bigImg)
		}else {
			img = subImages[0];
			bigImg = bigImages[0];
		}
		if(displayWaitMessage){
			document.getElementById('waitMessage').style.display='inline';
		}		
				
		if (document.getElementById('largeImageCaption')!=null)
			document.getElementById('largeImageCaption').style.display='none';
		if (nivel == 1)
			document.getElementById('scroll0Content').style.display='none';
					
		img.onload = function() { hideWaitMessageAndShowCaption(imageIndex-1, nivel); };
				
		if (imagem.lastIndexOf('.swf')!=-1){
		//bigImg.href = 'javascript:window.open("image.php?id='+ id + '&img='+ imagem +'","imagem","resizable=yes,toolbar=no,status=no,scrollbars=auto"); history.go(9);';
			bigImg.href = 'javascript:window.open("3D.php?id='+ imagem + '&img='+ id +'","imagem","resizable=no,width=640,height=480,toolbar=no,status=no,scrollbars=auto"); history.go(9);';
		}else{
			bigImg.href = 'javascript:window.open("image.php?id='+ id + '&img='+ imagem +'","imagem","resizable=yes,toolbar=no,toolbar=no,status=no,scrollbars=auto"); history.go(9);';
		
		}
			if (document.all){
				img.style.filter="blendTrans(duration=CrossFadeDuration)";
				img.style.filter="blendTrans(duration=CrossFadeDuration)";
				img.filters.blendTrans.Apply();
			}
			img.src = imagePath;
			if (document.all)
				img.filters.blendTrans.Play();
			
		}
	

	function hideWaitMessageAndShowCaption(imageIndex, nivel)
	{
		document.getElementById('waitMessage').style.display='none';
		if (document.getElementById('largeImageCaption')!=null){
			var str = imageGalleryCaptions[imageIndex];
			if (str.length >60){
				str = str.substr(0,str.indexOf(' ',50)) + ' ...';
			}
			document.getElementById('largeImageCaption').innerHTML = str;
			document.getElementById('largeImageCaption').style.display='block';	
		}
		if (nivel == 1){
			document.getElementById('scroll0Content').innerHTML = imageGalleryCaptions2[imageIndex];			
			document.getElementById('scroll0Content').style.display='block';		
		}
		var teste = document.getElementById('previewPane').getElementsByTagName('IMG');
		var img2 = document.createElement('IMG');		
		var img3 = document.createElement('IMG');
		img2 = teste[0];
		if (nivel == 4){			
			img3 = teste[1];
		}
		
		if (img2.width > 176){
					document.getElementById('tab').width = 272;
					document.getElementById('barraS').background ='Assets/images/BarraSL.gif';
					document.getElementById('barraI').background ='Assets/images/BarraIL.gif';
					document.getElementById('barraE').background ='Assets/images/BarraEL.gif';
					document.getElementById('barraD').background ='Assets/images/BarraDL.gif';
		}else{
					document.getElementById('tab').width = 176;
					document.getElementById('barraS').background ='Assets/images/BarraS.gif';
					document.getElementById('barraI').background ='Assets/images/BarraI.gif';
					document.getElementById('barraE').background ='Assets/images/BarraE.gif';
					document.getElementById('barraD').background ='Assets/images/BarraD.gif';
		}
		if (nivel == 4){
				if (img3.width > 176){
							document.getElementById('tab2').width = 272;
							document.getElementById('barraS2').background ='Assets/images/BarraSL.gif';
							document.getElementById('barraI2').background ='Assets/images/BarraIL.gif';
							document.getElementById('barraE2').background ='Assets/images/BarraEL.gif';
							document.getElementById('barraD2').background ='Assets/images/BarraDL.gif';
				}else{
							document.getElementById('tab2').width = 176;
							document.getElementById('barraS2').background ='Assets/images/BarraS.gif';
							document.getElementById('barraI2').background ='Assets/images/BarraI.gif';
							document.getElementById('barraE2').background ='Assets/images/BarraE.gif';
							document.getElementById('barraD2').background ='Assets/images/BarraD.gif';
				}
		}
	}
	//window.onload = initSlideShow;

	//function initAll(nivel){
		//instantiateScroller(0, "scroll0", 7, 0, 200, 200, 20);
		
		//initSlideDownMenu();
		//initSlideShow(nivel);
		//instantiateScroller(0, "scroll0", 7, 0, 200, 100, 150);
		//InitialiseScrollableArea();
		//setTimeout('instantiateScroller(0, "scroll0", 7, 0, 200, 200, 20)',30);
//	}
	//function initMenu(){
		//initSlideDownMenu();		
	//}


	//window.onload = initSlideDownMenu;
	//window.onload = initSlideShow();
	
/************************************************************************************************************
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 showToolTip(e,text){
	if(document.all)e = event;
	
	var obj = document.getElementById('bubble_tooltip');
	var obj2 = document.getElementById('bubble_tooltip_content');
	//var len = text);
	if(text.length<50)
		text = "<div align='center'>"+text+"<div>";
//	alert(text.length+"-"+text);
	obj2.innerHTML = text;
	obj.style.display = 'block';
	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
	var leftPos = e.clientX - 130;
	if(leftPos<0)leftPos = 0;
	obj.style.left = leftPos + 'px';
	obj.style.top = e.clientY - obj.offsetHeight -1 + st + 'px';	
}	

function hideToolTip()
{
	document.getElementById('bubble_tooltip').style.display = 'none';	
}

