// tab functions START

function show(layerName) { 
	document.getElementById(layerName).style.display = '';
	//return 'background-image:url(./images/ltab_blue.gif);';
} 

function hide(layerName) { 
	document.getElementById(layerName).style.display = 'none';
	//return 'background-image:url(./images/ltab_blue.gif);';
}	
function show_next(category, tab_name, allowClose) {
	if(LastCat[category] == tab_name && allowClose == 1){
		//hides tab if active
		if(document.getElementById(LastCat[category])){
			document.getElementById(LastCat[category]).className = 'tab'
		}
		hide(LastCat[category]+'_data');
		LastCat[category]='none';
	}else{
		//shows next tab
		if(document.getElementById(LastCat[category])&&LastCat[category]!='none'){
			document.getElementById(LastCat[category]).className = 'tab'
		}
		if(document.getElementById(tab_name)){
			var curr = document.getElementById(tab_name);
			curr.className='tab_hover';
		}
		if(LastCat[category]!='none'){
			hide(LastCat[category]+'_data');
		}
		show(tab_name+'_data');
		LastCat[category]=tab_name;
	}
}


// tab functions END

//showNote Config START

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
}

var noteActive = '';

showNote=function(popup, pLeft, pTop){
	newNote = popup;
	// gets popup element
	var popup=document.getElementById(popup);
	var popupguide=document.getElementById('pricelist');
	if (window.outerWidth){
	   browserWidth=window.outerWidth;
	}
	if (document.all){
	   browserWidth=document.body.clientWidth;
	}
	if (browserWidth < 780){
		browserWidth = 780;
	}
	//pLeft = (Math.round(browserWidth/2)+ pLeft);
	//if (tempX != 0){pLeft = tempX+20}  
	//if (tempX){pLeft = tempX}  
	if (tempY){pTop = tempY+20+pTop}  
	if (tempX){pLeft = tempX-150+pLeft}  
	popup.style.left=pLeft;
	popup.style.top=pTop;

	if (noteActive != ''){
		hideNote(noteActive);
	}
	// shows popup element
	if(popup.style.visibility!='visible'){
		popup.style.visibility='visible'
		noteActive = newNote;
	}
}

hideNote=function(popup){
	// gets note1 element
	var popup=document.getElementById(popup);
	// hides note1 element
	popup.style.visibility='hidden';
	noteActive = '';
}
//showNote END