function Validate_Email(theForm)
{


  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email Address\" field.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Email Address\" field.");
    theForm.email.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
  var checkStr = theForm.email.value;
  var allValid = true;
  var bDotPresent = false;
  var bRatePresent = false;
  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 (j == checkOK.length - 1  )
	    {
	    	bDotPresent = true;

	    }

	    if (j == checkOK.length -2 )
	    {
	    	bRatePresent = true;
	    }

  }

  if (!allValid)
  {
    alert("Please enter only letter, digit and \"-_@.\" characters in the \"Email Address\" field.");
    theForm.email.focus();
    return (false);
  }

  if ((!bDotPresent) || (!bRatePresent) )

    {
    	alert ("Please enter a valid email address");
    	theForm.email.focus();
    	return(false);
    }

	  return (true);
}

function openPopUp (winURL, winName, winFeatures){
	newWindow = window.open(winURL,winName,winFeatures);
	newWindow.focus();
}

function newGalleryWindow(galleryURL, galleryWinName, galleryFeatures){
	window.open(galleryURL, galleryWinName, galleryFeatures);
}

function displayWindow (url, width, height){
		var Win = window.open (url,"displayWindow",'width=' + width + ',height=' +
		height + ',resizable=0,scrollbars=no,menubar=no,status=yes');
		Win.focus();
	}

function validateIt(theForm)
 {
  if(theForm.categoryid.value != '')
	{
	theForm.submit()
	}
  else
     	{
     	return false
     	}
 }
 
function doClear(theText) {
	if (theText.value == theText.defaultValue) {
	  theText.value = ""
	}
}