//FUNCIONES COMUNES


/************************************************************************************
Obtiene la posicion exacta de cualquier objeto y sus dimesiones whith y heith
************************************************************************************/
getDimensions = function(oElement) {
    var x, y, w, h;
    x = y = w = h = 0;
    if (document.getBoxObjectFor) { // Mozilla
      var oBox = document.getBoxObjectFor(oElement);
      x = oBox.x-10;
      w = oBox.width;
      y = oBox.y-1;
      h = oBox.height;
    }
    else if (oElement.getBoundingClientRect) { // IE
      var oRect = oElement.getBoundingClientRect();
      x = oRect.left-2;
      w = oElement.clientWidth;
      y = oRect.top-2;
      h = oElement.clientHeight;
    }
	else{
		
		
	  if( typeof( oElement.offsetParent ) != 'undefined' ) {
		for( var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) {
		  posX += oElement.offsetLeft;
		  posY += oElement.offsetTop;
		}
		
		x=posX;
		y=posY;
	  } 
		
		
		
		
	}
	
    return {x: x, y: y, w: w, h: h};
  }

/************************************************************************************
Limpia el contenido de un objeto contenedor. 
Se usa para limpiar un div donde se crea la galeria de fotos. Este div esta en index.html
************************************************************************************/
function limpiar(obj) {
	var d = window.top.document.getElementById(obj);
	if(d){
	while (d.hasChildNodes())
	d.removeChild(d.firstChild);
	}

	


}
