// JavaScript Alliance

// Global ---------------------------------------- */

// Affichage
function aff_c(elt,bloc,type) {
	
	elt = document.getElementById(bloc);
	
	if(type == "show")
		elt.style.display = 'block';
	else
		elt.style.display = 'none';
	
}

// Menu
function menu(elt,bloc,lien,type) {
	aff_c(elt,bloc,type);
	bgMenu(lien,type);
}

// Fond des éléments du menu
function bgMenu(bloc,type) {
	
	elt = document.getElementById(bloc);
	
	if(type == "show") {
		elt.style.backgroundColor = '#336699';
		elt.style.padding = '4px 29px 4px 29px';
		elt.style.borderLeft = '1px solid #CCCCCC';
		elt.style.borderRight = '1px solid #CCCCCC';
	}
	else {
		elt.style.backgroundColor = 'transparent';
		elt.style.border = 'none';
		elt.style.padding = '4px 30px 4px 30px';
	}
	
}


// Plan d'accès ---------------------------------------- */

// Google Map
function load() {
	
	if (GBrowserIsCompatible()) {
		
		var map = new GMap2(document.getElementById("map"));	
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GOverviewMapControl());
                
		//map.setCenter(new GLatLng(48.871038194878636, 7.8717041015625), 10);
		map.setCenter(new GLatLng(48.80359886089938, 7.811236381530762), 9);

		// Creates a marker at the given point with the given number label
		function createMarker(point, number, infoTabs) {
		var marker = new GMarker(point);
		GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowTabsHtml(infoTabs)
		//marker.openInfoWindowHtml(description);
		});
		return marker;
		}
	
		// Add marker		
		//var point0 = new GLatLng(48.89876434994583, 7.907259464263916);
		//var infoTabs0 = [
		//	new GInfoWindowTab("Magasin", "<strong>Alliance des Technologies Informatiques</strong><br>54 rue du docteur Deutsch<br>67660 Betschdorf<br>Tél : 03 88 54 41 63<br>Fax : 03 88 54 44 07<br>E-mail : <a href='mailto:betschdorf@alliance-techinfo.fr'>betschdorf@alliance-techinfo.fr</a><br>"),
		//	new GInfoWindowTab("Horaires", "<br>Lundi : 14h00 - 18h30<br>Mardi - Vendredi : 9h00 - 12h00 / 14h00 - 18h30<br>Samedi : 9h00 - 12h00 / 14h00 - 17h00")
		//];
  		//map.addOverlay(createMarker(point0, 1, infoTabs0));

		var point1 = new GLatLng(48.80359886089938, 7.811236381530762);
		var infoTabs1 = [
			new GInfoWindowTab("Magasin", "<strong>Alliance des Technologies Informatiques</strong><br>79b route de Bischwiller<br>67500 Haguenau<br>Tél : 03 88 05 48 40<br>Fax : 03 88 93 39 24<br>E-mail : <a href='mailto:haguenau@alliance-techinfo.fr'>haguenau@alliance-techinfo.fr</a><br>"),
			new GInfoWindowTab("Horaires", "<br>Lundi : 14h00 - 18h30<br>Mardi - Vendredi : 9h30 - 12h00 / 14h00 - 18h30<br>Samedi : 9h00 - 12h00 / 14h00 - 17h00")
		];
  		map.addOverlay(createMarker(point1, 1, infoTabs1));
		
		//var point2 = new GLatLng(48.927884940997956, 7.896509170532227);
		//var infoTabs2 = [
		//	new GInfoWindowTab("Magasin", "<strong>Alliance des Technologies Informatiques</strong><br>6, rue des Chênes ZA du ROESSELBACH<br>67250 Soultz sous Forêts<br>Tél : 03 88 54 71 02<br>Fax : 03 88 54 72 19<br>E-mail : <a href='mailto:soultz@alliance-techinfo.fr'>soultz@alliance-techinfo.fr</a><br>"),
		//	new GInfoWindowTab("Horaires", "<br>Lundi : 9h00 - 12h00 / 14h30 - 19h00<br>Mardi : 9h00 - 12h00 / 14h30 - 19h00<br>Mercredi : 9h00 - 12h00 / 14h30 - 19h00<br>Jeudi : fermé<br>Vendredi : 9h00 - 12h00 / 14h30 - 19h00<br>Samedi : 9h00 - 12h00 / 14h30 - 18h00")
		//];
  		//map.addOverlay(createMarker(point2, 1, infoTabs2));
		
	}
	
}

