function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function select_all(status,theform) {
	for (i=0;i<theform.length;i++) {
		if(theform.elements[i].name=="pmid[]") theform.elements[i].checked = status;    
	}
}
function removestamp(iStampID, iPostID)
{
	if(confirm('Soll diese Sammelmarke wirklich aus dem Album des Benutzers entfernt werden? Vielleicht rechtfertigt ein anderer Beitrag in diesem Thema die Marke!'))
	{
		$('#stampadmin-' + iPostID).html('<img src="/images/scrapbook/working3.gif" alt="ajaxworking" />');
		$.get('/scrapbook.php', { action: 'admin', mode: 'removestamp', stampid: iStampID }, function(data) { $('#stampadmin-' + iPostID).remove(); $('#stamp-' + iPostID).remove(); });
	}
}
function addstamp(iStampID, iUserID, iPostID)
{
	$('#stampadmin-' + iPostID + '_' + iStampID).html('<img src="/images/scrapbook/working3.gif" alt="ajaxworking" />');
	$.get('/scrapbook.php', { action: 'admin', mode: 'addstamp', stampid: iStampID, userid: iUserID, postid: iPostID }, function(data) { $('#stampadmin-' + iPostID + '_' + iStampID).html(data); });
}
function commentstamp(iStampID, iUserID, iPostID)
{
	var sComment = $('#commentstamp-' + iPostID + '_' + iStampID + '-text').val();
	$('#stampadmin-' + iPostID + '_' + iStampID).html('<img src="/images/scrapbook/working3.gif" alt="ajaxworking" />');
	$.get('/scrapbook.php', { action: 'admin', mode: 'commentstamp', stampid: iStampID, userid: iUserID, postid: iPostID, comment: sComment }, function(data) { $('#stampadmin-' + iPostID + '_' + iStampID).html(data); });
}
function infostamp(iStampID, iUserID, iPostID)
{
	var sComment = $('#infostamp-' + iPostID + '_' + iStampID + '-text').val();
	$('#stampadmin-' + iPostID + '_' + iStampID).html('<img src="/images/scrapbook/working3.gif" alt="ajaxworking" />');
	$.get('/scrapbook.php', { action: 'admin', mode: 'infostamp', stampid: iStampID, userid: iUserID, postid: iPostID, comment: sComment }, function(data) { $('#stampadmin-' + iPostID + '_' + iStampID).html(data); });
}
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
NS6 = (document.getElementById) ? 1 : 0;
activmenu = false;
timerRunning = false;
function checkTimer() {
 if(timerRunning)  {
  clearTimeout(timerRunning);
  timerRunning = false;
 }
}
function startTimer() {
 timerRunning = setTimeout("show();",1000);
}
function who(threadid) {
 window.open("/misc.php?action=whoposted&threadid="+threadid+"", "moo", "toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300");
}
function noticepopup() {
 F = window.open("/notice.php?id=popup","Notizblock","width=750,height=500");
}
function rating(userid) {
 window.open("/misc.php?action=userrating&userid="+userid+"", "moo", "toolbar=no,scrollbars=yes,resizable=yes,width=350,height=205");
}
function jboardjump() {
 if($('#jumpform-boardid').val() != -1) $('#jumpform').submit();
}
function show(menu) { 
 if(activmenu) {
  checkTimer();
  if(NS4) document.layers[activmenu].display = "none";
  if(NS6) document.getElementById(activmenu).style.display= "none";
  if(IE4) document.all(activmenu).style.display = "none";
  activmenu = false;
 }
   
 if(menu) {
  if(NS4) {
   document.layers[menu].display = "show";
   document.layers[menu].bgColor = "FFFFFF";
   document.layers[menu].onmouseover = checkTimer;
   document.layers[menu].onmouseout = startTimer;
  }
      
  if(IE4) {
   document.all(menu).style.display = "inline";
   document.all(menu).onmouseover = checkTimer;
   document.all(menu).onmouseout = startTimer;
  }
      
  if(NS6) {
   document.getElementById(menu).style.display = "inline";
   document.getElementById(menu).onmouseover = checkTimer;
   document.getElementById(menu).onmouseout = startTimer;
  }
  activmenu = menu;
 }
}

function hide(menu) {
 checkTimer();
 if(NS4) document.layers[menu].display = "none";
 if(NS6) document.getElementById(menu).style.display = "none";
 if(IE4) document.all(menu).style.display = "none";
 activmenu = false;
}

function Coords(evt)
{
 if (!evt) var evt = window.event; 
 location.href = "/karte/eintragen/x" + evt.layerX + "y" + evt.layerY + "/";
}