function creaBanner(id, ofertas, imagenes, enlaces, tipurl, chkrot, tiempo, estilo, width, height){ this.id = id; this.ofertas = ofertas; this.imagenes = imagenes; this.enlaces = enlaces; this.estilo = estilo; this.tipurl = tipurl; this.chkrot = chkrot; this.tiempo = tiempo; this.numero = 0; document.write('<img border="0" id="'+ this.id +'" class="' + this.estilo + '">'); this.rotabanner = function(){ if (this.numero >= this.imagenes.length) { this.numero = 0; } var img = document.getElementById(this.id); img.src = this.imagenes[this.numero]; if ((width != null) && (width != '')) img.width = width; if ((height != null) && (height != '')) img.height = height; if (this.enlaces[this.numero] != '') { var link = this.enlaces[this.numero]; var url = this.tipurl[this.numero]; img.style.cursor = 'pointer'; img.onclick = function() { if (link != ''){ accionComponente( null, link, url ); } }; if (url == 'EXT') img.alt = this.enlaces[this.numero]; else img.alt = ''; } else { if (this.tipurl[this.numero] == 'RES') { var ofe = this.ofertas[this.numero]; var url = this.tipurl[this.numero]; img.style.cursor = 'pointer'; img.onclick = function() { if (ofe != ''){ accionComponente( ofe, null, url ); } }; img.alt = ''; } else { img.style.cursor = ''; img.onclick = function() { }; } } if ((this.chkrot == 'S') && (this.imagenes.length > 1)) { this.numero = this.numero + 1; setTimeout(this.id + '.rotabanner()', this.tiempo); } }; this.rotabanner();}function botonMini ( texto, funcion, size, id) { if (!size) size = 50; id = (id != null) ? ' id="' + id + '"' : ''; s ='<table ' + id + 'width="' + size + '" class="borde_oscuro" border="0" cellspacing="1" cellpadding="0" onclick="' + funcion + '">'; s +='<tr><td class="arial_9_oscuro_pastel" onmouseOver="this.className=\'arial_9_oscuro_naranja\'" onmouseOut="this.className=\'arial_9_oscuro_pastel\'" align="center" style="padding-left:2px;padding-right:2px;cursor:pointer">' + texto + '</td></tr></table>'; document.write(s);}var urlAccionOferta = 'offers.do';function accionComponente( codofe, url, tipurl ) { if (tipurl == 'RES') { document.forms[0].codofe.value = codofe; document.forms[0].action = urlAccionOferta; document.forms[0].submit(); } else if (tipurl == 'INF') { ventana = window.open(urlAccionOferta + '?codofe=' + codofe, 'ventana', 'toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no,width=384,height=400'); } else if (tipurl == 'URI') { document.location = url; } else if (tipurl == 'URE') { ventana = window.open(url,'ventana', 'toolbar=yes,location=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,width=800,height=420'); } else if (tipurl == 'FIC') { ventana = window.open(url, 'ventana', 'toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=yes');}}function posicionaComponente (comp, posicion) { var comp = document.getElementById('codcpn_' + comp); while (comp.childNodes.length > 0) { document.getElementById('posicion_' + posicion).appendChild(comp.firstChild); }}