ie = navigator.appName.indexOf('Internet Explorer')>-1;

function createhelp(idhelp, txt_const, izq)
{
	window.document.write('<div id="' + idhelp + '" style="position:absolute; left:10px; top:10px; width:10px; height:10px; z-index:1; visibility: hidden;">');
	window.document.write('<table width=123 height=47 border=0 cellpadding=0 cellspacing=0>');	

	if(! izq){
		//derecha, por defecto
		
		window.document.write('<tr><td valign="bottom"><img src="maq/help/globo_ayuda_d_00.gif" width=23 height=47 /></td><td  valign="bottom" width=100 height=47>');	
		window.document.write('<table width=100 height=47 border=0 cellpadding=0 cellspacing=0><tr><td><img src="maq/help/globo_ayuda_d_01.gif" width=100 height=11 /></td></tr>');
		window.document.write('<tr><td background="maq/help/globo_ayuda_d_02.gif"  width=100 height=8 class="helpglobofont">' + txt_const + '</td></tr>');
		window.document.write('<tr><td><img src="maq/help/globo_ayuda_d_03.gif" width=100 height=28 /></td></tr></table></td></tr>');
						  
	}
	else{		
		//izquierda	
			
		window.document.write('<tr><td width=100 height=47 valign="top">');
		window.document.write('<table width=100 height=47 border=0 cellpadding=0 cellspacing=0>');
		window.document.write('<tr><td><img src="maq/help/globo_ayuda_i_01.gif" width=100 height=11 /></td> </tr>');			 
		window.document.write('<tr><td width=100 height=8  background="maq/help/globo_ayuda_i_02.gif" class="helpglobofont">' + txt_const + '</td></tr>');			  
		window.document.write('<tr><td><img src="maq/help/globo_ayuda_i_03.gif" width=100 height=28 /></td> </tr></table></td>');			
		window.document.write('<td  valign="bottom"><img src="maq/help/globo_ayuda_i_00.gif" width=23 height=47 /></td></tr>');
			
	}

	window.document.write('</table>');	
	window.document.write('</div>');
}

function showhelp(idhelp, x, y)
{
	w = 123;
	h = 47;
	y -= h;

	wnd = window.document.getElementById(idhelp);
	
		if (wnd.style.visibility != "visible")
		{
			wnd.style.left=x;
			wnd.style.top=y;
			wnd.style.width=w;
			wnd.style.height=h;
			wnd.style.visibility = "visible";
		}	
}

function hidehelp(idhelp)
{
	wnd = window.document.getElementById(idhelp);
	if(wnd)
		wnd.style.visibility = "hidden";
}

function Calcula_X(objeto)
{	xPos = objeto.offsetLeft; tempEl = objeto.offsetParent; while (tempEl != null) { xPos += tempEl.offsetLeft; tempEl = tempEl.offsetParent; }
    return xPos;
}

function Calcula_Y(objeto)
{
	yPos = objeto.offsetTop; tempEl = objeto.offsetParent; while (tempEl != null) { yPos += tempEl.offsetTop; tempEl = tempEl.offsetParent; }
    return yPos;
}

function showimghelp(idhelp, img, izq)
{
	img.style.Cursor='pointer';
	
	var obj_aux = document.images[idhelp];
	
	difx=izq ? -195 : 17;//15 anchura de la imagen
	
	var MiX =Calcula_X(obj_aux)+difx;
	var MiY =Calcula_Y(obj_aux) - 2;

	showhelp(idhelp, MiX, MiY);
}

function hideimghelp(idhelp, img) {
	img.style.Cursor='none';
	hidehelp(idhelp);
}

function showlayerhelp(txthelp)
{
	document.getElementById("txthelp").value=txthelp;
	document.getElementById("txthelp").style.visibility = "visible";
}

function hidelayerhelp(idhelp, img) {
	document.getElementById("txthelp").style.visibility =  "hidden";
}


