function formControls() {
	if (document.getElementById("RightContactForm")) {
		rightName = document.getElementById("RightContactForm").Name;
		rightEmail = document.getElementById("RightContactForm").Email;
		rightPhoneNumber = document.getElementById("RightContactForm").PhoneNumber;
		rightName.onfocus = new Function("focusValues(rightName, 'Name')");
		rightName.onblur = new Function("blurValues(rightName, 'Name')");
		rightEmail.onfocus = new Function("focusValues(rightEmail, 'Email')");
		rightEmail.onblur = new Function("blurValues(rightEmail, 'Email')");
		rightPhoneNumber.onfocus = new Function("focusValues(rightPhoneNumber, 'Phone Number')");
		rightPhoneNumber.onblur = new Function("blurValues(rightPhoneNumber, 'Phone Number')");
	} else if (document.getElementById("ContactForm")) {
		firstName = document.getElementById("ContactForm").FirstName;
		lastName = document.getElementById("ContactForm").LastName;
		companyName = document.getElementById("ContactForm").CompanyName;
		email = document.getElementById("ContactForm").Email;
		phoneNumber = document.getElementById("ContactForm").PhoneNumber;
		message = document.getElementById("ContactForm").Message;
		firstName.onfocus = new Function("focusValues(firstName, 'First Name')");
		firstName.onblur = new Function("blurValues(firstName, 'First Name')");
		lastName.onfocus = new Function("focusValues(lastName, 'Last Name')");
		lastName.onblur = new Function("blurValues(lastName, 'Last Name')");
		companyName.onfocus = new Function("focusValues(companyName, 'Company Name')");
		companyName.onblur = new Function("blurValues(companyName, 'Company Name')");
		email.onfocus = new Function("focusValues(email, 'Email')");
		email.onblur = new Function("blurValues(email, 'Email')");
		phoneNumber.onfocus = new Function("focusValues(phoneNumber, 'Phone Number')");
		phoneNumber.onblur = new Function("blurValues(phoneNumber, 'Phone Number')");
		message.onfocus = new Function("focusValues(message, 'Message')");
		message.onblur = new Function("blurValues(message, 'Message')");
	}
}

function focusValues(formElement, val) {
	if (formElement.value == val) {
		formElement.value = "";
	}
}

function blurValues(formElement, val) {
	if (formElement.value == "") {
		formElement.value = val;
	}
}

function trimString(str) {
	str = this != window? this : str;
	return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function isEmpty(TmpString) {
	if (!TmpString) {
		return true;
	}
	TmpString = trimString(TmpString);
	if (TmpString.length <= 0) {
		return true;
	}
	return false;
}
