﻿
function Location(name, lat, lon) {
	this.name = name;
	this.lat = lat;
	this.lon = lon;
}

var Locations = new Array();

Locations[0] = new Location('OEAW', 48.20860, 16.37825);
Locations[1] = new Location('TUGraz', 47.06395, 15.45260);
Locations[2] = new Location('IDINAMLEX', 48.19642, 16.37360);
Locations[3] = new Location('UNIKLU', 46.61635, 14.26454);

var map;

function loadmap(idxLocation) {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
		// map.addControl(new GMapTypeControl());
		// map.addControl(new GOverviewMapControl(new GSize(120, 75)));
		
		ptTarget = new GLatLng(Locations[idxLocation].lat, Locations[idxLocation].lon);
		
		map.setCenter(ptTarget, 15);
	
		var icon = new GIcon();
		icon.image = "/images/mm_20_red.png";
		icon.shadow = "/images/mm_20_shadow.png";
		icon.iconSize = new GSize(12, 20);
		icon.shadowSize = new GSize(22, 20);
		icon.iconAnchor = new GPoint(6, 20);
		icon.infoWindowAnchor = new GPoint(5, 1);

		map.addOverlay(new GMarker(ptTarget, icon));
	}
}

function mailto (data, pwd) {
	window.location.href = 'mailto:' + secureDecrypt(data, pwd);
}

function createHoverLogos(){
	for (i = 0; i < document.images.length; i++) {
		if (document.images[i].src.indexOf("logos") > 0) {
			document.images[i].onmouseover = function (e) {
				document.images[i].src = document.images[i].src.replace(/0.gif/, ".gif");
			};
		
			document.images[i].onmouseout = function (e) {
				document.images[i].src = document.images[i].src.replace(/.gif/, "0.gif");
			};
		
		}
	}
}

