window.glam_affiliate_id = '183770529';
/* Begin code automatically fetched from http://c.amazon-adsystem.com/aax2/amzn_ads.js for A9 Ads API */
function amzn_ads(e){"use strict";try{amznads.updateAds(e)}catch(a){try{console.log("amzn_ads: "+a)}catch(t){}}}function aax_render_ad(e){var a=e.html;document.write(a)}var amzn_console=function(){"use strict";var e={};e.log=function(){};return e}();if(window.console){amzn_console=window.console}var amznads=function(e,a,t,n){"use strict";var o="https:"===a.location.protocol;e.protocol=o?"https://":"http://";e.host="aax.amazon-adsystem.com";e.dtb_svc="/e/dtb/bid";e.pb_svc="/x/getad";e.debug_mode=e.debug_mode||false;e.tasks=e.tasks||[];e.log=function(e){try{n.log(e)}catch(a){}};if(e.debug_mode){e.log("Initiating amznads")}if(!e.ads){e.ads={}}e.updateAds=function(a){e.ads=a.ads;if(e.debug_mode){e.log("Updated ads. Executing rest of the task queue")}e.doAllTasks();e.tasks.push=function(a){e.doTask(a)}};e.getAdForSlot=function(n,o,s){e.src_id=n;var d=d||{};var r=d.u;if(!r){r=encodeURIComponent(a.documentURI);try{r=encodeURIComponent(t.top.location.href)}catch(i){}}if(r&&r.indexOf("amzn_debug_mode")!==-1){e.debug_mode=true}if(e.debug_mode){e.log("amznads.getAdForSlot: Using url="+r)}var g="src="+e.src_id+"&slot_uuid="+o+"&c=100"+"&u="+r+"&cb="+Math.round(Math.random()*1e7);var c=e.protocol+e.host+e.pb_svc+"?"+g;if(e.debug_mode){e.log("amznads.getAdAdForSlot: "+(s?"Async ":"")+"Call to: "+c)}if(s){var u=a.createElement("script");u.type="text/javascript";u.async=true;u.src=c;var m=a.getElementsByTagName("script")[0];m.parentNode.insertBefore(u,m)}else{a.write("");a.close()}};e.getAdsAsync=function(a,t,n){e.getAds(a,t,n,true)};e.getAds=function(n,o,s,d){e.src_id=n;var s=s||{};var r=s.u;var i=s.d;if(!r){r=encodeURIComponent(a.documentURI);try{r=encodeURIComponent(t.top.location.href)}catch(g){}}if(r&&r.indexOf("amzn_debug_mode")!==-1){e.debug_mode=true}if(e.ads){if(e.debug_mode){e.log("amznads.getAds(): clear out existing ads")}e.ads={}}if(i){try{a.domain=i;if(e.debug_mode){e.log("amznads.getAds(): Using domain="+i)}}catch(c){if(e.debug_mode){e.log("amznads.getAds(): Unable to override document domain with '"+i+"'; exception="+c)}}}if(e.debug_mode){e.log("amznads.getAds(): Using url="+r)}var u="src="+n+"&u="+r+"&cb="+Math.round(Math.random()*1e7);if(o){u+="&sz="+o}var m=e.protocol+e.host+e.dtb_svc+"?"+u;if(e.debug_mode){e.log("amznads.getAds: "+(d?"Async ":"")+"Call to: "+m)}if(d){var l=a.createElement("script");l.type="text/javascript";l.async=true;l.src=m;var f=a.getElementsByTagName("script")[0];f.parentNode.insertBefore(l,f)}else{a.write("");a.close()}};e.renderAd=function(a,t){if(e.debug_mode){e.log("amznads.renderAd: key="+t+"; ad-tag="+e.ads[t])}if(e.ads[t]){a.write(e.ads[t]);a.close()}else{var n=new Object;n.c="dtb";n.src=e.src_id;n.kvmismatch=1;n.pubReturnedKey=t;n.aaxReturnedKeys=e.getTokens();n.cb=Math.round(Math.random()*1e7);try{n.u=encodeURIComponent(location.host+location.pathname);if(navigator){n.ua=encodeURIComponent(navigator.userAgent)}}catch(o){}var s=encodeURIComponent(JSON.stringify(n));var d=e.protocol+e.host+"/x/px/p/0/"+s;if(e.debug_mode){e.log("amznads.renderAd: keyValueMismatch detected, "+"pubReturnedKey="+t+", aaxReturnedKeys="+e.getTokens())}a.write("");a.close()}};e.hasAds=function(a){var t;if(!a){try{return Object.keys(e.ads).length>0}catch(n){if(e.debug_mode){e.log("amznads.hasAds: looks like IE 8 (and below): "+n)}for(t in e.ads){if(e.ads.hasOwnProperty(t)){return true}}}}for(t in e.ads){if(e.ads.hasOwnProperty(t)){if(t.indexOf(a)>0){return true}}}return false};e.setTargeting=function(a,t){var n;for(n in e.ads){if(e.ads.hasOwnProperty(n)){if(t&&n.indexOf(t)<0){continue}a(n,"1")}}};e.setTargetingForGPTAsync=function(a){try{if(a){var t=e.getTokens();if(typeof t!="undefined"&&t.length>0){googletag.cmd.push(function(){googletag.pubads().setTargeting(a,t)})}}else{var n;for(n in e.ads){if(e.ads.hasOwnProperty(n)){(function(){var a=n;if(e.debug_mode){e.log("amznads.setTargetingForGPTAsync: pushing localKey="+a)}googletag.cmd.push(function(){if(amznads.debug_mode){amznads.log("amznads.setTargetingForGPTAsync: localKey="+a)}googletag.pubads().setTargeting(a,"1")})})()}}}if(e.debug_mode){e.log("amznads.setTargetingForGPTAsync: Completed successfully. Number of ads returned by Amazon: "+Object.keys(e.ads).length)}}catch(o){if(e.debug_mode){e.log("amznads.setTargetingForGPTAsync: ERROR - "+o)}}};e.setTargetingForGPTSync=function(a){try{if(a){var t=e.getTokens();if(typeof t!="undefined"&&t.length>0){googletag.pubads().setTargeting(a,t)}}else{var n;for(n in e.ads){if(e.ads.hasOwnProperty(n)){googletag.pubads().setTargeting(n,"1")}}}if(e.debug_mode){e.log("amznads.setTargetingForGPTSync: Completed successfully. Number of ads returned by Amazon: "+Object.keys(e.ads).length)}}catch(o){if(e.debug_mode){e.log("amznads.setTargetingForGPTSync: ERROR - "+o)}}};e.appendTargetingToAdServerUrl=function(a){var t=a;try{if(a.indexOf("?")===-1){a=a+"?"}var n;for(n in e.ads){if(e.ads.hasOwnProperty(n)){a+="&"+n+"=1"}}if(e.debug_mode){e.log("amznads.appendTargetingToAdServerUrl: Completed successfully. Number of ads returned by Amazon: "+e.ads.length)}}catch(o){if(e.debug_mode){e.log("amznads.appendTargetingToAdServerUrl: ERROR - "+o)}}if(e.debug_mode){e.log("amznads.appendTargetingToAdServerUrl: input url: "+t+"\nreturning url: "+a)}return a};e.appendTargetingToQueryString=function(a){var t=a;try{var n;for(n in e.ads){if(e.ads.hasOwnProperty(n)){a+="&"+n+"=1"}}}catch(o){if(e.debug_mode){e.log("amznads.appendTargetingToQueryString: ERROR - "+o)}}if(e.debug_mode){e.log("amznads.appendTargetingToQueryString: input query-string:"+t+"\nreturning query-string:"+a)}return a};e.getTokens=function(a){var t,n=[];try{for(t in e.ads){if(e.ads.hasOwnProperty(t)){if(a&&t.indexOf(a)<0){continue}n.push(t)}}}catch(o){if(e.debug_mode){e.log("amznads.getTokens: ERROR - "+o)}}if(e.debug_mode){e.log("amznads.getTokens: returning tokens = "+n)}return n};e.getKeys=e.getTokens;e.doAllTasks=function(){while(e.tasks.length>0){var a=e.tasks.shift();e.doTask(a)}};e.doTask=function(a){try{a.call()}catch(t){if(e.debug_mode){e.log("Failed calling task: "+t)}}};e.tryGetAdsAsync=function(){if(e.asyncParams){e.getAdsAsync(e.asyncParams.id,e.asyncParams.size,e.asyncParams.data)}};return e}(amznads||{},document,window,amzn_console);amznads.tryGetAdsAsync();window["amzn_ads"]=amzn_ads;window["amznads"]=amznads;
/* End code automatically fetched from http://c.amazon-adsystem.com/aax2/amzn_ads.js for A9 Ads API */
if ( !window.glamadapt_timer )
window.glamadapt_timer = new Date().getTime();
window.GlamLogWithTimer = function(pLog)
{
var glamadapt_elapsed = new Date().getTime() - window.glamadapt_timer;
if (window.console != undefined )
console.log(glamadapt_elapsed + ': ' + pLog);
}
window.glam_session = new Object();
window.glam_session.country_code = null;
if ( !window.glamadapt_pvid )
{
window.glamadapt_pvid=5610140905024690546;
}
window.glam_session.glam_sid='119684140507041515311';
window.glam_session.country_code='ES';
function GlamGetGeoData(pName){
var vName = (pName == 'cc' || pName == 'co' ? 'country_code' : pName);
return (window.glam_session && window.glam_session[vName] ? window.glam_session[vName] : null);
}
function GlamGetSessionId(){
return ( window.glam_session && window.glam_session.glam_sid ? window.glam_session.glam_sid : null );
}
function GlamGetReferrerUrl()
{
var glamParentIsPermitted = false;
var glamCurWin = window;
try {
try {
for (i = 0; i <= 10; i++) {
if ((glamCurWin.parent != null) && (glamCurWin.parent != glamCurWin)) {
var loc = glamCurWin.parent.location.toString();
var x = loc.length;
if (x > 0) {
glamCurWin = glamCurWin.parent;
glamParentIsPermitted = true;
}
else {
glamParentIsPermitted = false;
break;
}
}
else {
if (i == 0) { glamParentIsPermitted = true; }
break;
}
}
}
catch (e)
{ glamParentIsPermitted = false; }
if (glamCurWin.document.referrer.length == 0) {
glamURL = glamCurWin.location.href;
}
else {
if (glamParentIsPermitted) {
glamURL = glamCurWin.location.href;
}
else {
glamURL = glamCurWin.document.referrer;
}
}
}
catch (ex) {};
return glamURL;
}
function GlamAddEventListener(expression, call)
{
if ( !window.glamadapt_event_listeners )
{
window.glamadapt_event_listeners = new Array();
}
event_listener = new Object();
event_listener.expression = expression;
event_listener.call = call;
window.glamadapt_event_listeners.push(event_listener);
}
function GlamCreateIframeSlot(afid, adsize, slotname, zone, tile)
{
var adslot = GlamCreateSlot(afid, adsize, slotname, zone, tile);
if ( adslot && adslot.pos )
{
slotname = 'a'+adslot.pos;
window.glamadapt_adslots[slotname].slot_tt = 'i';
}
}
function GlamCreateSlot(afid, adsize, slotname, zone, tile)
{
zone = ( zone ? zone : '/' );
if ( !window.glamadapt_timer )
{
window.glamadapt_timer = new Date().getTime();
}
if ( !window.glamadapt_adslots )
{
window.glamadapt_adslots = {};
}
if ( !window.glamadapt_adscount )
{
window.glamadapt_adscount = 0;
}
if ( ! window.glamadapt_pvid )
{
window.glamadapt_pvid = Math.random()*10000000000000000;
}
if ( '0' != '0' && !window.glamadapt_dormant_created )
{
window.glamadapt_dormant_created = true;
window.glamadapt_reskin_created = true;
window.glam_reskin_called = true; // API v1 compat
window.glam_dormant_called = true; // API v1 compat
GlamCreateSlot(afid, "", "dormant", zone, 999);
}
if ( '' == '1' && !window.glamadapt_reskin_created )
{
window.glamadapt_reskin_created = true;
window.glam_reskin_called = true; // API v1 compat
window.glam_dormant_called = true; // API v1 compat
GlamCreateSlot(afid, "888x11", "reskin", zone, 999);
}
if ( !tile )
{
window.glamadapt_adscount++;
}
adslotObject = new Object();
adslotObject.afid = afid;
adslotObject.ccalls = 0;
adslotObject.acalls = 1;
adslotObject.sz = adsize;
adslotObject.slot = slotname;
adslotObject.pos = ( tile ? tile : window.glamadapt_adscount );
adslotObject.zone = ( zone ? zone : '/' );
window.glamadapt_adslots["a" + adslotObject.pos] = adslotObject;
GlamLogWithTimer('Added ' + slotname);
return adslotObject;
}
function GlamTrack(afid)
{
GlamGetContent(afid, true, true);
}
function GlamGetAds(afid, zone)
{
GlamGetContent(afid, false, false, ( zone ? zone : '/' ));
}
function GlamGetContent(afid, async, track_only, zone)
{
var reqsq = -9999;
zone = ( zone ? zone : '/' );
var glam_host = 'www35.glam.com';
var ga_api_tt=(window==top ? 'j' : 'i');
var ga_api_dt='';
var ga_track_inv=1;
var ga_track_inv_mode='js';
window.glam_affiliate_id = (window.glam_affiliate_id ? window.glam_affiliate_id : afid);
var js_call = ('https:' == document.location.protocol ? 'https://s' : 'http://') +
(!track_only ? glam_host + '/gad/glamadapt_psrv.act' : glam_host + '/gad/glamadapt_psrv.act') +
'?;afid=' + afid + ';zone=' + ( zone.indexOf('/') > -1 ? zone : '/' + zone )+ ';ord=' + window.glamadapt_pvid + ';sz=1x1;ga_slot=yes;gszd=-;gsz=';
var js_udata ='';
var js_slotdata ='';
for(slot in window.glamadapt_adslots)
{
if ( afid == window.glamadapt_adslots[slot].afid && zone == window.glamadapt_adslots[slot].zone )
{
js_call += window.glamadapt_adslots[slot].sz + ':' + window.glamadapt_adslots[slot].pos + '-';
}
if ( afid == window.glamadapt_adslots[slot].afid && zone == window.glamadapt_adslots[slot].zone && window.glamadapt_adslots[slot].udata )
{
js_udata += ';' + window.glamadapt_adslots[slot].udata;
}
if ( afid == window.glamadapt_adslots[slot].afid && zone == window.glamadapt_adslots[slot].zone && window.glamadapt_adslots[slot].slot_tt )
{
js_udata += ';slot.' + window.glamadapt_adslots[slot].pos + '.tt=' + window.glamadapt_adslots[slot].slot_tt;
}
if ( afid == window.glamadapt_adslots[slot].afid && zone == window.glamadapt_adslots[slot].zone )
{
js_slotdata += ';slot.' + window.glamadapt_adslots[slot].pos + '.name=' + escape(window.glamadapt_adslots[slot].slot);
}
}
var ga_cli_time = new Date().getTime();
js_call += js_slotdata + js_udata + ';ga_api_dt=' + ga_api_dt + ';ga_api_tt=' + ga_api_tt + ';tt=' + ga_api_tt + ';ga_cli_time=' + ga_cli_time + ';';
js_call += ( reqsq>-999 ? ';reqsq=' + reqsq + ';' : '' );
js_call += (window.glam && window.glam.SimpleMetrics ? ';ga_lib_sm=1;': '');
js_call += (window.glam_hawkeye_called && window.glam_hawkeye_kvs ? ';' + window.glam_hawkeye_kvs + ';': '');
js_call += (window.glam_pubmatic_called && window.glam_pubmatic_kvs ? ';' + window.glam_pubmatic_kvs + ';': '');
js_call += ';ga_srv_log=0;ga_cli_log=1;ga_do_cli_log=yes;ga_api=iframe;_g_cv=2;';
if ( window != window.top )
{
var glam_url = GlamGetReferrerUrl();
glam_url = glam_url.substr(0, 512);
js_call += ';&ga_url=' + escape(glam_url.replace('#', '')) + '&;'
}
if ( track_only && ga_track_inv_mode == 'iframe' && document.getElementById("GLAM_JSAPI_TRACK"))
{
var glam_url = GlamGetReferrerUrl();
glam_url = glam_url.substr(0, 512);
js_call += ';ga_track_inv_mode=iframe;&ga_url=' + escape(glam_url.replace('#', '')) + '&;'
document.getElementById("GLAM_JSAPI_TRACK").innerHTML='';
}
else if ( async )
{
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = js_call;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
}
else
{
document.write('<' + '/sc' + 'ript>');
}
GlamLogWithTimer('Called GlamGetAds()' );
}
function GlamGetAdsDone()
{
GlamLogWithTimer('GlamGetAds() done' );
window.glamadapt_done = true;
document.write('GlamDoGetAdsDone();');
}
function GlamIsAvailable(slotname)
{
GlamLogWithTimer('GlamIsAdAvailable() called');
var adslot = GlamGetSlotObject(slotname);
GlamLogWithTimer('GlamIsAvailable ' + slotname);
if ( adslot && adslot.show && adslot.he_slot && window.GlamIsHawkeyeAvailable && (GlamIsHawkeyeAvailable(adslot.he_slot) || adslot.he_shown) )
return true;
else if ( !adslot || !adslot.show || adslot.noad || !window.glamadapt_done || adslot.nopda || adslot.processing || adslot.ccalls >= adslot.acalls )
return false;
else
{
adslot.ccalls++;
return true;
}
}
function GlamDoGetAdsDone()
{
window.glamadapt_done = true;
if ( window.glamadapt_event_listeners )
{
for(i in window.glamadapt_event_listeners)
{
if ( eval(window.glamadapt_event_listeners[i].expression) )
eval(window.glamadapt_event_listeners[i].call);
}
}
}
function GlamSetSlotData(slotname, slotdata)
{
for(slotid in window.glamadapt_adslots)
{
if ( window.glamadapt_adslots[slotid].slot == slotname )
{
window.glamadapt_adslots[slotid].udata = slotdata;
return window.glamadapt_adslots[slotid];
}
}
return null;
}
function GlamGetSlotObject(slotname, context)
{
if ( !context )
context=window;
for(slotid in context.glamadapt_adslots)
{
if ( context.glamadapt_adslots[slotid].slot == slotname )
{
return context.glamadapt_adslots[slotid];
}
}
return null;
}
function GlamSetAdSlotVar(slotname, advar, advalue)
{
for(slotid in window.glamadapt_adslots)
{
if ( window.glamadapt_adslots[slotid].slot == slotname )
{
window.glamadapt_adslots[slotid][advar]=advalue;
break;
}
}
}
function GlamShowIfAvailable(slotname)
{
var adslot = GlamGetSlotObject(slotname);
if ( adslot && adslot.showWithCallback )
adslot.showWithCallback();
else if ( adslot && adslot.show )
GlamShow(slotname, adslot);
return true;
}
function GlamShowFromIframe(slotname, context)
{
if ( !context )
{
context = window;
for (i=0; i <= 10; i++)
{
try
{
if (context.glamadapt_adslots )
break;
}
catch(err) {}
try{context = context.parent;} catch(err){}
}
}
var adslot = GlamGetSlotObject(slotname, context);
if ( adslot )
try { eval('(' + adslot.show.toString() + ')()'); } catch(err) {}
}
function GlamLoad(slotname, doShow)
{
return true;
}
function GlamShowIframeSlot(slotname, domid)
{
var adslot;
if ( (adslot=GlamGetSlotObject(slotname)) && document.getElementById(domid) && !(adslot.shown_count && adslot.group_id) && adslot.adid )
{
var shown_count = (adslot.shown_count ? adslot.shown_count : 0) + 1;
var slotname = 'a'+adslot.pos;
window.glamadapt_adslots[slotname].shown_count = shown_count;
var show_url = ( shown_count > 1 && adslot.refresh_url ? adslot.refresh_url : adslot.url ) + ';ga_output=html;ord=' + window.glamadapt_pvid;
document.getElementById(domid).innerHTML='<' + '/ifra' + 'me>';
}
}
function GlamShow(slotname, adslotobj)
{
if ( !window.glamadapt_reskin_shown )
{
window.glamadapt_reskin_shown = true;
}
if ( !window.glamadapt_dormant_shown )
{
window.glamadapt_dormant_shown = true;
GlamShow('dormant');
}
var adslot = (adslotobj ? adslotobj : GlamGetSlotObject(slotname));
if ( adslot && adslot.tt && adslot.tt == 'i' )
{
document.write('<' + '/ifra' + 'me>');
return true;
}
else
return ( adslot && adslot.show ? adslot.show() : false );
}
function GlamShowFromParentIframe(name){
if ( window.top.glamadapt_adslots ) {
window.glamadapt_adslots=window.top.glamadapt_adslots;
var adslot = GlamGetSlotObject(slotname);
if ( adslot && adslot.show ) {
slotname = 'a'+adslot.pos;
window.glamadapt_adslots[slotname].show_string = window.glamadapt_adslots[slotname].show.toString();
eval("window.glamadapt_adslots[slotname].show= " + window.glamadapt_adslots[slotname].show_string);
return window.glamadapt_adslots[slotname].show();
}
}
return false;
}
function GlamGetRequestVar(name){
if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))
return decodeURIComponent(name[1]);
}