function getId(id) {
	return document.getElementById(id);
}

var displayed_bubble = false;
 
function findPos(obj) {
	var curleft = obj.offsetLeft || 0;
    var curtop = obj.offsetTop || 0;
	
    while (obj = obj.offsetParent) {
		curleft += obj.offsetLeft
        curtop += obj.offsetTop
    }
	
    return {x:curleft,y:curtop};
}

function montre(text, id) {
	if (displayed_bubble == false) {
  
		if (id == 0) { 
			var markerpos = findPos(document.getElementById("splogo3d5")); 
			getId("bulle").style.left=markerpos.x+"px";
			getId("bulle").style.top=45+markerpos.y+"px"
		}
		
		else { 
			var markerpos = findPos(document.getElementById("photo"+id)); 
			getId("bulle").style.left=markerpos.x+"px";
			getId("bulle").style.top=15+markerpos.y+"px"
		}
		
		getId("bulle").innerHTML = '<img src="http://www.sharedparking.ch/images/'+ text +'" alt="" />';
  		getId("bulle").style.visibility = "visible"; 
  		displayed_bubble = true;
  	}
}

function cache() {
	if (displayed_bubble == true) {
		getId("bulle").style.visibility = "hidden";
		displayed_bubble = false;
	}
}

function cacheHelp(id) {
	if (displayed_bubble == true) {
		getId("cursor"+id).style.visibility = "hidden";
		getId("cursor"+id).style.zIndex = "1";
		getId("cursor"+id).style.display = "none"; 
		displayed_bubble = false;
	}
}

function help(id) {
	if (displayed_bubble == false) {
  		var markerpos = findPos(document.getElementById("helppoint"+id));
		getId("cursor"+id).style.left=30+markerpos.x+"px";
		getId("cursor"+id).style.top=20+markerpos.y+"px";
  		getId("cursor"+id).style.visibility = "visible"; 
		getId("cursor"+id).style.zIndex = "10000";
  		getId("cursor"+id).style.display = "block"; 
  		displayed_bubble = true;
  	}
}