function is_email_valid(an_email)
{
  return (an_email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)>=0);
///[a-zA-Z0-9_][a-zA-Z0-9_-]*@([a-zA-Z0-9_-]+\.)*[a-zA-Z0-9_-]+/i  - old
}

function is_empty_str(str)
{
 return (str.toString().replace(/ +/i,"")=="");
}

// Вывод в отдельном окне
function ShowWinFull(pict, namew)
{
  window.open(pict, "_blank", "width=600,height=500,resizable=yes,scrollbars=yes,status=no,dependent=no");
}

// Вывод в отдельном окне
/*function ShowPic(pict, namew) {
  window.open(pict, "_blank", "width=350,height=500,resizable=no,status=no,dependent=no,scrollbars=no");
 }*/

// Вывод faq
function OutPic(pict, par)
 {
  switch (par)
  {
     case 1: window.open(pict, "_blank", "width=350,height=220,resizable=yes,scrollbars=no,status=no,dependent=no");break;
     case 2: window.open(pict, "_blank", "width=400,height=470,resizable=yes,scrollbars=no,status=no,dependent=no");break;
     case 3: window.open(pict, "_blank", "width=350,height=500,resizable=yes,scrollbars=no,status=no,dependent=no");break;
  }
  return false;
 }
function Cur(s)
{
  s.style.cursor="hand";
}

// Вывод в отдельном окне
function ShowPic(pict, xw, yw)
{
  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;

  pic=window.open("about:blank", "_blank", "top="+w_top+",left="+w_left+",width="+x_width+",height="+y_height+",resizable=no,status=no,dependent=no,scrollbars=no");
  pic.document.writeln("<html><body leftmargin=0 topmargin=0>");
  eval("pic.document.writeln(\"<table border=0  HEIGHT=100% valign=center align=center CELLSPACING=0 CELLPADDING=0 ><tr ><td><img valign=middle width=640 src='"+ pict +"'></td></tr></table>\")");
  pic.document.writeln("</body></html>");

  return false;
}


// окно, которое по центру
function OutInWin(pict, xw, yw, namew,scroll)
{
    var x_width, y_height;
    x_width  = xw;
    y_height = yw;
    if(!scroll)
     scroll='yes';
    w_top=0; w_left=0;

    w_top = (screen.height - y_height)/2-50;
    w_left= (screen.width - x_width)/2;

    window.open(pict, namew, "top="+w_top+",left="+w_left+",width="+x_width+",height="+y_height+",resizable=yes,scrollbars="+scroll+",status=no,dependent=no");
    return false;
 }