function showLegendTooltip(e, src) {        	
	if (!legendTooltipShown) {
    	clearInterval(intervalLegendTooltip);
      	var legendTooltip = document.getElementById('legendTooltip');        					        
      	var offsetX = -5;
      	var offsetY = -166;
		if(document.all) {
			e = event;			
			legendTooltip.style.pixelLeft=e.clientX + offsetX;
			legendTooltip.style.pixelTop=e.clientY + parseInt(offsetY,10)-2;		
		} else {			
			legendTooltip.style.left=e.clientX + offsetX;
			legendTooltip.style.top=e.clientY + offsetY;			
		}
		legendTooltip.style.width = '178px';
		legendTooltip.style.height = '166px';				
		legendTooltip.style.visibility='visible';
		if (_ie && ie_version < 7) { 
			legendTooltip.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";       								
		} else {
			legendTooltip.innerHTML = '<img src="'+src+'" border="0">';
		}
     	legendTooltipShown = true;       	
	}      	 
};
function hideLegendTooltip(){
	if (legendTooltipShown) {
   		clearInterval(intervalLegendTooltip);
  		intervalLegendTooltip = setInterval("hideWithIntervalLegendTooltip()",400);
 	}
};
function hideWithIntervalLegendTooltip() {
  	var legendTooltip = document.getElementById('legendTooltip'); 
	if (_ie && ie_version < 7) {
		legendTooltip.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/empty.gif',sizingMethod='scale')";				
    } else {        		
      	legendTooltip.innerHTML = '';        		
    }   
  	legendTooltip.style.visibility='hidden';	   
 	legendTooltip.style.left=0;
	legendTooltip.style.top=0;     	
  	clearInterval(intervalLegendTooltip);        		    
  	legendTooltipShown = false; 
};                
function showSeatTooltip(e, obj) {        	        	       		
	var seatTooltip = document.getElementById('seatTooltip');        					        
	var src ="images/seat_tooltip.png";	 
	 
	var txt = parseFloat(obj.id.substring(5, obj.id.length));
	var offsetX = 5;
	var offsetY = 14;
	if(document.all) {
		e = event;			
		seatTooltip.style.pixelLeft=e.clientX + offsetX;
		seatTooltip.style.pixelTop=e.clientY + parseInt(offsetY,10)-2;		
	} else {			
		seatTooltip.style.left=e.clientX + offsetX;
		seatTooltip.style.top=e.clientY + offsetY;			
	}			
	seatTooltip.style.visibility='visible';
	if (_ie && ie_version < 7) {
		seatTooltip.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";       								
	} else { 
		seatTooltip.innerHTML = '<table style="background-image: url(\'images/seat_tooltip.png\');background-repeat: no-repeat; width: 47px; height:21px;" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" class="top-type3" width="100%" height="100%" nowrap="nowrap" style="padding-bottom:1px;">'+txt+"</td></tr></table>";
	}
};
function hideSeatTooltip(){
  	var seatTooltip = document.getElementById('seatTooltip'); 

	if (_ie && ie_version < 7) {
		seatTooltip.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/empty.gif',sizingMethod='scale')";				
     } else {        		
     	seatTooltip.innerHTML = '';        		
     }   
    seatTooltip.style.visibility='hidden';	   
   	seatTooltip.style.left=0;
	seatTooltip.style.top=0;     		    	
};
                
function showHomePageTooltip() {
	if (!homePageTooltipShown) {
		show('homePage');
		homePageTooltipShown = true;
	}
};
function hideHomePageTooltip() {
	if (homePageTooltipShown) {
		hide('homePage');
		homePageTooltipShown = false;
	}
};
function showTicketsAndVehiclesTooltip() {
	if (!vehiclesAndSeatsTooltipShown) {
		show('vehiclesAndSeats');
		vehiclesAndSeatsTooltipShown = true;
	}
};
function hideTicketsAndVehiclesTooltip() {
	if (vehiclesAndSeatsTooltipShown) {
		hide('vehiclesAndSeats');
		vehiclesAndSeatsTooltipShown = false;
	}
};  
function hideSaleOKMsgInclude(showState){
	if (saleOKMessageIncludeShown) {		
		hide('saleOKMessageInclude');
		clearMessage(showState);
		if (showState == stateTicketsAndVehicles) {
			showTicketsAndVehiclesTooltip();
		}
		saleOKMessageIncludeShown= false;
	}
};
function hideAllShowHomePage() {		
	hideSaleOKMsgInclude(stateHomePage);
	if (summaryIncludeTooltipShown) { 
		getInitStateTimerState();	
	}
	hideSummaryTooltip();	
	hideTicketsAndVehiclesTooltip();
	showHomePageTooltip();		
	if (!userLogged) {
		document.getElementById('loginProfileLabelDIVId').innerHTML = getHomePageLoginTitleInfo();	
		document.getElementById(windowContentId + loginHomePageDIVWindow).innerHTML = getHomePageLoginHTML();
		document.getElementById('lhpUsername').focus(); 
		checkState('lhp');
	}
};
function hideAllMessagesShowTicketsAndVehicles() {		
	hideSaleOKMsgInclude(stateTicketsAndVehicles);
	if (summaryIncludeTooltipShown) { 
		getInitStateTimerState();	
	}
	hideSummaryTooltip();	
	hideHomePageTooltip();
	showTicketsAndVehiclesTooltip();
};

function switchVisibility(element1, element2) {
	if(document.getElementById(element1) != undefined && document.getElementById(element2) != undefined) {
		document.getElementById(element1).style.visibility = "visible";
		document.getElementById(element2).style.visibility = "hidden";
	}	
}; 
function hide(element) {
	if (document.getElementById(element) != undefined) {
		document.getElementById(element).className = 'hide';
	}	
};
function show(element) {
	if (document.getElementById(element) != undefined) {
		document.getElementById(element).className = 'show';
	}	
};
function hideCustomTooltip(element) {
	if (document.getElementById(element) != undefined) {
		document.getElementById(element).style.visibility = 'hidden';
	}
};
function showCustomTooltip(element) {
	if (document.getElementById(element) != undefined) {
		document.getElementById(element).style.visibility = 'visible';
	}
};
		
