
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 debug(f)
{
  s = "";
  for (i in f) s = s  + " " +i;
  alert(s);
}


// окно, которое по центру
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 OutPicInWin(pict, xw, yw, title)
{
    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;

    prop = ",resizable=yes,scrollbars=yes,status=no,dependent=no";
    
    w = window.open("", '', "top="+w_top+",left="+w_left+",width="+x_width+",height="+y_height+prop);
    w.document.writeln('<html><head><title>'+title+'</title><link rel="stylesheet" type="text/css" href="/css/popup.css" /></head><body vlink="#FFFFFF" bgcolor="#000000"><center><img src="'+pict+'" vspace="10" hspace="10"><br><a href="" onclick="window.close();return false;">Закрыть</a></center></body></html>');

    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;
}
