

function openPrintWin(){
  artId = parent.frames.praeMain.frames.main.tellAFriendId;
  if(parent.frames.praeMain.frames.main.frames.productShow) {
    prodgetId = parent.frames.praeMain.frames.main.frames.productShow.tellAFriendProductId;
  }
  else{
    prodgetId = '';
  }
  fenster = window.open('print.php?rad_id='+artId+'&rad_version=deutsch&productGetId='+prodgetId+'&radPrintCmd=print&mopSession=4af03ef59c738f4fb9a70d022cc21c0d','','width=570,height=500,scrollbars=no');
  fenster.moveTo(((window.screen.availWidth/2)-285),((window.screen.availHeight/2)-250));
}

function radReactor(obj) {
  if(obj.id) {
    this.obj = obj;
  }
  else {
   this.obj = document.getElementById(objName);
  }
  this.frameRate = 20;
  this.status    = 'idle';
  this.name      = this.obj.id + 'Reactor';
  this.xStep     = 0;
  this.ySTep     = 0;
  this.frame     = 0;
  this.lastFrame = 0;
  this.idle      = function() {
    this.status    = 'idle';
    window.clearInterval( this.interval );
  }
  this.start     = function() {
    this.status    = 'running';
    this.setFrameRate(this.frameRate);
  }
  this.getElementInfo  = function() {
    alert(this.obj.id);
  }
  this.setFrameRate    = function(fps) {
    this.frameRate = fps;
    if(this.status == 'running') {
      this.interval = window.setInterval(this.name + '.run()', parseInt(1000 / this.frameRate) );
    }
  }
  this.stripPX = function(pxSize) {
    return parseInt(pxSize.substring(0,(pxSize.length-2)));
  }
  this.moveTo = function(left,top,steps) {
    this.xStep = (left - this.stripPX(this.obj.style.left)) / steps;
    this.yStep = (top - this.stripPX(this.obj.style.top)) / steps;
    this.lastFrame = steps;
    this.start();
  }
  this.run             = function() {
    if(this.frame < this.lastFrame) {
      this.obj.style.top = (this.stripPX(this.obj.style.top) + this.yStep) + 'px';
      this.obj.style.left = (this.stripPX(this.obj.style.left) + this.xStep) + 'px';
      this.frame ++;
    }
    else {
      this.idle();
    }
  }
}

function toggle(call) {
  parent.frames.praeMain.frames.main.window.scrollTo(0,0);
  parent.frames.praeMain.window.scrollTo(0,0);
  toolDivReactor = new radReactor(parent.frames['praeMain'].document.getElementById('toolDiv'));
  if(call) {
    var location = 'show.htm?rad_id=' + call + '&mopSession=4af03ef59c738f4fb9a70d022cc21c0d';
    if(location != parent.frames['praeMain'].frames['tools'].location && (location + '#') != parent.frames['praeMain'].frames['tools'].location ) {
      parent.frames['praeMain'].frames['tools'].location = 'about:blank';
      parent.frames['praeMain'].frames['tools'].location = location;
    }
    if(lastCall != call && lastCall != '' && toolDivReactor.obj.style.top != '360px') {
      lastCall = call;
      return;
    }
  }
  if(!false) {
     showDivReactor = new radReactor(parent.frames['praeMain'].document.getElementById('showDiv'));
     toolDivReactor.setFrameRate(100);
     if(toolDivReactor.obj.style.top == '360px'){
       toolDivReactor.moveTo(0,220,10);
       showDivReactor.moveTo(0,-140,10);
     }
     else {
       toolDivReactor.moveTo(0,360,10);
       showDivReactor.moveTo(0,0,10);
     }
   }
   else {
     toolDivReactor.setFrameRate(100);
     if(toolDivReactor.obj.style.top == '360px') {
       toolDivReactor.moveTo(0,220,10);
     }
     else {
       toolDivReactor.moveTo(0,360,10);
     }
   }
   if(call) {
     lastCall = call;
   }
}
var lastCall = '';



