window.onload = function() {
    var links = document.getElementsByTagName('a');
    for (var i=0;i < links.length;i++) {
        if (links[i].className == 'nw') {
            links[i].onclick = function() {
                window.open(this.href);
                return false;
            };
        }
    }
};

function makelink( name, domain, desc, pre, post ) {
    if ( pre != null && pre != "" )
        document.write( pre );
    
    document.write( '<a href="mailto:' );
    document.write( name + '&#64;' );
    document.write( domain + '">' );
    
    if ( desc != null && desc != "" )
        document.write( desc )
    else
        document.write( name + '&#64;' + domain );
    
    document.write( '</a>' );
    
    if ( post != null && post != "" )
        document.write( post );
}

function SetBGin( ogg, name ) {
	ogg.style.backgroundImage="url('./data/archivio/min/TMP_"+name+".jpg')";
//	ogg.style.fontSize="1pt";
}

function SetBGout( ogg, name ) {
	ogg.style.backgroundImage="none";
	ogg.style.fontSize="7pt";
}

function GF_carica( dida,img,img_height,cont,cont_tot ) {
	var num = Math.round(10*Math.random());
	dida=unescape(decodeURIComponent(dida));
	dida1="<strong>Fig. "+cont+"</strong>";
    if ( dida != null && dida != "" ) dida1 = dida1 + " - <em>"+dida+"</em>"; 
	document.getElementById('didascalia').innerHTML = dida1;
	document.getElementById('abart_img').style.height = img_height+"px";
	document.getElementById('fotografia').style.height = img_height+"px";
	document.getElementById('fotografia').style.backgroundImage = "url('"+img+"?rand="+num+"')";

	x = 1;
	var ogg_tmp="";
	while (x <= cont_tot) {
		ogg_tmp = "min"+x;
		document.getElementById(ogg_tmp).style.borderColor = "#fff";
		x++;
	}

	var ogg = "min"+cont;
	document.getElementById(ogg).style.borderColor = "#ff6600";
}