var openWinKarteikarte;
var openWinPopup;

function doSwap(who,what) {
 var tmp=document.images["img"+who];
 tmp.src=what;
}


function doPosition()
{
   var tmpx;
   var tmpy;
   var tmpo;
   var tmpd;
   if (document.getElementById)
   {
      for (i=0;i<doPositionData.length;i++)
      {
         tmpd=doPositionData[i];
         var tmp=document.getElementById("float"+tmpd[0]).style;
         if (document.all)
         {
            if (document.body.offsetWidth >= 723 && document.body.offsetHeight >= 462){
               tmpx=(document.body.offsetWidth/2-361)+tmpd[1];
               tmpy=(document.body.offsetHeight/2-229)+tmpd[2];
            }else if (document.body.offsetWidth >= 723 && document.body.offsetHeight < 462 ){
               tmpx=(document.body.offsetWidth/2-360)+tmpd[1];
               tmpy=tmpd[2]+5;
            }else if (document.body.offsetWidth < 723 && document.body.offsetHeight >= 462 ){
               tmpx=tmpd[1]+11;
               tmpy=(document.body.offsetHeight/2-229)+tmpd[2];
            }else if (document.body.offsetWidth < 723 && document.body.offsetHeight < 462 ){
               tmpx=tmpd[1]+11;
               tmpy=tmpd[2]+5;
            }
            tmpx=tmpx;
            tmpy=tmpy;            
         } else {
            if (document.body.offsetWidth >= 723 && document.body.offsetHeight >= 462){
               tmpx=(document.body.offsetWidth/2-361)+tmpd[1]+10;
               tmpy=(document.body.offsetHeight/2-229)+tmpd[2]+3;
            }else if (document.body.offsetWidth >= 723 && document.body.offsetHeight < 462 ){
               tmpx=(document.body.offsetWidth/2-360)+tmpd[1]+10;
               tmpy=tmpd[2]+5+3;
            }else if (document.body.offsetWidth < 723 && document.body.offsetHeight >= 462 ){
               tmpx=tmpd[1]+11+10;
               tmpy=(document.body.offsetHeight/2-229)+tmpd[2]+3;
            }else if (document.body.offsetWidth < 723 && document.body.offsetHeight < 462 ){
               tmpx=tmpd[1]+11+10;
               tmpy=tmpd[2]+5+3;
            }
                     }
         tmp.top=tmpy.toString()+"px";
         tmp.left=tmpx.toString()+"px";
         tmp.visibility=tmpd[3];
      }
   }
}

var oldSwapImage;
oldSwapImage="";

function swapImage(whichImg,whichSrc) {
  if (oldSwapImage=="") {
    if (document.images[whichImg]) {
      oldSwapImage=document.images[whichImg].src;
      document.images[whichImg].src=whichSrc;
    }
  } else {
    document.images[whichImg].src=oldSwapImage;
    oldSwapImage="";
  }
}

function doPopup(whichURI,mode) {
  if (mode==1) {  
   if (!(openWinKarteikarte)) {
    openWinKarteikarte=window.open(whichURI,'karteikarten','width=539,height=410,scrollbars=no,top=50,left=50');
   } else {
    openWinKarteikarte.location.href=whichURI;
   }
  } else {
   if (!(openWinPopup)) {
    openWinPopup=window.open(whichURI,'karteikarten','width=450,height=500,scrollbars=yes,top=50,left=50');
   } else {
    openWinPopup.location.href=whichURI;
   }
  }
}