
var withBreaks = "friend1@example.com \nfriend2@example.com \nfriend3@example.com";
function print() {
	document.getElementById("invite").value=withBreaks;
}

function blurtextarea(obj) {
	obj.id == "invite";
		if ((obj.value == "") || (obj.value == withBreaks)) {
			obj.style.color = "#a4a4a4";
			obj.value = withBreaks;
		}
}

function focustextarea(obj) {
	if ((obj.id == "invite") && (obj.value == withBreaks)) {
		obj.style.cursor = "default";
		obj.value = "";
		obj.style.color = "#333333";
	}
}

function blurfunction(obj) {
	if ((obj.id == "uname") || (obj.id == "email")) {
		if ((obj.value == "") || (obj.value == "Email")) {
			obj.style.color = "#a4a4a4";
			obj.value = "Email";
		} 
	} else if ((obj.id == "upass") || (obj.id == "cpassword")) {
		if ((obj.value == "") || (obj.value  == "Password")) {
			obj.type = "text";
			obj.style.color = "#a4a4a4";
			obj.value = "Password";
		}
	} else if ((obj.id == "fName") || (obj.id == "First")) {
		if ((obj.value == "") || (obj.value == "First")) {
			obj.style.color = "#a4a4a4";
			obj.value = "First";
		} 
	} else if ((obj.id == "lName") || (obj.id == "Last")) {
		if ((obj.value == "") || (obj.value == "Last")) {
			obj.style.color = "#a4a4a4";
			obj.value = "Last";
		} 
	}
	else if ((obj.id == "signupEmail") ) {
		if ((obj.value == "") || (obj.value == "Enter Email")) {
			obj.style.color = "#a4a4a4";
			obj.value = "Enter Email";
		} 
	}
	else if ((obj.id == "signupPassword") ) {
		if ((obj.value == "") || (obj.value == "Enter Password")) {
			obj.style.color = "#a4a4a4";
			obj.value = "Enter Password";
			obj.type = "text";
		} 
	}
}

function focusfunction(obj) {
	if (((obj.id == "uname") && (obj.value == "Email")) || ((obj.id == "fName") && (obj.value == "First")) || ((obj.id == "lName") && (obj.value == "Last")) || ((obj.id == "upass") && (obj.value == "Password")) || ((obj.id == "email") && (obj.value == "Email")) || ((obj.id == "cpassword") && (obj.value == "Password"))) {
		obj.style.cursor = "default";
		obj.value = "";
		obj.style.color = "#333333";
	}
	if ((obj.id == "upass") || (obj.id == "cpassword")) {
		obj.type = "password";
	}
	
	if (((obj.id == "signupPassword") && (obj.value == "Enter Password")) || ((obj.id == "signupEmail") && (obj.value == "Enter Email"))){
		obj.style.cursor = "default";
		obj.value = "";
		obj.style.color = "#333333";
	}
	if (obj.id == "signupPassword") {
		obj.type = "password";
	}
}

function validateNLSignUpForm() {
	var email = document.nlSignupForm.signupEmail.value;
	//var password = document.nlSignupForm.signupPassword.value;
	if(email == "" || email == "Enter Email") {
		alert("Please provide your email address to signup");
		document.nlSignupForm.signupEmail.focus();
		return false;
	}	else if(email.search("[ ]") == 0) {
		alert("EMail should not start with spaces.");
		document.nlSignupForm.signupEmail.focus();
		document.nlSignupForm.signupEmail.select();
		return false;
	} else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))) 	{
		alert("Invalid E-mail Address! Please re-enter.");
		document.nlSignupForm.signupEmail.focus();
		document.nlSignupForm.signupEmail.select();
		return false;
	}/* else if (password == "") {
		alert("Please provide a proper password");
		document.nlSignupForm.signupPassword.focus();
		return false;
	}  */document.nlSignupForm.submit();
}