// JavaScript Document
var time_variable;
 
function getXMLObject()  //XML OBJECT
{
   var xmlHttp = false;
   try {
     xmlHttp = new ActiveXObject("Msxml2.XMLHTTP")  // For Old Microsoft Browsers
   }
   catch (e) {
     try {
       xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")  // For Microsoft IE 6.0+
     }
     catch (e2) {
       xmlHttp = false   // No Browser accepts the XMLHTTP Object then false
     }
   }
   if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
     xmlHttp = new XMLHttpRequest();        //For Mozilla, Opera Browsers
   }
   return xmlHttp;  // Mandatory Statement returning the ajax object created
}
 
var xmlhttp = new getXMLObject();	//xmlhttp holds the ajax object
 
function content(id) {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="grabcontent.php?id="+id;	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function extracontent(id) {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="grabcontent.php?id="+id+"&content=extra";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function getevent(id) {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="grabevent.php?id="+id;	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function listevents() {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="listevents.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function ambassador() {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="ambass_gal.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function amnav(pnum,trow) {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="ambass_gal.php?pageNum_ambass_large="+pnum+"&totalRows_ambass_large="+trow;
	xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function exponav(pnum,trow) {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="biz_expogal.php?pageNum_ambass_large="+pnum+"&totalRows_ambass_large="+trow;
	xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}


function taste() {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="taste.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function mem2mem() {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="mem2mem.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function safetysem() {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="safetysem.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function anmeeting() {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="annualmeeting.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function benefits() {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="benefits_meeting.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function joinFunction() {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="join_benefits.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function tastenav(pnum,trow) {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="taste.php?pageNum_taste_large="+pnum+"&totalRows_taste_large="+trow;
	xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	window.location.hash = "photo"
	
  }
}

function directory() {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="directory.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function search() {
var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) {
  	var sendstr;
		sendstr="memresults.php?select1="+document.getElementById("select1").value;	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function memnav(pnum,trow,term) {
var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="memresults.php?pageNum_Recordset1="+pnum+"&totalRows_Recordset1="+trow+"&select1="+term;		
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function catsearch() {
	var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
	var sendstr;
		sendstr="catresults.php?select2="+document.getElementById("select2").value;	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}


function catnav(pnum,trow,term) {
var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  	var sendstr;
		sendstr="catresults.php?pageNum_Recordset1="+pnum+"&totalRows_Recordset1="+trow+"&select2="+term;		
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function indexsearch(id) {
	var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
	var sendstr;
		sendstr="memindex.php?indexid="+id;	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function memselect(id) {
	var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
	var sendstr;
		sendstr="memindexresults.php?select1="+id;	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function parade() {
	var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
	var sendstr;
		sendstr="parade_app.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function bizExpo() {
	var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
	var sendstr;
		sendstr="biz_expogal.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function golfOuting() {
	var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
	var sendstr;
		sendstr="golf_outing.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function newsletter() {
	var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
	var sendstr;
		sendstr="newsletter.php";	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	
  }
}

function sitebrowse() {
	var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
	var sendstr;
		sendstr="sitesearch.php?search="+document.getElementById("searchsite").value;	
    xmlhttp.open("GET",sendstr,true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(null); //Posting txtname to PHP File
	document.getElementById("searchsite").value="Search the Site";
	document.getElementById("searchsite").style.color='#999999';
  }
}

function handleServerResponse() {
   if (xmlhttp.readyState == 4) {
     if(xmlhttp.status == 200) {
       document.getElementById('home').style.display='none';
	   document.getElementById('body_content').style.display='block';
	   document.getElementById("body_content").innerHTML=xmlhttp.responseText; //Update the HTML Form element 
     }
     else {
        alert("Error during AJAX call. Please try again");
     }
   }
}

function homefunction() {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  document.getElementById('home').style.display='block';
  document.getElementById('body_content').style.display='none';
  
  }
}

function expandFunction(pid) {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  document.getElementById(pid).style.display='block';
  }
}

function collapseFunction(pid) {
  var getdate = new Date();  //Used to prevent caching during ajax call
  if(xmlhttp) { 
  document.getElementById(pid).style.display='none';
  }
}

//TIME REFRESH
function timeFunction(){

var divid = "time";
var url = "time.php";

// The XMLHttpRequest object

var xmlHttp;
try{
xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
}
catch (e){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
}
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
alert("Your browser does not support AJAX.");
return false;
}
}
}

// Timestamp for preventing IE caching the GET request

fetch_unix_timestamp = function()
{
return parseInt(new Date().getTime().toString().substring(0, 10))
}

var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;

// The code...

xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
document.getElementById(divid).innerHTML=xmlHttp.responseText;
setTimeout('timeFunction()',1*1000);
}
}
xmlHttp.open("GET",nocacheurl,true);
xmlHttp.send(null);
}

// Start the refreshing process

window.onload = function startrefresh(){
setTimeout('timeFunction()',1*1000);
}

//TEMP REFRESH
function tempFunction(){

var divid = "temp";
var url = "temp.php";

// The XMLHttpRequest object

var xmlHttp;
try{
xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
}
catch (e){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
}
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
alert("Your browser does not support AJAX.");
return false;
}
}
}

// Timestamp for preventing IE caching the GET request

fetch_unix_timestamp = function()
{
return parseInt(new Date().getTime().toString().substring(0, 10))
}

var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;

// The code...

xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
document.getElementById(divid).innerHTML=xmlHttp.responseText;
setTimeout('tempFunction()',60*1000);
}
}
xmlHttp.open("GET",nocacheurl,true);
xmlHttp.send(null);
}

// Start the refreshing process

window.onload = function startrefresh(){
setTimeout('tempFunction()',60*1000);
}

//load Calendar
function calFunction(){

var divid = "calendar";
var url = "cal.php";

// The XMLHttpRequest object

var xmlHttp;
try{
xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
}
catch (e){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
}
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
alert("Your browser does not support AJAX.");
return false;
}
}
}

// Timestamp for preventing IE caching the GET request

fetch_unix_timestamp = function()
{
return parseInt(new Date().getTime().toString().substring(0, 10))
}

var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;

// The code...

xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
document.getElementById(divid).innerHTML=xmlHttp.responseText;
}
}
xmlHttp.open("GET",nocacheurl,true);
xmlHttp.send(null);
}

//load Calendar
function calback(prm,chm){

var divid = "calendar";
var url = "cal.php";

// The XMLHttpRequest object

var xmlHttp;
try{
xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
}
catch (e){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
}
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
alert("Your browser does not support AJAX.");
return false;
}
}
}

// Timestamp for preventing IE caching the GET request

fetch_unix_timestamp = function()
{
return parseInt(new Date().getTime().toString().substring(0, 10))
}

var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp+"&prm="+prm+"&chm="+chm;

// The code...

xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
document.getElementById(divid).innerHTML=xmlHttp.responseText;
}
}
xmlHttp.open("GET",nocacheurl,true);
xmlHttp.send(null);
}

function searchbox() {
document.getElementById("searchsite").value="";
document.getElementById("searchsite").style.color='#000000';
}