var banner_derecha_propiedades=Array(Array(77,2,'http://www.mercosurinversiones.com/imgs/banners/filename77.jpg','078104012','_self',0,0,1),Array(73,2,'http://www.mercosurinversiones.com/imgs/banners/filename73.gif','078108012','_blank',0,0,1),Array(71,2,'http://www.mercosurinversiones.com/imgs/banners/filename71.gif','078110012','_blank',0,0,1)); var banner_abajo_propiedades=Array(); var banner_derecha_mercosur=Array(Array(74,2,'http://www.mercosurinversiones.com/imgs/banners/filename74.gif','078107012','_blank',0,0,1),Array(70,2,'http://www.mercosurinversiones.com/imgs/banners/filename70.gif','078111012','_blank',0,0,1),Array(76,2,'http://www.mercosurinversiones.com/imgs/banners/filename76.jpg','078105012','_blank',0,0,1)); var banner_abajo_mercosur=Array(); var banner_derecha_properties=Array(Array(75,2,'http://www.mercosurinversiones.com/imgs/banners/filename75.gif','078106012','_blank',0,0,1),Array(69,2,'http://www.mercosurinversiones.com/imgs/banners/filename69.gif','079102012','_blank',0,0,1)); var banner_derecha_prop_mvdo=Array(Array(72,2,'http://www.mercosurinversiones.com/imgs/banners/filename72.gif','078109012','_blank',0,0,1),Array(68,2,'http://www.mercosurinversiones.com/imgs/banners/filename68.gif','079103012','_blank',0,0,1)); var banner_abajo_prop_mvdo=Array(); var banner_abajo_properties=Array(); var banner_posiciones=Array(); banner_posiciones[2]="derecha_propiedades"; banner_posiciones[11]="abajo_propiedades"; banner_posiciones[15]="derecha_mercosur"; banner_posiciones[16]="abajo_mercosur"; banner_posiciones[17]="derecha_properties"; banner_posiciones[18]="derecha_prop_mvdo"; banner_posiciones[19]="abajo_prop_mvdo"; banner_posiciones[20]="abajo_properties"; var banner_punteros=Array(),banner_punteros_ant=Array(); banner_punteros[2]=-1;banner_punteros_ant[2]=-1; banner_punteros[11]=-1;banner_punteros_ant[11]=-1; banner_punteros[15]=-1;banner_punteros_ant[15]=-1; banner_punteros[16]=-1;banner_punteros_ant[16]=-1; banner_punteros[17]=-1;banner_punteros_ant[17]=-1; banner_punteros[18]=-1;banner_punteros_ant[18]=-1; banner_punteros[19]=-1;banner_punteros_ant[19]=-1; banner_punteros[20]=-1;banner_punteros_ant[20]=-1; var banner_usados=Array(); banner_usados[77]=0; banner_usados[73]=0; banner_usados[71]=0; banner_usados[74]=0; banner_usados[70]=0; banner_usados[76]=0; banner_usados[75]=0; banner_usados[69]=0; banner_usados[72]=0; banner_usados[68]=0; var banner_rotativos=Array(); banner_rotativos[2]=0; banner_rotativos[11]=1; banner_rotativos[15]=0; banner_rotativos[16]=1; banner_rotativos[17]=0; banner_rotativos[18]=0; banner_rotativos[19]=1; banner_rotativos[20]=1; var banner_interval=11000; var banner_timer=null; var cargando_banner=false; var primera_vez=true; function rotar_banners() { if (cargando_banner) return; banner_stop_timer(); var banner_vec,banner_vec_banners_aux,banner_puntero_aux,banner_html,banner_obj,banner_puntero_anterior; for (banner_pos in banner_posiciones) { if (banner_posiciones[banner_pos]!="") { banner_vec_banners_aux=eval("banner_"+banner_posiciones[banner_pos]); if (banner_vec_banners_aux.length>0) { banner_puntero_aux=banner_punteros[banner_pos]; banner_posicion_rotativa=banner_rotativos[banner_pos]; if (banner_posicion_rotativa==0) { banner_html=""; for (banner_count=0;banner_count"+get_banner(banner_id,banner_tipo,banner_url_click,banner_target,banner_width,banner_height,banner_imagen,banner_sin_click)+""; banner_crear_script_tag(banner_url_view,"scr1342"); } banner_obj=document.getElementById("banner_"+banner_posiciones[banner_pos]); if (banner_obj!=null) { banner_obj.innerHTML=banner_html; } banner_posiciones[banner_pos]=""; } else { if (banner_puntero_aux>=banner_vec_banners_aux.length-1) { banner_puntero_aux=0; } else { banner_puntero_aux++; } if (banner_puntero_aux==banner_punteros_ant[banner_pos]) { } else { banner_punteros[banner_pos]=banner_puntero_aux; banner_punteros_ant[banner_pos]=banner_puntero_aux; banner_vec=banner_vec_banners_aux[banner_puntero_aux]; banner_id=banner_vec[0]; //ID EN LA DB DEL BANNER banner_tipo=banner_vec[1]; //1=SWF 2=CUALQUIER OTRA COSA banner_imagen=banner_vec[2]; //JPG, GIF, o SWF o lo que sea banner_click=banner_vec[3]; //ADONDE HACE CLICK banner_target=banner_vec[4]; //TARGET (OJO SI ESTA VACIO) banner_width=banner_vec[5]; //ANCHO SWF banner_height=banner_vec[6]; //HEIGHT SWF banner_sin_click=banner_vec[7]; //BANNER_SIN_CLICK if (banner_target=="") {banner_target="_blank";} banner_url_click="http://www.mercosurinversiones.com/banners/banners_ctrl.php?m=c&u="+banner_click; banner_url_view="http://www.mercosurinversiones.com/banners/banners_ctrl.php?m=v&u="+banner_click; banner_html = get_banner(banner_id,banner_tipo,banner_url_click,banner_target,banner_width,banner_height,banner_imagen,banner_sin_click) banner_obj=document.getElementById("banner_"+banner_posiciones[banner_pos]); if (banner_obj!=null) { old_div = document.getElementById("divbanner"+banner_id); if (old_div!=null) old_div.parentNode.removeChild(old_div); new_div = document.createElement("DIV"); new_div.setAttribute("id","divbanner"+banner_id); new_div.style.display="none"; new_div.innerHTML=banner_html; document.body.appendChild(new_div); img_banner=document.getElementById("img_banner"+banner_id); if (img_banner==null || primera_vez) { display_banner(banner_id,banner_posiciones[banner_pos]); } else { if (img_banner.addEventListener) { img_banner.setAttribute("onload","display_banner("+banner_id+",\""+banner_posiciones[banner_pos]+"\")"); } else { img_banner.attachEvent("onload", function(){display_banner(banner_id,banner_posiciones[banner_pos])}, false); } } if (banner_usados[banner_id]==0) { //ACA CONTABILIZAR EL VIEW DEL BANNER banner_usados[banner_id]=1; banner_crear_script_tag(banner_url_view); } } } } } } } primera_vez=false; banner_start_timer(); } function get_banner(banner_id,banner_tipo,banner_url_click,banner_target,banner_width,banner_height,banner_imagen,banner_sin_click) { if (banner_tipo==1) { //SWF if (banner_sin_click==1) { banner_imagen+="?url_banner="; } else { banner_imagen+="?url_banner="+escape(banner_url_click); } banner_html=""; banner_html+=""; banner_html+=""; banner_html+=""; banner_html+=""; banner_html+=""; banner_html+=""; } else { //IMAGEN COMUN if (banner_sin_click==1) { banner_html="
"; } else { banner_html="
"; } } return banner_html; } function banner_crear_script_tag(file,tagname) { var head_html = document.getElementsByTagName('head'); if (head_html==null) head_html=document; else head_html=head_html[0]; if (tagname==undefined) tagname="jscript_gen"; scriptTag = getObj(tagname); if(scriptTag!=null) { head_html.removeChild(scriptTag); delete(scriptTag); scriptTag=null; } var script = document.createElement('script'); var vch="?"; if (file.indexOf("?")!=-1) vch="&"; script.src = file+vch+Math.random()*1000000; script.type = "text/javascript"; script.id = tagname; head_html.appendChild(script); } function banner_start_timer() { banner_timer=setTimeout("rotar_banners()" , banner_interval); } function banner_stop_timer() { if (banner_timer!=null) { clearTimeout(banner_timer); banner_timer=null; } } function display_banner(id,pos) { var banner_obj=document.getElementById("banner_"+pos); var divbanner = document.getElementById("divbanner"+banner_id); if (divbanner!=null && banner_obj!="") { banner_obj.innerHTML=divbanner.innerHTML; if (divbanner!=null) divbanner.parentNode.removeChild(divbanner); } } rotar_banners();