/*********************************************** Dynamic Calendar II (By Jason Moon at http://www.jasonmoon.net) Permission granted to Dynamicdrive.com to include script in archive For this and 100's more DHTML scripts, visit http://dynamicdrive.com ***********************************************/ var ns6=document.getElementById&&!document.all var ie4=document.all var Selected_Month; var Selected_Year; var Current_Date = new Date(); var Current_Month = Current_Date.getMonth(); var Days_in_Month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); var Month_Label = new Array('Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'); var Current_Year = Current_Date.getYear(); if (Current_Year < 1000) Current_Year+=1900 var Today = Current_Date.getDate(); function Header(Year, Month) { if (Month == 1) { Days_in_Month[1] = ((Year % 400 == 0) || ((Year % 4 == 0) && (Year % 100 !=0))) ? 29 : 28; } var Header_String = Month_Label[Month] + ' ' + Year; return Header_String; } function Make_Calendar(Year, Month) { var First_Date = new Date(Year, Month, 1); var Heading = Header(Year, Month); var First_Day = First_Date.getDay() + 1; if (((Days_in_Month[Month] == 31) && (First_Day >= 6)) || ((Days_in_Month[Month] == 30) && (First_Day == 7))) { var Rows = 6; } else if ((Days_in_Month[Month] == 28) && (First_Day == 1)) { var Rows = 4; } else { var Rows = 5; } var msg_titulo = new Array(); cal_msg_titulo(2010,8,03,'47ª Exposição Feira de Animais da Região Centro Sul'); cal_msg_titulo(2010,7,04,'1º Simpósio Sergipano de Buiatria'); cal_msg_titulo(2010,6,05,'GRUPO TECNOLOGIA - REUNIÃO PARA INSTALAÇÃO'); cal_msg_titulo(2011,6,06,'39ª EXPOSIÇÃO AGROPECUÁRIA DE JATAÍ - GO'); cal_msg_titulo(2010,7,07,'EXPORURAL - Salvador'); cal_msg_titulo(2011,8,07,'9ª EXPOVEC'); cal_msg_titulo(2010,7,10,'GranExpoES 2010'); cal_msg_titulo(2011,8,10,'LEILÃO DNASERGIPE NACIONAL '); cal_msg_titulo(2010,7,11,'EXPOFEST TRÊS RIOS - RJ - DNASERGIPE PARTICIPA'); cal_msg_titulo(2010,7,12,'5ª Exposição Agropecuária de Canindé do São Francisco'); cal_msg_titulo(2010,6,13,'EXPOBONFIM 2010 E II Copa Dorper SERGIPE/BAHIA'); cal_msg_titulo(2010,9,13,'29ª Exposição Feira de Animais da Região Norte” '); cal_msg_titulo(2010,8,15,'IV EXPOSIÇÃO ESPECIALIZADA DE OVINOS DE ARARUAMA/RJ'); cal_msg_titulo(2010,9,17,'4ª Exposição Nacional da Raça Dorper'); cal_msg_titulo(2011,6,20,'1ª EXPO SIMÃO DIAS'); cal_msg_titulo(2010,3,21,'8ª EXPOVEC E 1ª COPA DORPER BAHIA/SERGIPE'); cal_msg_titulo(2011,2,21,'VIII FEINCO'); cal_msg_titulo(2010,6,22,'1ª Exposição agropecuária de Coronel João Sá'); cal_msg_titulo(2011,2,23,'APRESENTAÇÃO DO SUMÁRIO 2011'); cal_msg_titulo(2011,4,23,'EXPOSIÇÃO PECUÁRIA DE GOIANIA'); cal_msg_titulo(2011,7,24,'ITABAIANA AGROSHOW'); cal_msg_titulo(2010,10,27,'NACIONAL DO SANTA INÊS - Salvador'); cal_msg_titulo(2011,8,28,'1º Simpósio Internacional de Avaliação Animal e Qualidade de Carne '); function cal_msg_titulo(ano, mes, dia, msg) { if (msg_titulo[dia] == null && mes == Month && ano == Year) { msg_titulo[dia] = "- " + msg; } else if (mes == Month && ano == Year) { msg_titulo[dia] += "\r\n- " + msg; } } ; var HTML_String = '
'; HTML_String += ''; HTML_String += ''; var Day_Counter = 1; var Loop_Counter = 1; var MesAtual = 02-1; for (var j = 1; j <= Rows; j++) { HTML_String += ''; for (var i = 1; i < 8; i++) { if ((Loop_Counter >= First_Day) && (Day_Counter <= Days_in_Month[Month]) ) { if (msg_titulo[Day_Counter] != null) { HTML_String += ''; } else if(Day_Counter=='06' && Month==MesAtual && Year=='2012') { HTML_String += ''; } else { HTML_String += ''; } Day_Counter++; } else { HTML_String += ''; } Loop_Counter++; } HTML_String += ''; } HTML_String += '
' + Heading + '
DOMSEGTERQUAQUISEXSÁB
' + Day_Counter + '' + Day_Counter + '' + Day_Counter + '
'; cross_el=ns6? document.getElementById("Calendar") : document.all.Calendar cross_el.innerHTML = HTML_String; } function Check_Nums() { if ((event.keyCode < 48) || (event.keyCode > 57)) { return false; } } function On_Year() { var Year = document.when.year.value; if (Year.length == 4) { Selected_Month = document.when.month.selectedIndex; Selected_Year = Year; Make_Calendar(Current_Year, Selected_Month); } alert(Year); } function On_Month() { var Year = document.when.year.value; if (Year.length == 4) { Selected_Month = document.when.month.selectedIndex; Selected_Year = Year; Make_Calendar(Selected_Year, Selected_Month); } else { alert('Please enter a valid year.'); document.when.year.focus(); } } function calendar() { if (!ie4&&!ns6) return var Mid_Screen = Math.round(document.body.clientWidth / 2); document.when.month.selectedIndex = Current_Month; document.when.year.value = Current_Year; Selected_Month = Current_Month; Selected_Year = Current_Year; Make_Calendar(Current_Year, Current_Month); } function Skip(Direction) { if (Direction == '+') { if (Selected_Month == 11) { Selected_Month = 0; Selected_Year++; } else { Selected_Month++; } } else { if (Selected_Month == 0) { Selected_Month = 11; Selected_Year--; } else { Selected_Month--; } } document.when.month.selectedIndex = Selected_Month; document.when.year.value = Selected_Year; Make_Calendar(Selected_Year, Selected_Month); }