//-------------------------------------------------------------------
// initial_drop.js
//
// 
// Author: Zenobia Liendo
// Created Date:  09/01/2003
//-------------------------------------------------------------------

function rexy (obj) {
      newx = defaultPosX (obj);
      newy = defaultPosY (obj);
      obj.moveTo(newx, newy);  
      movechildren(dd.elements.logo);
      movechildren(dd.elements.photo);
      movechildren(dd.elements.antenna_movil);
}

function resize (obj) {
//check size, if it is out of area because of move, or because valid area has change
 //resize it to max size
    
    
      var maxw = getMaxWithWithinValidArea (obj);
      if (obj.w > maxw )
         obj.resizeTo (maxw, obj.h);
      var maxh = getMaxHeightWithinValidArea (obj);
      if (obj.h > maxh )
         obj.resizeTo(obj.w,maxh);   
      movechildren(dd.elements.logo);
      movechildren(dd.elements.photo);
      movechildren(dd.elements.antenna_movil);
      
}

function positionObject (obj) {

if  ((obj.w  ==  1) && (obj.h  ==  1))
  return;  // the object does not exist on the desing yet
  
  rexy (obj);
  if (notWithinValidarea (obj) ) 
     resize (obj);
 

}

function repos (obj) {

if  ((obj.w  ==  1) && (obj.h  ==  1))
  return;  // the object does not exist on the desing yet
  
// reposition object if it is not in a valid area.

if  ( notWithinValidarea (obj)  ){     
     rexy (obj);
   }
 
 if (notWithinValidarea (obj) ) {
     resize (obj);
 }
 
 
}

