function is_email_valid(an_email)
{
  return (an_email.search(/[a-zA-Z0-9_][a-zA-Z0-9_-]*@([a-zA-Z0-9_-]+\.)+[a-zA-Z0-9_-]+/i)>=0);
}

function is_empty_str(str)
{
 return (str.toString().replace(/ +/i,"")=="");
}

// Вывод в отдельном окне
function ShowWinFull(pict, namew)
{
   OutInWin(pict, 670, 520, "_blank");
}

// Вывод в отдельном окне
/*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)
{
    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;

    window.open(pict, namew, "top="+w_top+",left="+w_left+",width="+x_width+",height="+y_height+",resizable=yes,scrollbars=yes,status=no,dependent=no");
    return false;
 }

var _s_img_=new Image();
_s_img_.src='/img/edit.cur';

var _s_obj_=new Object();
_s_obj_.cursor='/img/edit.cur';

function _set_style_(obj, style)
{
 if ((typeof(obj)=='object') && (obj!=null) &&
     (typeof(style)=='object') && (style!=null) && (obj._was_styled_!=style))
 {
  for(var v in style)
  {
   obj.style[v]=style[v];
  } // for
  obj._was_styled_=style;
  if (obj.canHaveChildren && (obj.children!=null) && (obj.children.length>0))
   for(var i=0;i<obj.children.length;i++)
    _set_style_(obj.children[i], style);
 } // if
}
