
function foto (tipofoto,id,params,sale) {

    if (id>0 && sale) {

	document.write('<img border=0 '+params+' src=\"?goto_file=foto'+tipofoto+'&id='+id+'\">')
    }

}

function relacionado(id,nombre,idseccion,idcategoria)
{
    if (id!=0) {
    	document.write('<table width="100%" border=0 cellspacing=0 cellpadding=0><tr><td><img src=images/relacionado.gif height=10 widht=10 border=0>&nbsp;<a href=?goto_screen=articulo&id='+id+'&idseccion='+idseccion+'&idcategoria='+idcategoria+'&pagina=1 class=azul9titu>'+nombre+'</a></td></tr></table>')
    }
}


function openWindow(url, w, h) {

    var options = "width=" + w + ",height=" + h + ",";

    options += "resizable=no,scrollbars=no,status=no,";

    options += "menubar=no,toolbar=no,location=no,directories=no";

    var newWin1 = window.open(url, 'newWin1', options);

    newWin1.focus();

}


function openWindow2(url, w, h) {

    var options = "width=" + w + ",height=" + h + ",";

    options += "resizable=yes,scrollbars=yes,status=yes,";

    options += "menubar=yes,toolbar=yes,location=yes,directories=yes";

    var newWin1 = window.open(url, 'newWin1', options);

    newWin1.focus();

}


var ventana_flotante=0
var tiene_enlace=0

function begin_banner (id,enlace,tipo,ancho,alto)
{
    if (tipo==2) {
	ventana_flotante=1
    }
    if ((enlace!='') && (enlace!=null)) {
	tiene_enlace=1
    } else {
	tiene_enlace=0
    }
    
    // Deberia saltar al screen de control de banners
    if (ventana_flotante) {
	total_enlace='javascript:openWindow2(\''+enlace+'\','+ancho+','+alto+')'
    } else {
	total_enlace=enlace
    }
    
    if (tiene_enlace==1) {
//	alert('<a href=\"'+total_enlace+'\">')
	document.write('<a border=0 class="blanco" href=\"'+total_enlace+'\">')
    }
}

function end_banner ()
{
    if (tiene_enlace==1) {
    	document.write('</a>')
    }
}
