/* Aktualisieren der Länderflaggen */
function update_Landesflagge() {
	feld = document.getElementById("land").options[document.getElementById("land").selectedIndex].value;
	document.getElementById("landesflagge_img").src = "_img/icons/laenderflaggen/" + feld + ".gif";
}

function update_Herkunftslandesflagge() {
	feld = document.getElementById("herkunftsland").options[document.getElementById("herkunftsland").selectedIndex].value;
	document.getElementById("herkunftslandesflagge_img").src = "_img/icons/laenderflaggen/" + feld + ".gif";
}

/* Formularabfragen übers graue Fenster JA / NEIN */
function gotolink(link) {
	var antwort = false;
	antwort = confirm("Willst du die Aktion wirklich durchführen?");
	if (antwort) {
		self.location.href = link;
	}
}

/* Formularabfragen übers graue Fenster JA / NEIN */
function gotosubmit(link) {
	var antwort = false;
	antwort = confirm("Willst du die Aktion wirklich durchführen?");
	if (antwort) {
		submit();
	}
}

/* zurück Funktion in der Registrierung */
function prev() {
	var url = document.location.href;
	var url_laenge = url.length;
	var url_gesliced = url.slice(0, url_laenge-1);
	var url_wert = url.slice(url_laenge-1, url_laenge);
	var url_neu = (url_gesliced) + (url_wert-1);
	with (this.document.forms["form_registration"]) {
		//alert(url_neu);
		action = url_neu
		submit();
	}
}

/* zurück Funktion */
function zurueck(step) {
	window.location.href = "index.php?site=" + step;
}

/* Formular abschicken Funktion */
function formSubmit(formularname) {
	document.getElementById(formularname).submit();
}

/* Formular in Work Funktion */
function in_work(my_but, old_value) {
	my_but.disabled = true;
	my_but.value = old_value;
	return true;
}

/* Webcam Refresh Funktion */
function refreshCam() {
	rfsh = new Date() ; rfsh = "?"+rfsh.getTime()
	document.images["webcam"].src = "_img/webcam/webcam.jpg"+rfsh
	setTimeout("refreshCam()", 7000)
}

/* einfaches Popup */
function OpenWindow(theURL) {
	winName = 'OpenWindow'
	features = 'width=100,height=100,top=150,left=150,screenX=150,screenY=150,scrollbars=no,resizable=no,toolbar=no,status=no,menubar=no,location=no,directories=no,copyhistory=no'
	window.open(theURL,winName,features)
}

/* Größe des Popups mit Bild automatisch anpassen */
var arrTemp = self.location.href.split("&");
var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
var NSAA = (navigator.appName=="Netscape")?true:false;

function FitPic() {
	iWidth = (NSAA)?window.innerWidth:document.body.clientWidth;
	iHeight = (NSAA)?window.innerHeight:document.body.clientHeight;
	iWidth = document.images[0].width - iWidth;
	iHeight = document.images[0].height - iHeight;
	window.resizeBy(iWidth, iHeight+82);
	self.focus();
}

/* Zentriertes Popup */
function zpopup(theURL, winName, w, h, scroll) {
	var winleft = (screen.width - w) / 2;
	var wintop = (screen.height - h) / 2;
	features = 'height='+h+',width='+w+',top='+wintop+',left='+winleft+',scrollbars='+scroll+',resizable=no,toolbar=no,status=no,menubar=no,location=no,directories=no'
	win = window.open(theURL, winName, features)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

/* Pictures David Schubert */
function GalleryImage(imgName) {
	document.GalleryForm.GalleryImgSrc.src = "_img/gallery/" + imgName;
}

/* Seite drucken */
function printWindow() {
	browserversion = parseInt(navigator.appVersion)
	if (browserversion >= 4) window.print()
}

/* Bookmark */
function addBookmark(url, description) {
	if (parseInt(navigator.appVersion) >= 4 &&  navigator.appName.indexOf("Microsoft") != (-1)) {
		javascript:window.external.AddFavorite(url, description);
	}
	else {
		alert("Dieser Service steht Ihnen nur im Microsoft Internet Explorer ab Version 4 zur Verf" + String.fromCharCode(252) + "gung.\nBitte f" +  String.fromCharCode(252) + "gen sie die Seite manuell zu Ihren Favoriten hinzu.");
	}
}