// JavaScript Document $(document).ready(function(){ //$('#select_corsi').bind('change',function(){ recupero_date(); }); $('a.lightbox').lightBox(); //video $('a.media').media({ width: 421, autoplay: false }); $('#slideScuola').cycle({ // 'pager':'#pagerciclahome', // pause:1, // 'timeout': 8000 }); $('#slideProgetto').cycle({ // 'pager':'#pagerciclahome', // pause:1, // 'timeout': 8000 }); $('.ciclahome').show().cycle({ 'pager':'#pagerciclahome', pause:1, 'timeout': 8000 }); $('.ciclahome_news').show().cycle({ 'pager':'#pagerciclahome_news', pause:1, 'timeout': 8000 }); }); function seleziona_sede(){ var id_corso = $('select#select_corsi option:selected').val(); var id_sede_prog = $('#id_sede_prog').val(); var lingua = "it"; rand = uuid(); $('#dettagli_sede').load('/_ajax/corsi.php?act=seleziona_sede&id_corso=' + id_corso + '&id_sede_prog=' + id_sede_prog + '&rand=' + rand + '&lingua=' + lingua); $('#dettagli_sede').show(); }// fine funzione seleziona sede function uuid(){ // Private array of chars to use var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); var len = null; var radix = null; var chars = CHARS, uuid = [], rnd = Math.random; radix = radix || chars.length; if (len) { // Compact form for (var i = 0; i < len; i++) uuid[i] = chars[0 | rnd()*radix]; } else { // rfc4122, version 4 form var r; // rfc4122 requires these characters uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'; uuid[14] = '4'; // Fill in random data. At i==19 set the high bits of clock sequence as // per rfc4122, sec. 4.1.5 for(var i = 0; i < 36; i++) { if (!uuid[i]) { r = 0 | rnd()*16; uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r & 0xf]; } } } return uuid.join(''); } function recupero_date(){ var id_corso = $('select#select_corsi option:selected').val(); var id_sede = $('select#select_sedi option:selected').val(); var lingua = "it"; var rand = uuid(); $('#dettagli_data').load('/_ajax/corsi.php?act=recupero_date&id_corso=' + id_corso + '&id_sede=' + id_sede + '&rand=' + rand + '&lingua=' + lingua); $('#dettagli_data').show(); }// fine funzione recupero date function vuoto(str){ if( (str == null) || (str == '') || (str == 'undefined') || (str == 0) || (isNaN(str) == true) ){ return true; } else{ return false; } }// fine funzione vuoto function nonvuoto(str){ if( (str != null) && (str != '') && (str != 'undefined') && (str != 0) && (isNaN(str) == false) ){ return true; } else{ return false; } }// fine funzione non vuoto function vuotostr(str){ if( (str == null) || (str == '') || (str == 'undefined') || (str == 0) ){ return true; } else{ return false; } }// fine funzione vuoto str function nonvuotostr(str){ if( (str != null) && (str != '') && (str != 'undefined') && (str != 0) ){ return true; } else{ return false; } }// fine funzione non vuoto str