
function is_email_invalid(an_email)
{
  if (is_empty_str(an_email)) return 0;

  if (!(an_email.search(/[a-zA-Z0-9_][a-zA-Z0-9_-]*@([a-zA-Z0-9_-]+)*\.[a-zA-Z0-9_-]+/i)>=0))
       return 1
  else return 0;
}

function is_empty_str(str)
{
 return (str.toString().replace(/ +/i,"")=="");
}

function Cur(s)
{
  s.style.cursor="hand";
}

// окно, которое по центру
function OutInWin(pict, xw, yw, namew, prop)
{
    var x_width, y_height;
    x_width  = xw;
    y_height = yw;

    w_top=0; w_left=0;

    w_top = (screen.height - y_height)/2-50;
    w_left= (screen.width - x_width)/2;

    if (prop=="") prop = ",resizable=yes,scrollbars=yes,status=no,dependent=no";
    
    window.open(pict, namew, "top="+w_top+",left="+w_left+",width="+x_width+",height="+y_height+prop);
    return false;
}

function htmlspecialchars(s)
{
  s = s.replace(/</g, "&lt;");	
  s = s.replace(/>/g, "&gt;");	

  return(s);
}
//вывод вакансий
function out_more(id)
{
     OutInWin("catalog-v.html?pw_patt=easy&op=one&id="+id, 500, 400, "", "");
     return false;
}

function out_more_rez(id)
{
     OutInWin("catalog-r.html?pw_patt=easy&op=one&id="+id, 500, 400, "", "");
     return false;
}