// hmwAds.js - Serve Ads for HispanicMarketingWeekly.com

// This is meant for backward compatibility with old ad server script
function epsStream ( s ) {
	if (s == 'Pos1') {
		eps_top1();
	}
	else if (s == 'Left1') {
		eps_left1();
	}
	else if (s == 'Middle1') {
		eps_middle1();
	}
	else if (s == 'Right1') {
		eps_right1();
      eps_right2();
	}
	else if (s == 'Bottom1') {
		eps_bottom1();
	}
}

// Right now we do 2 ads in the left stack, 4 ads in the right, and 1 on top
// Top Ad Component
function eps_top1 () {
  eps_general( "ad248f95", 675 );
}

// Left Ad Stack Components
function eps_left1 () {
  eps_general( "a56e37f9", 678 );
}
// Vertical 2,  685 , a5582efd
function eps_right2 () {
  eps_general( "a5582efd", 685 );
}
// Middle Ad Component
function eps_middle1 () {
  eps_general( "a57da022", 677 );
}

// Right Ad Stack Components
function eps_right1() {
  eps_general( "a1de8fc7", 680 );
}

// Bottom Ad Component
function eps_bottom1 () {
  eps_general( "a53cf69f", 679 );
}

// 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);
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>");
}
}

