function is_empty(str)
{
  if(!str)
	return true;
  return str.search("^[ \t\n\r]*$") > -1 ? true : false ;
}

function is_password ( str )
{
  if ( str.length < 6 )
	return false;
  
  return str.search ( "[^a-zA-Z0-9_]{1}" ) > -1 ? false : true;
}

function is_email(str)
{
  //return true;
  return str.search("^([a-zA-Z0-9_]|\\-|\\.)+@(([a-zA-Z0-9_]|\\-)+\\.)+[a-zA-Z]{2,4}\$") > -1 ? true : false ;
}

function is_number ( str )
{
  uint = str.replace( /[ ]/g, "");
  if ( str.length == 0 )
    return false;
  return uint.search ( "([^0-9]{1})" ) != -1 ? false : true;
}

function is_checked(theForm, inputName)
{
  
  if ( theForm.elements[inputName] )
  {
    if ( theForm.elements[inputName].length )
    {
	  
  	  for ( i = 0 ; i<theForm.elements[inputName].length; i ++)
	  {
		if ( theForm.elements[inputName][i].checked )
		{
		   return true;
		}
	  }
	}
  }
  else
  {
	  inputName2=inputName+"[]";

	  if(theForm.elements[inputName2].length)
	  {
		for ( i = 0 ; i<theForm.elements[inputName2].length; i ++)
		{
		  if ( theForm.elements[inputName2][i].checked )
		  {
		   return true;
		  }
		}
	  }
	  else
		 	
	  {
		if ( theForm.elements[inputName].checked )
		  return true;		  		
	  }
  }
  
  return false;
}


function OpenPopUp_NoScroll(win_name,x,y){
	var sw1;
	var param = "toolbar=no,titlebar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,screenX=0,screenY=0,width="+x+",height="+y+",top=0,left=0";
	sw1 = window.open( win_name, "window1", param );
	sw1.focus();
}
