var flash = 0;
function cambia_imagen(id,img){

document.getElementById(id).src=img;

}
function abre_ventana(){
	
	var a = abre_ventana.arguments;
	ancho = 630;
	largo = 550;
	
	aux = a[0];
	
	 var left = Math.floor( (screen.width - ancho) / 2);
	 var top = Math.floor( (screen.height - largo) / 2);

	ventana_principal=window.open(aux,"noticia","top="+top+",left="+left+",width="+ancho+",height="+largo+",titlebar=0, status=0, scrollbars=1");

}
function abre_not(){
	var a = abre_not.arguments;
	ancho = 630;
	largo = 550;
	
	aux = "detalle_not.jsp?" + a[0];
	
	 var left = Math.floor( (screen.width - ancho) / 2);
	 var top = Math.floor( (screen.height - largo) / 2);

	ventana_principal=window.open(aux,"noticia","top="+top+",left="+left+",width="+ancho+",height="+largo+",titlebar=0, status=0, scrollbars=1");
}
function abre_vo(){
	var a = abre_vo.arguments;
	ancho = 630;
	largo = 550;
	
	aux = "detalle_vo.jsp?" + a[0];
	
	 var left = Math.floor( (screen.width - ancho) / 2);
	 var top = Math.floor( (screen.height - largo) / 2);

	ventana_principal=window.open(aux,"noticia","top="+top+",left="+left+",width="+ancho+",height="+largo+",titlebar=0, status=0, scrollbars=1");
}
function pinta_flechas(){

document.write('<div id="flecha1" style="visibility:hidden;position:absolute;top=0;left=0;z-indez:3">');
document.write('<img src="/img/flecha_banner.gif">');
document.write('</div>');
document.write('<div id="flecha2" style="visibility:hidden;position:absolute;top=0;left=0;z-indez:3">');
document.write('<img src="/img/flecha_banner.gif">');
document.write('</div>');
}
function pinta_logo(){

document.write('<div id="logo" style="visibility:hidden;position:absolute;top=0;left=0;z-indez:3">');
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write(' WIDTH="450" HEIGHT="30" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"');
document.write('id="myMovieName">');
document.write('<PARAM NAME=movie VALUE="/img/logo.swf">');
document.write('<PARAM NAME=quality VALUE=high>');
document.write('<EMBED WIDTH="450" HEIGHT="30" src="/img/logo.swf" quality=high bgcolor=#FFFFFF NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write('</EMBED>');
document.write('</OBJECT>');
document.write('</div>');

}
function setpos(nom1,nom2,posx,posy){
var aux= document.getElementById(nom1);
	aux2 = findPosX(aux);
	aux3 = findPosY(aux);
	aux4= document.getElementById(nom2);
	aux4.style.top = aux3+posx;
	aux4.style.left = aux2+posy;
	if((((nom2=="flecha1")||(nom2=="flecha2"))&&(flash!=1))||(nom2=="logo")){
		aux4.style.visibility = "visible";
	}
	
}

function coords(nom){
var aux= document.getElementById(nom);
	aux2 = findPosX(aux);
	aux3 = findPosY(aux);

}

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;
}

