
function getInternetExplorerVersion()
{
   var rv = -1; // Return value assumes failure.
   if (navigator.appName == 'Microsoft Internet Explorer')
   {
      var ua = navigator.userAgent;
      var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
      if (re.exec(ua) != null)
         rv = parseFloat( RegExp.$1 );
   }
   return rv;
}


function bol() {
	if(getInternetExplorerVersion()==6) {
		$(document.body).append('<div style="position: absolute; width: 100%; height: 42px; background: url(gfx/noIE.png) 0 0 no-repeat; background-color: #faffcf; border-bottom: 2px solid #ffd71f; color: #555555; top: 0px; font-family: Verdana; font-size: 10pt;"><div style="padding-left: 40px;"><b>Rilevato Internet Explorer 6. Consigliamo di aggiornare il browser internet per migliorare l\'esperienza di navigazione</b><br /><a href="http://www.getfirefox.com" style="font-size: 7.5pt; text-decoration: none;"><img src="gfx/ib/firefox.png" align="middle"  border="0" />&nbsp;Firefox</a>&nbsp;<a href="http://www.apple.com/safari/download" style="font-size: 7.5pt; text-decoration: none;"><img src="gfx/ib/safari.png" align="middle"  border="0" />&nbsp;Safari</a>&nbsp;<a href="http://www.opera.com/download" style="font-size: 7.5pt; text-decoration: none;"><img src="gfx/ib/opera.png" align="middle"  border="0" />&nbsp;Opera</a>&nbsp;<a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx" style="font-size: 7.5pt; text-decoration: none;"><img src="gfx/ib/ie.png" align="middle" border="0" />&nbsp;Explorer &gt; 6</a>&nbsp;</div>');
		$('#headerWrapper').css('background-image',"url('gfx/0/canvasTopIE.png')");
		$('#canvasmnu').css('background-image',"url('gfx/0/canvasMnuIE.png')");
		$('#canvasmid1').css('background-image',"url('gfx/0/canvasMidIE.png')");
		$('#canvasmid2').css('background-image',"url('gfx/0/canvasMidIE.png')");
		$('#canvasmid3').css('background-image',"url('gfx/0/canvasMidIE.png')");
		document.getElementById('canvasbtm').src='gfx/0/canvasMidIE.png';
		}
}
function fontsizeto(v) {

	$(document.body).animate({
			fontSize: v+'pt'
			},700);
			
			
	$.ajax({
		type: "POST",
		url: "ajax/storeCharDim.php",
		data: 'd='+v,
		dataType: 'json',	
		beforeSend: function(x){},
		success: function(msg)
			{
			
			
	
			}
		});
	
	
	}
	
function themeto(t) {
	
	$.ajax({
		type: "POST",
		url: "ajax/settheme.php",
		data: 't='+t,
		dataType: 'json',	
		beforeSend: function(x){},
		success: function(msg)
			{
			notify("Stile impostato correttamente. Cambiare pagina o aggiornare per vedere lo stile impostato.");
			}
		});
	
	}



function setinterest(i,s) {
	
	$.ajax({
		type: "POST",
		url: "ajax/setInterest.php",
		data: 'i='+i+'&s='+s,
		dataType: 'json',	
		beforeSend: function(x){},
		success: function(msg)
			{
			notify('Interessi utente modificati');
			//~ alert('Interessi utente modificati');
			}
		});
	
	}

function setUserImage(f) {
	$.ajax({
		type: "POST",
		url: "ajax/setImage.php",
		data: 'f='+f,
		dataType: 'json',	
		beforeSend: function(x){},
		success: function(msg)
			{
			notify('Nuova immagine impostata');
			}
		});
	
	}
	
function notify(txt) {
	yoffset=$(document).scrollTop();
	//~ alert(yoffset);
	// alert($('#barNotify').css('top'));
	if( $('#barNotify') ) $('#barNotify').remove();
	$(document.body).append('<div id="barNotify" style="position: absolute; width: 100%; height: 30px; background-color: #faffcf; border-bottom: 2px solid #ffd71f; color: #555555; top: -35px; font-family: Verdana; font-size: 10pt;"><b>'+txt+'</b></div>');
	$('#barNotify').css('top', (yoffset-30)+'px');
	$('#barNotify').animate({
			top: (yoffset + 'px')
			},300,"linear", function(){ 
			$(window).scroll( function() { $('#barNotify').remove(); } );
			window.setTimeout( 'unnotify()', 2000 ) 
			});	
}

function pnotify(txt) {
	yoffset=$(document).scrollTop();
	//~ alert(yoffset);
	// alert($('#barNotify').css('top'));
	if( $('#barNotify') ) $('#barNotify').remove();
	$(document.body).append('<div id="barNotify" style="position: absolute; width: 100%; height: 30px; background-color: #faffcf; border-bottom: 2px solid #ffd71f; color: #555555; top: -35px; font-family: Verdana; font-size: 10pt;"><b>'+txt+'</b></div>');
	$('#barNotify').css('top', (yoffset-30)+'px');
	$('#barNotify').animate({
			top: (yoffset + 'px')
			},300,"linear", function(){ 
			$(window).scroll( function() { $('#barNotify').remove(); } );
			});	
}

function pnotifyEx(txt, h) {
	yoffset=$(document).scrollTop();
	//~ alert(yoffset);
	// alert($('#barNotify').css('top'));
	if( $('#barNotify') ) $('#barNotify').remove();
	$(document.body).append('<div id="barNotify" style="position: absolute; width: 100%; height: '+h+'px; background-color: #faffcf; border-bottom: 2px solid #ffd71f; color: #555555; top: -35px; font-family: Verdana; font-size: 10pt;"><b>'+txt+'</b></div>');
	$('#barNotify').css('top', (yoffset-30)+'px');
	$('#barNotify').animate({
			top: (yoffset + 'px')
			},300,"linear", function(){ 
			$(window).scroll( function() { $('#barNotify').remove(); } );
			});	
}


function unnotify() {
	if( $('#barNotify') ) {
		yoffset=$(document).scrollTop();
		$('#barNotify').animate({
					top: (yoffset-30)+'px'
					},300,"linear", function() { $('#barNotify').remove(); });
		}
}


function submitPoll() {
	v=0;
	rad = document.formSondaggio.radRispostaSondaggio;
	for(j=0;j<rad.length;j++)
	 if(rad[j].checked) v = 1;
	if(v)document.formSondaggio.submit();
	else notify('Devi scegliere una risposta per votare');
	}
