
// -----------
//  Function:  testContactData
// -----------
function testContactData(sFormId)
{
	sForm = document.getElementById(sFormId);
	
	if ( sForm.fullname.value.length < 1 )
	{
		alert('Your Name and your Email address are both required.   ');
		sForm.fullname.focus( );
		return false;
	}
	if ( sForm.email.value.length < 1 && sForm.fullname.value != "aSa" )
	{
		alert('Your Name and your Email address are both required.   ');
		sForm.email.focus( );
		return false;
	}
	
	return true;
}

// -----------
//  Function:  testUpdateData
// -----------
function testUpdateData(sFormId)
{
	sForm = document.getElementById(sFormId);
	
	if ( sForm.name.value.length < 1 )
	{
		alert('Please enter the Title before continuing.   ');
		sForm.name.focus( );
		return false;
	}
	if ( sForm.name.value.match(/"/) )
	{
		alert('The Title contains non-valid characters:   \n"');
		sForm.name.focus( );
		return false;
	}
	if ( sForm.desc.value.length < 1 )
	{
		alert('Please enter some Content before continuing.   ');
		sForm.desc.focus( );
		return false;
	}
	
	return true;
}

// -----------
//  Function:  changePhotoImage
// -----------
function changePhotoImage(iIndex)
{
	sImg = document.getElementById("photoHeadImage");
	if (iIndex == 0)
	{
		sImg.src = "/img/photography/arc_de_triomphe.jpg";
	}
	else if (iIndex == 1)
	{
		sImg.src = "/img/photography/jason_kravitz_scream.jpg";
	}
	else if (iIndex == 2)
	{
		sImg.src = "/img/photography/sudbury_snow.jpg";
	}
}

// -----------
//  Function:  checkFullname
// -----------
function checkFullname( )
{
	var elemFullname = document.getElementById("fullname");
	
	if ( elemFullname.value == "aSa" )
	{
		displayPassword();
	}
	
	return false;
}

// -----------
//  Function:  displayPassword
// -----------
function displayPassword( )
{
	var elemLabel = document.getElementById("idPasswordLabel");
	var elemField = document.getElementById("idPasswordField");

	// Display/hide password
	elemLabel.style.display = '';
	elemField.style.display = '';
	
	window.focus( );
	
	return false;
}
