// JavaScript Document

function adattaHeight(id, idd, original){
	if(document.getElementById){
		oHeight = document.getElementById(id).offsetHeight;
	}
	else if (document.layers){
		oHeight = document.layers[id].clip.height;
	}
	
	
	n=oHeight-original;

	
	if(n>0){
		
	if(document.getElementById){
		iHeight = document.getElementById(idd).offsetHeight;
	}
	else if (document.layers){
		iHeight = document.layers[idd].clip.height;
	}
	
	
	var ua = navigator.userAgent.toLowerCase();
	if (ua.indexOf("win")!= -1){
		document.getElementById(idd).style.height=((iHeight+n)-14)+'px';
	}
	else{
		document.getElementById(idd).style.height=((iHeight+n)-20)+'px';
	}
	
	}
}

function adattaHeight2(id, idd, original){//solo per la pagina del menu
	if(document.getElementById){
		oHeight = document.getElementById(id).offsetHeight;
	}
	else if (document.layers){
		oHeight = document.layers[id].clip.height;
	}
	
	
	n=oHeight-original;

	
	if(n>0){
		
	iHeight = 1015;
		
	var ua = navigator.userAgent.toLowerCase();
	if (ua.indexOf("win")!= -1){
		document.getElementById(idd).style.height=((iHeight+n)-14)+'px';
	}
	else{
		document.getElementById(idd).style.height=((iHeight+n)-20)+'px';
	}
	
	}
}


function adattaStripe(){
	oHeight = document.getElementById('SfPage').offsetHeight;
	document.getElementById('stripeFooter').style.marginTop=(oHeight+50)+'px';
}

function center(){
	ScreenWidth = document.getElementById('SfPage').offsetWidth;
	WindWidth = window.innerWidth;
	offset= ((ScreenWidth-WindWidth)/2);
	if(offset>0) window.scrollTo(offset+5,0);
}

function adattaMarginTop(id, idd, original){
	if(document.getElementById){
		oHeight = document.getElementById(id).offsetHeight;
	}
	else if (document.layers){
		oHeight = document.layers[id].clip.height;
	}
	
	n=oHeight-original;
	
	if(n>0){
		document.getElementById(idd).style.marginTop=(728+n)+'px';	
	}
}

function FooterR(){
	w = window.screen.width;
	if( w < 1200){
		document.getElementById('ricciF').style.display='none';
	}
	else{
		if(w < 1300){
			document.getElementById('ricciF').style.width=1280+'px';
			}
		else
			if(w < 1460){
				document.getElementById('ricciF').style.width=1420+'px';
			}
		}
}

function so(){
var text=""
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("win") != -1) {text=text_win;} 
else if (ua.indexOf("mac") != -1) {text=text_mac;} 
else if (ua.indexOf("linux") != -1) {text=text_linux;} 
else if (ua.indexOf("x11") != -1) {text=text_unix;} 
else {text=text_unknown;}
}
