//########### DETECCIÓN DEL NAVEGADOR Y POP UP
IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);
var radval = 0;
var newWin=null;

function popup(loc, name, width, height, scroll) {
	if (scroll == 'yes'){
	scroll = 'yes';
	}else{
	scroll = 'no';
	}
        var _params = "width="+width+",height="+height+",resizable=no, scrollbars="+scroll+",status=no";

        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-width) >>1 );
                 _top = ( (screen.height-height) >>1 );
        } else {
                 _left = ( (800-width) >>1 );
                 _top = ( (600-height) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;
        
		newWin = window.open(loc, name, _params);
        if ( newWin!=null && !(IE && bVer<5) )
        newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}

function popup2(loc, name, width, height, scroll) {
	if (scroll == 'yes'){
	scroll = 'yes';
	}else{
	scroll = 'no';
	}
        var _params = "width="+width+",height="+height+",resizable=no, scrollbars="+scroll+",status=no";

        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-width) >>1 );
                 _top = ( (screen.height-height) >>1 );
        } else {
                 _left = ( (800-width) >>1 );
                 _top = ( (600-height) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;
        
		newWin = window.open(loc, name, _params);
        //if ( newWin!=null && !(IE && bVer<5) )
        //newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}

//####### BARRA DEL NAVEGADOR
var message = 'Bienvenido a Comext.com.ve';
statuss();
function statuss()
    {
    window.status = message;
    //timerID = setTimeout("statuss()", 25);
}

//########### POLITICAS DE PRIVACIDAD
function politicas(){
	popup( '../politicas/politica_privacidad.asp', 'POLITICAS', 500, 550, 'yes');
}

//########### ACCESESIBILIDAD
function accesibilidad(){
	popup( '../politicas/accesibilidad.asp', 'ACCESESIBILIDAD', 500, 550, 'yes');
}

//########### TAMAÑOS DE FUENTES
function AumentarTamano(){
var Boton=window.event.srcElement
var Elementos=document.all.tags("span")
var tam

for (i=0;i<Elementos.length;i++){
tam = 0;
tam=parseFloat(Elementos[i].style.fontSize);
Elementos[i].style.fontSize=tam + 1
if (tam>=13) {
Elementos[i].style.fontSize=10
}
}
}

function DisminuirTamano(){
var Boton=window.event.srcElement
var Elementos=document.all.tags("span")
var tam

for (i=0;i<Elementos.length;i++){
tam = 0;
tam=parseFloat(Elementos[i].style.fontSize);
Elementos[i].style.fontSize=tam - 1
}
if (tam<=10) {
//tool.disminuir.disabled = true;
}else{
//tool.aumentar.disabled = false;
}
}

function Inicio(){
var Elementos=document.all.tags("span")
for (i=0;i<Elementos.length;i++){
Elementos[i].style.fontSize=10
}
}


//########### RECOMENDAR ARTICULO
function recomendar_articulo(){
	popup2( '../soporte/recomendar.asp', 'RECOMENDAR', 400, 350, 'no');
}

//####### VALIDAR CONTACTENOS
function validar() {
  checkResult = true;
  //VALIDAR NOMBRES
  if (document.contactenos.nombre.value.length==0) {
     alert("Debe de escribir su Nombre y Apellido");
     document.contactenos.nombre.focus();
     return (false);
     checkResult = false;
  }
  //VALIDAR EMPRESA
  if (document.contactenos.empresa.value.length==0) {
     alert("Debe de escribir el Nombre de su Empresa");
     document.contactenos.empresa.focus();
     return (false);
     checkResult = false;
  }
  //VALIDAR CORREO
  if (document.contactenos.correo.value.length==0) {
     alert("Debe de escribir su Correo");
     document.contactenos.correo.focus();
     return (false);
     checkResult = false;
  }
  //VALIDAR TELEFONO
  if (document.contactenos.telefono.value.length==0) {
     alert("Debe de escribir su Teléfono");
     document.contactenos.telefono.focus();
     return (false);
     checkResult = false;
  }
  //VALIDAR AREA DE INTERES
  if (document.contactenos.area_interes.value.length==0) {
     alert("Debe de selecionar un Área de Interés");
     document.contactenos.area_interes.focus();
     return (false);
     checkResult = false;
  }
  if (checkResult == true)
  {
  document.contactenos.B1.disabled = true;
  document.contactenos.B2.disabled = true;
  }
  return checkResult;
}