bData = null;

function browserData(browser,version,platform) {
   this.browser = browser;
   this.version = version;
   this.platform = platform;
}

function browserInfo() {
        if (bData == null) bData = new browserData(0,null,0);

        // BROWSER TYPE

        if ((navigator.appName.indexOf("Netscape") >= 0)||
                (navigator.appName.indexOf("Navigator") >= 0)){
                bData.browser=1;
        }else
        if (navigator.appName.indexOf("Explorer") >= 0){
                bData.browser=2;
        }else
                bData.browser=0;


        // BROWSER VERSION

        var tail = navigator.appVersion.indexOf(' ');
        bData.version = parseFloat(navigator.appVersion.substring(0,tail));
        var head =  navigator.appVersion.indexOf('(');
        var tail =  navigator.appVersion.indexOf(')');

        // BROWSER PLATFORM

        brPlatformData =navigator.appVersion.substring(head,tail);
        if (brPlatformData.indexOf("Macintosh") >= 0){
                if ( brPlatformData.indexOf("PPC") >= 0){
                        bData.platform=2;
                }else
                        bData.platform=1;
        }else{
                if ( brPlatformData.indexOf("Win") >= 0) bData.platform=3;
        }
}
        // funzione menu
function rollin(imgName) {
        if ((bData.browser == 1) && (bData.version >=3) || (bData.browser==2 && bData.version>=4)) {
        imgFile = imgName + "_bw.jpg";
        document [imgName].src = imgFile;
        }
}

function rollout(imgName) {
        if ((bData.browser == 1) && (bData.version >=3) || (bData.browser==2 && bData.version>=4)) {
        imgFile = imgName + "_co.jpg";
        document [imgName].src = imgFile;
        }
}
        // endfunzione menu


function rollinAlto(imgName,sotto,liv) {
        if ((bData.browser == 1) && (bData.version >=3) || (bData.browser==2 && bData.version>=4)) {
        imgFile = imgName + "_2.gif";
		quadrato = "r" + sotto;
        document [imgName].src = imgFile;
		if (liv == 1) sottoFile = "http://www.collegati.ch/menu/sotto_on.gif";
		else sottoFile = "http://www.collegati.ch/menu/sotto_on.gif";
		document [quadrato].src = sottoFile;
        }
}

function rolloutAlto(imgName,sotto,liv) {
        if ((bData.browser == 1) && (bData.version >=3) || (bData.browser==2 && bData.version>=4)) {
        imgFile = imgName + "_1.gif";
		quadrato = "r" + sotto; 
        document [imgName].src = imgFile;
		if (liv == 1) sottoFile = "http://www.collegati.ch/menu/sotto_off.gif";
		else sottoFile = "http://www.collegati.ch/menu/sotto_off.gif";
		document [quadrato].src = sottoFile;
        }
}

 // TD QUADRATI SFONDO COLORATO
function changeto(highlightcolor){
source=event.srcElement
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD")
source=source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}
 // TD fine
 
function setPointer(theRow, thePointerColor){	
	if (thePointerColor == '' || typeof(theRow.style) == 'undefined')
	{
	return false;}
	if (typeof(document.getElementsByTagName) != 'undefined') {
	var theCells = theRow.getElementsByTagName('td');}
	else if (typeof(theRow.cells) != 'undefined') {
	var theCells = theRow.cells;}
	else {return false;}
	var rowCellsCnt  = theCells.length;
	for (var c = 0; c < rowCellsCnt; c++) {
	theCells[c].style.backgroundColor = thePointerColor;}
	return true;}


 
function popup(){
newwin = window.open('','copyright','width=500,height=500,resizable=0');
}
	   
browserInfo();

