function init() {
	googleAnalytics();
}

function googleAnalytics() {
        try {
                var pageTracker = _gat._getTracker('UA-7704031-1');
				pageTracker._setDomainName(".mach1-club.de");
                pageTracker._trackPageview();
        } catch(err) {}
}

function getMinHeight()
{
	return document.body.clientHeight;
}

function setBackground(newColor)
{
	document.getElementById("mainelement").style.backgroundColor = newColor;
}

function setPanoramaFlash()
{
	var flashvars_pan = {};
	var params_pan = {
		salign : "t",
		wmode : "window",
		bgcolor : "#ffffff"
	};
	params_pan.allowfullscreen = "true";
	var attributes_pan = { };

	var d = document.createElement("div");
	d.setAttribute("id", "panorama");
	document.getElementById("mainelement").appendChild(d);	
	
	swfobject.embedSWF("panorama.swf", "panorama", "684", "281", "9.0.0", "expressInstall.swf", flashvars_pan, params_pan, attributes_pan);
	document.getElementById("panorama").style.position='absolute';
	document.getElementById("panorama").style.top='173px';
	document.getElementById("panorama").style.left='35%';
}

function delPanoramaFlash()
{
	swfobject.removeSWF("panorama");
}

function newSize(datoY) {
	datoY += 60;
	
	if (datoY < getMinHeight() - 4)
		datoY = getMinHeight() - 4;

	document.getElementById('miFlash').style.height = datoY;
}

function getScrollPosition() {
	if (navigator.userAgent.toLowerCase().indexOf("msie") >= 0) {
		return document.body.scrollTop;
	} else {
		return window.pageYOffset;
	}
}

function openVideoWindow(video_id) {
	document.getElementById("miFlash").stopPlayback(); // stop music playback
	videoWindow = window.open('video.php?id=' + video_id, "VideoWindow", "width=398,height=300,scrollbars=no");
}

function imprint_init() {
	var addr;

	addr = printMail('info', 'decastro.ch');
	document.getElementById('mailaddress_decastro').innerHTML = addr;
	document.getElementById('mailaddress_decastro').setAttribute('href', 'mailto:' + addr, 1);
	
	addr = printMail('office', 'fablestudios.de');
	document.getElementById('mailaddress_fablestudios').innerHTML = addr;
	document.getElementById('mailaddress_fablestudios').setAttribute('href', 'mailto:' + addr, 1);

	addr = printMail('info', 'ersmedia.de');
	document.getElementById('mailaddress_ersmedia').innerHTML = addr;
	document.getElementById('mailaddress_ersmedia').setAttribute('href', 'mailto:' + addr, 1);
}

function printMail(user, domain) {
        return user + '@' + domain;
}