
function getHTTPObject(){var http_object;if(!http_object&&typeof XMLHttpRequest!='undefined'){try{http_object=new XMLHttpRequest();}
catch(e){http_object=false;}}
return http_object;}
function getXMLHTTPObj(){if(typeof(XMLHttpRequest)!='undefined')
return new XMLHttpRequest();var axO=['Msxml2.XMLHTTP.6.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP'],i;for(i=0;i<axO.length;i++)
try{return new ActiveXObject(axO[i]);}catch(e){}
return null;}
function expand(root){var wrapper=document.getElementById(root+'Wrapper');if(wrapper){wrapper.style.height='auto';}
var miniPlus=document.getElementById(root+'MiniPlus');if(miniPlus){miniPlus.style.display='none';}
var miniMinus=document.getElementById(root+'MiniMinus');if(miniMinus){miniMinus.style.display='';}}
function collapse(root,collapsedHeight){var wrapper=document.getElementById(root+'Wrapper');if(wrapper){if(collapsedHeight){wrapper.style.height=collapsedHeight;}else{wrapper.style.height='20em';}}
var miniMinus=document.getElementById(root+'MiniMinus');if(miniMinus){miniMinus.style.display='none';}
var miniPlus=document.getElementById(root+'MiniPlus');if(miniPlus){miniPlus.style.display='';}}
function expandTable(root){var tbody=document.getElementById(root+'TBody');if(tbody){tbody.style.height='auto';}
var miniPlus=document.getElementById(root+'MiniPlus');miniPlus.style.display='none';var miniMinus=document.getElementById(root+'MiniMinus');miniMinus.style.display='';}
function collapseTable(root,collapsedHeight){var tbody=document.getElementById(root+'TBody');if(tbody){tbody.style.height='20em';}
var miniMinus=document.getElementById(root+'MiniMinus');miniMinus.style.display='none';var miniPlus=document.getElementById(root+'MiniPlus');miniPlus.style.display='';}
var inviteReq=getXMLHTTPObj();function replyCallback(){if(inviteReq.readyState==4){var invitationDiv=document.getElementById('invitation');invitationDiv.innerHTML=inviteReq.responseText;var refreshImage=document.getElementById('refreshInvitationIcon');refreshImage.style.display='';}}
function reply(baseURL){var yesReply=document.getElementById('yesReply').checked;var noReply=document.getElementById('noReply').checked;var maybeReply=document.getElementById('maybeReply').checked;var comment=escape(document.getElementById('replyComment').value);var status;if(yesReply){status='1';}else if(noReply){status='0';}else{status='2';}
var url=baseURL+"status="+status+"&comment="+comment;inviteReq.open('GET',url,true);inviteReq.onreadystatechange=replyCallback;inviteReq.send(null);}
function refreshInvitation(url){var refreshImage=document.getElementById('refreshInvitationIcon');refreshImage.style.display='none';inviteReq.open('GET',url,true);inviteReq.onreadystatechange=replyCallback;inviteReq.send(null);}
var rosterReq=getHTTPObject();function fillRosterCallback(){if(rosterReq.readyState==4){var rosterDiv=document.getElementById('rosterSection');rosterDiv.innerHTML=rosterReq.responseText;}
Nifty("div#rosterHeader","tr tl");}
function fillRoster(baseURL,origin){var active=document.getElementById('active');var showProfiles=document.getElementById('showProfiles').checked;var showNotes=document.getElementById('showNotes').checked;var height=document.getElementById('rosterWrapper').style.height;var playerClass;if(active){active=active.checked;}
var inactive=document.getElementById('inactive');if(inactive){inactive=inactive.checked;}
var retired=document.getElementById('retired');if(retired){retired=retired.checked;}
if(inactive){playerClass='2';}else if(retired){playerClass='3';}else{playerClass='1';}
if(showProfiles){showProfiles='1';}else{showProfiles='0';}
if(showNotes){showNotes='1';}else{showNotes='0';}
var url=baseURL+'playerClass='+playerClass+"&showProfiles="+showProfiles+"&showNotes="+showNotes+"&height="+height+'&origin='+origin;rosterReq.open('GET',url,true);rosterReq.onreadystatechange=fillRosterCallback;rosterReq.send(null);}
var calReq=getHTTPObject();function fillCalendarCallback(){if(calReq.readyState==4){var rosterDiv=document.getElementById('calendar');rosterDiv.innerHTML=calReq.responseText;}
Nifty("div#calenderHeader","tr tl");}
function fillCalendar(baseURL){var showCancelled=document.getElementById('showCancelled').checked;var height=document.getElementById('calendarWrapper').style.height;if(showCancelled){showCancelled='1';}else{showCancelled='0';}
var url=baseURL+"showCancelled="+showCancelled+"&height="+height;calReq.open('GET',url,true);calReq.onreadystatechange=fillCalendarCallback;calReq.send(null);}
var poyReq=getHTTPObject();function fillPOYCallback(){if(poyReq.readyState==4){var poyDiv=document.getElementById('poy');poyDiv.innerHTML=poyReq.responseText;}
Nifty("div#poyHeader","tr tl");}
function fillPOY(baseURL,origin){var showInactivePOY=document.getElementById('showInactivePOY');var showRetiredPOY=document.getElementById('showRetiredPOY');var height=document.getElementById('poyStandingsTBody').style.height;if(showInactivePOY){showInactive=showInactivePOY.checked;}else{showInactive=false;}
if(showRetiredPOY){showRetired=showRetiredPOY.checked;}else{showRetired=false;}
if(showInactive){showInactive='1';}else{showInactive='0';}
if(showRetired){showRetired='1';}else{showRetired='0';}
var url=baseURL+"showInactive="+showInactive+"&showRetired="+showRetired+"&height="+height+"&origin="+origin;poyReq.open('GET',url,true);poyReq.onreadystatechange=fillPOYCallback;poyReq.send(null);}
var cashOutReq=getHTTPObject();function fillCashOutCallback(){if(cashOutReq.readyState==4){var cashOutDiv=document.getElementById('cashOut');cashOutDiv.innerHTML=cashOutReq.responseText;}
Nifty("div#cashOutHeader","tr tl");}
function fillCashOut(baseURL,origin){var showInactiveCashOut=document.getElementById('showInactiveCashOut');var showRetiredCashOut=document.getElementById('showRetiredCashOut');var height=document.getElementById('cashOutStandingsTBody').style.height;if(showInactiveCashOut){showInactive=showInactiveCashOut.checked;}else{showInactive=false;}
if(showRetiredCashOut){showRetired=showRetiredCashOut.checked;}else{showRetired=false;}
if(showInactive){showInactive='1';}else{showInactive='0';}
if(showRetired){showRetired='1';}else{showRetired='0';}
var url=baseURL+"showInactive="+showInactive+"&showRetired="+showRetired+"&height="+height+"&origin="+origin;cashOutReq.open('GET',url,true);cashOutReq.onreadystatechange=fillCashOutCallback;cashOutReq.send(null);}
var cashNetReq=getHTTPObject();function fillCashNetCallback(){if(cashNetReq.readyState==4){var cashNetDiv=document.getElementById('cashNet');cashNetDiv.innerHTML=cashNetReq.responseText;}
Nifty("div#cashNetHeader","tr tl");}
function fillCashNet(baseURL,origin){var showInactiveCashNet=document.getElementById('showInactiveCashNet');var showRetiredCashNet=document.getElementById('showRetiredCashNet');var height=document.getElementById('cashNetStandingsTBody').style.height;if(showInactiveCashNet){showInactive=showInactiveCashNet.checked;}else{showInactive=false;}
if(showRetiredCashNet){showRetired=showRetiredCashNet.checked;}else{showRetired=false;}
if(showInactive){showInactive='1';}else{showInactive='0';}
if(showRetired){showRetired='1';}else{showRetired='0';}
var url=baseURL+"showInactive="+showInactive+"&showRetired="+showRetired+"&height="+height+"&origin"+origin;cashNetReq.open('GET',url,true);cashNetReq.onreadystatechange=fillCashNetCallback;cashNetReq.send(null);}
var messReq=getHTTPObject();var deletePostReq=getHTTPObject();function hidePost(){var subject=document.getElementById('messageSubjectEntry');if(subject){subject.value='';}
var content=document.getElementById('messageContentEntry');if(content){content.value='';}
var subjectError=document.getElementById('subjectError');subjectError.style.display='none';postDiv=document.getElementById('messageEntry');if(postDiv){postDiv.style.display='none';}
postDiv=document.getElementById('postMessageLink');if(postDiv){postDiv.style.display='';}}
function postCallback(){if(messReq.readyState==4){var messageBoardDiv=document.getElementById('messageBoard');messageBoardDiv.innerHTML=messReq.responseText;hidePost();var refreshImage=document.getElementById('refreshMessagesIcon');refreshImage.style.display='';}}
function deleteCallback(){if(deletePostReq.readyState==4){var messageBoardDiv=document.getElementById('messageBoard');messageBoardDiv.innerHTML=deletePostReq.responseText;var refreshImage=document.getElementById('refreshMessagesIcon');refreshImage.style.display='';}}
function post(baseURL){var subject=document.getElementById('messageSubjectEntry');if(subject){subject=subject.value;}else{subject='';}
var content=document.getElementById('messageContentEntry');if(content){content=content.value;}else{content='';}
var tzOffset=document.getElementById('tzOffset');if(tzOffset){tzOffset=tzOffset.value;}else{tzOffset='0';}
var subjectError=false;if(subject===null||subject===""){subjectError='The subject may not be empty.';}
if(subject.length>50){subjectError='The subject may not be longer than 50 characters.';}
var errorPara=document.getElementById('subjectError');if(subjectError){errorPara.innerHTML=subjectError;errorPara.style.display='';}else{errorPara.style.display='none';}
var contentError=false;if(content.length>1000){contentError='The message may not be longer than 1000 characters.';}
errorPara=document.getElementById('contentError');if(contentError){errorPara.innerHTML=contentError;errorPara.style.display='';}else{errorPara.style.display='none';}
if((!subjectError)&&(!contentError)){subject=escape(subject);content=escape(content);var url=baseURL+"subject="+subject+"&content="+content+"&tzOffset="+tzOffset;messReq.open('GET',url,true);messReq.onreadystatechange=postCallback;messReq.send(null);}}
function deletePost(url){if(confirm("Are you sure you want to delete this message?")){deletePostReq.open('GET',url,true);deletePostReq.onreadystatechange=deleteCallback;deletePostReq.send(null);}}
function refreshMessages(url){var refreshImage=document.getElementById('refreshMessagesIcon');refreshImage.style.display='none';messReq.open('GET',url,true);messReq.onreadystatechange=postCallback;messReq.send(null);}
function enablePost(){postDiv=document.getElementById('messageEntry');if(postDiv){postDiv.style.display='';}
postDiv=document.getElementById('postMessageLink');if(postDiv){postDiv.style.display='none';}}

