﻿function hidelayer(bid) {document.getElementById(bid).style.display='none'; }
function showlayer(bid) {document.getElementById(bid).style.display='block'; }
function showAvailability(tid,eid,auth) {
var xmlhttp=false;if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}
if(!xmlhttp&&window.createRequest){try{xmlhttp=window.createRequest();}catch(e){xmlhttp=false;}}

xmlhttp.open("GET", "functions-availability.asp?tid="+tid+"&eid="+eid+"&get=allavailable&auth="+auth,true);
 xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
      showlayer('availability');showlayer('floatdiv');showlayer('shade');
     document.getElementById('aDetail').innerHTML=xmlhttp.responseText;
  }
 }
 xmlhttp.send(null)
}
function hideDetail(eventid) {
      hidelayer('availability'); hidelayer('floatdiv'); hidelayer('shade');updateAvailability(eventid);
}
function doAvailability(eid,tid,uid,status,auth) {
var xmlhttp=false;if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}
if(!xmlhttp&&window.createRequest){try{xmlhttp=window.createRequest();}catch(e){xmlhttp=false;}}

if (status === "add") {

xmlhttp.open("GET", "functions-availability.asp?eid="+eid+"&availability=addconfirm&tid="+tid+"&uid="+uid+"&auth="+auth,true);
 xmlhttp.onreadystatechange=function() {  if (xmlhttp.readyState==4) {     
 document.getElementById('aDetail').innerHTML=xmlhttp.responseText;
  }
 }
 xmlhttp.send(null)
} else {

xmlhttp.open("GET", "functions-availability.asp?eid="+eid+"&availability=removeconfirm&tid="+tid+"&uid="+uid+"&auth="+auth,true);
 xmlhttp.onreadystatechange=function() {  if (xmlhttp.readyState==4) {     
 document.getElementById('aDetail').innerHTML=xmlhttp.responseText;
  }
 }
 xmlhttp.send(null)
} }

function getAllAvailable(eid) {
var xmlhttp=false;if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}
if(!xmlhttp&&window.createRequest){try{xmlhttp=window.createRequest();}catch(e){xmlhttp=false;}}
xmlhttp.open("GET", "AJX-functions.asp?eid="+eid+"&get=allavailable",true);
 xmlhttp.onreadystatechange=function() {  if (xmlhttp.readyState==4) {     
 document.getElementById('attending').innerHTML=xmlhttp.responseText;
  }
 }
 xmlhttp.send(null)
showlayer('attending');}
function addAvailability(eid) {
var xmlhttp=false;if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}
if(!xmlhttp&&window.createRequest){try{xmlhttp=window.createRequest();}catch(e){xmlhttp=false;}}
xmlhttp.open("GET", "AJX-functions.asp?eid="+eid+"&availability=addconfirm",true);
 xmlhttp.onreadystatechange=function() {  if (xmlhttp.readyState==4) {     
 document.getElementById('myAvailability').innerHTML=xmlhttp.responseText;
  }
 }
 xmlhttp.send(null)
}
function removeAvailability(eid) {
var xmlhttp=false;if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}
if(!xmlhttp&&window.createRequest){try{xmlhttp=window.createRequest();}catch(e){xmlhttp=false;}}

xmlhttp.open("GET", "AJX-functions.asp?eid="+eid+"&availability=removeconfirm",true);
 xmlhttp.onreadystatechange=function() {  if (xmlhttp.readyState==4) {     
 document.getElementById('myAvailability').innerHTML=xmlhttp.responseText;
  }
 }
 xmlhttp.send(null)
}

function showEventDetail(tid,eid,auth) {
var xmlhttp=false;if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}
if(!xmlhttp&&window.createRequest){try{xmlhttp=window.createRequest();}catch(e){xmlhttp=false;}}

xmlhttp.open("GET", "AJX-Event-Details-ALT.asp?tid="+tid+"&id="+eid+"&auth="+auth,true);
 xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
      showlayer('detailBox'); showlayer('floatdiv'); showlayer('shade');
     document.getElementById('eventDetail').innerHTML=xmlhttp.responseText;
  }
 }
 xmlhttp.send(null)
}
function hideEventDetail() {     hidelayer('detailBox');hidelayer('shade'); hidelayer('floatdiv');}

function updateAvailability(eventid) {
var xmlhttp=false;if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}
if(!xmlhttp&&window.createRequest){try{xmlhttp=window.createRequest();}catch(e){xmlhttp=false;}}

xmlhttp.open("GET", "functions-availability.asp?eventid="+eventid+"&availability=update",true);
 xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
     document.getElementById('avail'+eventid+'').innerHTML=xmlhttp.responseText;
  }
 }
 xmlhttp.send(null)
}







