// Washington City Paper

RandomCPNumber = Math.round(Math.random() * 20000);

function writeClassyAd(slot) {

	// Suppress ads from being written to admin screens
	var earl = window.location.href.split("/");
	var this_domain = earl[2];
	if (this_domain == 'admin.classifieds.washingtoncitypaper.com') {
		exit;
	}

	them = 'http://ad.doubleclick.net/';
	us = '/washingtondc.creativeloafing/class;';
	if (slot == 1) {
		w = '728';
		h = '90';
		id = 'topBannerAd';
	}
	if (slot == 2) {
		w = '300';
		h = '250';
		id = 'rightSideRectangleAd';
	}
	if (slot == 3) {
		w = '160';
		h = '600';
		id = 'rightSideAd';
	}
	sz = 'sz=' + w + 'x' + h + ';';
	sex = 'sec=' + sec + ';';
	if (subsec != '') {
		sex += 'subsec=' + subsec + ';';
	}
	tile = 'tile=' + slot + ';';
	path = us + sex + sz + tile + 'ord=' + RandomCPNumber + '?';
	iframe = '<iframe src="' + them + 'adi' + path + '" width="' + w + '" height="' + h + '" scrolling="no" frameborder="0">';
	href = '<a href="' + them + 'jump' + path + '">';
	img = '<img src="' + them + 'ad' + path + '" width="' + w + '" height="' + h + '" alt="">';

	document.write('<div id="' + id + '">')
	document.write('<div class="advertCaption">advertisement</div>');
	document.write(iframe);
	document.write(href);
	document.write(img);
	document.write('</a>');
	document.write('</iframe>');
	document.write('</div>');
}
