/* 
  ------------------------------------
  Drop-Down Menu
  ------------------------------------
*/
function DropDownMenu(){ 
 if(navigator.appVersion.indexOf("MSIE")==-1){return;}
 var i,k,g,lg,r=/\s*hvr/,nn='',c,cs='hvr',bv='menubar';
 for(i=0;i<10;i++){g=document.getElementById(bv+nn);if(g){
 lg=g.getElementsByTagName("LI");if(lg){for(k=0;k<lg.length;k++){
 lg[k].onmouseover=function(){c=this.className;cl=(c)?c+' '+cs:cs;
 this.className=cl;};lg[k].onmouseout=function(){c=this.className;
 this.className=(c)?c.replace(r,''):'';};}}}nn=i+1;}
}


/* 


/* 
  ------------------------------------
  Javascript External Links
  ------------------------------------
*/



		function externalLinks() {
			if (!document.getElementsByTagName) return;
			var anchors = document.getElementsByTagName("a");
			for (var i=0; i<anchors.length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute("href") &&
				anchor.getAttribute("rel") == "external")
				anchor.target = "_blank";
      			}
      		}
		window.onload = externalLinks;


/* 


  ------------------------------------
  Google Map
  ------------------------------------
*/

/* Initialise and load fiunction for DropDown Menu. */
function init(){
	load();
	DropDownMenu();
	externalLinks();
    }

function load() {
	//check the browser for compatability
	if (GBrowserIsCompatible()) {
		//makes a new map and places it in div map also uses div map size for map
		var map = new GMap2(document.getElementById("map"));
		//this gives you the pan and zoom in and out controls
		map.addControl(new GSmallMapControl());
		//this gives you hybrid satellite and standard choices
		map.addControl(new GMapTypeControl());
		//the maps centre using lattitude and longitude also 16 is zoom facter
		map.setCenter(new GLatLng(-31.986279, 115.930094), 12);
		// Creates a marker at the given point with the given number label
		var point = new GLatLng(-31.986279, 115.930094);
		var marker = new GMarker(point);
		
		 function createMarker(point, marker) {
			GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml("Prime Motion &amp; Control<br />91a Kew Street<br />Welshpool<br />WA 6106");
				});
				return marker;
            }
            map.addOverlay(createMarker(point, marker));
            marker.openInfoWindowHtml("Prime Motion &amp; Control<br />91a Kew Street<br />Welshpool<br />WA 6106");
		
	}
}