

//------------------- for clearing and replacing text in form input fields and textareas -------------------//
function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 
function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}

function goBack(){
	history.back(1);
}


function news_validate(){

mesg = "Please check the following errors:\n\r";

if (document.enews.email.value == "" || document.enews.email.value == "email") {mesg = mesg + "Enter Email..\n\r"}



if (document.enews.email.value != "") 

{

	var str = enews.email.value;

	var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;

	if (!str.match(re)) 



	{

		mesg = mesg + "Please Enter A Valid EMail Address ...\n\r"

	}

}


if (mesg!="Please check the following errors:\n\r") {alert(mesg); return false}

if (mesg == "Please check the following errors:\n\r") {return true}

}



function openWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

