function displayEventDetails(EVT_ID, pIntWidth, pIntHeight)
{
	intWidth = 600; // Default..
	intHeight = 220; // Default...
	if(arguments.length >= 3)
	{
		intWidth = pIntWidth;
		intHeight = pIntHeight;
	}
	
	Lightbox.showBoxByAJAX('/ajax/displayEventDetails.cfm?EVT_ID=' + EVT_ID + '&intWidth=' + intWidth + '&intHeight=' + intHeight, intWidth, intHeight);
}

function displayLightBoxMsg(strConfirmationMsg, pIntWidth, pIntHeight)
{
	intWidth = 600; // Default..
	intHeight = 220; // Default...
	if(arguments.length >= 3)
	{
		intWidth = pIntWidth;
		intHeight = pIntHeight;
	}
	Lightbox.showBoxByAJAX('/ajax/displayLightBoxMsg.cfm?strConfirmationMsg=' + strConfirmationMsg, intWidth, intHeight);
}

function emailThisPageToAFriend(strPageURL, strRedirect)
{
	intWidth = 600;
	intHeight = 470;
	Lightbox.showBoxByAJAX('/ajax/emailThisPageToAFriend.cfm?strPageURL=' + strPageURL + '&strRedirect=' + strRedirect, intWidth, intHeight);
}

// Function used under the 'Email to a Friend' section uder my Account...
function validateEmailToAFriendForm()
{
	objForm = document.frmEmail;
	blnError = false;
	strErrorMsg = '';
	if(objForm.strMyEmail.value == '')
	{
		strErrorMsg += '\nPlease enter your email address';
		blnError = true;
	}
	else if(!_CF_checkEmail(objForm.strMyEmail.value, true))
	{
		strErrorMsg += '\nPlease enter a valid email address';
		blnError = true;
	}
	
	if(objForm.txtMessage.value == '')
	{
		strErrorMsg += '\nPlease enter a message';
		blnError = true;
	}
	if(objForm.strFriendsName.value == '')
	{
		strErrorMsg += "\nPlease enter your friend's name";
		blnError = true;
	}
	if(objForm.strFriendsEmail.value == '')
	{
		strErrorMsg += "\nPlease enter your friend's email address";
		blnError = true;
	}
	/* - Removed email validation since it fails when multiple email addresses are entered - Victor - August 11, 2008
	else if(!_CF_checkEmail(objForm.strFriendsEmail.value, true))
	{
		strErrorMsg += '\nPlease enter a valid email address';
		blnError = true;
	}												
	*/
	if(blnError)
	{
		alert(strErrorMsg);
	}
	else
	{
		/* Submit the form...*/
		objForm.submit();
	}	
}

/* Helper functions stollen from the cfform.js file */											
function _CF_checkregex(object_value, regexPattern, required)
{
	if( required )
	{
		if( object_value.length == 0 )
		{
			return false;
		}
	}else{
		if( object_value.length == 0 )
		{
			return true;
		}
	}

	return regexPattern.test(object_value);
}

function _CF_checkEmail(object_value, required)
{
	//trim whitespace before we validate
	object_value = object_value.replace(/^\s+/,'').replace(/\s+$/,'');
	return _CF_checkregex(object_value, /^[a-zA-Z_0-9-'\+~]+(\.[a-zA-Z_0-9-'\+~]+)*@([a-zA-Z_0-9-]+\.)+[a-zA-Z]{2,7}$/, required);
}

function resizeLightBoxToContent()
{
	$('box').style.height = $('boxContents').scrollHeight + 'px';
}
