

function locate_elm(n, d)
	{
		var p,i,x;
		
		if(!d) d=document;
		
		if((p=n.indexOf("?"))>0&&parent.frames.length)
			{
				d=parent.frames[n.substring(p+1)].document;
				n=n.substring(0,p);
			}
		
		if(!(x=d[n])&&d.all)
		x=d.all[n];
		
		for (i=0;!x&&i<d.forms.length;i++)
		x=d.forms[i][n];
		
		for(i=0;!x&&d.layers&&i<d.layers.length;i++)
		x=locate_elm(n,d.layers[i].document);
		
		if(!x && d.getElementById)
		x=d.getElementById(n);
		
		return x;
	}

	
var cursor = {x:0, y:0};
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
	
function new_win_user(s, p, lang)
	{
			
		if(document.all)
			{
				sx=window.screenLeft;
				sy=window.screenTop;
			}
		else
			{
				sx=window.screenX;
				sy=window.screenY;
			}
			
		if(document.all)
			{
				if(document.compatMode == "CSS1Compat")
					{
						tx=document.body.parentNode.scrollLeft;
						ty=document.body.parentNode.scrollTop;
					}
				else
					{
						tx=document.body.scrollLeft;
						ty=document.body.scrollTop;
					}
			}
		else
			{
				tx=window.scrollX;
				ty=window.scrollY;
			}
		
		if(cursor.y<130)
			{
				y=10;
			}
		else
			{
				y=cursor.y-130;
			}
		if(cursor.x<380)
			{
				x=10;
			}
		else
			{
				x=cursor.x-380;
			}
		
		x=x+sx-tx;
		y=y+sy-ty;
  		window.open("pop.php?id="+s+"&pagina="+p+"&lang="+lang,"","WIDTH=600,HEIGHT=520, TOP="+y+" ,LEFT="+x+"");
	}
	

function UpdateCursorPosition(e)
	{
		cursor.x = e.pageX;
		cursor.y = e.pageY;
	}
function UpdateCursorPositionDocAll(e)
	{
		cursor.x = event.clientX;
		cursor.y = event.clientY;
	}


function changecolor(sid,color)
{
   color=eval("document.all."+sid+".style.color="+"\"" + color + "\"");
   //style=eval("document.all."+sid+".style.textDecoration='underline'");
}
function changeoldcolor(sid,color)
{
    color=eval("document.all."+sid+".style.color="+"\"" + color + "\"");
	//style=eval("document.all."+sid+".style.textDecoration='none'");
}


function ag_popup(unln)
{
	window.open(unln,"","WIDTH=840,HEIGHT=520, TOP=10 ,LEFT=10");
	return false;
}



function popup_galerie(unln)
{
	window.open(unln,"","WIDTH=860,HEIGHT=600, TOP=10 ,LEFT=10");
	return false;
}
