// hmwAds.js - Serve Ads for HispanicMarketingWeekly.com

// This is meant for backward compatibility with old ad server script
function epsStream ( s ) {
  if (s == 'Left1') {
     eps_left1();
     document.write("<p>\n");
     eps_left2();
     document.write("<p>\n");
     eps_left3();
     document.write("<p>\n");
     eps_left4();
     document.write("<p>\n");
     eps_left5();
  }
  if (s == 'Pos1') {
     eps_top1();
  }
  if (s == 'Middle1') {
     eps_middle1();
  }
  if (s == 'Middle2') {
      eps_middle2();
   }
  if (s == 'Right1') {
     eps_right1();
     document.write("<p>\n");
     eps_right2();
     document.write("<p>\n");
     eps_right3();
     document.write("<p>\n");
     eps_right4();
     document.write("<p>\n");
     eps_right5();
     document.write("<p>\n");
     eps_right6();
     document.write("<p>\n");
     eps_right7();
     document.write("<p>\n");
     eps_right8();

  }
}

// Right now we do 2 ads in the left stack, 4 ads in the right, and 1 on top

// Left Ad Stack Components

function eps_left1 () {
  eps_general( "hmw0ea2f45", 34 );
}

function eps_left2 () {
  eps_general( "hmwc8cc830", 35 );
}

function eps_left3 () {
  eps_general( "hmw1f2d7e4", 43 );
}

function eps_left4 () {
  eps_general( "hmw64e1d2f", 44 );
}

function eps_left5 () {
  eps_general( "hmwbe43447", 45 );
}

// Right Ad Stack Components

function eps_right1() {
  eps_general( "hmw86b136f", 36 );
}

function eps_right2() {
  eps_general( "hmwfa33309", 37 );
}

function eps_right3() {
  eps_general( "hmwa881e2b", 38 );
}

function eps_right4() {
  eps_general( "hmw784797c", 39 );
}

function eps_right5() {
  eps_general( "hmw06f8093", 41 );
}

function eps_right6() {
  eps_general( "hmw0d8edbe", 42 );
}
function eps_right7() {
  eps_general( "hmwaadf5d81", 572 );
}
function eps_right8() {
  eps_general( "hmwad538c21", 646 );
}


// Top Ad Component
function eps_middle1 () {
  eps_general( "hmw520ad0f", 46 );
}
// Top Ad Component
function eps_middle2 () {
  eps_general( "a2cef327", 674 );
}

// Top Ad Component
function eps_top1 () {
  eps_general( "hmw47efaa3", 40 );
}

// General Ad Fetcher
function eps_general ( hash, zone ) {
var awrz_rnd = Math.floor(Math.random()*99999999999);
var awrz_protocol =
location.protocol.indexOf('https')>-1?'https:':'http:';
if (awrz_protocol == 'http:') {
if (!document.phpAds_used) document.phpAds_used = ',';
document.write ("<" + "script language='JavaScript' type='text/javascript'src='");
document.write (awrz_protocol+"//servedby.epublishing.net/m3/adjs.php?n="+hash);
document.write ("&zoneid="+zone+"&block=1");
document.write ("&exclude=" + document.phpAds_used);
document.write ("&loc=" + escape(window.location));
if (document.referrer)
document.write ("&referer=" + escape(document.referrer));
document.write ('&r=' + awrz_rnd);
document.write ("&ct0=" + escape(document.phpAds_ct0));
document.write ("'><" + "/script>");
}
}

