function add(){
	if (navigator.userAgent.indexOf("Firefox") >= 0){
	document.getElementById('sublinks').style.top = '-23px';//'-103px';
}else if(navigator.userAgent.indexOf("MSIE 8.0") >= 0 || navigator.userAgent.indexOf("MSIE 7.0") >= 0 || navigator.userAgent.indexOf("MSIE 6.0") >= 0){
	document.getElementById('sublinks').style.top = '-23px';//'-117px';
}else if(navigator.userAgent.indexOf("MSIE 9.0") >= 0 ){
	document.getElementById('sublinks').style.top = '-20px';//'-107px';
}else{
	document.getElementById('sublinks').style.top = '-24px';//'-107px';
	}

/*if(screen.width<=1152){
		document.getElementById('menu').style.display = 'none';
		document.getElementById('menu-p').style.display = 'block';
		document.getElementById('apDiv5').style.width = screen.width+'px';
}*/

}

var fadeEffect=function(){
	return{
		init:function(id, flag, target){
			this.elem = document.getElementById(id);
			clearInterval(this.elem.si);
			this.target = target ? target : flag ? 100 : 0;
			this.flag = flag || -1;
			this.alpha = this.elem.style.opacity ? parseFloat(this.elem.style.opacity) * 100 : 0;
			this.si = setInterval(function(){fadeEffect.tween()}, 20);
		},
		tween:function(){
			if(this.alpha == this.target){
				clearInterval(this.si);
			}else{
				var value = Math.round(this.alpha + ((this.target - this.alpha) * .001)) + (1 * this.flag);
				this.elem.style.opacity = value / 100;
				this.elem.style.filter = 'alpha(opacity=' + value + ')';
				this.alpha = value
			}
		}
	}
}();

function print1(){
	var a = $('#phpFastNews>li>div').text();
	var b = $('li').onmouseover(function() {$(this).attr('id');})
	if(a != ""){
		for(var i = 0; i<= 20;i++){
		$("#print"+i).css("display","block");
		}
		}else{}
	}
	
function nascondi() {
for(var i = 0; i<= 20;i++){
		document.getElementById("print"+i).style.display = "none";
		}
}

function printDiv()
{
var titolo = $('#title').html();
var testo = $('#testo').html();
 var a = window.open('','','width=300,height=300');
 a.document.open("text/html");
 a.document.write('<div id="news" style="height:auto; border-radius:5px; background:#fff; padding:10px; -moz-border-radius:10px; -khtml-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; border:1px solid #e5e5e5; -moz-box-shadow:rgba(200,200,200,1) 0 4px 18px; -webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;  -khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px; box-shadow:rgba(200,200,200,1) 0 4px 18px;" align="center"><div id="title">'+titolo+'</div><br /><div id="text">'+testo+'</div>');
 a.document.close();
 a.print();
}

function chk_login(){
	var form = document.getElementById('fn-loginForm');
	var div = document.getElementById('loading');
	var user = document.getElementById('username');
	var pass = document.getElementById('password');
	if(user.value == ""){
		pass.style.backgroundColor = '';
		pass.style.backgroundPosition = "5px -350px";
		pass.style.border = "solid 1px #999999";
		user.style.backgroundColor = '#D84743';
		user.style.backgroundPosition = "5px -867px";
		user.style.border = "1px #911D1B solid";
		div.innerHTML = '<div style="border:#911D1B 1px solid; background:#D84743; border-radius:3px;"><font style="color:#FFF">Inserire Nome Utente!!</font></div>';
	}
	if(pass.value == ""){
		user.style.backgroundColor = '';
		user.style.backgroundPosition = "5px -852px";
		user.style.border = "solid 1px #999999";
		pass.style.backgroundColor = '#D84743';
		pass.style.backgroundPosition = "5px -365px";
		pass.style.border = "1px #911D1B solid";
		div.innerHTML = '<div style="border:#911D1B 1px solid; background:#D84743; border-radius:3px;"><font style="color:#FFF">Inserire Password!!</font></div>';
		}
	if(user.value == "" && pass.value == ""){
		user.style.backgroundColor = '#D84743';
		user.style.backgroundPosition = "5px -867px";
		user.style.border = "1px #911D1B solid";
		pass.style.backgroundColor = '#D84743';
		pass.style.backgroundPosition = "5px -365px";
		pass.style.border = "1px #911D1B solid";
		div.innerHTML = '<div style="border:#911D1B 1px solid; background:#D84743; border-radius:3px;"><font style="color:#FFF">Inserire entrambi i campi!!</font></div>';
		}
	if(user.value != "" && pass.value != ""){
		user.style.backgroundColor = '#96ED89';
		user.style.backgroundPosition = "5px -867px";
		user.style.border = "1px #45BF55 solid";
		user.style.color = '#ffffff';
		pass.style.backgroundColor = '#96ED89';
		pass.style.backgroundPosition = "5px -365px";
		pass.style.border = "1px #45BF55 solid";
		pass.style.color = '#ffffff';
		div.innerHTML = '<img src="images/loading.gif" alt="Loading..." title="Loading..."/><span>Verifico...</span>';
		form.submit();
	}
	}
