// JavaScript Document


    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);
    }



/* Popup */
    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);
    }


    // MENU LATERAL
    function WSovr(src) {
           //if (!src.contains(event.fromElement)) {
                   src.style.cursor = 'pointer';
                   src.bgColor = "#EFEFEF";
                   src.style.color = "#000000";
           //}
    }
    function WSout(src) {
           //if (!src.contains(event.toElement)) {
                   src.style.cursor = 'default';
                   src.bgColor = "C8C8C8";
                   src.style.color = "#000000";
           //}
    }
    function WSout2(src) {
           //if (!src.contains(event.toElement)) {
                   src.style.cursor = 'default';
                   src.bgColor = "D6D6D6";
                   src.style.color = "#000000";
           //}
    }
    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]+"'");
    }

    // IMAGENS
    function newImage(arg) {
            if (document.images) {
                    rslt = new Image();
                    rslt.src = arg;
                    return rslt;
            }
    }

    function changeImages() {
            if (document.images && (preloadFlag == true)) {
                    for (var i=0; i<changeImages.arguments.length; i+=2) {
                            document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
                    }
            }
    }

    var preloadFlag = false;
    function preloadImages() {
            if (document.images) {
                    sd2 = newImage("images/sd2.gif");
                    se2 = newImage("images/se2.gif");
                    preloadFlag = true;
            }
    }

    // MARCAS
    function WSgomarcas()
    {
         var url = "marca.php?m=" + document.WSmarcas.marca.value;
         window.location.href=url;
    }

/********* Enquete **********/
  // 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');
  }



/** **/
              function LembrarSenha(){
                  if( document.wslogin.email.value == "" )
                     alert("Digite o seu e-mail e clique em \"esqueci minha senha\" \npara receber sua senha por e-mail.");
                  else
                     self.location.href = "cliente_lembrarsenha.php?email=" + document.wslogin.email.value;
              }



function A(m)
{
	alert(m);
}


/* Float Div */
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var px = document.layers ? "" : "px";
function JSFX_FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};
	el.flt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.flt()", 40);
	}
	return el;
}
//JSFX_FloatDiv("divTopLeft",       10,   10).flt();
//JSFX_FloatDiv("divTopRight", 	  -100,   10).flt();
//JSFX_FloatDiv("divBottomLeft",    10, -100).flt();
//JSFX_FloatDiv("divBottomRight", -100, -100).flt();
