/* JavaScript for pfadi-rheinfelden.ch */

domain = "pfadi-rheinfelden.ch";

var pic;
pic = new Array;
pic[0] = "image/title/pic00.jpg";
pic[1] = "image/title/pic01.jpg";
pic[2] = "image/title/pic02.jpg";
pic[3] = "image/title/pic03.jpg";
pic[4] = "image/title/pic04.jpg";
pic[5] = "image/title/pic05.jpg";
pic[6] = "image/title/pic06.jpg";
pic[7] = "image/title/pic07.jpg";
pic[8] = "image/title/pic08.jpg";
pic[9] = "image/title/pic09.jpg";

var coord;
coord = new Array;
coord[0] = "map/belchenblick.kmz";
coord[1] = "map/lokal.kmz";
coord[2] = "map/tanksperre.kmz";
coord[3] = "map/bahnhof.kmz";

var now = new Date();
var seed = now.getTime() % 0xffffffff;

function rand(n) {

	seed = (0x015a4e35 * seed) % 0x7fffffff;
	return ( seed >> 16 ) % n;

}

function titlepic() {

	var num = rand(10);
	document.write("<IMG src='" + pic[num] + "' border='0' >");

}

function contact(vulgo) {
	
	window.location = "mailto:" + vulgo + "@" + domain;
	
}

function contactSubject(vulgo, subject) {
	
	window.location = "mailto:" + vulgo + "@" + domain + "?subject=" + subject;
	
}

function newWindow(location) {
	win = window.open(location);
}

function mapLink(location) {

	var index = -1;
	if (location == "Belchenblick") {
		index = 0;
	} else if (location == "Lokal") {
		index = 1;
	} else if (location == "Tanksperre") {
		index = 2;
	} else if (location == "Bahnhof") {
		index = 3;
	}
	if (index != -1) {
		document.write("<a href='" + coord[index] + "' target='_blank'><img src='image/kmz.gif' alt='Google Earth Link' height='8'></a>");
	}

}

