﻿// JScript File
 
<!-- Begin
	function placeFocus() {
	if (document.forms.length > 0) {
	var field = document.forms[0];
	for (i = 0; i < field.length; i++) {
	if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
	document.forms[0].elements[i].focus();
	break;
	         }
	      }
	   }
	}
	
function qCard()	{
	form = document.contact_form;
	q = form.subject.options[form.subject.selectedIndex].value;
	switch (q)	{
		case 'Report Abusive Member' :
			form.message.value = 'You are solely responsible for your interactions with other RateMyBody.com Members. RateMyBody.com reserves the right, but has no obligation, to monitor disputes between you and other Members.  If you are recieving abusive Instant Messages remember you can simply block the user.  If you feel it is appropriate to report them you may do this also.';
			break;
		case 'Account Removal' :
			form.message.value = 'You can delete your account on your own by simply clicking the delete account button found on the "MyAccount" page.  Your account will the permanently be removed within 24 hours.';
			break;
		case 'Trouble Logging In/Out' :
			form.message.value = 'Please make sure that your internet browser is setup to allow cookies.  For Internet Explorer... Go to the Tools menu and select "Internet Options".  Click the "Security" tab and then the "Custom Level" button.  Make sure that both options in the list dealing with cookies are set to "Enable".\nIf you still can\'t login, try clearing your temporary internet files from your computer and deleting all your RateMyBody cookies.  Also in the "Privacy" tab click "Edit".  Then add "ratemybody.com" to your allow list.  \n\nAlso, please make sure that your time zone, date and time are properly set on your computer.  Cookies require this to be accurate.  If you still can\'t login, try clearing your temporary internet files from your computer and deleting all your ratemybody cookies.  If all else fails contact us..';
			break;
		case 'Member Using My Photo' :
			form.message.value = 'If somebody is using your picture and you would like it removed, you will have to provide us with AMPLE PROOF that it is you.  We ask you to create an account (can be deleted after if desired) using a picture that adhears to our salute guidelines.  A salute is credited when the user has taken a clear picture of themselves with their RMB username as well as RateMyBody.com in the photo. The username and sitename must appear in the actual photo (on paper, written on body, etc) and not added in with image editing software.  They also must be clear, highly visible and in color.  To report a faker go to our message forums under "Report Fakes" and report it there with proof and it will be promptly removed.  You can also create an account using a valid salute. ';
			break;
		case 'Forgot Password' :
			form.message.value = 'If you have forgotten your password on RMB, simply proceed to the login page.  On the right there is a link to retrieve your password.  If you do not receive your password, make sure your junk mail settings allow for incoming mail from ratemybody.  This is a common problem.';
			break;
		case 'Activation Link' :
			form.message.value = 'If you did not receive the activation link for your account, you can have the email sent to your email address again by using the link on the right of the login page.  If you do not receive a link, make sure your junk mail settings allow for incoming mail from ratemybody.  This is a common problem.  If after all these steps it still doesnt work please try the alternative email validation method listed on the login page';
			break;
		default :
			form.message.value = ''
	}
		form.message.blur(); form.message.focus(); form.message.select();
}

function validateForm() {
	form = document.contact_form;
	subject = form.subject.value;
	email = form.email.value;

	var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
    var regex = new RegExp(emailReg);
    email_valid = (regex.test(email)) ? 1 : 0 
	if (!email_valid)
	{
		form.email.blur();
		form.email.focus();
		form.email.select();
		alert("Please enter a valid email address.");
		return false;
	}

	if (subject.length < 1)
	{
		form.subject.blur();
		form.subject.focus();
		form.subject.select();
		alert("Please enter a subject for this message.");
		return false;
	}
	
	return true;
}
	//  End --> 
