
/*navigazione js (NO:0)*/

function NAV(){if(navigator.appVersion.indexOf("MSIE")==-1){return;}
var i,k,g,lg,r=/\s*iefix/,nn='',c,cs='iefix',bv='menu';for(i=0;i<10;i++){g=document.getElementById(bv+nn);if(g){lg=g.getElementsByTagName("LI");if(lg){for(k=0;k<lg.length;k++){lg[k].onmouseover=function(){c=this.className;cl=(c)?c+' '+cs:cs;this.className=cl;};lg[k].onmouseout=function(){c=this.className;this.className=(c)?c.replace(r,''):'';};}}}nn=i+1;}}
/*topbar js (NO:1)*/

$(document).ready(function(){(function(){var fadeSpeed=200,fadeTo=0.0,topDistance=10;var topbarME=function(){$('#uberbar').fadeTo(fadeSpeed,0.7);},topbarML=function(){$('#uberbar').fadeTo(fadeSpeed,fadeTo);};var inside=false;$(window).scroll(function(){position=$(window).scrollTop();if(position>topDistance&&!inside){topbarML();$('#uberbar').bind('mouseenter',topbarME);$('#uberbar').bind('mouseleave',topbarML);inside=true;}
else if(position<topDistance){topbarME();$('#uberbar').unbind('mouseenter',topbarME);$('#uberbar').unbind('mouseleave',topbarML);inside=false;}});})();});
/*campi js (NO:3)*/

function checkForm(f){if(!f.nome.value){alert('Nome e\' un campo obbligatorio');return false;}
if(!f.cognome.value){alert('Cognome e\' un campo obbligatorio');return false;}
if(!f.telefono.value){alert('Telefono e\' un campo obbligatorio');return false;}
if(isNaN(f.telefono.value)){alert('Telefono e\' un campo numerico');return false;}
if(!f.email.value){alert('Email e\' un campo obbligatorio');return false;}
if((f.email.value.indexOf("@")==-1)||(f.email.value.indexOf(".")==-1)){alert('Email inserita non valida');return false;}
if(f.consenso_dato[1].checked==1){alert('Se non presti il consenso al trattamento dei dati personali non puoi inviare la richiesta');return false;}
return true;}
/*commenti_post js (NO:4)*/

$(document).ready(function(){getcommenti();$("#submit").click(function(){var user=$("#autore").val();var comment=$("#commento").val();var id_post=$("#id_post").val();var id_pscat=$("#categoria_post").val();var id_pscat2=$("#categoria_post2").val();$.post("/page/commenti.php",{type:"addcommento",autore:user,commento:comment,id_post:id_post,categoria_post:id_pscat,categoria_post2:id_pscat2},function(data){$("#return").html(data)});getcommenti();return false;});function getcommenti(){var id_post=$("#id_post").val();$.post("/page/commenti.php?randval="+Math.random(),{type:"getcommenti",id_post:id_post},function(data){$("#commenti").html(data)});}});
/*jconfirmaction.jquery js (NO:5)*/

(function($){jQuery.fn.jConfirmAction=function(options){var theOptions=jQuery.extend({question:"Sei sicuro ?",yesAnswer:"Si",cancelAnswer:"No"},options);return this.each(function(){$(this).bind('click',function(e){e.preventDefault();thisHref=$(this).attr('href');if($(this).next('.ask').length<=0)
$(this).after('<div class="question">'+theOptions.ask+'<br/> <span class="yes">'+theOptions.yesAnswer+'</span><span class="cancel">'+theOptions.cancelAnswer+'</span></div>');$(this).next('.ask').animate({opacity:1},300);$('.yes').bind('click',function(){window.location=thisHref;});$('.cancel').bind('click',function(){$(this).parents('.ask').fadeOut(300,function(){$(this).remove();});});});});}})(jQuery);
