document.onload = window.setTimeout('datum()', 500);

function datum() {
 a = new Date();

 sekunden = a.getSeconds();
 minuten  = a.getMinutes();
 stunden  = a.getHours();

 if(sekunden < 10) {sekunden = '0' + sekunden;} 
 if(minuten  < 10) {minuten  = '0' + minuten;} 
 if(stunden  < 10) {stunden  = '0' + stunden;} 
 zeit = stunden + ':' + minuten + ':' + sekunden+ ' Uhr';

 html=document.getElementById('datum');
 html.innerHTML=zeit;
 window.setTimeout("datum()", 1000);
}

function artikel_del(id) {
 frage=confirm("Artikel wirklich löschen?");
 if(frage==true) document.location.href='artikel.php?del='+id;
}

function bild_del(a,id) {
 frage=confirm("Foto wirklich löschen?");
 if(frage==true) document.location.href='index.php?a='+ a +'&del='+id;
}

function jump(url) {
 this.jumpID=0;
 this.jumpURL=url;
 this.jumpIDInput='';
 this.jumpIDLink='';
  
 this.jumpInput=function(id) {
  this.jumpID=id;
  this.jumpSetIDs();
  this.jumpDisplay('none','inline');
  this.jumpIDInput.focus();
  this.jumpIDInput.onkeyup=function(e) { pj.jumpStart(e) };
  this.jumpIDInput.onblur=function() { pj.jumpStop() };
 }
 this.jumpStart=function(event) {
	if(!event) event=window.event;
	if(event.which) {
   var key=event.which;
	}
	else if (event.keyCode) {
	 var key=event.keyCode;
	}
	var input=this.jumpIDInput.value;
	if(key==13) {
	 this.jumpGo(input);
	}
	else if(key==27) {
	 this.jumpStop()
	}
 }
 this.jumpStop=function() {
  this.jumpDisplay('inline','none');
 }
 this.jumpSetIDs=function() {
  this.jumpIDLink=document.getElementById('p-a-'+this.jumpID);
  this.jumpIDInput=document.getElementById('p-i-'+this.jumpID);
 }
 this.jumpDisplay=function(link,input) {
  this.jumpIDLink.style.display=link;
  this.jumpIDInput.style.display=input;
 }
 this.jumpGo=function(input) {
  document.location.href = this.jumpURL.replace(/%p%/,parseInt(input));
 }
}

function erscheinung(art)
{
  if (art == 2)
  {
    document.getElementById('erscheinung2').style.display = 'inline';
    document.getElementById('erscheinung1').style.display = 'none';
  }
  else
  {
    document.getElementById('erscheinung1').style.display = 'inline';
    document.getElementById('erscheinung2').style.display = 'none';
  }
  document.getElementById('erscheinungswiederholung').value = art;
}

function storno(id) {
 frage=confirm("Anzeige ab sofort stornieren?");
 if(frage==true) document.location.href='anzeigen.php?storno='+id;
}
