var width = 60;
var height = 80;
var xPosition;
var yPosition;
var image = document.getElementById( "image" );
var frame = document.getElementById( "frame" );

function moveFrame( Ereignis )
{
  document.getElementById('frame').style.display = 'block';

  xPosition = is_ie ? window.event.offsetX - 0.5*width - 3 : Ereignis.layerX - 0.5*width - 3;
  yPosition = is_ie ? window.event.offsetY - 0.5*height - 3 : Ereignis.layerY - 0.5*height - 3;

  if( xPosition > imagewidth  - width  - 3 ) xPosition = imagewidth  - width  - 3;
  if( yPosition > imageheight - height - 3 ) yPosition = imageheight - height - 3;
  if( xPosition < -3 ) xPosition = -3;
  if( yPosition < -3 ) yPosition = -3;

  frame.style.left = xPosition + 'px';
  frame.style.top = yPosition + 'px';
  frame.style.width = width + 'px';
  frame.style.height = height + 'px';
}
function stopFrame()
{
  frame.style.display = 'none';
}
function namesign_checked( checkbox )
{
  image.onmouseover = checkbox.checked ? moveFrame : nothing;
  image.onmousemove = checkbox.checked ? moveFrame : nothing;
  image.onmouseout = checkbox.checked ? stopFrame : nothing;
  image.disabled = checkbox.checked ? '' : 'disabled';
  document.getElementById('mark_options').style.display = checkbox.checked ? 'block' : 'none';
}
function setSize( pWidth, pHeight )
{
  width = pWidth;
  height = pHeight;

  document.getElementById( "width" ).value = width;
  document.getElementById( "height" ).value = height;
}
function nothing()
{
}