function getDocumentObject(name)
{
  //NN6+, IE5+
  if (document.getElementById)
  {
            if(document.getElementById(name)){
                     this.obj = document.getElementById(name);
                     this.style = document.getElementById(name).style;
            }
            else return;
  }
  //IE4
  else if (document.all)
  {
            if(document.all[name]){
                   this.obj = document.all[name];
                   this.style = document.all[name].style;
            }
            else return;
  }
        //NN4
  else if (document.layers)
  {
           this.obj = getObjNN4(document,name);
           this.style = this.obj;
  }
  return this;
}


//used for NN4 to search in nested layers
//created by PPK - untouched by me
function getObjNN4(obj,name)
{
        var x = obj.layers;
        var thereturn;
        for (var i=0;i<x.length;i++)
        {
                if (x[i].id == name)
                         thereturn = x[i];
                else if (x[i].layers.length)
                        var tmp = getObjNN4(x[i],name);
                if (tmp) thereturn = tmp;
        }
        return thereturn;
}


/*
  getObjectProperty
  Description: the function searches for the object with the specified id
  					and if found returns the specified property value
               NOTE: undefined value may be returned if the object is found
               and its property was not explicitly defined
  Parameters: the id(name) of the object and the property of that object
  Returns: the value of the property if object found or null
*/
function getObjectProperty(id, property){
       var object=getDocumentObject(id);
       if(object!=null){
          var styleObject=object.style;
                if(styleObject[property]){
                     return styleObject[property];
                }
       }
       else return;
}

/*
  setObjectProperty
  Description: the function searches for the object with the specified id
               and if found the specified property is updated to value
  Parameters: the id(name) of the object,
              the property of that object,
              the new value for property;
  Returns:true(if succesfull)/false
*/

function setObjectProperty(id, property, value){
       var object=getDocumentObject(id);
       //alert(object.obj.style);
       if(object!=null){
          var styleObject=object.style;
                if(styleObject[property]=value) return true;
       }
       else return false;
}

function move(id,top,left){
  styleObject=getDocumentObject(id).style;
  if(styleObject){
  		styleObject.top=top;
  		styleObject.left=left;
  }
}