var oroscopoBaseUrl = 'http://oroscopo.leiweb.it'; $(document).ready(function(){ $("input:checkbox, input:radio, input:file").uniform(); /* --INIZIO OROSCOPO CELTICO-- */ $("#calcola_oroscopo_celtico").click(function() { var segno; var d = new Date($("#anno").val(), $("#mese").val()-1, $("#giorno").val()); for(var i=0;i=d1 && d<=d2) segno = tab[i].segno; } window.location = oroscopoBaseUrl+"/celtico/" + segno.toLowerCase() + ".shtml"; }); /* --FINE OROSCOPO CELTICO-- */ /* --INIZIO OROSCOPO CINESE-- */ $("#calcola_oroscopo_cinese").click(function() { var segno; var d = new Date(parseInt($("#anno").val()), parseInt($("#mese").val())-1, parseInt($("#giorno").val())); for(var i=0;i=d1 && d<=d2) segno = tab[i].segno; } window.location = oroscopoBaseUrl+"/cinese/" + segno + ".shtml"; }); /* --FINE OROSCOPO CINESE-- */ /* --INIZIO OROSCOPO AZTECO-- */ $("#calcola_oroscopo_azteco").click(function() { var segno; var d = new Date($("#anno").val(), $("#mese").val()-1, $("#giorno").val()); var index=((parseInt($("#anno").val(),10)-1894)%13)+1; var periodiSegni = eval('lista'+index); for (var i = 0; i=dal && d<=al) { segno=periodo.segno; } } window.location = oroscopoBaseUrl+"/azteco/" + segno + ".shtml"; return false; }); /* --FINE OROSCOPO AZTECO-- */ /* --INIZIO SELETTORE OROSCOPO COPPIA-- */ var coppia1=''; var coppia2=''; $('.oroscopo-red li').click(function(){ if(coppia1 != ''){ if(coppia1.indexOf('last-row') > 0){ var lstR = coppia1.replace(' last-row', ''); $('#' + lstR + '-a').children().css('color','#C20069'); $('#' + lstR + '-a').attr('class', lstR + ' last-row'); $('#' + lstR + '-a').attr('id', lstR); }else{ $('#' + coppia1 + '-a').children().css('color','#00366D'); $('#' + coppia1 + '-a').attr('class', coppia1); $('#' + coppia1 + '-a').attr('id', coppia1); } } coppia1 = $(this).attr('class'); var coppiaId =''; if(coppia1.indexOf('last-row') > 0){ coppiaId = coppia1.replace(' last-row', ''); $(this).attr('class', coppiaId + '-a last-row'); }else{ coppiaId = coppia1; $(this).attr('class', coppiaId + '-a'); } $(this).attr('id', coppiaId + '-a'); $(this).children().css('color','white') goToCoppia(coppia1,coppia2); return false; }); $('.oroscopo-blue li').click(function(){ if(coppia2 != ''){ if(coppia2.indexOf('last-row') > 0){ var lstR = coppia2.replace(' last-row', ''); $('#' + lstR + '-a').children().css('color','#00366D'); $('#' + lstR + '-a').attr('class', lstR + ' last-row'); $('#' + lstR + '-a').attr('id', lstR); }else{ $('#' + coppia2 + '-a').children().css('color','#00366D'); $('#' + coppia2 + '-a').attr('class', coppia2); $('#' + coppia2 + '-a').attr('id', coppia2); } } coppia2 = $(this).attr('class'); var coppiaId =''; if(coppia2.indexOf('last-row') > 0){ coppiaId = coppia2.replace(' last-row', ''); $(this).attr('class', coppiaId + '-a last-row'); }else{ coppiaId = coppia2; $(this).attr('class', coppiaId + '-a'); } $(this).attr('id', coppiaId + '-a'); $(this).children().css('color','white') goToCoppia(coppia1,coppia2); return false; }); /* --FINE SELETTORE OROSCOPO COPPIA-- */ /* --INIZIO SELETTORE VASCHETTA BOTTOM-- */ var oroscopotype=''; var oroscoposegno=''; var loc = document.location.href; if(loc.indexOf('giorno') > 0){ $('#uniform-oro-giorno').hide().next().hide(); $('#oro-settimana').attr('checked', true); oroscopotype = 'oro-settimana'; $.uniform.update(); }else if(loc.indexOf('settimana') > 0){ $('#uniform-oro-settimana').hide().next().hide(); $('#oro-giorno').attr('checked', true); oroscopotype = 'oro-giorno'; $.uniform.update(); }else if(loc.indexOf('mese') > 0){ $('#uniform-oro-mese').hide().next().hide(); $('#oro-giorno').attr('checked', true); oroscopotype = 'oro-giorno'; $.uniform.update(); }else if(loc.indexOf('anno') > 0){ $('#uniform-oro-anno').hide().next().hide(); $('#oro-giorno').attr('checked', true); oroscopotype = 'oro-giorno'; $.uniform.update(); } $('.select-oroscopo').click(function(){ $('.select-oroscopo').attr('checked', false); oroscopotype = $(this).attr('id'); $('#'+oroscopotype).attr('checked', true); $.uniform.update(); if(oroscoposegno != '' && oroscopotype!=''){ goToOroscopo(oroscopotype,oroscoposegno); } return false; }); $('.select-segno').click(function(){ oroscoposegno = $(this).attr('id'); if(oroscoposegno != '' && oroscopotype!=''){ goToOroscopo(oroscopotype,oroscoposegno); } return false; }); /* --FINE SELETTORE VASCHETTA BOTTOM-- */ var tday = new Date(); if($('#giorno').size()>0){ $('#giorno').val(tday.getDate()); $.uniform.update(); } if($('#mese').size()>0){ $('#mese').val(tday.getMonth() + 1); $.uniform.update(); } }); /*-------------------------*/ /* FINE DOCUMENT READY */ /*-------------------------*/ function goToCoppia(segno1,segno2){ if(segno1.indexOf('last-row') > 0){ segno1 = segno1.replace('last-row',''); } segno1 = segno1.replace(' ', ''); segno1 = segno1.replace('-lei', ''); segno1 = segno1.substring(3,segno1.length); if(segno2.indexOf('last-row') > 0){ segno2 = segno2.replace(' last-row',''); } segno2 = segno2.replace(' ', ''); segno2 = segno2.replace('-lui', ''); segno2 = segno2.substring(3,segno2.length); if(segno1!='' && segno2!=''){ document.location=oroscopoBaseUrl+'/risultati_oroscopo.shtml?mese=1&segno1='+segno1+'&segno2='+segno2; } } function goToOroscopo(oroscopotype,oroscoposegno){ var urltoGo = ''; if(oroscopotype == 'oro-giorno'){ urltoGo = oroscopoBaseUrl + '/giorno/' + oroscoposegno.charAt(0).toUpperCase() + oroscoposegno.slice(1) + '-oggi.shtml'; }else if(oroscopotype == 'oro-settimana'){ urltoGo = oroscopoBaseUrl + '/settimana/' + oroscoposegno + '-settimanale.shtml'; }else if(oroscopotype == 'oro-mese'){ urltoGo = oroscopoBaseUrl + '/mese/' + oroscoposegno + '.shtml'; }else if(oroscopotype == 'oro-anno'){ urltoGo = oroscopoBaseUrl + '/anno/2011/' + oroscoposegno + '.shtml'; } document.location = urltoGo; return false; } /** * Per selezionare la data nella home dell'oroscopo del giorno */ function getToday(){ var RightNow = new Date(); var hrNow = RightNow.getHours(); var mnNow = RightNow.getMinutes(); var scNow = RightNow.getSeconds(); var miNow = RightNow.getTime(); var mon = RightNow.getMonth() + 1; var date = RightNow.getDate(); var year = RightNow.getYear(); if(navigator.appName == "Netscape") { var year = RightNow.getYear() +1900; } var day = RightNow.getDay(); var zday=new Array(7) if (day==0) {zday="Domenica"}; if (day==1) {zday="Lunedì"}; if (day==2) {zday="Martedì"}; if (day==3) {zday="Mercoledì"}; if (day==4) {zday="Giovedì"}; if (day==5) {zday="Venerdì"}; if (day==6) {zday="Sabato"}; var zmon = new Array(12) if (mon==1) {zmon="Gennaio"}; if (mon==2) {zmon="Febbraio"}; if (mon==3) {zmon="Marzo"}; if (mon==4) {zmon="Aprile"}; if (mon==5) {zmon="Maggio"}; if (mon==6) {zmon="Giugno"}; if (mon==7) {zmon="Luglio"}; if (mon==8) {zmon="Agosto"}; if (mon==9) {zmon="Settembre"}; if (mon==10) {zmon="Ottobre"}; if (mon==11) {zmon="Novembre"}; if (mon==12) {zmon="Dicembre"}; document.write(""+date+" "+zmon+" "); } /** * Per selezionare la data nella home dell'oroscopo del giorno */ function getTomorrow(){ var tomorrow = new Date(); tomorrow.setDate(tomorrow.getDate()+1); var hrNow = tomorrow.getHours(); var mnNow = tomorrow.getMinutes(); var scNow = tomorrow.getSeconds(); var miNow = tomorrow.getTime(); var mon = tomorrow.getMonth() + 1; var date = tomorrow.getDate(); var year = tomorrow.getYear(); if(navigator.appName == "Netscape") { var year = tomorrow.getYear() +1900; } var day = tomorrow.getDay(); var zday=new Array(7) if (day==0) {zday="Domenica"}; if (day==1) {zday="Lunedì"}; if (day==2) {zday="Martedì"}; if (day==3) {zday="Mercoledì"}; if (day==4) {zday="Giovedì"}; if (day==5) {zday="Venerdì"}; if (day==6) {zday="Sabato"}; var zmon = new Array(12) if (mon==1) {zmon="Gennaio"}; if (mon==2) {zmon="Febbraio"}; if (mon==3) {zmon="Marzo"}; if (mon==4) {zmon="Aprile"}; if (mon==5) {zmon="Maggio"}; if (mon==6) {zmon="Giugno"}; if (mon==7) {zmon="Luglio"}; if (mon==8) {zmon="Agosto"}; if (mon==9) {zmon="Settembre"}; if (mon==10) {zmon="Ottobre"}; if (mon==11) {zmon="Novembre"}; if (mon==12) {zmon="Dicembre"}; document.write(""+date+" "+zmon+" "); }