var IEversion=0;

if (navigator.appVersion.indexOf("MSIE")!=-1){
	IEversion = parseFloat(navigator.appVersion.split('MSIE')[1]);
}


if (IEversion==6){
	alert('Su navegador pertenece a una version de Internet Explorer insegura y desactualizada, se recomienda cambiar a una version nueva (IE8 en adelante) o preferiblemente otro navegador.');
    location.href=document.URL.replace('dropmin','') + 'recursos/error.html';
}

if (IEversion==7){
	alert('Su navegador pertenece a una version de Internet Explorer insegura y desactualizada, se recomienda cambiar a una version nueva (IE8 en adelante) o preferiblemente otro navegador.');
    location.href=document.URL.replace('dropmin','') + 'recursos/error.html';
}

$(function(){

   $('#footer').fadeOut(0);
   $('#footer').fadeIn(1500);
   $('.block_info .titulo_dato').tooltip({ effect: 'slide', tip: $(".tooltip_info"),offset: [200 ,170]});
   $('.sub_block_info .titulo_dato').tooltip({ effect: 'slide', tip: $(".tooltip_info"),offset: [200 ,150]});
});

function opactext(element){
   document.getElementById(element).style.opacity= 0.4;
}

function desopactext(element){
   document.getElementById(element).style.opacity= 1;
}

 var flag_oc=0;
 var arrayFLAGS=new Array;

 for (var x=0;x<=1000;x++){
     arrayFLAGS[x]=0;
 }

 function open_close(id,count_sub_prod){
   if(arrayFLAGS[id]==0){
     $(function(){
          $('#block_'+id).animate({height: (92*(count_sub_prod+1))},500);
     });
     document.getElementById('open_close_'+id).innerHTML = "CERRAR SUBPRODUCTOS/CLOSE";
     for(var i=1;i<=count_sub_prod;i++){
        document.getElementById('sub_block_info_'+id+'-'+i).style.display = 'block';
      }

      fix_size(count_sub_prod*92);
      arrayFLAGS[id]=1;

     }else{
     $(function(){
          $('#block_'+id).animate({height: 90},500);
     });
     document.getElementById('open_close_'+id).innerHTML = "VER SUBPRODUCTOS/OPEN";
     for(var i=1;i<=count_sub_prod;i++){
        document.getElementById('sub_block_info_'+id+'-'+i).style.display = 'none';
      }
      fix_size(-(count_sub_prod*92));
      arrayFLAGS[id]=0;
     }
 }

 function validarOnlyLet(e) { // 1
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
    patron =/[A-Za-z\s]/; // 4
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
}

function validarOnlyNum(e) { // 1
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
    patron =/\d/; // 4
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
}

function hover_select(item,img) {
    document.getElementById(item).style.backgroundImage = "url(" + img + ")";
    document.getElementById(item).style.backgroundRepeat = "no-repeat";
    document.getElementById(item).style.backgroundPosition = "center";
}









