/**********************************************************************************************************************************************/
// Function to open link rows for editing
function showCalendar(month,year)
{
	str     = 'info=' + month + '|' + year; //alert(str);
	var url = "getCalendar.php";

	// Send the stuff on over to the url
	request.open("POST", url, true);
	request.onreadystatechange = update_showCalendar;
	request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	request.send(str);	
}
function update_showCalendar()
{
	if(request.readyState == 4) 
	{ 	
		if(trim(request.responseText))
		{		
			document.getElementById('calendarTable').innerHTML = request.responseText;

			// Wait a hundredth of a second
			setTimeout(showEvents,10);
		}
	}
}


// Function to open link rows for editing
function showEvents()
{
	//alert(document.getElementById('calhid').value);	
	var params = document.getElementById('calhid').value.split(',');
	str     = 'info=' + params[0] + '|' + params[1] + '|' + params[2]; //alert(str);

	var url = "getEvents.php";

	// Send the stuff on over to the url
	request.open("POST", url, true);
	request.onreadystatechange = update_showEvents;
	request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	request.send(str);
}

function update_showEvents()
{
	if(request.readyState == 4) 
	{ 	
		//alert(request.responseText);
		
		// Get current Div height
		if(trim(request.responseText))
		{
		var mainDivHt = document.getElementById('main').offsetHeight;
		//alert(document.getElementById('main').offsetHeight);	
		document.getElementById('main').innerHTML = request.responseText;
		
		document.getElementById('main').style.background = '#EFF7FF';
		}
	}
}

// Function to read more on an event
function readMore(div)
{
	
	// Close current open div	
	if(trim(document.getElementById('readmorehid').value)!='')	
	{
		if(document.getElementById('readmorehid').value != div)
		{      
			var olddiv = document.getElementById('readmorehid').value;
	      		wipes('wipeIn','brf' + olddiv,'500','-');
			wipes('fadeOut' , 'rm' + document.getElementById('readmorehid').value , '1000' , '-');
			
			setTimeout(myWipeOut,175);
		}
	}
	
		function myWipeOut()
		{
		wipes('wipeOut','rm' + olddiv,'500','-');
		}


		// Set current open div in hidden value	
		document.getElementById('readmorehid').value = div;
	
		wipes('wipeIn' , 'rm' + div , '1' , '-');
		wipes('fadeOut' , 'rm' + div , '1' , '-');
	
   		setTimeout(myFaderIn,100);	
	
		function myFaderIn()
		{
		wipes('wipeOut','brf' + div,'500','-');
		wipes('fadeIn','rm' + div,'1000','-');
		}

	
	
}
