/*******************************************************************************************************
 **   File Name: calendar.js
 **   Author:    Tony Davydets
 **   Date:      07-28-2009
 **         
 **              This file contains JavaScript code necessary for proper functionality of the oes
 **				 calendar feature. 
 **				
 **					Accompanying file:	--oes_calendar.php
 **       
 *******************************************************************************************************/

var popupCalendar           = ""; 	// instance of 'Contact Info' window

/**************************************************** CALENDAR NAVIGATION FUNCTIONS ****************************************************/
/******************************************************************************************************* 
 ***  switchMonth()
 ***	
 ***	This function helps preserve currently specified parameters as the user surfs from month to month 
 ***
 ***		Inputs:	scriptName  ==> the name of the script (i.e. URL) to which the form is to be submitted
 ***				month		==> helps switching months (i.e. from previous to next)
 ***				year		==> helps switching months by specifying years
 ***		Output: none
 ********************************************************************************************************/
var popupCalendar = '';

function switchMonth(scriptName, month, year, source)
{	
	document.getElementById('month').value = month;
	document.getElementById('year').value = year;	
	document.forms[0].action = scriptName;
	
	document.getElementById('theform').submit();	
}



function linkToEvent(month, year, source)
{															
	// form URL string with parameters
	var URLString = '../largeCalendar.php?month=' + month + '&year=' + year + '&source=' + source; 

	popupCalendar = window.open(URLString, 'popupCalendar', 'toolbar=no, scrollbars=yes, resizable=yes, location=0, width=' + screen.width +', height=750');
		
	// if window is already open, set focus
	if (window.focus) 
	{
		popupCalendar.focus();
	}
}


function filterCalendar()
{
	document.forms[0].submit();		
}


/**************************************************** end CALENDAR NAVIGATION FUNCTIONS ****************************************************/
