var dotPath = "/images/map/dot.png";
var dotOverPath = "/images/map/dot-over.png";

var dotInfo = new Array();
dotInfo.push(createDot("272","121","R&D (Portugal)",(new Array(
"<h1>R&D (Portugal)</h1>",
"Critical Links SA",
"Parque Industrial de Taveiro",
"Lote 48",
"3045-504 Coimbra",
"Portugal",
"<h3>Tel:</h3> +351 239 985 254",
"<h3>Fax:</h3> +351 239 985 255",
"<h3>Support Hotline:</h3> +351 239 985 253",
"<a href=\"mailto:sales-emea@critical-links.com\">sales-emea@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("169","118","Global Headquarters (USA)",(new Array(
"<h1>Global Headquarters (USA)</h1>",
"Critical Links",
"695 Route 46 West,",
"Fairfield, NJ 07004",
"USA",
"<h3>Tel:</h3> 973.276.9006",
"<h3>Fax:</h3> 973.276.9007",
"<h3>Support Hotline:</h3> +1 888 433 4326",
"<a href=\"mailto:sales@critical-links.com\">sales@critical-links.com</a>")).join("<br/>")));

/*dotInfo.push(createDot("287","95","UK",(new Array(
"<h1>UK</h1>",
"Critical Links",
"Kenneth Dibben House,",
"Enterprise Road",
"University of Southampton",
"Science Park",
"Chilworth, Southampton,",
"SO16 7NS, UK",
"<h3>Tel:</h3> +44 2380 111 347",
"<a href=\"mailto:sales@critical-links.com\">sales@critical-links.com</a>")).join("<br/>")));*/

dotInfo.push(createDot("313","115","Italy",(new Array(
"<h1>Italy</h1>",
"v. C. Marx, 41",
"50051 Castelfiorentino - FI -",
"Italia",
"<h3>Tel:</h3> +39 0571 1825 300",
"<h3>Fax:</h3> +39 0571 684 849",
"<a href=\"mailto:info@critical-links.it\">info@critical-links.it</a>")).join("<br/>")));

dotInfo.push(createDot("313","115","Italy",(new Array(
"<h1>Italy</h1>",
"v. C. Marx, 41",
"695 Route 46 West,",
"50051 Castelfiorentino - FI -",
"Italia",
"<h3>Tel:</h3> +39 0571 1825 300",
"<h3>Fax:</h3> +39 0571 684 849",
"<h3>Support Hotline:</h3> +1 888 433 4326",
"<a href=\"mailto:info@critical-links.it\">info@critical-links.it</a>")).join("<br/>")));

dotInfo.push(createDot("422","156","India",(new Array(
"<h1>India</h1>",
"116b, Mandakini Enclave",
"New-Delhi 110019,",
"India",
"<a href=\"mailto:sales-apac@critical-links.com\">sales-apac@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("296","110","France",(new Array(
"<h1>France</h1>",
"Mladen Matijas",
"<h3>Cell:</h3> 00-33686 270 472",
"<a href=\"mailto:mladen.matijas@critical-links.com\">mladen.matijas@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("329","125","Greece",(new Array(
"<h1>Greece</h1>",
"Anestis Mavrofillidis",
"<h3>Cell:</h3> 00-306937019800",
"<a href=\"mailto:anestis.mavro@critical-links.com\">anestis.mavro@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("348","125","Turkey",(new Array(
"<h1>Turkey</h1>",
"Azat Camlibel",
"<h3>Cell:</h3> +90 (542) 6358100",
"<a href=\"mailto:azat.camlibel@critical-links.com\">azat.camlibel@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("279","97","Ireland (Eire)",(new Array(
"<h1>Ireland (Eire)</h1>",
"John O'Hanlon",
"<h3>Cell:</h3> +353 86 831 6940",
"<a href=\"mailto:john.ohanlon@critical-links.com\">john.ohanlon@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("289","95","UK & Northern Ireland",(new Array(
"<h1>UK & Northern Ireland</h1>",
"Roger Halliday",
"<h3>Cell:</h3> +44 7775973678",
"<a href=\"mailto:roger.halliday@critical-links.com\">roger.halliday@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("332","245","Southern Africa",(new Array(
"<h1>Southern Africa</h1>",
"Eckart Zollner",
"<h3>Cell:</h3> + 27 82 990 3460",
"<a href=\"mailto:eckart.zollner@critical-links.com\">eckart.zollner@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("298","101","Belgium, Netherlands and Luxembourg",(new Array(
"<h1>Belgium, Netherlands and Luxembourg</h1>",
"Chris Gerretsen",
"<h3>Cell:</h3> + 31 (0)6 5357 1292",
"<a href=\"mailto:chris.gerretsen@critical-links.com\">chris.gerretsen@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("353","101","Eastern Europe",(new Array(
"<h1>Eastern Europe</h1>",
"Ray Downes",
"<a href=\"mailto:ray.downes@critical-links.com\">ray.downes@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("346","106","Eastern Europe",(new Array(
"<h1>Eastern Europe</h1>",
"Ross Green",
"<h3>Cell:</h3> +44 7703 503 242",
"<a href=\"mailto:ross.green@critical-links.com\">ross.green@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("321","103","Czech Republic, Slovaks",(new Array(
"<h1>Czech Republic, Slovaks</h1>",
"Oudrej Soukal",
"<h3>Cell:</h3> 420607966699",
"<a href=\"mailto:ondrej.soukal@critical-links.com\">ondrej.soukal@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("359","86","Poland, Russia CIS",(new Array(
"<h1>Poland, Russia CIS</h1>",
"Marek Danilowski",
"<h3>Cell:</h3>  +48 503 159 019",
"<a href=\"mailto:marek.danilowski@critical-links.com\">marek.danilowski@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("308","102","Germany",(new Array(
"<h1>Germany</h1>",
"Albrecht Deutschmann",
"<h3>Cell:</h3> +49 (179) 79 43413",
"<a href=\"mailto:a.deutschmann@critical-links.com\">a.deutschmann@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("303","173","Nigeria",(new Array(
"<h1>Nigeria</h1>",
"Isaac Osei",
"<h3>Cell:</h3> +234 (703) 251 0599",
"<a href=\"mailto:isaac.osei@critical-links.com\">isaac.osei@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("287","121","Spain",(new Array(
"<h1>Spain</h1>",
"Jose Maria Martinez",
"<h3>Cell:</h3> +34 670 600 925",
"<a href=\"mailto:josemaria.martinez@critical-links.com\">josemaria.martinez@critical-links.com</a>")).join("<br/>")));

dotInfo.push(createDot("350","136","Israel",(new Array(
"<h1>Israel</h1>",
"Chaim Rainer",
"<h3>Tel:</h3> +972 2 5791637",
"<h3>Fax:</h3> +972 2 5791606",
"<h3>Cell:</h3> +34 670 600 925",
"<a href=\"mailto:rainer-c@013.net\">rainer-c@013.net</a>")).join("<br/>")));


function createDot(x,y,alt,inner) {

	var oImg=document.createElement("img");
	oImg.setAttribute('src', dotPath);
	oImg.setAttribute('alt', alt);
	oImg.setAttribute('height', '10px');
	oImg.setAttribute('width', '10px');
	oImg.style.border = "none";
	oImg.style.cursor = "pointer";
	oImg.style.zIndex = "9998";


	var oBaloon=document.createElement("div");
	oBaloon.setAttribute("class","baloon");
	oBaloon.style.position = "absolute";
	oBaloon.style.display = "none";
	oBaloon.style.zIndex = "9999";
	oBaloon.innerHTML = inner;
	
	var oLink = document.createElement("a");
	//oLink.setAttribute("href","#");
	oLink.style.position = "absolute";
	oLink.style.marginLeft = x+"px";
	oLink.style.marginTop = y+"px";
	oLink.onmouseover = function () {
		oImg.setAttribute('src', dotOverPath);
		oBaloon.style.display = "block";
		//alert("oBaloon dims: "+oBaloon.clientWidth+", "+oBaloon.clientHeight);
		oBaloon.style.marginTop = "-"+(oBaloon.clientHeight-2)+"px";
		oBaloon.style.marginLeft = 5+"px";
	}
	oLink.onmouseout = function () {
		oImg.setAttribute('src', dotPath);
		oBaloon.style.display = "none";
	}

	oLink.appendChild(oBaloon);
	oLink.appendChild(oImg);
	return oLink;
}

function putDots() {
	for (dot in dotInfo) {
		document.getElementById("mapContainer").insertBefore(dotInfo[dot],document.getElementById("locationsMap"));
	}
}
