//-----------------------------------------------
//   CALCULA CORDENADAS DE UN OBJETO
//   PUEDE SER UNA FILA DE TABLA.
//   PUEDE SER UNA IMAGEN.
//   PUEDE SER...
//-----------------------------------------------
function GetposXposY(idNombre, array_pos) {
    var  i, obj, x,y;
	// alert("calcula posicion="+idNombre)
    obj=document.getElementById(idNombre);
	x = obj.x;
	y = obj.y;
    if (!document.layers) {
	    // alert(' (!document.layers)  es true ');
	} else {	
	   // alert(' (!document.layers)  es false ');
	};
	// alert("obj=" + obj);
	    x=0; 
		y=0;
	    var img = obj
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		// if (onWindows) alert(" es onWindows true ");
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffsetx = 0;
		var lastOffsety = 0;
		while(par){
		    //---calculo de x
			if( par.leftMargin && (!onWindows) ) x += parseInt(par.leftMargin);
			if( (par.offsetLeft != lastOffsetx) && par.offsetLeft ) x += parseInt(par.offsetLeft);
			if( par.offsetLeft != 0 ) lastOffsetx = par.offsetLeft;
			//---calculo de y
			if( par.topMargin && (!onWindows) ) y += parseInt(par.topMargin);
			if( (par.offsetTop != lastOffsety) && par.offsetTop ) y += parseInt(par.offsetTop);
			if( par.offsetTop != 0 ) lastOffsety = par.offsetTop;
			//  debug datos
			if ( par ) {
   			   // alert( "ver obj=" + par.id + " pos x=" + x );
			}   
			par = macIE45 ? par.parentElement : par.offsetParent;
		}
	// alert("pos x=" + x.toString() + " pos y =" + y.toString() );
	array_pos[0] = x;
	array_pos[1] = y;

}


//-----------------------------------------------
//   CALCULA EL ALTO DEL FREME DE DATOS.
//-----------------------------------------------
function  getFrameDatAlto() {
   var   x1,y1, x2, y2,  s;
   var   pos = new Array();
   pos[0]=0;
   pos[1]=0;
   GetposXposY( "FilaFrame1",    pos );   x1 = pos[0];  y1 = pos[1];
   GetposXposY( "FilaPiePagina", pos );   x2 = pos[0];  y2 = pos[1];
   // alert("OnLOAD pos x1=" + x1.toString() + " pos y1 =" + y1.toString() );
   // alert("OnLOAD pos x2=" + x2.toString() + " pos y2 =" + y2.toString() );
   var  altura;
   altura = y2-y1;
   return  altura;
}

//------------------------------------
function StrPropiedades(objeto){
	var resultado="";
	var nl=String.fromCharCode(13); 
	resultado += nl;
	try {
	   resultado += nl+"ObjetoID="+objeto.id+nl; 
	} catch(e) {
	   // sin atributo de Id
	}   
	resultado += nl;
	for(var i in objeto){
              if (i != "outerHTML") {
		         resultado+=i+"="+objeto[i]+nl;
              } else {
		         resultado+=i+"="+objeto[i]+nl;
                 // alert("outerHTML"+objeto[i]);
              };
	};
	return resultado;
}


