function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}


var entreprise = "<b>CARTEQ</b> est une entreprise qu&eacute;b&eacute;coise sp&eacute;cialis&eacute;e en <b>conception cartographique</b>, en <b>g&eacute;omatique</b> et en <b>web-mapping</b>. Nos bureaux sont situ&eacute;s &agrave Sherbrooke.<br><br>CARTEQ offre ses services depuis 2006.";
var services = "<b>Nos principaux services sont les suivants : </b> <br> - cr&eacute;ation et traitement de donn&eacute;es g&eacute;ographiques;<br> - cartographie sur mesure;<br>- d&eacute;veloppement d'application de <a href='http://www.dynamicmaps.net/accueil.html' target='_blank'>web-mapping</a>;<br>- programmation li&eacute;e &agrave; la g&eacute;omatique.";
var clientele = "<b>Nos services sont offerts aux organisations qui : </b><br> - d&eacute;sirent utiliser de l'information g&eacute;ographique pour optimiser la gestion de leurs activit&eacute;s; <br> - veulent pr&eacute;senter des cartes g&eacute;ographiques dans leurs documents internes ou dans ceux destin&eacute;s &agrave; leur client&egrave;le.";

function changeText(text, linkId){
if (text == "services")
{$("entreprise").innerHTML = services;}
else if (text == "clientele")
{$("entreprise").innerHTML = clientele;}
else if (text == "entreprise")
{$("entreprise").innerHTML = entreprise;}

$("link1").style.color = "black";
$("link2").style.color = "black";
$("link3").style.color = "black";
$(linkId).style.color = "red";
}

function over(theId){
$(theId).style.backgroundColor = "#CCCCCC";
}

function out(theId){
$(theId).style.backgroundColor = "#FFFFFF";
}

var ie = (navigator.appName.indexOf("Microsoft") >= 0)? true: false;

function disableSelect() {
  if (ie)
  onselectstart = function () { return false; } // ie
  else
 onmousedown = function () { return false; } // mozilla
}

(function(){
	window.onload = function() {
	var mapDiv = $('map');
	var latlng = new google.maps.LatLng(45.396, -71.9005);
	var options = {zoom:14, center: latlng , mapTypeId : google.maps.MapTypeId.ROADMAP};

	var mapDiv = new google.maps.Map(mapDiv, options);
	var marker = new google.maps.Marker({
	position: new google.maps.LatLng(45.3889, -71.9005),
	map: mapDiv
	
	});
	var bulle = "<div class='bulle' align='left'>";
	bulle += "<div id='buttons' class='buttons'> <span onclick='changeText(&quot;entreprise&quot;, this.id)' id='link1' class='link1' onmouseover='over(this.id)' onmouseout='out(this.id)'><b>Entreprise</b></span>&nbsp;|&nbsp;<span onclick='changeText(&quot;services&quot;, this.id)' id='link2' class='link2' onmouseover='over(this.id)' onmouseout='out(this.id)'><b>Services</b></span>&nbsp;|&nbsp;<span onclick='changeText(&quot;clientele&quot;, this.id)' id='link3' class='link3' onmouseover='over(this.id)' onmouseout='out(this.id)'><b>Client&egrave;le</b></span> </div>";
	bulle += "<p align='left' id='entreprise' class='texte'><b>CARTEQ</b> est une entreprise qu&eacute;b&eacute;coise sp&eacute;cialis&eacute;e en <b>conception cartographique</b>, en <b>g&eacute;omatique</b> et en <b>web-mapping</b>. Nos bureaux sont situ&eacute;s &agrave Sherbrooke.<br><br>CARTEQ offre ses services depuis 2006.</p> </div>";

	var infowindow = new google.maps.InfoWindow({content: bulle});
	google.maps.event.addListener(marker, 'click', function(){ infowindow.open(mapDiv, marker);});
	infowindow.open(mapDiv, marker);
	disableSelect();
	}
})();





