/*
function ControllaFrame(){
	if(top.frames.length == 0){
	  document.location.href="default.htm";
	  return false;
	}
	return true;
}
*/
function ControllaFrame(Pagina){
	if(top.frames.length == 0){
		if (Pagina == null){
		    Pagina= "";
		}
		document.location.href="default.asp?Rinvia=" + Pagina;
		return false;
	}
	return true;
}
function InserisciHTM (sHtm){
	if (document.getElementById){ //MZ e IE5
		parent.frames['superioredx'].document.getElementById('indietro').innerHTML = sHtm;
	}
	else if (document.all){ 
		parent.frames['superioredx'].document.all['indietro'].innerHTML = sHtm;
	}
}

function InserisciHTML (sHtm, sTag){
	if (document.getElementById){ //MZ e IE5
		eval('document.getElementById(\'' + sTag + '\')').innerHTML = sHtm;
	}
	else if (document.all){ 
		eval('document.all[\''+ sTag +'\']').innerHTML = sHtm;
	}
}

function AddImageToImageList(name, Default, MouseOver, MouseDown)
{
    ImageList[imgCounter] = new Array(nMaxItem);
    ImageList[imgCounter][NameIndex] = name;
    ImageList[imgCounter][DefaultState] = new Image();
    ImageList[imgCounter][DefaultState].src = Default;
    if (MouseOver != "") {
        ImageList[imgCounter][MouseOverState] = new Image();
        ImageList[imgCounter][MouseOverState].src = MouseOver;
    }
    if (MouseDown != "") {
        ImageList[imgCounter][MouseDownState] = new Image();
        ImageList[imgCounter][MouseDownState].src = MouseDown;
    }

    imgCounter++;
}

function ReplaceImage(name, state)
{
    if (bIsSupportOK) {
        for (i = 0; i < imgCounter; i++) {
            if (document.images[ImageList[i][NameIndex]] != null) {
                if ((name == ImageList[i][NameIndex]) && (ImageList[i][state] != null))
                    document.images[name].src = ImageList[i][state].src;
            }
        }
    }
}


function ViewConta(){
	document.write('<TABLE cellPadding=0 cellSpacing=0  border=0>');
	document.write('<TR>');
	
	document.write('<TD nowrap>'); 	
	document.write('<FONT size=-1 id=ContaF >');
	document.write('&nbsp;sei il visitatore numero&nbsp;&nbsp;');	
	document.write('</FONT></TD>');
	document.write('<TD align=middle vAlign=center id=ContaTD>');
	document.write(num1);
	document.write('</TD>');
	document.write('<TD align=middle vAlign=center id=ContaTD>');
	document.write(num2);
	document.write('</TD>');
	document.write('<TD align=middle vAlign=center id=ContaTD>');
	document.write(num3);
	document.write('</TD>');
	document.write('<TD align=middle vAlign=center id=ContaTD>');
	document.write(num4);
	document.write('</TD>');
	document.write('<TD align=middle vAlign=center id=ContaTD>');
	document.write(num5);
	document.write('</TD>');
	document.write('</TR>');
	document.write('</TABLE>');

}


function mostra(m, iLarghMenu) {
var iLarghMenuPuno = iLarghMenu +1 ;
var nt = IsNetscape();
 if (menu!='' && parseInt(menu.top)>-iLarghMenu) {
  if (!nt && menu!=m.style)menu.top = -iLarghMenuPuno; 
  if (nt && menu!=m) menu.top = -iLarghMenuPuno;
 }
 if (window.ritrai) clearInterval(ritrai);
 if (!nt) menu = m.style; 
  else menu = m;
 espandi = setInterval("mostram()",5);
}
function nascondi(m, iLarghMenu) {
 if (window.espandi) clearInterval(espandi);
 if (!nt) menu = m.style; 
  else menu = m;
 ritrai = setInterval("nascondim(" + iLarghMenu + ")",5);
}
function mostram() {
  app = parseInt(menu.top);
  if (app>-2 && window.espandi) {
    clearInterval(espandi);
  } else {
    app += 10;
    menu.top = app;
  }
}
function nascondim(iLarghMenu) {
  app = parseInt(menu.top);
  if (app<-iLarghMenu && window.ritrai) {
    clearInterval(ritrai);
  } else {
    app -=10;
    menu.top = app;
  }
}

function IsNetscape (){
//	if (navigator.appName == "Netscape") {
//		return true;
//	}
//	else{
//		return false;
//	}
	
	if (navigator.appName == "Netscape") { 
		if (navigator.appVersion.charAt(0) >= "5"){ 
			return false; //Netscape 6.0 - Mozzilla: non - supporta i Layer
		}
		else{
			return true; //Netscape: supporta i Layer
		}
	 } else if (navigator.appVersion.indexOf("MSIE") != -1) {
	    return false; //Explorer
	}
	else{
		return false; //qualcos'altro
	}
}


function ControllaBrowser (){
	if (navigator.appName == "Netscape") { 
		if (navigator.appVersion.charAt(0) >= "5"){ 
			return true; //Netscape 6.0 - Mozilla
		}
		else{
			return false; //Netscape inf 6.0
		}
	 } else if (navigator.appVersion.indexOf("MSIE") != -1) {
		var InM = navigator.appVersion.indexOf("MSIE");
		var Num = navigator.appVersion.substr(InM + 5,1);
		if (Num >= 5){
			return true; //IE5 o superiore
	    }
	    else{
			return false; //IE inferiore alla 5
	    }
	}
	else{
		return false; //altro browser diverso da IE e Netscape
	}
}

function TrimRL(strValue){

	var strOut='';
	var strOutR='';
	var vposizione = 0;

	//pulisco a sinistra
	for(var posizione = 0; posizione < strValue.length && strValue.substring(posizione,(posizione + 1))==' '; posizione++){
		carattere = strValue.substring(posizione, (posizione + 1));
		
	}
	for (var i = posizione;i < strValue.length;i++){
		carattere = strValue.substring(i, (i + 1));
		strOut=strOut + carattere;	
		
	}

	strValue = strOut;

	vposizione = strValue.length;
	
	//pulisco a destra
	for(var posizione = strValue.length; posizione != 0 && strValue.substring(posizione - 1,posizione)==' '; posizione--){
		//alert(posizione  + strValue.substring(posizione -1,posizione));
		vposizione = posizione-1;
	}
	
	strOutR = strValue.substring(0, vposizione);

	return strOutR;
}

//-----------------------------------------------------
//				OLD
/*********************
function mostra(m, iLarghMenu) {
var iLarghMenuPuno = iLarghMenu +1 ;

 if (menu!='' && parseInt(menu.left)>-iLarghMenu) {
  if (document.all && menu!=m.style)menu.left = -iLarghMenuPuno; 
  if (!document.all && menu!=m) menu.left = -iLarghMenuPuno;
 }
 if (window.ritrai) clearInterval(ritrai);
 if (document.all) menu = m.style; 
  else menu = m;
 espandi = setInterval("mostram()",5);
}
function nascondi(m, iLarghMenu) {
 if (window.espandi) clearInterval(espandi);
 if (document.all) menu = m.style; 
  else menu = m;
 ritrai = setInterval("nascondim(" + iLarghMenu + ")",5);
}
function mostram() {
  app = parseInt(menu.left);
  if (app>-2 && window.espandi) {
    clearInterval(espandi);
  } else {
    app += 10;
    menu.left = app;
  }
}
function nascondim(iLarghMenu) {
  app = parseInt(menu.left);
  if (app<-iLarghMenu && window.ritrai) {
    clearInterval(ritrai);
  } else {
    app -=10;
    menu.left = app;
  }
}
*****************/
//---------------------------------------------------------

