// 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 = '20100913,20100915,20100920,20100922,20100927,20100929,20101011,20101013,20101018,20101020,20101025,20101027,20101101,20101103,20101110,20101115,20101117,20101122,20101129,20101201,20101206,20101208,20101213,20101215,20101220,20101222,20101227,20101229,20110103,20110105,20110112,20110110,20110117,20110119,20110124,20110126,20110131,20110202,20110207,20110209,20110214,20110216,20110221,20110223,20110228,20110302,20110309,20110307,20110316,20110314,20110323,20110321,20110328,20110330,20110404,20110406,20110411,20110413,20110418,20110420,20110425,20110427,20110502,20110504,20110509,20110511,20110516,20110518,20110523,20110525,20110530,20110601,20110606,20110608,20110613,20110615,20110620,20110622,20110627,20110629,20110704,20110706,20110711,20110713,20110718,20110720,20110725,20110727,20110801,20110803,20110808,20110810,20110815,20110817,20110822,20110824,20110829,20110831,20110905,20110907,20110912,20110914,20110919,20110921,20110926,20110928,20111003,20111005,20111010,20111012,20111017,20111019,20111024,20111026,20111031,20111102,20111107,20111109,20111114,20111116,20111121,20111123,20111128,20111130,20111205,20111207,20111212,20111214,20111219,20111221,20111226,20111228,20101108,20101006,'; }else{ baddate = '20100913,20100920,20101004,20101013,20101018,20101020,20101025,20101027,20101206,20101215,20101213,20101220,20101222,20101227,20101229,20110103,20110105,20110110,20110112,20110117,20110119,20110124,20110126,20110131,20110202,20110207,20110209,20110214,20110216,20110221,20110223,20110228,20110302,20110307,20110309,20110314,20110316,20110321,20110323,20110328,20110330,20110404,20110406,20110411,20110413,20110418,20110420,20110425,20110427,20110502,20110504,20110509,20110511,20110516,20110518,20110523,20110525,20110530,20110601,20110606,20110608,20110613,20110615,20110620,20110622,20110627,20110629,20110704,20110706,20110711,20110713,20110718,20110720,20110725,20110727,20110801,20110803,20110808,20110810,20110815,20110817,20110822,20110824,20110829,20110831,20110905,20110907,20110912,20110914,20110919,20110921,20110926,20110928,20111003,20111005,20111010,20111012,20111017,20111019,20111024,20111026,20111031,20111102,20111107,20111109,20111114,20111116,20111121,20111123,20111128,20111130,20111205,20111207,20111212,20111214,20111219,20111221,20111226,20111228,20101011,20101101,20101103,20101108,'; } 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