var currentId = "news";

function init() {
	hideContent("contact");
	hideContent("lamebox");
	hideContent("fruitmachine");
	hideContent("untitled2");
	hideContent("popup");
	hideContent("untitled1");
	hideContent("weltbirne");
	hideContent("miniausstellung");
	hideContent("reisebuero");
	hideContent("reise");
	hideContent("lehmboden");
	hideContent("geldspeicher");
	hideContent("tischeundstuehle");
	hideContent("cratesandbarrels");
	hideContent("bildschirm");
	getDeepLink();
}

function decryptCharacter(x) {
	return String.fromCharCode(x-2);	
}

function linkEmail() {
	var encrypted = "65*111*99*107*110*118*113*60*10*111*99*107*110*66*99*116*111*107*112*100*121*99*105*112*103*116*48*101*113*111*12*110*66*113*116*105";
	var decrypted = "";
	var temp = encrypted.split("*");
	for(var i=1; i < 30; i++)	{
		decrypted = decrypted + decryptCharacter(temp[i]);
	}
	location.href = decrypted;
}

function showContent ( contentId ) {
	currentId = contentId;
	document.getElementById(contentId).style.display = "inline";
}

function hideContent ( contentId ) {
	document.getElementById(contentId).style.display = "none";
}

function changeContent ( contentId ) {
	hideContent(currentId);
	showContent(contentId);
}

function changePicture ( pictureId, picturename ) {
	document.getElementById( pictureId ).src = "pictures/"+picturename;
}

function changePictureToVideo ( pictureId, videoId ) {
	document.getElementById(pictureId).style.display = "none";
	document.getElementById(videoId).style.display = "inline";
}

function changeVideoToPicture ( videoId, pictureId ) {
	document.getElementById(videoId).style.display = "none";
	document.getElementById(pictureId).style.display = "inline";
}

function getDeepLink() {
	var url = window.location.href;
	if ( url.indexOf("?") > -1 ){
		changeContent(url.split( "?")[1]);
	}
}
