var general_numLoadUrl = 0; function Is () { // convert all characters to lowercase to simplify testing var agt=navigator.userAgent.toLowerCase(); // --- BROWSER VERSION --- this.major = parseInt(navigator.appVersion); this.minor = parseFloat(navigator.appVersion); this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1))); this.nav2 = (this.nav && (this.major == 2)); this.nav3 = (this.nav && (this.major == 3)); this.nav4 = (this.nav && (this.major == 4)); this.nav5 = (this.b=="ns" && this.v==5) this.ie = (agt.indexOf("msie") != -1); this.ie3 = (this.ie && (this.major == 2)); this.ie4 = (this.ie && (this.major == 4)); this.ie5 = (agt.indexOf('msie 5')>0); if (this.ie){ aux=parseInt(agt.substr(agt.indexOf('msie')+5,agt.indexOf(';',agt.indexOf('msie'))-agt.indexOf('msie')-5)); this.ieVersion = aux; }else this.ieVersion = null; this.opera = (agt.indexOf("opera") != -1); this.NN = this.nav && (this.major >= 4); this.IE = this.ie && (this.major >= 4); if (this.ie5) this.v = 5 this.min = (this.NN||this.IE) } var isMobile = { Android: function() { return navigator.userAgent.match(/Android/i); }, BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i); }, iOS: function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); }, Opera: function() { return navigator.userAgent.match(/Opera Mini/i); }, Mobile: function() { return navigator.userAgent.match(/Mobile/i); }, GooglebotMobile: function() { return navigator.userAgent.match(/Googlebot-Mobile/i); }, Windows: function() { return navigator.userAgent.match(/IEMobile/i); }, any: function() { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows() || isMobile.Mobile() || isMobile.GooglebotMobile()); } }; function general_isLoaded(){ if ( typeof HM_idioma == 'undefined') HM_idioma='es'; if ( typeof HM_Menu_Dir == 'undefined') HM_Menu_Dir='/menus/'; if ( typeof HM_DirJs == 'undefined') HM_DirJs=HM_Menu_Dir+"js/"; if (jQuery.ui && isMobile.any()) { loadUrlScript(HM_DirJs +"jquery.ui.touch-punch.min.js",null,null); } loadUrlScript( HM_DirJs+ "/" + HM_idioma + "/general.js",null,"UTF-8"); } function findObj(n, d) { var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0 ? n.toString().length - 1 - n.toString().lastIndexOf(".") : (isNaN(c = Math.abs(c)) ? 2 : c), d = typeof d == 'undefined' ? "." : d, t = typeof t == 'undefined' ? "," : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); }; Number.prototype.formatMoneyLang = function(c){ var n = this, c = c==null && n.toString().lastIndexOf(".")>0 ? n.toString().length - 1 - n.toString().lastIndexOf(".") : (isNaN(c = Math.abs(c)) ? 2 : c), d = typeof general_charDecimal == 'undefined' ? "." : general_charDecimal, t = typeof general_chatMiles == 'undefined' ? "," : general_chatMiles, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); }; String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } String.prototype.ltrim = function() { return this.replace(/^\s+/,""); } String.prototype.rtrim = function() { return this.replace(/\s+$/,""); } function alerta(titulo){ try{ if ($( "#tooltipWindowAlert" ).length==0){ $("body").append("
"); $( "#tooltipWindowAlert" ).dialog({ position:{my: 'center', at: 'center'}, autoOpen: false, closeOnEscape: true, modal:true, title: Txt_general_aviso, show: { effect: "fade", duration: 300 }, hide: { effect: "fade", duration: 300 } }); } $( "#tooltipWindowAlert" ).html(titulo); $( "#tooltipWindowAlert" ).dialog( "open" ); }catch(e){ alert(titulo); } } //Usada para añadir un video de youtube //Insertar el código que devuelve youtube directamente da errores de accesibilidad //Hay que indicar el title del video ya que es necesario por accesibilidad, el identificador del mismo, el ancho y alto del iframe function addVideo(idVideo, titulo, alto, ancho ){ var urlVideo = "//www.youtube.com/embed/" + idVideo; if (titulo == null || titulo =="") alert("Es obligatorio indicar un titulo"); var chr_lt=String.fromCharCode(60); var chr_gt=String.fromCharCode(62); try{ document.write(chr_lt + 'iframe frameborder="0" height="' + alto + '" src="' + urlVideo + '" width="' + ancho + '" title="' + titulo + '" allowfullscreen ' + chr_gt + chr_lt + '/iframe' + chr_gt); }catch(e){ alert(e); } } function loadUrlScript(url,callback,charset){ return loadUrlScriptSync(url,callback,charset,true); } var genLoadTimeOut; function loadUrlScriptSync(url,callback,charset,sync){ var script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); if(charset!=null) script.setAttribute('charset', charset); var funcLoad=callback; if (typeof sync != 'undefined' && sync==true){ if (window.jQuery && general_numLoadUrl==0) { $.holdReady( true ); genLoadTimeOut=setTimeout(function(){ general_numLoadUrl=0; if ( console && console.log ) console.log("Se esta intentado cargar un archivo vacio "); $.holdReady( false ); }, 5000); } general_numLoadUrl++; funcLoad= function(){ general_numLoadUrl--; if (window.jQuery && general_numLoadUrl<=0) { clearTimeout(genLoadTimeOut); $.holdReady( false ); } if (typeof callback!= 'undefined' && callback!=null) callback(); }; } if (script.addEventListener){ script.addEventListener('load', funcLoad,false); } else if (script.attachEvent){ script.attachEvent('load', funcLoad); } script.setAttribute('src', url); try{ document.head.appendChild(script); }catch(e){ document.getElementsByTagName('head')[0].appendChild(script); } } function loadUrlStyle(url,callback,charset){ var script = document.createElement('style'); script.setAttribute('type', 'text/css'); script.setAttribute('src', url); if(charset!=null) script.setAttribute('charset', charset); if(callback!=null) script.addEventListener('load', callback); document.head.appendChild(script); } function readParams(query){ var objStr =""; var valvalue=""; if (query.length>0){ var n=query.split("&"); objStr+="[{"; for (var i=0;i0) objStr+=","; objStr+="\"" + valvalue[0] + "\":\"" + valvalue[1]+ "\""; } objStr+="}]"; } var obj = eval(objStr); if( obj.length>0) return obj[0]; else return null; } general_isLoaded(); var is = new Is(); if (is.ieVersion<8){ $(document).ready(function(){ $("label>input:submit").each(function( key, obj ) { $(obj).parent("label").click(function(event){ $(this).children("input:submit")[0].click(); }); }); }); }