
//
// Standard error messages and error handling to support client-side processing.
//

function trap_login_error()
{
	switch( url_query_string( "login-error" ) )
	{
		case "missing-fields":		alert( "User name and password are required to login." ); break;
		case "invalid-user-pass":	alert( "Your username and password are incorrect." ); break;
		case "admin-not-connected":	alert( "You are not connected as admin." ); break;
		case "pin-failed":		alert( "Your PIN verification failed." ); break;
		case "pin-not-complete":	alert( "Your PIN verification contained missing data." ); break;
		case "pin-not-needed":		alert( "You do not need to verify your PIN." ); break;
		case "password-sent":		alert( "Your password details have been emailed to you." ); break;
		default: break;
	}
}

function trap_client_alerts()
{
	switch( url_query_string( "email" ) )
	{
		case "spam-reported":		alert( "The email has been marked as spam and the administrator has been alerted. Thank you for your assistance in making this a spam-free zone!" ); break;
		case "abuse-reported":		alert( "We take abusive emails very seriously and will not tolerate offensive content.  Thank you for alerting us and an administrator will now investigate." ); break;
		default: break;
	}
}

function alert_blocked_user( p_block_type, p_member )
{
//
// Blocked...
//
	if( p_block_type == 1 )
		alert( p_member + " decided not to accept messages from you." );
//
// Must have photo attached...
//
	if( p_block_type == 2 )
		alert( p_member + " will only accept message if you have a photo attached to your profile." );
//
// Must be looking for same thing...
//
	if( p_block_type == 3 )
		alert( p_member + " only wants contact from people with similar interests." );
//
// Must be from the same country...
//
	if( p_block_type == 4 )
		alert( p_member + " is only accepting messges from people who live in the same country." );
//
// Must be in the same age group...
//
	if( p_block_type == 5 )
		alert( p_member + " will only accept messages from people within the same age group." );
}


function you_have_mail( p_error, p_to_id )
{
	if( p_error == "mail_sent" )
		alert( "Mail sent successfully to " + p_to_id + "..." );
	if( p_error == "wink_sent" )
		alert( "You just winked at " + p_to_id + "!" );
}
