function action_flash(id,howlong) {

if (typeof howlong=='undefined') var howlong=2000;

var howlong=parseInt(howlong);
if (howlong<2000) howlong=2000;
action_show(id);
var verdi=setTimeout('action_hide("' + id + '")',howlong);
}


function action_show(id) {

  var elem = fetch_Element(id);
  if( is_ns4) elem.visibility = "show";

          else  {
//          alert('Decloaking  :' + elem + '|' + id + ' ' + my_browser);
          elem.style.visibility = "visible" }
}
function action_hide(id) {
//  alert(id);
  var elem = fetch_Element( id );
  if( is_ns4 ) elem.visibility = "hide";
	else {
         elem.style.visibility = "hidden";
         }
}

function action_move( id,x,y ) {
  var elem = fetch_Element(id);
  if( is_ns4 ) elem.moveTo(x,y );
         else {
         elem.style.left = x;
         elem.style.top = y; }
}


//Mausposition auslesen, Syntax abhängig vom Browser
function action_trackMouseEvent( evt ) {

  if( is_ns4 ) {
    mouse_at_x = evt.pageX;
    mouse_at_y= evt.pageY;
  } else {
    mouse_at_x = event.clientX;
    mouse_at_y = event.clientY;
    if( document.body.scrollLeft )
      mouse_at_x += document.body.scrollLeft;
    if( document.body.scrollTop  )
      mouse_at_y += document.body.scrollTop;
  }

  return false;
}


//Ist Objekt sichtbar?
function is_visual(id) {
  var elem = fetch_Element(id);
  if( is_ns4 ) {
     var vis_status = elem.visibility;
     }
  else {
    var vis_status = elem.style.visibility;
  }

return vis_status

}


//Umschalten sichtbar<-->unischtbar
function toggle_visual(id) {

vis_status=is_visual(id);
vis_status=vis_status.substring(0,2)
//alert(vis_status);
switch (vis_status) {
  case "vi" :
    action_hide(id);
    break;
    break;
  case "hi" :
    action_show(id);
    break;
    break;
}
}

function initmouse() {

//document.onmouseup=drop_here;
document.onmousemove=action_trackMouseEvent;

}


function drop_here() {

drag_obj=null;

}

function drag_start(id) {

drag_obj=id;
rel_x=mouse_at_x-drag_obj.offsetLeft;
rel_y=mouse_at_y-drag_obj.offsetTop;

//alert('Dragging ' + id);

}

function trace_mouse(id) {

//var elem = fetch_Element(id);
//alert('Moving to ' + mouse_at_x + '/' + mouse_at_y);
if (drag_obj!=null) {
  action_move(id,mouse_at_x-rel_x,mouse_at_y-rel_y);
  }
//window.setTimeout('trace_mouse(' + "'" + id + "'"  + ')',10);

}


//Objekt-Pos. folgt der Maus-Position
function follow_mouse(id,xoff,yoff) {
var squot="'";
//Fixierung der x-Position

if (xoff=='^') {
  var movto_x=x_start;
}
else {
  var xoff=parseInt(xoff,10);
  var movto_x=mouse_at_x + xoff;
  }

  //Fixierung der y-Position
  if (yoff=='^') {
  var movto_y=y_start;
}
else {
  var yoff=parseInt(yoff,10);
  var movto_y=mouse_at_y + yoff;
}


//Wenn Objekt ausgeblendet ist und die Einblend-Kriterien erfuellet, dann sichtbar machen
if (hidden_bar!=null) {
   if ((mouse_at_x>=x_start) && (mouse_at_y>=y_start)) {
     action_show(id);
     hidden_bar=null;
     }
}
else {
//Wenn Objekt eingeblendet ist und die Einblend-Kriterien nicht erfuellt sind, dann unsichtbar machen
   if ((mouse_at_x<x_start) || (mouse_at_y<y_start)) {
     hidden_bar=true;
     action_hide(id);
     }
}

   action_trackMouseEvent;
//alert('Moving ' + elem + ' to ' + mouse_at_x + '/' + mouse_at_y);
//Bewegungs-Prozedur mit Objekt und neuer Mauszeiger-Position aufrufen
//von trackMouseEvent geliefert
action_move(id,movto_x,movto_y);
window.setTimeout('follow_mouse(' + squot + id + squot + "," + squot + xoff + squot + "," + squot + yoff + squot  +")",5);

}

function hide_all() {
var items_tohide = new Array();
var items_tohide=item_ids.split(',');

for (hii=0;hii<items_tohide.length;hii++) {
//alert(items_tohide[hii]);
   action_hide(items_tohide[hii]);
    }


}


function rota(cx,cy,cr,angle,ocx,ocy) {
var squot="'";

var movto_x=0;
var movto_y=0;

action_move(id,movto_x,movto_y);


window.setTimeout('rota(' + squot + id + squot + "," + squot + cx + squot + "," + squot + cy + squot + "," + squot + cr + squot + "," + squot + angle + squot+ "," + squot + ocx + squot + "," + squot + ocy + squot+ ")",5);


}

function mo(id) {

var elem=fetch_Element(id);
hide_all();
action_show(id);

return true

}