function speTrackSubmit() {} function speReadySponsor() { //write cookie document.cookie="cosubmited=1"; //document.getElementById(speIdFormSubmit).submit(); if(typeof window.speCustomAfterSubmit == 'function') { speCustomAfterSubmit(); }else{ document.getElementById(speIdFormSubmit).submit(); } } /*carga de coregistros en un id*/ function speLoadCoregistros() { if(!document.getElementById('speIframe')){ var coregistros = document.createElement('iframe'); coregistros.id = 'speIframe'; coregistros.style.borderWidth = '0'; var parameters = speGetTracker(); coregistros.src = 'http://www.sponsoremail.com/acciones/intnew/coregistros.php?parameters='+base64_encode(parameters); var cantLoaded = 0; if (coregistros.attachEvent){ //alert("dfdsfsdf") coregistros.attachEvent("onload", function(){ if (cantLoaded == 1) { speReadySponsor(); } cantLoaded++; }); } else { coregistros.onload = function(){ if(cantLoaded == 1) { speReadySponsor(); } cantLoaded++; }; } document.getElementById(speIdLoadIframe).innerHTML = '
'; document.getElementById('spe-wrapper').appendChild(coregistros); //document.getElementById(speIdLoadIframe).appendChild(coregistros); } } /** * Arma y retorna la ulr con los parámetros */ function speGetTracker(){ var lista_aficciones = ''; if (speValidateAficcionesSPE == 1) { aficciones = getValueAficcionesSPE().split('|'); lista_aficciones = aficciones[0]; } if (speValidateAficcionesCM == 1) { aficciones = getValueAficcionesCM().split('|'); lista_aficciones = aficciones[0]; } /*if (speValidateAficcionesCustom == 1) { lista_aficciones = spe_getAficiones(); }*/ var parameters = speIdAfiliado+'|'+speIdWeb; parameters += '|'+document.getElementById(speIdEmail).value; parameters += '|'+document.getElementById(speIdNombre).value; parameters += '|'+document.getElementById(speIdApellido).value; parameters += '|'+document.getElementById(speIdCodigoPostal).value; parameters += '|'+document.getElementById(speIdDiaNacimiento).value; parameters += '|'+document.getElementById(speIdMesNacimiento).value; parameters += '|'+getValueAnioNacimiento(); parameters += '|'+getValueSexo(); parameters += (speIdPassword != '') ? '|'+document.getElementById(speIdPassword).value : '|'; parameters += '|'+document.getElementById(speIdSector).value; parameters += '|'+lista_aficciones; parameters += (speValidateMovil == 1) ? '|'+document.getElementById(speIdMovil).value : '|'+0; return parameters; } /** * Retorna el valor el año de nacimiento para SPE (YYYY). Formatos disponibles: YYYY; dd-mm-YYYY */ function getValueAnioNacimiento(){ var anio = speIdAnioNacimiento.split('|'); // speIdAnioNacimiento = "fec_ncto|dd-mm-YYYY" var id = anio[0]; var formato = anio[1]; var value_anio = ''; if (formato == 'dd-mm-YYYY') { value_anio = document.getElementById(id).value.substr(6, 4); }else if (formato == 'YYYY') { value_anio = document.getElementById(id).value; } return value_anio; } /** * Retorna el valor del sexo para SPE (0 o 1) */ function getValueSexo(){ var sexo = speIdSexo.split('|'); // speIdSexo = id_input|tipo_input[select|radio]|valores[H&M] var id_input = sexo[0]; var tipo_input = sexo[1]; var values_web = sexo[2].split('&'); var value_sexo_spe = 2; value_sexo = (tipo_input == 'select') ? document.getElementById(id_input).value : ''; if (tipo_input == 'radio'){ var elements = document.getElementsByName(id_input); for (var i=0; i