
function winOpen(myurl,myname,mywidth,myheight,myresize,myscroll)
{
  myheight = myheight + 25;
  var xPos = (screen.availWidth / 2) - (mywidth / 2) - 4;
  var yPos = (screen.availHeight / 2) - (myheight / 2) - 16;

  var options = "left=" + xPos + ",top=" + yPos + ",width=" + mywidth + ",height=" + myheight +",location=no,menubar=no,resizable=" + myresize + ",scrollbars=" + myscroll + ",status=yes,toolbar=no";

  //alert( myurl + "\n" + myname + "\n" + options );
  var win = window.open( myurl, "", options );
  win.focus();
  //var newWin =
  //newWin.focus();
}

function confirmLink( theLink, confirmMsg )
{

  // Confirmation is not required in the configuration file
  // or browser is Opera.
  if( ( confirmMsg == '' ) || ( typeof( window.opera ) != 'undefined' ) )
  {
    return true;
  }

  var is_confirmed = confirm(confirmMsg);
  if( is_confirmed )
  {
    theLink.href += '&is_js_confirmed=1';
  }

  return is_confirmed;
}

function checkEmail( email )
{
  var regularExpr = /^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-\.]+)\.([a-zA-Z]{2,4}$)/;

  if (regularExpr.test(email) )
  {
    return true;
  }
  else if( email.value == "" )
  {
    return true;
  }
  else
  {
    return false;
  }
}
