function change_foto(img){
  var rnd_image = document.getElementById("rnd_image");
  /*rnd_image.src = null;
  rnd_image.src = img.src;
  document.write('BG:'+img.src);*/
  rnd_image.style.backgroundImage = 'url('+img.src+')';
}


function my_popup(url,width,height) { 
	var left = Math.floor((screen.width-width)/2);
    var top = Math.floor((screen.height-height)/2);
    
	window.open(url,'pierpaololenoci','width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + ',scrollbars=no,status=no,directories=no,location=no,toolbar=no,resizable=no,menubar=no,titlebar=no');
} 


function FullScreen(url){
	var w_open=window.open('','pierpaololenoci','scrollbars=no,status=no');
	
	if (document.all){
		w_open.moveTo(0,0)
		w_open.resizeTo(screen.width,screen.height)
	}
	w_open.location=url;
}

  
function scroll_txt(wich_id,wait) {
  if (((position<=end)&&(delta==-2)) || ((position>=start)&&(delta==2)))
	  {
		  delta=0;
	  }
  position=position+delta;
  document.getElementById(wich_id).style.top=parseInt(position)+'px';
  if (delta!=0) 
	  {
		setTimeout(function() {scroll_txt(wich_id,wait); }, wait); 
	  }
}


function position_selected(wich_id,pos){
	document.getElementById(wich_id).style.top = parseInt(pos)+'px';
	position = pos;
}