var jv_web = { timer_lat : null , init : function(){ this.testo_barra('2'); var rand = Math.round(Math.random() * 1000000); $.getJSON("http://unaproa.com//web/gallery_json?" + rand, jv_web.carica_json); } , bottone_ricerca : function(){ if(!$('#campo_ricerca').val())alert('Attenzione. Il campo ricerca risulta essere vuoto.'); else $('#form_ricerca').submit(); } , ricerca_submit : function() { if($('#testo_ricerca_normativa').val()) { $('#form_ricerca_normativa').submit() ; } } , carica_json : function(data){ // var items = []; var contatore = 0 ; $.each(data, function(key, val) { jv_web.timer_lat = "" ; // jv_web.img_sost(val['id_user'] , val['logo'] ); jv_web.timer_lat = window.setTimeout(" jv_web.img_sost('" + val['id_user'] + "' , '" + val['logo'] + "' ) ", contatore * 10000); contatore = contatore + 1 ; }); } , img_sost : function(id_user , logo){ // jv_web.timer_lat = window.setTimeout("alert('" + logo + "')", 3000); // $('#contenitore_loghi').html(logo); $("#img_loghi").fadeOut( 200); $("#img_loghi").attr("src" , "http://unaproa.com/upload/loghi/" + logo ); $("#link_loghi").attr("href" , "http://unaproa.com/web/dettaglio_soci/" + id_user); $("#img_loghi").fadeIn( 200); //alert(logo); // $('#contenitore_loghi').html(logo); //window.clearTimeout(jv_web.timer_lat) ; // window.clearTimeout(timer_var) ; } , testo_barra : function(id_tipo){ if(id_tipo=="1"){ $('#barra_ajax_1').css('background-color' , '#81abc1'); $('#barra_ajax_2').css('background-color' , '#888'); } else { $('#barra_ajax_1').css('background-color' , '#888'); $('#barra_ajax_2').css('background-color' , '#81abc1'); } $.ajax({ cache : false , type : 'post' , url : 'http://unaproa.com/web/testo_barra/' + id_tipo , success : function(htm){ $('#testo_laterale').html(htm); } }); } , // Questo fa il check sui campi ed invia la form submit_login : function(){ var username = $('#username').val(); var password = $('#password').val(); if(!username){ alert('Il campo username vuoto'); $('#username').focus(); } else if(!password){ alert('Il campo password vuoto'); $('#password').focus(); } else{ $('#box_login').submit(); } } , testo_xxx : function(){ } }