// JavaScript Document
<!--

var xmlHttp;

function createXMLHttpRequest()
{
  if (window.ActiveXObject) {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  else if (window.XMLHttpRequest) {
    xmlHttp = new XMLHttpRequest();
  }
}

function showSchedule( date, width ) {
  //alert( date );
  document.body.style.cursor = "progress";
  createXMLHttpRequest();
  xmlHttp.onreadystatechange = function()
  {
	  //alert( "fieldname = " + fieldname );
  	//document.getElementById( "headerRow" ).innerHTML = "Loading Schedule...";
	// alert( "readyState = " + xmlHttp.readyState );
 	 if(xmlHttp.readyState == 4)
	 {
		//alert( "status = " + xmlHttp.status );
		//alert( "responsetext = " + xmlHttp.responseText );
    	if(xmlHttp.status == 200)
		{
      		document.getElementById( "shortCuts" ).innerHTML = xmlHttp.responseText;
      		document.body.style.cursor = "auto";
    	}
  	 }
  }
  //alert( "productCategories.cfm?catid="+catid+"&fieldname="+fieldname );
  xmlHttp.open("GET", "Schedule_ListModule.cfm?day="+date+"&width="+width, true);
  document.body.style.cursor = "auto";
  xmlHttp.send(null);
}


function showScheduleFull( month, date, width ) {
  //alert( date );
  document.body.style.cursor = "progress";
  createXMLHttpRequest();
  xmlHttp.onreadystatechange = function()
  {
	  //alert( "fieldname = " + fieldname );
  	//document.getElementById( "headerRow" ).innerHTML = "Loading Schedule...";
	// alert( "readyState = " + xmlHttp.readyState );
 	 if(xmlHttp.readyState == 4)
	 {
		//alert( "status = " + xmlHttp.status );
		//alert( "responsetext = " + xmlHttp.responseText );
    	if(xmlHttp.status == 200)
		{
      		document.getElementById( "shortCuts" ).innerHTML = xmlHttp.responseText;
      		document.body.style.cursor = "auto";
    	}
  	 }
  }
  //alert( "productCategories.cfm?catid="+catid+"&fieldname="+fieldname );
  xmlHttp.open("GET", "Schedule_ListModule_schedulepage.cfm?month="+month+"&day="+date+"&width="+width, true);
  document.body.style.cursor = "auto";
  xmlHttp.send(null);
}


function showEvents( type ) {
	
  document.body.style.cursor = "progress";
  createXMLHttpRequest();
  xmlHttp.onreadystatechange = function()
  {
	  //alert( "fieldname = " + fieldname );
	  
		/*if ( type == 'weekly' )
 		{
			document.getElementById( "headerRow" ).innerHTML = "Loading Weekly Events...";
		}
		else
		{
			if (type == 'special')
			{
				document.getElementById( "headerRow" ).innerHTML = "Loading Special Events...";
			}
			
			else
			{
				if (type == 'Announcement')
				{
				document.getElementById( "headerRow" ).innerHTML = "Loading Announcements...";
				}
			}
		}*/
 
  	
	 //alert( "readyState = " + xmlHttp.readyState );
 	 if(xmlHttp.readyState == 4)
	 {
		//alert( "status = " + xmlHttp.status );
		//alert( "responsetext = " + xmlHttp.responseText );
    	if(xmlHttp.status == 200)
		{
      		document.getElementById( "shortCuts" ).innerHTML = xmlHttp.responseText;
      		document.body.style.cursor = "auto";
    	}
  	 }
  }
  //alert( "productCategories.cfm?catid="+catid+"&fieldname="+fieldname );
 if ( type == 'weekly' )
 {
	 xmlHttp.open("GET", "/includes/weeklyEvents2.cfm", true);
 }
 else
 {
	 if (type == 'Announcement')
	 {
		 xmlHttp.open("GET", "homeAnnouncementModule.cfm", true);
	 }
	  else
	 {
		 if (type == 'Workshop')
		 {
			 xmlHttp.open("GET", "homeWorkshopModule.cfm", true);
		 }
		 else
		 {
			 if (type == 'Special')
			 {
			 	xmlHttp.open("GET", "/includes/specialEvents2.cfm", true);
		 	 }
		 }
	 }
 }
  document.body.style.cursor = "auto";
  xmlHttp.send(null);
}

function viewPhotos( previewDiv ) {
  //alert( date );
  document.body.style.cursor = "progress";
  createXMLHttpRequest();
  xmlHttp.onreadystatechange = function()
  {
	  //alert( "previewDiv = " + previewDiv );
  	document.getElementById( previewDiv ).innerHTML = "<span style='padding:50px 0 0 0;'>Loading...</span>";
	 //alert( "readyState = " + xmlHttp.readyState );
 	 if(xmlHttp.readyState == 4)
	 {
		//alert( "status = " + xmlHttp.status );
		//alert( "responsetext = " + xmlHttp.responseText );
    	if(xmlHttp.status == 200)
		{
      		document.getElementById( previewDiv ).innerHTML = xmlHttp.responseText;
      		document.body.style.cursor = "auto";
    	}
  	 }
  }
  //alert( "productCategories.cfm?catid="+catid+"&fieldname="+fieldname );
  xmlHttp.open("GET", "includes/photoViewer.cfm", true);
  document.body.style.cursor = "auto";
  xmlHttp.send(null);
}

function showPhotos( galleryID, imageID, currentRow, divHeight ) {
  //alert( date );
  document.body.style.cursor = "progress";
  createXMLHttpRequest();
  xmlHttp.onreadystatechange = function()
  {
	  //alert( "fieldname = " + fieldname );
  	//document.getElementById( "headerRow" ).innerHTML = "Loading Schedule...";
	// alert( "readyState = " + xmlHttp.readyState );
 	 if(xmlHttp.readyState == 4)
	 {
		//alert( "status = " + xmlHttp.status );
		//alert( "responsetext = " + xmlHttp.responseText );
    	if(xmlHttp.status == 200)
		{	
			document.getElementById( "photoViewer" ).style.height = divHeight;
      		document.getElementById( "photoViewer" ).innerHTML = xmlHttp.responseText;
      		document.body.style.cursor = "auto";
    	}
  	 }
  }
  //alert( "productCategories.cfm?catid="+catid+"&fieldname="+fieldname );
  xmlHttp.open("GET", "includes/LargeImageViewer.cfm?galleryID="+galleryID+"&imageID="+imageID+"&currentRow="+currentRow, true);
  document.body.style.cursor = "auto";
  xmlHttp.send(null);
}

function showPrices( priceDiv, priceid ) {
  //alert( date );
  document.body.style.cursor = "progress";
  createXMLHttpRequest();
  xmlHttp.onreadystatechange = function()
  {
	//alert( "priceDiv = " + priceDiv + "priceid" + priceid  );
	//document.getElementById( priceDiv ).innerHTML = "<span style='padding:50px 0 0 0;'>Loading...</span>";
	//alert( "readyState = " + xmlHttp.readyState );
 	 if(xmlHttp.readyState == 4)
	 {
		//alert( "status = " + xmlHttp.status );
		//alert( "responsetext = " + xmlHttp.responseText );
    	if(xmlHttp.status == 200)
		{
      		document.getElementById( priceDiv ).innerHTML = xmlHttp.responseText;
      		document.body.style.cursor = "auto";
    	}
  	 }
  }
  //alert( "productCategories.cfm?catid="+catid+"&fieldname="+fieldname );
  xmlHttp.open("GET", "pricemodule.cfm?priceid="+priceid, true);
  document.body.style.cursor = "auto";
  xmlHttp.send(null);
}



function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function swapMarqueeImage( imageName )
{
	
  var marqueeDiv = document.getElementById("marquee400");  
  marqueeDiv.innerHTML = "<img src='images/" + imageName + "' width='800' height='400' hspace='0' vspace='0'>";
  
} 



var t;
//var y = 0;
var q = 0;
//var g = 0;
	
// var maxheight = 250;
// var expandedDiv = "allclosed";



/*****function checkOpenDiv( div3 )
{
		//alert( "START - " + expandedDiv + " is open." + " - y = " + y + " - q = " + q );
		
		//y = y
		
		if( y == 0 && expandedDiv == "allclosed" ) { showDiv( div3 ); }	// opens div clicked for first time
		else 
		{
			if( y == 0 && expandedDiv == div3 ) { showDiv( div3 ); }	// 
			else
			{
				if( y != 0 && expandedDiv == div3 ) { showDiv( div3 ); }   //closes div if open
				else 
				{
					if( y != 0 && expandedDiv != div3 ) {  showDiv( expandedDiv ); showDiv( div3 ); }
					
				}
			}
		}
		
		//alert( "END - " + expandedDiv + " is open." + " - y = " + y + " - q = " + q );
	
}


function showDiv( divname )
{	
	

	//alert( expandedDiv + " - " + y );
	
	//alert( "INSIDE showDiv - " + expandedDiv + " is open." + " - y = " + y + " - q = " + q );
	
	//if( y>maxheight && divname != expandedDiv && expandedDiv != "allclosed" ) { y = 0; q = 5; g = 0; return false; }
	
		e=document.getElementById( divname );
		
		if( y >= 0 && e.style.visibility == "hidden"  ) { e.style.visibility = "visible"; e.style.display = "block"; }
		
 		if( y==maxheight && g==0 ){ g=1; expandedDiv=divname; return; }
 		if( y==0 && g==1 ){ g=0; expandedDiv="allclosed"; e.style.visibility = "hidden"; e.style.display = "none"; return; }
 		if( g ) q=-10; // shrinks div
		if( !g ) q=10; // expands div
		
		y=y+q;
 		
 		e.style.height = y + 'px';
		
		//alert( "y = " + y );
		if( y == 0 ) { e.style.visibility = "hidden"; e.style.display = "none"; expandedDiv="allclosed"; g=0; return; }
  		t=setTimeout("showDiv('" + divname + "');",0);
  
} ********/


function openDiv( div2, y, maxHeight )
{
		
		e=document.getElementById( div2 );
		
		heightStor = e.style.height
		//alert("i'm here")
		//alert( "y = " + y + " - div = " + e.style.visibility + " - height = " + e.style.height + " - maxHeight = " + maxHeight );
		//alert( "heightStor = " + heightStor );
		
		//if( heightStor == maxHeight ) { alert( "INSIDE closeDiv call"); closeDiv( div2, maxHeight ); return; }

		if( e.style.visibility == "hidden"  ) { e.style.visibility = "visible"; e.style.display = "block"; }
		//alert( "y = " + y + "div = " + e.style.visibility );
		if( y == maxHeight ){ return; }
 		
		g=0
		if( !g ) q=10; // expands div
		
		y=y+q;

 		e.style.height = y + 'px';
		
		//alert( "y = " + y + "div = " + e.style.visibility );
		//if( y <= 0 ) { e.style.visibility = "hidden"; e.style.display = "none"; }
  		t=setTimeout("openDiv('"+ div2 + "'," + y + ", " + maxHeight + ");",0);
		
}
	
function closeDiv( div2, y )
{

		e=document.getElementById( div2 );
		
		if( y == 0 ){ e.style.visibility = "hidden"; e.style.display = "none";  return; }
		
		g=1;
 		if( g ) q=-10;  // shrinks div
		
		y=y+q;

 		e.style.height = y + 'px';
		
  		t=setTimeout("closeDiv('"+ div2 + "'," + y  + ");",0);
		
}


var cycleCount = 1;

	function moveSlider( divname, pixmove, resetcycle )
	{
		if ( resetcycle == 1 )
		{
			cycleCount = 1;
		}
		else
		{
			cycleCount += 1;
		}
		
		//alert( "cycleCount = " + cycleCount );
	
		var divSlider = document.getElementById( divname );
		
		//alert( "divSlider.style.left = " + divSlider.style.left );
		
		currentPos = divSlider.style.left;
		
		//finalStop = parseInt( currentPos ) + 200; // final left position of thumb div on this cycle.
		//alert( "finalStop = " + finalStop );
		//alert( "currentPos = " + parseInt( currentPos ) );
		nextPos = ( pixmove + parseInt( currentPos ) );
		//alert( "nextPos = " + nextPos );
		
		
		if( cycleCount == 6 )
		{
			pixmove > 0 ? nextPos += 12:nextPos -= 12;
			divSlider.style.left = nextPos + 'px'; return;
		}
		else
		{
			divSlider.style.left = nextPos + 'px';
		}
		
		t=setTimeout("moveSlider('"+ divname + "', " + pixmove + ", 0 );",0);
	
	}



function killtimeOut()
{
	clearTimeout( t );
}


var clickedDiv = "";



function rolloverTab( divName )
{
	divName.style.backgroundImage = 'url(images/homeTabLong_90_gray.gif)';
	divName.style.color='white';
}

function rolloutTab( divName )
{
	if ( divName != clickedDiv )
	{
		divName.style.backgroundImage = 'url(images/homeTabLong_90.gif)';
		divName.style.color='black';
	}
	
}

function clickTab( divName )
{
	if ( clickedDiv != "" && divName != clickedDiv )
	{
		clickedDiv.style.backgroundImage = 'url(images/homeTabLong_90.gif)';
		clickedDiv.style.color='black';
	}
	
	clickedDiv = document.getElementById( divName );
	
	clickedDiv.style.backgroundImage = 'url(images/homeTabLong_90_gray.gif)';
	clickedDiv.style.color='white';
}

function clickTabLong( divName )
{
	if ( clickedDiv != "" && divName != clickedDiv )
	{
		clickedDiv.style.backgroundImage = 'url(images/homeTabLong.gif)';
		clickedDiv.style.color='black';
	}
	
	clickedDiv = document.getElementById( divName );
	
	clickedDiv.style.backgroundImage = 'url(images/homeTabLong_107_gray.gif)';
	clickedDiv.style.color='white';
}


function rolloverTabLong( divName )
{
	divName.style.backgroundImage = 'url(images/homeTabLong_107_gray.gif)';
	divName.style.color='white';
}

function rolloutTabLong( divName )
{
	if ( divName != clickedDiv )
	{
		divName.style.backgroundImage = 'url(images/homeTabLong.gif)';
		divName.style.color='black';
	}
	
}











-->