

/***************************************************************************
 Es una funcion para que al pinchar sobre el elemento que la activa se
 crea una nueva pantallita y se muestra la imagen dada como argumento.
***************************************************************************/
function ExpandeImagen(oObj, sImg){
    
    oDiv = document.createElement("div");
    oDiv.style.visibility="hidden";
    document.body.appendChild(oDiv);
    
    // create the full sized image and automatically expand when loaded
    oImg = new Image();
    oImg.expander = this;
    oImg.src = sImg;
    
    oDiv.appendChild(oImg);
    oDiv.style.position = "absolute";
    
    oDiv.style.top=findPosY(oObj);
    oDiv.style.left=findPosX(oObj);
    oDiv.onmouseout = function(){document.body.removeChild(oDiv);};
    oImg.title = "";
    bigWidth = this.oImg.width;
    bigHeight = this.oImg.Height;
    oDiv.style.visibility="visible";
}

function findPosX(obj){
	var curleft = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj){
	var curtop = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}else if (obj.y)
		curtop += obj.y;
	return curtop;
}


/***************************************************************************
 Código para que saltar al servicio elegido por el combo de la seccion
 de servicios.
 oObj: el objeto, en este caso un combo.
 sPg: pagina a la cual se saltará
 iOP, iSOP: operacion y suboperacion necesarias para el codigo php.
 Se crea una url del tipo
    principal.php?op=3&sop=3B&id=2
***************************************************************************/
function MuestraServicio(oObj, sPg, iOP, iSOP){
    sURL=sPg+"?op="+iOP+"&sop="+iSOP+"&id="+oObj.value;
    RecargaInmediata(sURL);
}
