// JavaScript Document
	//this is the script linking to the image
	
	var locationInfo = new Array();
	locationInfo[0] = new Array("http://maps.google.ca/maps?f=q&source=s_q&hl=en&geocode=&q=knibbe+automotive+repair,+160+Crowfoot+Way,+Calgary,+AB+T3G+4M4&mrt=yp&sll=51.126543,-114.208632&sspn=0.008794,0.022295&ie=UTF8&hq=knibbe+automotive+repair,&hnear=160+Crowfoot+Way+NW,+Calgary,+Division+No.+6,+Alberta&ll=51.126381,-114.208632&spn=0.008794,0.022295&z=16&iwloc=A", "/assets/_images/go_map_hover.png", new Array("160 Crowfoot Way NW","(403) 547-7771","M-F 8am to 5:30pm","Closed Weekends"));
	locationInfo[1] = new Array("http://maps.google.ca/maps?f=q&source=s_q&hl=en&geocode=&q=knibbe+automotive+repair,+1505+Centre+St.+NW,+Calgary,+AB+T2E+2S1&mrt=yp&aq=&sll=51.06547,-114.062784&sspn=0.009143,0.022295&ie=UTF8&hq=knibbe+automotive+repair,&hnear=1505+Centre+St+NW,+Calgary,+Division+No.+6,+Alberta&ll=51.065794,-114.062784&spn=0.008805,0.022295&z=16&iwloc=A", "/assets/_images/go_map.png", new Array("1505 Centre St. NW","(403) 276-7676","M-F 8am to 5:30pm","Closed Weekends"));
	locationInfo[2] = new Array("#", "/assets/_images/go_map_hover2.png", new Array("NEW LOCATION","COMING SOON"));
	
	
	function MapInformation()
	{
		var defaultLocation = document.getElementById("px_directions");
		
		//create the information for links and such
		for (var i = 0; i < locationInfo.length; i++)
		{
			var ul = document.createElement("ul");
			for (var b = 0; b < locationInfo[i][2].length; b++)
			{
				var li = document.createElement("li");
				li.appendChild
				(
					document.createTextNode(locationInfo[i][2][b])
				);
				ul.appendChild(li);
			}
			
			ul.onclick = new Function("clickedMe('"+i+"')");

			ul.setAttribute("class", "px_dark");
			
			defaultLocation.appendChild(ul);
		}
		clickedMe(0);
	}
	
	function clickedMe(buttonId)
	{
		var defaultLocation = document.getElementById("px_directions");
		for (var i = 0; i < locationInfo.length; i++)
		{
			defaultLocation.getElementsByTagName("ul")[i].className = "px_dark";
		}
		defaultLocation.getElementsByTagName("ul")[buttonId].className = "px_light";
		
		var image = document.getElementById("px_map");
		image.src = locationInfo[buttonId][1];
		
		image.onclick = function()
		{
			
			window.open(locationInfo[buttonId][0]);
		}
	}
	
