// JavaScript Document function ultimos_dias(mes,p_year){ ultimoDiadoMes = new Array() if ((p_year % 4) == 0) { if ((p_year % 100) == 0 && (p_year % 400) != 0){ ultimoDiadoMes = Array(0,31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); }else{ // anos bissestos ultimoDiadoMes = Array(0,31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); } }else{ ultimoDiadoMes = Array(0,31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); } return ultimoDiadoMes[mes]; } function exibeSemna(semana,tmp){ var inner=''; for(i=0;i'+semana[i]+'' } return inner; } function exibeDias(mes,ano,tmp){ os = navigator.appVersion.toLowerCase(); osd = os.indexOf("windows"); if(osd>0){ os ='mac' }else{ os ='win' } mesE = new Array(" ","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");// precisa disso pra manipular mes para pegar o primeiro dia var d = new Date(", 1 "+mesE[mes]+" "+ano+" 00:01:01 UTC");//Primeiro dia do Mes var semana = d.getUTCDay(); //SEMANA var uDia = ultimos_dias(mes,ano) var inner = ''; // exibe dias aantes de começar o mes pac = 3; dhoje = new Date(); diahoje = dhoje.getDate(); meshoje = dhoje.getMonth()+1; anohoje = dhoje.getFullYear(); for(i=0;i'; } // exibe os dias do mes pacday =document.getElementById('pac').value; cruisertipe =document.getElementById('cruiser').value; dsc=0; if(cruisertipe=='938'){ baddate = '20120620,20120618,20120625,20120613,20120611,20120606,20120409,20120326,20120321,20120319,20120604,20120314,20120307,20120213,20120208,20120627,20120702,20120730,20120723,20120725,20120827,20120829,20120903,20120910,20120912,20120917,20121001,20121003,20121008,20121010,20121015,20121017,20121022,20121024,20121029,20121031,20121112,20121114,20121119,20121121,20121126,20121128,20121203,20120507,20120509,20120516,20120521,20120523,20120528,20120423,20120425,20120411,'; }else{ baddate = '20120312,20120208,20120806,20120402,20120404,20120409,20120411,20120507,20120509,20120514,20120530,20120606,20120613,20120620,20120625,20120627,20120423,20120418,'; } if(pacday == 3 || pacday == 6){ sq=1;} if(pacday == 4){sq=3;} if(mes<10){mess='0'+mes;}else{mess=mes;} if(diahoje<10){diahoje = '0'+diahoje;} mesdiahoje=(anohoje+''+meshoje+''+diahoje)*1 for(i=1;i<=uDia;i++){ var ds = new Date(", "+i+" "+mesE[mes]+" "+ano+" 00:01:01 UTC");//Primeiro dia do Mes var ss = ds.getUTCDay(); //SEMANA if(i<10){dia='0'+i;}else{dia=i;} xdiamesano = ano+''+mess+''+dia; iof = baddate.indexOf(xdiamesano); if(mes<10){mescomparacao='0'+mes}else{mescomparacao=mes} mesdia = (ano+''+mescomparacao+''+dia)*1; if(sq==ss && dsc==0 && iof == -1 && mesdiahoje < mesdia ){ inner = inner+''.replace(/actionds/,tmp.replace(/dia/,dia).replace(/mes/,mes).replace(/ano/,ano))+dia+''; dsc++; }else{ if(dsc < pacday && dsc > 0){ dsc++; color=' background:#C7FAD2 '; if(dsc==(pacday)){dsc=0;} }else{ color=''; } inner = inner+''+dia+''; } } return inner; } function criaCalendario(mes,ano,local,tmp){ var d = new Date(); if((mes*1)<1){ var mes = d.getMonth()+1; // MES var ano = d.getFullYear(); // ANO } var semana = d.getDay(); //SEMANA var dia = d.getDate(); //DIA var dSemana = Array("D","S","T","Q","Q","S","S"); var meses = Array('',"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"); var pmes = (mes*1)+1; // proximo mes var pano = ano; // proximo mes var ames = (mes*1)-1; // anterior mes var aano = ano; // anterior mes if(pmes==13){ pmes = 1; pano = (ano*1)+1 } if(ames==0){ ames = 12; aano = (ano*1)-1 } // Coloca Links var inner = '
'; var inner = inner+' < ' var inner = inner+' 0 ' var inner = inner+' > ' var inner = inner+meses[mes]+' '+ano+'
'; var inner = inner+exibeSemna(dSemana,tmp); var inner = inner+exibeDias(mes,ano,tmp); var inner = inner+'
'; document.getElementById(local).innerHTML = inner; } function showCalendar(){ document.getElementById('calendario').style.visibility='visible'; document.getElementById('calendario').style.display=''; } function CompilaFlash(arq,largura,altura,parametro,dia,skin) { document.write(""+ ""+ ""+ ""+ ""+ ""+ ""+ ""); } function passengers() { document.getElementById('nome').style.color=''; document.getElementById('nome').style.backgroundColor=''; document.getElementById('email').style.color=''; document.getElementById('email').style.backgroundColor=''; var err = 0; tabela = document.getElementById('table_pax').getElementsByTagName('input'); total = tabela.length; for(i=0;i0){ document.getElementById(dv).style.display=''; document.getElementById(dv+'1').style.background='url(img/bgm.jpg)'; document.getElementById(dv+'1').style.color='#006E00'; } } function valida_highlight(campo,status) { if(status == 1) { document.getElementById(campo).style.backgroundColor = '#f00'; document.getElementById(campo).style.color = '#fff'; } else { document.getElementById(campo).style.backgroundColor = ''; document.getElementById(campo).style.color = ''; } } function valida_form(form,f) { campos = f.split(','); for(i=0;i