// JavaScript Document

var anchura=screen.width;
var position=(anchura/2)-200; 
var pos;

/* Evento setInterval

window.setInterval(function() { 
 					var scrollpos = scroll_capa(); 
 					document.getElementById('4life_up').style.top = scrollpos + 114 + 'px';
 					},10);
*/

//Evento onscroll
 window.onscroll = function() {
				  var scrollpos = scroll_capa(); 
 				  document.getElementById('4life_up').style.top = scrollpos + 114 + 'px';
 				  } 

function cargar_4life() {
document.getElementById('4life_up').style.visibility='visible';
document.getElementById('4life_up').style.overflow='visible';
document.getElementById('4life_up').style.top='114px';
document.getElementById('4life_up').style.left=position+'px';  		
}

function scroll_capa(){
  
  if( typeof window.pageYOffset != 'undefined' ) { // for Mozilla browsers, Safari, Konqueror and Opera 
    pos = window.pageYOffset;
  }
  
  else if( typeof document.documentElement.scrollTop != 'undefined' && document.documentElement.scrollTop > 0) { // for IE 6 in standards-compliant mode
    pos = document.documentElement.scrollTop;
  }
  
  else if( typeof document.body.scrollTop != 'undefined' ) { // for IE 5 and IE 6 in "Quirks" mode
    pos = document.body.scrollTop;
  }

  return pos;
   		
}

function cerrar_4life() {
document.getElementById('4life_up').style.visibility='hidden';
} 
