﻿// File JScript

msg = "Esempio di testo scorrevole posizionato ";
msg += "nel corpo della pagina. ";
pos = 0;

var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

function getRef(id) {
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];
}



 
 msg = "E’ nato ECG ON THE WEB!!! ";
 link = "news1.htm"

pos = 0;
function ScrollMessage() {
return;
 var a;
 a = document.getElementById("scroll");
 
 var newtext = msg.substring(pos, msg.length) + msg.substring(0, pos);
 a.firstChild.nodeValue = newtext;
 a.href="javascript:void(0)";
 a.title=link ;
   pos++;
   if (pos > msg.length) {
      window.setTimeout("ScrollMessage()",5000);
      pos = 0;
      //eventualecodice per cambiare notizia
   }
   else{
      window.setTimeout("ScrollMessage()",150);
   }
}


function popup(url_pagina){
     alt=480;
     lar=640;
     props='height='+alt+',width='+lar+',top='+parseInt((screen.availHeight-alt)/2)+',left='+parseInt((screen.availWidth-lar)/2)+',scrollbars=1,resizable=1,toolbar=0,menubar=0,location=0,status=0';
     finestrapopup=window.open(url_pagina,'_blank',props);
     }
     
function popupPWD(url_pagina){
     alt=480;
     lar=640;
     props='height='+alt+',width='+lar+',top='+parseInt((screen.availHeight-alt)/2)+',left='+parseInt((screen.availWidth-lar)/2)+',scrollbars=1,resizable=1,toolbar=0,menubar=0,location=0,status=0';
     finestrapopup=window.open('Pub_PopUp_Pwd.aspx?Page=' + url_pagina,'_blank',props);
     }     

function addEvent( obj, type, fn ){
           if (obj.addEventListener){
              obj.addEventListener( type, fn, false );
           }
           else if (obj.attachEvent){
              obj["e"+type+fn] = fn;
              obj[type+fn] = function(){ obj["e"+type+fn]( window.event ); }
              obj.attachEvent( "on"+type, obj[type+fn] );
           }
        }

  
addEvent(window, 'load', ScrollMessage);