function ET_Trim(str)
{
  var i,j;
  i = 0;
  j=str.length-1;
  str = str.split("");
  while(i < str.length)
  {
    if(str[i]==" ")
    {
      str[i] = "";
    }
    else
    {
      break;
    }
    i++;
  }
  while(j > 0)
  {
    if(str[j]== " ")
    {
      str[j]=""
    }
    else
    {
      break;
    }
    j--;
  }
  return str.join("");
}


// Validate an Email.
function validEmail(email) {
var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
var checkend=/\.[a-zA-Z]{2,3}$/;

if((email.search(exclude) != -1) || (email.search(checkend) == -1)) {
	return false;
}

atPos = email.indexOf("@",0);
pPos1 = email.indexOf(".",0);
periodPos = email.indexOf(".",atPos);
pos1 = pPos1;
pos2 = 0;
while (pos2 > -1) {
	pos2 = email.indexOf(".",pos1+1);
	if (pos2 == pos1+1) {return false;
	} else {pos1 = pos2;}
}

if (atPos == -1) {return false;}
if (atPos == 0) {return false;}
if (pPos1 == 0) {return false;}
if(email.indexOf("@",atPos+1) > -1) {return false;}
if (periodPos == -1) {return false;}
if (atPos+1 == periodPos) {	return false;}
if (periodPos+3 > email.length) {return false;}
return true;
}



function AcceptNumber()
			{
	
				code=eval(event.keyCode);						
				if (code<48 || code>57)
				{
				event.keyCode=0;
				}
			}


function OpenPop(url)
{
	window.open(url,"epop","width=400,height=400,scrollbars=yes");
}