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()); } }; if (jQuery.ui && isMobile.any()) { document.write(""); } if ( typeof HM_DirJs != 'undefined') document.write("<\/SCR" + "IPT>"); if ( typeof HM_idioma != 'undefined') document.write("<\/SCR" + "IPT>"); var is = new Is(); 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 = d == undefined ? "." : d, t = 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 = general_charDecimal === undefined ? "." : general_charDecimal, t = 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+$/,""); } 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(); }); }); }); } function alerta(titulo){ 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" ); } //Usada para aƱadir un video de youtube //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 = "http://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); } }