var is 		= new Is();
var sHidden	= "hidden";
var sVisible	= "visible";
if(is.nav4) {
    doc = "document[";
    sty = "]";
    htm = "].document";
} else if(is.ie4) {
    doc = "document.all[";
    sty = "].style";
    htm = "]";
} else if(is.ns6) {
    doc = "document.getElementById(";
    sty = ").style";
    htm = ")";
}

function Is ()
{  
    var agt=navigator.userAgent.toLowerCase()
    this.major = parseInt(navigator.appVersion)
    this.minor = parseFloat(navigator.appVersion)
    this.nav  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1)))
    this.nav2 = (this.nav && (this.major == 2))
    this.nav3 = (this.nav && (this.major == 3))
    this.nav4 = (this.nav && (this.major == 4))
    this.ie   = (agt.indexOf("msie") != -1)
    this.ie3  = (this.ie && (this.major == 2))
    this.ie4  = (this.ie && (this.major == 4))
    this.opera = (agt.indexOf("opera") != -1)
    this.nav4up = this.nav && (this.major >= 4)
    this.ie4up  = this.ie  && (this.major >= 4)
    this.ns6 	= document.getElementById && !document.all ;

}
function WriteToParentTag(ParentName, TagName, strContent) {
var	objTag;

RealContent='<span class="ColorLogoSx">';
RealContent=RealContent + strContent + "</span>";
	objTag = eval("parent." + ParentName + "." + doc + '"' + TagName + '"' + htm);
	if (is.ie || is.ns6) {
		objTag.innerHTML = RealContent;
	}
	else {
		objTag.open();
		objTag.write();
		objTag.write(RealContent);
      		objTag.close();
	}

}

function check(e) {
	if (n) {if (e.which==3){alert("Right mouse button not available.");return false;}
	else {return true;}	}
	else {if (event.button==2) {alert("Right mouse button not available.");return false;}
	else {return true;}}

}
	
//usata - controlla il backspace
function myclick2() {if (n) {if (e.keyCode==8) return false; }
else {if (event.keyCode == 8) return false;}
}

//usata
function myStart(b) {
	document.onmousedown=check;document.onmouseup=check;
	if (b == "yes") {window.onkeydown = myclick2;window.onkeyup = myclick2;window.onkeypress = myclick2;document.onkeydown = myclick2;document.onkeyup = myclick2;document.onkeypress = myclick2;}
	n = (document.layers) ? 1:0
	ie = (document.all) ? 1:0
}

//usata
function DisableRightButton(s){

myStart(s);
}



function MM_findObj(n, d)
{ //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}


function WriteToTag(TagName,strContent)
{
	var	objTag;
	objTag = MM_findObj(TagName);
	if (is.ie || is.ns6) {
		objTag.innerHTML = strContent;
	}
	else {
		objTag.open();
		objTag.write();
		objTag.write(strContent);
      		objTag.close();
	}
}