var bigcal = false;
var calbox = 'smcal';
function gobig(){if(!bigcal){location='http://floridausawrestling.org/Information.htm?ms=m9';}else{return;}}
function calinit(size,box){
aprev = '<';
anext = '>';
if(size){
bigcal = true;
aprev = '<img border=0 src="http://floridausawrestling.org/images/previous.gif" style="cursor:pointer;">';
anext = '<img border=0 src="http://floridausawrestling.org/images/next.gif" style="cursor:pointer;">';
}
if(box){calbox = box;}
jscal();}
function jscal(date) {
ccss = 'smjscal';
if(bigcal){ccss = 'bigjscal';}
if(!date){date = new Date();}
else{date = new Date(date);}
today = new Date();
day = date.getDate();
month = date.getMonth();
year = date.getFullYear();
months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
this_month = new Date(year, month, 1);
next_month = new Date(year, month + 1, 1);
prev_month = new Date(year, month - 1, 1);
first_week_day = this_month.getDay();
days_in_this_month = Math.round((next_month.getTime() - this_month.getTime()) / (1000 * 60 * 60 * 24));
var wd=new Array(['06/08/2012','06/10/2012','2012 Sunshine State Games',3],['07/15/2012','07/21/2012','2012 Cadet and Junior Men National Championships',3],['05/11/2012','05/13/2012','2012 Body Bar Women`s National Championships',3],['05/25/2012','05/27/2012','2012 Southeast Regional Freestyle Greco-Roman and Folkstyle Championships',3],['06/12/2012','06/16/2012','2012 Cadet National Dual Championships',3],['06/26/2012','06/30/2012','2012 Junior National Dual Championships',3],['06/26/2012','06/28/2012','2012 Kids FS/GR National Chamipionships',3],['05/11/2012','05/13/2012','2012 Florida Freestyle and Greco-Roman State Championships',3],['06/06/2012','06/10/2012','2012 Schoolboy National Dual Championships',3],['03/30/2012','04/01/2012','2012 USA Folkstyle National Championships',3],['08/25/2012','08/25/2012','FAWA Annual Board Meeting',3],['03/23/2012','03/25/2012','FILA Pan American Olympic Games Qualifying Tournament',3],['09/24/2011','09/24/2011','Spring Hill Iron Man 3',1],['10/15/2011','10/15/2011','Spring Hill Pre Season Duals',1],['10/29/2011','10/29/2011','South Miami Pre-Season Classic at Jackson High School',1],['10/08/2011','10/08/2011','Wellington Duals',1],['09/03/2011','09/03/2011','Brandon Tournament 9/3',1],['09/17/2011','09/17/2011','Brandon Tournament 9/17',1],['10/01/2011','10/01/2011','Brandon Tournament 10/1',1],['10/08/2011','10/08/2011','Brandon Tournament 10/8',1],['10/22/2011','10/22/2011','Brandon Tournament 10/22',1],['11/05/2011','11/05/2011','Brandon Tournament 11/5',1],['10/29/2011','10/29/2011','Lakeland Open 10/29',1],['09/24/2011','09/24/2011','Lakeland Open 9/24',1],['09/17/2011','09/17/2011','River City Rumble',1],['09/17/2011','09/17/2011','Bear Classic 9/17/11',1],['07/13/2012','07/19/2012','2012 Cadet and Junior Women National Championships and Duals',3],['09/17/2011','09/17/2011','Plantation Patriots Wrestling Tournament',1],['10/01/2011','10/01/2011','Olympic Heights Open 10/1/11',1],['09/18/2011','09/18/2011','CWC Challenge I',1],['09/10/2011','09/10/2011','Spring Hill Iron Man 2',1],['10/08/2011','10/08/2011','Battle at the Dawg Pound',1],['11/25/2011','11/26/2011','37th Annual Seahorse Open (Kids-Cadets)',1],['09/24/2011','09/24/2011','Fall Gladiator Throwdown',1],['11/05/2011','11/05/2011','Fall Gladiator Challenge 11/5',1],['10/01/2011','10/01/2011','Spartan Express Open 10/1',1],['10/15/2011','10/15/2011','Wrangler Tournament',1],['10/29/2011','10/29/2011','Bear Pre-Season Classic',1],['11/05/2011','11/05/2011','Kowboys Fall Classic #1',1],['03/04/2012','03/04/2012','2012 Florida Cadet, Junior and Open Folkstyle State Championships',5],['11/23/2011','11/23/2011','37th Annual Seahorse Duals',1],['11/26/2011','11/26/2011','37th Annual Seahorse Open (Junior-Open-Masters)',1],['10/22/2011','10/22/2011','Your Options Insurance 2011 SD Open',1],['12/03/2011','12/03/2011','Calvary Call Out-1',1],['12/10/2011','12/10/2011','Calvary Call Out-2',1],['12/17/2011','12/17/2011','Calvary Call Out-3',1],['10/29/2011','10/29/2011','Halloween Havoc At Coral Springs High',1],['12/28/2011','12/28/2011','43rd Annual Sunshine Open (Junior Varisty)',1],['11/19/2011','11/19/2011','Redskin-1',1],['10/22/2011','10/22/2011','Falcon Fury-I',1],['11/12/2011','11/12/2011','2011 Fall Romp In The Swamp',1],['03/03/2012','03/03/2012','2012 Florida Rookie Folkstyle State Championships',5],['03/03/2012','03/03/2012','2012 Florida JV Folkstyle State Championships',5],['03/04/2012','03/04/2012','2012 Florida Kids Folkstyle State Championships',5],['11/12/2011','11/12/2011','McIntosh Match Up',1],['12/24/2011','12/24/2011','Brandon Tournament 12/24',1],['01/07/2012','01/07/2012','Brandon Kids/Cadets Tournament 1/7',1],['01/14/2012','01/14/2012','Brandon Kids/Cadets Tournament 1/14',1],['04/28/2012','04/29/2012','RFLX Folkstyle Wrestling Challenge',3],['12/28/2011','12/28/2011','43rd Annual Sunshine Open (High School Division)',1],['12/28/2011','12/28/2011','43rd Annual Sunshine Open (14 and Under)',1],['12/28/2011','12/28/2011','43rd Annual Sunshine Open (College / Open Division)',1],['02/25/2012','02/25/2012','4th Annual Lake County Show Down',4],['02/25/2012','02/25/2012','Bear Brawl',4],['04/14/2012','04/14/2012','Bear Classic',3],['05/05/2012','05/05/2012','Bear Open',3],['02/25/2012','02/25/2012','Brandon Tournament 2/25',4],['03/10/2012','03/10/2012','Brandon Tournament 3/10',3],['03/24/2012','03/24/2012','Brandon Tournament 3/24',3],['04/07/2012','04/07/2012','Brandon Tournament 4/7',3],['04/21/2012','04/21/2012','Brandon Tournament 4/21',3],['01/15/2012','01/15/2012','USA SE Regional Training Center Rookie Clinic',1],['01/22/2012','01/22/2012','SE Regional Training Center Rookie Clinic #2',3],['03/30/2012','03/31/2012','13th Annual Marine Corps Ironman Challenge',3],['03/10/2012','03/10/2012','Introduction to Olympic Freestyle Wrestling',3],['03/31/2012','03/31/2012','Lakeland Open 3/31/12',3],['04/14/2012','04/14/2012','Lakeland Open 4/14/12',3],['05/05/2012','05/05/2012','Lakeland Open 5/5/12',3],['02/25/2012','02/25/2012','Wellington Kids Duals',3],['02/04/2012','02/04/2012','Southeast Regional Training Center Youth Wrestling Rookie Clinic',1],['02/26/2012','02/26/2012','CWC Challenge I',3],['05/19/2012','05/19/2012','Wellington Freestyle Duals',3],['03/17/2012','03/17/2012','Introduction to Olympic Freestyle Wrestling #2',3],['03/24/2012','03/24/2012','Introduction to Olympic Freestyle Wrestling #3',3]);
htm = '<table class='+ccss+' border=0 cellpadding=0 cellspacing=2>';  
htm += '<tr><th onclick="jscal(\''+prev_month+'\');" onmouseover="stip(\'Previous Month\',120)" onmouseout="htip();">'+aprev+'</th>';
htm += '<th colspan=5 onclick="jscal();" onmouseover="stip(\'Current Month\',120)" onmouseout="htip();">' + months[month] + ' ' + year + '</th>';
htm += '<th onclick="jscal(\''+next_month+'\');" onmouseover="stip(\'Next Month\',120)" onmouseout="htip();">'+anext+'</th></tr>';
if(bigcal){htm += '<tr class=mh onclick="eval(\'gobig()\')"><td>Sunday</td><td>Monday</td><td>Tuesday</td><td>Wednesday</td><td>Thursday</td><td>Friday</td><td>Saturday</td></tr>';}
else{htm += '<tr class=mh onclick="eval(\'gobig()\')"><td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td></tr>';}
htm += '<tr valign=top onclick="eval(\'gobig()\')">';
for(week_day = 0; week_day < first_week_day; week_day++) {htm += '<td>&nbsp;</td>';}
week_day = first_week_day;
for(day_counter = 1; day_counter <= days_in_this_month; day_counter++) {
week_day %= 7;
if(week_day == 0){htm += '</tr><tr valign=top onclick="eval(\'gobig()\')">';}
show_day = day_counter;
if(today.getDate() == day_counter && today.getMonth() == month){show_day = '<font color=red>' + show_day + '</font>';}
tdhtm = '';msg = '';
for (var i=0;i < wd.length;i++){
s = wd[i][0].split('/');sm = parseInt(s[0]*1);sd = parseInt(s[1]*1);sy = parseInt(s[2]*1);
e = wd[i][1].split('/');em = parseInt(e[0]*1);ed = parseInt(e[1]*1);ey = parseInt(e[2]*1);
if(year >= sy && year <= ey && (month+1) >= sm && (month+1) <= em && day_counter >= sd && day_counter <= ed){
rmsg = '';
if(wd[i][3] == 0){rmsg = "<font color=red><b>Cancelled<b></font>";}
if(wd[i][3] == 3){rmsg = "<font color=blue>Upcoming</font>";}
if(bigcal){if(wd[i][3] == 4){rmsg = "<a class=reg href='http://floridausawrestling.org/Login.htm?ms=m6'>Register&nbsp;Now!</a>";}
if(wd[i][3] == 5){rmsg = "<a class=reg href='http://floridausawrestling.org/Login.htm?ms=m6'>Register&nbsp;&nbsp;Now!</a>";}}
else{if(wd[i][3] == 4){rmsg = "<a class=reg href=#>Register&nbsp;Only</a>";}
if(wd[i][3] == 5){rmsg = "<a class=reg href=#>Register&nbsp;&&nbsp;Pay</a>";}}
if(wd[i][3] == 2){rmsg = "<font color=green>Online Registration is Closed</font>";}
if(wd[i][3] == 1){rmsg = "<font color=green>Completed</font>";}
msg += '<li>'+wd[i][2]+' '+rmsg+'</li>';}}
if(bigcal){
tdhtm = '<td><b>'+ show_day+'</b>';
if(msg.length){tdhtm = '<td class=e>'+ show_day +'<br>'+ msg;}}
else{
tdhtm = '<td>'+ show_day;
if(msg.length){tdhtm = '<td class=e onmouseover="stip(\''+msg+'\',400)" onmouseout="htip();">'+ show_day;}}
htm += tdhtm + '</td>';
week_day++;}
htm += '</tr></table>';
document.getElementById(calbox).innerHTML = htm;}
