﻿
//Modificar según URL en producción
var srcIframe = 'http://www.neoteo.com/DesktopModules/FBlogArticles/bbv.aspx';

//Funciones
function scrubSXX(str) {
    str = str.replace(/eval\(/g, "");
    str = str.replace(/javascript:/g, "");
    str = str.replace(/[^A-Za-z0-9# \-;\,_]/g, "");
    
	return str;
}

//Código
var iframe;

//Comprobamos que llegan todas las variables
var neoteo_an;
var neoteo_al;

//Función que comprueba que los valores requeridos han llegado por query string
function ExistenValores() {
    if( neoteo_an == null || neoteo_al == null ){             
        return false;
    }
    else {
        return true;
    }
}

//Formatos validos
if ( ExistenValores() ) {
    //Armamos el iframe a mostrar
	iframe = "<iframe name='neoteo_iframe' " + 
                "frameborder='0' marginwidth='0' marginheight='0' vspace='0' hspace='0' " + 
                "height='"              + scrubSXX(neoteo_al) + "' " +
                "width='"               + scrubSXX(neoteo_an) + "' " +
                "allowtransparency='true' scrolling='no' src='" + srcIframe + 	                
                "?neoteo_al="           + scrubSXX(neoteo_al) +                 
                "&neoteo_an="           + scrubSXX(neoteo_an) + 
                "&neoteo_u="            + document.URL + 
                "'>" + 
	         "</iframe>";
} 
else {   
	iframe = "<span style=\"font-family:Arial; font-weight:bold; font-size:11px; color:#000000;\">" + 
	            "No es posible mostrar el banner.<br/>Por favor revise los parámetros." + 
	         "</span>";
}

//Pintamos el iframe
document.write(iframe);







