// JavaScript Document

function countries(uri,id)
{
	document.location.href = "index.php?ModEintrag&id="+id+"&url="+uri+"&country="+document.getElementsByName("country")[0].value;
}
function land()
{
	document.location.href = "index.php?ModAdd&url=step2&country="+document.getElementsByName("country")[0].value;
}

function refreshecat()
{
	
	document.location = "index.php?ModKategorie&tbl_kontinent_id="+document.getElementsByName("tbl_kontinent_id")[0].value
	
}
function refresheucat1()
{
	
	document.location = "index.php?ModKategorie&tbl_kontinent_id="+document.getElementsByName("tbl_kontinent_id")[0].value+"&tbl_land_id="+document.getElementsByName("tbl_land_id")[0].value;
	
} 

function NextPic(){

	var tmp = document.getElementsByName("pics")[0].value.split("#");

	var teil = window.document.images["galeriebild"].src.split("/");

	var laenge = teil.length;

	for(x=0;x<tmp.length;x++){

		if(teil[(laenge -1)] == tmp[x]){

			if(x == tmp.length - 1)

				window.document.images["galeriebild"].src = "images/galerie/large/"+tmp[0];

			else

				window.document.images["galeriebild"].src = "images/galerie/large/"+tmp[(x+1)];

		}

	}
}

function PreviousPic(){

	var tmp = document.getElementsByName("pics2")[0].value.split("#");

	var teil = window.document.images["galeriebild"].src.split("/");

	var laenge = teil.length;

	for(x=0;x<tmp.length;x++){

		if(teil[(laenge -1)] == tmp[x]){

			if(x == tmp.length - 1)

				window.document.images["galeriebild"].src = "images/galerie/large/"+tmp[0];

			else

				window.document.images["galeriebild"].src = "images/galerie/large/"+tmp[(x+1)];

		}

	}
}
function zeichen(maxlength) {
	if(!maxlength) {
		maxlength = 1000;
	}
	if(window.document.add.text.value.length >= maxlength){
		$text = window.document.add.text.value.substring(window.document.add.text.value,maxlength);
		window.document.add.text.value = $text;
	}
	tmp = window.document.add.text.value.length;
	wert = (maxlength - tmp);
	window.document.add.anzahl.value = wert;
}

