
	function roll_on (img_name)
	{
		var v_img = eval( 'document.'+img_name);
		v_img.src='images/'+img_name+'_on.JPG';	
		
	}
	function roll_off (img_name)
	{
		var v_img = eval( 'document.'+img_name);
		v_img.src='images/'+img_name+'_off.JPG';
	}

function isEmpty()
{
	
	if (document.theform.name.value == "" || document.theform.name.value ==null)
		{
		alert ("Please enter your full name so I may know whom I will be speaking with.");
		document.theform.name.focus();
		return true
		}
	if (document.theform.email.value == "" || document.theform.email.value ==null)
		{
		alert ("Please enter your email address.");
		document.theform.email.focus();
		return true
		}
	if (document.theform.comments.value == "" || document.theform.comments.value ==null)
		{
		alert ("Please enter what services you are looking for or why I need to contact you.");
		document.theform.comments.focus();
		return true
		}	
	else
	{
	return false
	}
}

//change to upper case

//fix name
function fixName()
{
var i=document.theform.name.value.indexOf(' ')+1
if
((document.theform.name.value.charCodeAt(i) < 65) || (document.theform.name.value.indexOf (' ') < 1) || ((document.theform.name.value.length) == (document.theform.name.value.indexOf(' ')+1)))
{
alert("Please enter your first and last name in the name field.\nMake sure there are no spaces before your name.");
document.theform.name.focus();
return true;
}
else
	{
	return false;
	}
}		
	

//make sure e-mail has an @ sign and a dot
function emailCheck() 
{
if 
(document.theform.email.value.indexOf ('@',0) < 0 || document.theform.email.value.indexOf ('.',0) < 0)
{
alert("Please enter a valid e-mail address.\nThe e-mail field requires an \"@\" and a \".\" be used.\n\nPlease re-enter your e-mail address.")
document.theform.email.focus();
return true;
}
else
	{
	return false;
	}
}
//allow valid characters - error if character not in this list
function emailChars()
{
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒšœŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789_-@.-";
	  var checkStr = document.theform.email.value;
	  var allValid = true;
	  for (i = 0;  i < checkStr.length;  i++)
	  {
	    ch = checkStr.charAt(i);
	    for (j = 0;  j < checkOK.length;  j++)
	      if (ch == checkOK.charAt(j))
	        break;
	    if (j == checkOK.length)
	    {
	      allValid = false;
	      break;
	    }
	  }
	  if (!allValid)
	  {
	    alert("Please enter only letters, digits and \"@.-_\" characters in the \"email\" field.");
	    document.theform.email.focus();
	    return true;
	  }
}
//check for strings of @. and .. - error if found
function moreEmail() 
{
if 
(document.theform.email.value.indexOf ('@.',0) > 0 || document.theform.email.value.indexOf ('..',0) > 0)
{
	alert("Please enter a valid e-mail address.")
	document.theform.email.focus();
	return true;
}
else
	{
	return false;
	}
}
function checkEmail()
{
	var email = document.theform.email.value
	if (email.length  > 1)
		{
			if (emailCheck() || emailChars() || moreEmail())
				{
					return true;
				}
			
			else
		{
		return false;
		}
	}
}


//Here is the batch form validation		
function validateForm()
{
		
	if (isEmpty())
		{
			return false;
		}
	if (checkEmail())
		{
			return false;
		}
	else
	{
	return true
	}
}

function upperMe(formfield)
	{
		var field1 = eval( 'document.theform.'+formfield);
		field1.value=field1.value.toUpperCase();
	}

function openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
  }
//