    function OpenCertDetails(){
      height = 495;
      width = 498;
      var str = "height="+ height +",width="+ width +",toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no";
      if (window.screen){
         var ah = screen.availHeight - 30;
         var aw = screen.availWidth - 10;
         var xc = (aw - width) / 2;
         var yc = (ah - height) / 2;
         str += ",left=" + xc + ",screenX=" + xc;
         str += ",top=" + yc + ",screenY=" + yc;
      }
      thewindow = window.open('https://security.webstorm.com.br/BRWEBS4.php', 'anew', str);
    }

    // POP UP
    function WSpopup(url, name, height, width, barra)
    {
      var str = "height=" + height + ",innerHeight=" + height;
      str += ",width=" + width + ",innerWidth=" + width;
      str += ",status=no,scrollbars="+barra+",resizable=no";
      if (window.screen){
         var ah = screen.availHeight - 30;
         var aw = screen.availWidth - 10;
         var xc = (aw - width) / 2;
         var yc = (ah - height) / 2;
         str += ",left=" + xc + ",screenX=" + xc;
         str += ",top=" + yc + ",screenY=" + yc;
      }
      var win = window.open(url, name, str);
    }
    
    function WS_goToURL() {
           var i, args=WS_goToURL.arguments; document.WS_returnValue = false;
           for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    }
    
    
    // ENQUETE
  //variáveis essenciais
  var myHeight = 420;
  var myWidth = 400;
  var isResizable = true;
  function createTarget(form)
  {
          _target = form.target;
          _colon = _target.indexOf(":");

          if(_colon != -1)
          {
                  form.target = _target.substring(0,_colon);
                  form.args = _target.substring(_colon+1);
          }
          else if(typeof(form.args)=="undefined")
          {
                  form.args = "";
          }

          if(form.args.indexOf("{")!=-1)
          {
                  _args = form.args.split("{");
                  form.args = _args[0];
                  for(var i = 1; i < _args.length;i++)
                  {
                          _args[i] = _args[i].split("}");
                          form.args += eval(_args[i][0]) + _args[i][1];
                  }
          }
          if (window.screen){
             var ah = screen.availHeight - 30;
             var aw = screen.availWidth - 10;
             var xc = (aw - myWidth) / 2;
             var yc = (ah - myHeight) / 2;
             form.args += ",left=" + xc + ",screenX=" + xc;
             form.args += ",top=" + yc + ",screenY=" + yc;
          }
          form.args = form.args.replace(/ /g,"");
          window.name = 'POPUP'; //nome desta janela
          _win = window.open('',form.target,form.args);
          _win.opener = self;

          if(typeof(focus)=="function")
                  _win.focus();

          return true;
  }

  function WSenquete(form)
  {
          if (createTarget(form))
          {
                  form.submit();
          }
  }

  // ENQUETE RESULTADO
  function WSenqueteR()
  {
    str = 'enquete.php';
    WSpopup(str, 'ENQUETE', 420, 400, 'yes');
  }
  
  // VALIDA E-MAIL
	function WSemail(obj){
		ob = obj;
		obj = obj.value;
    	var invalid = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
     	if ( obj.length == 0 )	{
     		alert("Endereço de email inválido!");
     		ob.focus();
	     	return false;
     	}
     	if (invalid.test( obj ) == false) {
     		alert("Endereço de email inválido!");
     		ob.focus();
     		return false;
     	}     
     	return true;
	}