function scanargs(args,search)
{
 check=eval('/\\b'+search+'\\b/').test(args);
 return check;
}

function neededargs(a)
{
 nocenter=(scanargs(a,'nocenter'))?true:false;
 rightmiddle=(scanargs(a,'rightmiddle'))?true:false;
 resizable=(scanargs(a,'resizable'))?'yes':'no';
 scrollbars_=(scanargs(a,'scrollbars'))?'yes':'no';
}

function popup(url,name,x,y,t,l)
{
 a=new Array();
 for(i=0;i<arguments.length;i++)
  a[i]=arguments[i];
 neededargs(a);
 win=window.open(url,name,'width='+x+',height='+y+',top='+t+',left='+l+',resizable='+resizable+',scrollbars='+scrollbars_+',status=no,toolbar=no,location=no,menubar=no');
 if(rightmiddle)
  win.moveTo((screen.width-x),(screen.height-y)/2);
 else if(!nocenter)
  win.moveTo((screen.width-x)/2,(screen.height-y)/2);
 else
  win.moveTo(t,l);
 win.resizeTo(x,y);
 win.focus();
}

function picpopup(url)
{
 ie=((document.all)&&(window.offscreenBuffering)) ? true : false;
 nn=((document.captureEvents)&&(!document.getElementById)) ? true : false;
 mz=((document.getElementById)&&(!document.all)&&(document.documentElement)) ? true : false; 
 op=((document.getElementById)&&(navigator.userAgent.indexOf('Opera') != -1)) ? true : false;
 sa=((document.getElementById)&&(navigator.userAgent.indexOf('Safari') != -1)) ? true : false;
 version=navigator.appVersion.substring(0,1);
 win=(navigator.appVersion.indexOf("Win") != -1) ? true : false;
 mac=(navigator.appVersion.indexOf("Mac") != -1) ? true : false;
 other=((win==false)&&(mac==false)) ? true : false;
 if(win)
 {
  if(ie)
  {
   x_correct=10;
   y_correct=36;
  }
  else if(mz)
  {
   x_correct=21;
   y_correct=34;
  }
  else
  {
   x_correct=0;
   y_correct=0;
  }
 }
 else if(mac)
 {
  if(mz && !sa)
  {
   x_correct=16;
   y_correct=18;
  }
  else if(sa)
  {
   x_correct=0;
   y_correct=23;
  }
  else
  {
   x_correct=0;
   y_correct=0;
  }
 }
 else
 {
  x_correct=0;
  y_correct=0;
 }
 a=new Array();
 for(i=0;i<arguments.length;i++)
  a[i]=arguments[i];
 neededargs(a);
 picwin=window.open('','Bild','width=200,height=25,top=0,left=0,resizable='+resizable+',scrollbars='+scrollbars_+',status=no,toolbar=no,location=no,menubar=no');
 picwin.document.open();
 picwin.document.write('<html><head><title>'+url+'<\/title><meta http-equiv=imagetoolbar content=no>');
 picwin.document.write('<style type=text/css>body { margin:0; }<\/style>');
 picwin.document.write('<script type=text/javascript>document.title="Bild wird geladen...";');
 picwin.document.write('function resize(){ x=document.images[0].width+'+x_correct+'; y=document.images[0].height+'+y_correct+';');
 picwin.document.write('if(!'+nocenter+') moveTo((screen.width-x)/2,(screen.height-y)/2); else moveTo(0,0); resizeTo(x,y);');
 picwin.document.write('document.title="'+url+'"; }<\/script><\/head>');
 picwin.document.write('<body onclick="window.close();" onkeydown="window.close();"><img src="'+url+'" onload="resize();"><\/body><\/html>');
 picwin.document.close();
 picwin.focus();
}

