﻿// Archivo JScript

<!--
    //Funcion que modifica el formulario al seleccionar el radioButton (particular)
    function SelectParticular() {                                  
       //Deshabilitamos el campo empresa y su validador
       document.getElementById("fila_empresa").style.display = "none";
       document.getElementById("txt_empresa").value = "particular";           
       ValidatorEnable(document.getElementById("validaempresa"), false);
       //Cambiamos el label para Nombre
       document.getElementById("lbl_contacto").innerHTML = "Nombre <span class='asterisco'>*</span>";       
       document.getElementById("resumen_errores").innerText= "";
       document.getElementById("radio_particular").checked = true;              
              
       //innerText solo funciona en IE, hay que utilizar innerHTML.
    }
    
    //Funcion que modifica el formulario al seleccionar el radioButton (empresa)
    function SelectEmpresa() {                  
      //Mostramos el bloque de empresa                 
       if(navigator.appName.indexOf("Microsoft") > -1){
          document.getElementById("fila_empresa").style.display = "block"
        }else{
          document.getElementById("fila_empresa").style.display = "table-row";  
        }	                                     
       document.getElementById("txt_empresa").value = ""; 
       ValidatorEnable(document.getElementById("validaempresa"), true);
       //Cambiamos el label para Nombre
       document.getElementById("lbl_contacto").innerHTML = "Nombre contacto <span class='asterisco'>*</span>";
       //Cambiamos el label para Usuario
       //document.getElementById("lbl_usuario").innerHTML = "Usuario (CIF) <span class='asterisco'>*</span>";
       document.getElementById("resumen_errores").innerText= "";
    }
    
    
    //Funcion Preload Images
    function MM_preloadImages() { //v3.0
        var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }    

    function preload_img(){        
        MM_preloadImages('imgs/tabs_hover.jpg')        
    }
    
     //Funciones MapaGoogle.
    function expand(nombre){ 
      if (document.getElementById(nombre).style.display == "none") {         
         document.getElementById(nombre).style.display = "block";   
      }else{
         document.getElementById(nombre).style.display = "none";    
 }
}
    
               
// -->

function despliegue () {
//$(document).ready(function(){  
  
    $("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)  
  
    $("ul.topnav li span").click(function() { //When trigger is clicked...  
  
        //Following events are applied to the subnav itself (moving subnav up and down)  
        $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click  
  
        $(this).parent().hover(function() {  
        }, function(){  
            $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up  
        });  
  
        //Following events are applied to the trigger (Hover events for the trigger)  
        }).hover(function() {  
            $(this).addClass("subhover"); //On hover over, add class "subhover"  
        }, function(){  //On Hover Out  
            $(this).removeClass("subhover"); //On hover out, remove class "subhover"  
    });  
} ; 


