var menu=function(){
	var t=15,z=50,s=6,a;
	function dd(n){this.n=n; this.h=[]; this.c=[]}
	dd.prototype.init=function(p,c){
		a=c; var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0;
		for(i;i<l;i++){
			var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i];
			h.onmouseover=new Function(this.n+'.st('+i+',true)');
			h.onmouseout=new Function(this.n+'.st('+i+')');
		}
	}
	dd.prototype.st=function(x,f){
		var c=this.c[x], h=this.h[x], p=h.getElementsByTagName('a')[0];
		clearInterval(c.t); c.style.overflow='hidden';
		if(f){
			p.className+=' '+a;
			if(!c.mh){c.style.display='block'; c.style.height=''; c.mh=c.offsetHeight; c.style.height=0}
			if(c.mh==c.offsetHeight){c.style.overflow='visible'}
			else{c.style.zIndex=z; z++; c.t=setInterval(function(){sl(c,1)},t)}
		}else{p.className=p.className.replace(a,''); c.t=setInterval(function(){sl(c,-1)},t)}
	}
	function sl(c,f){
		var h=c.offsetHeight;
		if((h<=0&&f!=1)||(h>=c.mh&&f==1)){
			if(f==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'}
			clearInterval(c.t); return
		}
		var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s), o=h/c.mh;
		c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')';
		c.style.height=h+(d*f)+'px'
	}
	return{dd:dd}
}
();

function Download_TeamViewer()
	{
	var ck;

	if(document.all) 
		ck=document.all['optAccetta'].checked;
	else 
		ck=document.getElementById('optAccetta').checked;

	if(ck)
		window.open( "../download/downloadObj.asp?obj=software/varie/TeamViewerQS_it.exe", "download", "toolbar=0,location=no,directories=0,status=0,scrollbars=yes,resizable=1,width=1,height=1,top=0,left=0" )
	else
		alert( "Per procedere, bisogna prima accettare le condizioni" )
	};

function openlink(xlink){
	window.open("./linkesterni.shtml?" + xlink, "xpage");
	}

function openlinkex(xlink){
	window.open("../pagine/linkesterni.shtml?" + xlink, "xpage");
	}

function bookmarksite(){
	if (window.sidebar) // firefox
		   window.sidebar.addPanel('Siam & Logica', 'http://www.siamelogica.it', '');
	else if(window.opera && window.print) // opera
		{
	   	var elem = document.createElement('a');
		elem.setAttribute('href','http://www.siamelogica.it');
		elem.setAttribute('title','Siam & Logica');
		elem.setAttribute('rel','sidebar');
		elem.click();
		}
	else if(document.all)// ie
   		window.external.AddFavorite('http://www.siamelogica.it', 'Siam & Logica');
	}

function chiudi(id){
	if(document.all) 
		document.all[id].style.display="none";
	else 
		document.getElementById(id).style.display="none";
	
	return(false);
	}


function setHomepage()
	{
	if (document.all)
    		{
        	document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage('http://www.siamelogica.it');
 
    		}
    	else if (window.sidebar)
    		{
		if(window.netscape)
    			{
         		try
	   			{  
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
         			}  
         		catch(e)  
         		{  
			alert("this action was aviod by your browser.if you want to enable, please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");  
         		}
    		} 
    		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    		prefs.setCharPref('browser.startup.homepage','http://www.siamelogica.it');
 		}
	}

