function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function checkOS() {
  if(navigator.userAgent.indexOf('Linux') != -1)
    { var OpSys = "Linux"; }
  else if((navigator.userAgent.indexOf('Win') != -1) &&
  (navigator.userAgent.indexOf('95') != -1))
    { var OpSys = "Windows95"; }
  else if(navigator.userAgent.indexOf('Win') != -1)
    { var OpSys = "Windows3.1 or NT"; }
  else if(navigator.userAgent.indexOf('Mac') != -1)
    { var OpSys = "Macintosh"; }
  else { var OpSys = "other"; }
  return OpSys;
}

var OpSys = checkOS();

beginRollover = false;// This handles a bug in Nav4.0x that executes the code too quickly.

// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();
// *** BROWSER VERSION ***
// Note: On IE5, these return 4, so use is_ie5up to detect IE5.
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
            && (agt.indexOf('webtv')==-1));
var is_nav2 = (is_nav && (is_major == 2));
var is_nav3 = (is_nav && (is_major == 3));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                      (agt.indexOf("; nav") != -1)) );
var is_nav5 = (is_nav && (is_major == 5));
var is_nav5up = (is_nav && (is_major >= 5));

var is_ie   = (agt.indexOf("msie") != -1);
var is_ie3  = (is_ie && (is_major < 4));
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
var is_ie4up  = (is_ie  && (is_major >= 4));
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);
var isIE4, isIE4PC, isNav4PC, isNav4, isNav3;

if (is_ie4 || is_ie4up || is_nav5 || is_nav5up) {
	isIE4 = true;
	if (OpSys != "Macintosh") {
		isIE4PC = true;
	}
} else if (is_nav4) {
	isNav4 = true;
	if (OpSys != "Macintosh") {
		isNav4PC = true;
	}
} else if  (is_nav) {
	isNav3 = true;
}

self.name = "parentWin";
function openDec(url, name, w, h) {
        popupWin = window.open(url, name, 'resizable=0,scrollbars=0,width=' + w + ',height=' + h + '');
    // focus window (only for Navigator >= 3.0)
    if ( (navigator.appName != "Microsoft Internet Explorer") && (navigator.appVersion.substring(0,1) == "3") )
    popupWin.focus();
}

function StringTimeCorto(BrowserTime) {


var MonthofYear = new Array(12)
MonthofYear[0] = "gennaio"
MonthofYear[1] = "febbraio"
MonthofYear[2] = "marzo"
MonthofYear[3] = "aprile"
MonthofYear[4] = "maggio"
MonthofYear[5] = "giugno"
MonthofYear[6] = "luglio"
MonthofYear[7] = "agosto"
MonthofYear[8] = "settembre"
MonthofYear[9] = "ottobre"
MonthofYear[10] = "novembre"
MonthofYear[11] = "dicembre"

var theYear = BrowserTime.getYear()
if (theYear < 1900) { theYear = theYear + 1900 }

 return  " " + BrowserTime.getDate() + "/"   + BrowserTime.getMonth() + "/" + theYear
}

function StringTime(BrowserTime) {


var MonthofYear = new Array(12)
MonthofYear[0] = "gennaio"
MonthofYear[1] = "febbraio"
MonthofYear[2] = "marzo"
MonthofYear[3] = "aprile"
MonthofYear[4] = "maggio"
MonthofYear[5] = "giugno"
MonthofYear[6] = "luglio"
MonthofYear[7] = "agosto"
MonthofYear[8] = "settembre"
MonthofYear[9] = "ottobre"
MonthofYear[10] = "novembre"
MonthofYear[11] = "dicembre"

var theYear = BrowserTime.getYear()
if (theYear < 1900) { theYear = theYear + 1900 }


 return " " + BrowserTime.getDate() + " " + MonthofYear[BrowserTime.getMonth()] + " " + theYear
}

function Greeting(BrowserTime) {
     thisTime = BrowserTime.getHours()
     return true
}

function orainternet(BrowserTime) {
var thisT;
var thisM;
var thisS;
var iT;
     thisT = BrowserTime.getHours();
	 thisM = BrowserTime.getMinutes();
	 thisS = BrowserTime.getSeconds();
	 iT = (thisT*3600 + thisM*60 +thisS)*10/864;
     //return '<a href="javascript:;" onClick="popUpInternetTime()">' + iT + '</a>';
     return iT;
}

function addbookmark(pagina,titolo){
if (isIE4)
		window.external.AddFavorite(pagina,titolo);
else
	if (isNav4)
		alert ('ctrl-D per aggiungere ai preferiti');
	else
		alert ('non è possibile aggiungere bookmark');
}
function showImage(filename, imageName)
			{
		    	document.images[imageName].src = filename;
		    }


function stampa() {
            self.print();
			}
function principale(modulo) {
if (isIE4){
modulo.style.behavior='url(#default#homepage)';
modulo.setHomePage("http://www.mytech.it/");
}

}

function popUpCostaMeno(pPage) {
  var winOpts = 'resizable=no,scrollbars=no,width=140,height=106'; popUpWinCostaMeno = window.open(pPage,'popCostaMeno',winOpts);
}

function popUp(pPage) {
  var winOpts = 'resizable=yes,scrollbars=yes,width=600,height=400'; popUpWin = window.open(pPage,'popWin',winOpts);
}


function popUpZine(pPage) {
  var winOpts = 'resizable=yes,scrollbars=yes,width=640,height=600'; popUpWin = window.open(pPage,'popWin',winOpts);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function doLoad() {
    // the timeout value should be the same as in the "refresh" meta-tag
    setTimeout( "refresh()", 60000 );
}

function doLoadSec(s) {
    // the timeout value should be the same as in the "refresh" meta-tag
    var tempo;
    tempo = 1000 * s;
    setTimeout( "refresh()", tempo);
}

function refresh() {
    window.location.href = window.location.href;
}

function popUpLavoro(pPage,nPage) {
  var winOpts = 'resizeable=yes,scrollbars=yes,width=520,height=460';
popUpWin = window.open(pPage,nPage,winOpts);
}

function popUpInternetTime() {
  var winOpts = 'resizeable=yes,scrollbars=yes,width=350,height=350';
popUpWin = window.open('../includes/internet_time.html','popWin',winOpts);
}

var linesToOutput = 10;
var numLines = 1;

function Top10Line(nomefile, nomeprogramma) {
	if ( numLines > linesToOutput ) {
		return;
	}
	document.writeln('<tr valign="top" bgcolor="#FFFFFF">');
	document.writeln('<td width="4" bgcolor="#666699"><img src="images/space.gif" width="4" height="1" alt="" border="0"></td>');
	document.writeln('<td width="9"><img src="images/space.gif" width="9" height="1" alt="" border="0"></td>');
	document.writeln('<td width="133"><img src="images/freccia_link.gif" width="12" height="12" alt="" border="0">&nbsp;<a href="http://volftp.mondadori.com/cgi/scheda?'+nomefile+'" class="testonerolittle">'+nomeprogramma+'</a></td>');
	document.writeln('<td width="3" bgcolor="#666699"><img src="images/space.gif" width="3" height="1" alt="" border="0"></td>');
	document.writeln('</tr>')
	numLines++
}
