// JavaScript Document

function verifydel(url){
	if(confirm('Wollen Sie diesen Datensatz wirklich löschen?'))location.href=url;
}

function verifyDelete(){
	return confirm('Wollen Sie diesen Datensatz wirklich löschen?');
}

function hideshow(id) {
	if (document.getElementById(id).style.display == "none"){
		document.getElementById(id).style.display="";
	}else{
		document.getElementById(id).style.display="none";
	}
}

function HideShowByName(id) {
	if (document.getElementByName(id).style.display == "none"){
		document.getElementByName(id).style.display="";
	}else{
		document.getElementByName(id).style.display="none";
	}
}

function switchOrder(field){
	if(document.getElementById('orderfield').value != field){
		document.getElementById('orderfield').value = field;
		document.getElementById('ordervalue').value = "";
	}

	if (document.getElementById('ordervalue').value == "ASC"){
		document.getElementById('ordervalue').value = "DESC";
	}else if(document.getElementById('ordervalue').value == "DESC"){
		document.getElementById('ordervalue').value = ""
	}else{
		document.getElementById('ordervalue').value = "ASC";
	}
}

function PopUp(Adresse) {
  PopUpWindow = window.open(Adresse, "PopUpWindow", "width=645,height=500,left=100,top=200,scrollbars=no,resizable=yes");
  PopUpWindow.focus();
}


function returnPic(id, label, filesrc){
	window.opener.document.getElementById('picture').value = id;
	window.opener.document.getElementById('pictureimg').src = filesrc;
	window.opener.document.getElementById('pictureid').firstChild.nodeValue = id;
	window.opener.document.getElementById('picturelabel').firstChild.nodeValue = label;
}

function getVal(element){
	return document.getElementById(element).value;
}