
// Funciones y parametros para la generacion dinamica de contenido JS
// 20031230
// Producciones Lo Nunca Visto
//

// Array de posibles ID
var identifiers = Array();

// Valores por defecto (NO CAMBIAR)
setIdTlf('default', '902 060 440');
setIdTlf('www.infoalarmas.es', '902 060 440');

// Valores por defecto para el banner
setBanner('default', 'ofertas/oferta_sept.jpg.jpg', 'alarmas_hogar.html');
setBanner('www.infoalarmas.es', 'ofertas/oferta_sept.jpg', 'alarmas_hogar.html');

// Valores por defecto para el iframe
setIframe('default', 'iframes_speed/iframe_call_speed_securitas.html');
setIframe('www.infoalarmas.es', 'iframes_speed/iframe_call_speed_securitas.html');

// Valores por defecto para la URL de destino
setURLFinal('default', 'http://www.infoalarmas.es/enviado_ok.html');
setURLFinal('www.infoalarmas.es', 'http://www.infoalarmas.es/enviado_ok.html');

// Ids adicionales: escribir siempre el nombre del id en minusculas
// Escribir de la forma: 
//           setIdContents(id_proveedor, imagen);
//
setIdTlf('www.infoalarmas.es', '902 060 440'); 					// 902 543 145		ACD = 66156		G = 91 512 71 90
setIdTlf('buzoneo_internet', '902 118 317'); 					// 902 118 317		ACD = RP		G =	RP
setIdTlf('google_marca', '902 300 088');						// 902 111 194		ACD = 66124		G = 91 512 71 82
setIdTlf('google_generico', '902 255 075');						// 902 111 288		ACD = 66138		G = 91 503 15 61
setIdTlf('int_seo', '902 060 440');								// 902 060 440		ACD = 66168		G = 91 512 93 61
setIdTlf('facebook', '902 544 055');							// 902 544 055		ACD = 66157		G = 91 512 71 93
setIdTlf('youtube', '900 33 00 88');							// 900 33 00 88		ACD = 66119		G = 91 512 71 72
setIdTlf('yahoo', '902 111 194');								// 902 111 194		ACD = 66124		G = 91 512 71 82

setIdTlf('me_gusta', '900 11 33 33');							//

// Ids WEB

setIdTlf('promociones', '900 80 07 94');						// 900 80 07 94		ACD = 66135		G = 91 512 93 68						
setIdTlf('cesta', '900 80 07 94');								// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('action50', '900 80 07 94');							// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('travelclub', '900 80 07 94');							// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('msn', '900 80 07 94');								// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('ciberclick', '900 80 07 94');							// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('idealista', '900 80 07 94');							// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('anuntis', '900 80 07 94');							// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('vocento', '900 80 07 94');							// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('portae', '900 80 07 94');								// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('rumbo', '900 80 07 94');								// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('su_vivienda', '900 80 07 94');						// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('grupo_zeta', '900 80 07 94');							// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('net_affiliation', '900 80 07 94');					// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('muchoviaje', '900 80 07 94');							// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('travelclub_emailig', '900 80 07 94');					// 900 80 07 94		ACD = 66135		G = 91 512 93 68
setIdTlf('int_qdq', '900 80 07 94');							// 900 80 07 94		ACD = 66135		G = 91 512 93 68




// Banner
// Formato setBanner(proveedor, imagen, enlace);
// Donde imagen es la imagen del banner que reside en la carpeta cuerpo\imag y enlace es el enlace del banner

setBanner('www.securitasdirect.es', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html'); 	// Id = www.securitasdirect.es
setBanner('buzoneo_internet', 'imag/ofertahome2.jpg', 'alarmas_hogar.html');					// Id = buzoneo_internet
setBanner('google_marca', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');				// Id = google_marca
setBanner('google_generico', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');			// Id = google_generico
setBanner('int_seo', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');					// Id = int_seo
setBanner('facebook', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');					// Id = facebook
setBanner('youtube', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');					// Id = youtube
setBanner('yahoo', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');						// Id = yahoo
setBanner('me_gusta', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');					// Id = me_gusta



// Ids WEB

setBanner('cesta', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('action02', 'imag/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('action50', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('promociones', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('travelclub', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('msn', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('ciberclick', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('idealista', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('anuntis', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('vocento', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('portae', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('rumbo', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('su_vivienda', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('grupo_zeta', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('net_affiliation', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('muchoviaje', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('travelclub_emailig', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');
setBanner('int_qdq', 'imag/ofertas/oferta_sept.jpg', 'alarmas_hogar.html');


// Iframe
// Formato setIframe(proveedor, enlace);
// Donde enlace es el enlace del iframe

setIframe('www.securitasdirect.es', 'iframes_speed/call_homesd.html');						// UI = 1baf2751a673c33d1113b939597072b9 - V = homesd				enviadoweb/enviado_homesd.html
setIframe('buzoneo_internet', 'iframes_speed/call_securitas.html');							// UI = 33bd418905719c2e79602d3ea7ef41fe - V = sec					enviadoweb/enviado_securitas.html
setIframe('google_generico', 'iframes_speed/call_google_generico.html');					// UI = 739428143810587827185b6e341eca31 - V = google_generico		enviadoweb/enviado_google_generico.html
setIframe('google_marca', 'iframes_speed/call_google_marca.html');							// UI = 0d3535cc313d0bdd62969de46843a88a - V = google_marca			enviadoweb/enviado_google_marca.html
setIframe('int_seo', 'iframes_speed/call_seo.html');										// UI = c4730163969d0c1abfdae6c66f4c0ebc - V = seo					enviadoweb/enviado_seo.html
setIframe('facebook', 'iframes_speed/call_facebook.html');									// UI = e7755b988a181baa5f1693945229735e - V = facebook				enviadoweb/enviado_facebook.html
setIframe('youtube', 'iframes_speed/call_youtube.html');									// UI = 4ba879fa6f272606ca50f348605189e9 - V = youtube				enviadoweb/enviado_youtube.html
setIframe('yahoo', 'iframes_speed/call_megusta.html');										// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('me_gusta', 'iframes_speed/call_megusta.html');									// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html



// Ids WEB

setIframe('cesta', 'iframes_speed/call_megusta.html');										// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('action02', 'iframes_speed/call_rp.html');										// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('travelclub', 'iframes_speed/call_megusta.html');									// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('msn', 'iframes_speed/call_megusta.html');										// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('ciberclick', 'iframes_speed/call_megusta.html');									// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('idealista', 'iframes_speed/call_megusta.html');									// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('anuntis', 'iframes_speed/call_megusta.html');									// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('vocento', 'iframes_speed/call_megusta.html');									// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('portae', 'iframes_speed/call_megusta.html');										// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('rumbo', 'iframes_speed/call_megusta.html');										// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('yahoo', 'iframes_speed/call_megusta.html');										// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('su_vivienda', 'iframes_speed/call_megusta.html');								// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('grupo_zeta', 'iframes_speed/call_megusta.html');									// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('net_affiliation', 'iframes_speed/call_megusta.html');							// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('muchoviaje', 'iframes_speed/call_megusta.html');									// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('travelclub_emailig', 'iframes_speed/call_megusta.html');							// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html
setIframe('int_qdq', 'iframes_speed/call_megusta.html');									// UI = 3c189089505b27215b342ac0d2a4eb49 - V = me_gusta				enviadoweb/enviado_me_gusta.html



// URLs finales adicionales
// Escribir de la forma: 
//           setURLFinal(id_proveedor, URL);
//
setURLFinal('www.securitasdirect.es', 'http://www.securitasdirect.es/enviadoweb/enviado_home_form.html');		//enviadoweb/enviado_home_form.html*
setURLFinal('buzoneo_internet', 'http://www.securitasdirect.es/enviadoweb/enviado_buzoneo_form');				//enviado_buzoneo_form.html*
setURLFinal('google_generico', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');	//enviadoweb/enviado_google_generico_form.html*
setURLFinal('google_marca', 'http://www.securitasdirect.es/enviadoweb/enviado_google_marca_form.html');			//enviadoweb/enviado_google_marca_form.html*
setURLFinal('int_seo', 'http://www.securitasdirect.es/enviadoweb/enviado_seo_form.html');						//enviadoweb/enviado_seo_form.html*					
setURLFinal('facebook', 'http://www.securitasdirect.es/enviadoweb/enviado_facebook_form.html');					//enviadoweb/enviado_facebook_form.html*
setURLFinal('youtube', 'http://www.securitasdirect.es/enviadoweb/enviado_youtube_form.html');					//enviadoweb/enviado_youtube_form.html*
setURLFinal('yahoo', 'http://www.securitasdirect.es/enviadoweb/enviado_yahoo_form.html');						//enviadoweb/enviado_yahoo_form.html*
setURLFinal('me_gusta', 'http://www.securitasdirect.es/enviadoweb/enviado_megusta_form.html');					//enviadoweb/enviado_megusta_form.html


// Ids WEB

setURLFinal('promociones', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');				//enviadoweb/enviado_megusta_form.html
setURLFinal('cesta', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');						//enviadoweb/enviado_megusta_form.html
setURLFinal('action02', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');					//enviadoweb/enviado_megusta_form.html
setURLFinal('travelclub', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');				//enviadoweb/enviado_megusta_form.html
setURLFinal('msn', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');						//enviadoweb/enviado_megusta_form.html
setURLFinal('ciberclick', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');				//enviadoweb/enviado_megusta_form.html
setURLFinal('idealista', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');					//enviadoweb/enviado_megusta_form.html
setURLFinal('anuntis', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');					//enviadoweb/enviado_megusta_form.html
setURLFinal('vocento', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');					//enviadoweb/enviado_megusta_form.html
setURLFinal('portae', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');					//enviadoweb/enviado_megusta_form.html
setURLFinal('rumbo', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');						//enviadoweb/enviado_megusta_form.html
setURLFinal('su_vivienda', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');				//enviadoweb/enviado_megusta_form.html
setURLFinal('grupo_zeta', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');				//enviadoweb/enviado_megusta_form.html
setURLFinal('net_affiliation', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');			//enviadoweb/enviado_megusta_form.html
setURLFinal('muchoviaje', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');				//enviadoweb/enviado_megusta_form.html
setURLFinal('travelclub_emailig', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');		//enviadoweb/enviado_megusta_form.html
setURLFinal('int_qdq', 'http://www.securitasdirect.es/enviadoweb/enviado_google_generico_form.html');					//enviadoweb/enviado_megusta_form.html





// Establecer la cookie del proveedor
if (GetCookie("Proveedor") == null) { setCookie("Proveedor", strValueCookie); }

// Establecer la cookie de origen
if(strValueCookieOrigen != null){
	if ( GetCookie("Origen") != 'google_generico' ) {
		if ( strValueCookieOrigen == 'google_generico' ) {
			setCookieYears("Origen", strValueCookieOrigen, 2);
		}
		else {
			setCookie("Origen", strValueCookieOrigen);
		}
	}
}

// Establecer la cookie 
if (GetCookie("IdTravel") == null) { setCookie("IdTravel", strValueCookieTravelId) }

//
// Funciones de gestion de cookies para la obtencion de contenidos
//

function setIdTlf ( proveedor, strImage ) {
	
	if ( !identifiers[proveedor] ) {
		identifiers[proveedor] = Array();
	}
	identifiers[proveedor]['tlf'] = strImage;
}

function setBanner ( proveedor, strImage, strLink ) {
	
	if ( !identifiers[proveedor] ) {
		identifiers[proveedor] = Array();
	}
	identifiers[proveedor]['bannerImage'] = strImage;
	identifiers[proveedor]['bannerLink'] = strLink;
}

function setIframe ( proveedor, strLink ) {
	
	if ( !identifiers[proveedor] ) {
		identifiers[proveedor] = Array();
	}
	identifiers[proveedor]['iframeLink'] = strLink;
}

function setURLFinal ( proveedor, urlFinal ) {
	
	if ( !identifiers[proveedor] ) {
		identifiers[proveedor] = Array();
	}
	identifiers[proveedor]['urlFinal'] = urlFinal;
}

// getContents
// Devuelve el array de contenidos variables para el visitante actual
// PARAMETROS:
// DEVUELVE:
//   Un array o null en caso de error
function getContents ( ) {
	var id = GetCookie("Proveedor").toLowerCase();
	
	if ( id == 'undefined' || id == null || id == "" || identifiers[id] == 'undefined' || identifiers[id] == null ) {
		return identifiers['default']
	}
	return identifiers[id.toLowerCase()];
}


// getPhoneNumber
// Devuelve el nombre de la imagen del telefono variable para el visitante actual
// PARAMETROS:
// DEVUELVE:
//   Cadena con el numero de telefono o null en caso de error
function getPhoneNumber() {
	var contents = getContents();
	
	if ( contents == null || contents == 'undefined' || !contents || contents['tlf'] == 'undefined' || 
		contents['tlf'] == null || contents['tlf'] == "" ) {
		return identifiers['default']['tlf'];	
	}
	return contents['tlf'];
}

// getBannerImage
// Devuelve el nombre de la imagen del banner variable para el visitante actual
// PARAMETROS:
// DEVUELVE:
//   Cadena con el banner o null en caso de error
function getBannerImage() {
	var contents = getContents();
	
	if ( contents == null || contents == 'undefined' || !contents || contents['bannerImage'] == 'undefined' || 
		contents['bannerImage'] == null || contents['bannerImage'] == "" ) {
		return identifiers['default']['bannerImage'];	
	}
	return contents['bannerImage'];
}


// getBannerLink
// Devuelve el nombre de la imagen del banner variable para el visitante actual
// PARAMETROS:
// DEVUELVE:
//   Cadena con el banner o null en caso de error
function getBannerLink() {
	var contents = getContents();
	
	if ( contents == null || contents == 'undefined' || !contents || contents['bannerLink'] == 'undefined' || 
		contents['bannerLink'] == null || contents['bannerLink'] == "" ) {
		return identifiers['default']['bannerLink'];	
	}
	return contents['bannerLink'];
}

// getIframeLink
// Devuelve el el enlace del iframe variable para el visitante actual
// PARAMETROS:
// DEVUELVE:
//   Cadena con el iframe o null en caso de error
function getIframeLink() {
	var contents = getContents();
	
	if ( contents == null || contents == 'undefined' || !contents || contents['iframeLink'] == 'undefined' || 
		contents['iframeLink'] == null || contents['iframeLink'] == "" ) {
		return identifiers['default']['iframeLink'];	
	}
	return contents['iframeLink'];
}

// getURLFinal
// Devuelve el enlace de la URL final para el formulario
// PARAMETROS:
// DEVUELVE:
//   Cadena con la URL o null en caso de error
function getURLFinal() {
	var contents = getContents();
	
	if ( contents == null || contents == 'undefined' || !contents || contents['urlFinal'] == 'undefined' || 
		contents['urlFinal'] == null || contents['urlFinal'] == "" ) {
		return identifiers['default']['urlFinal'];	
	}
	return contents['urlFinal'];
}


