<?php

/* advertising code */
/* to configure this, use the RevvedUp pane under the
Presentation tab in your the WordPress admininistration interface  */

function ad_after_content() {
	global $revvedup;
	if ($revvedup->option["ad_after_content_code"]) {
		print '<div class="ad-after-content">';
		print $revvedup->option["ad_after_content_code"];
		print '</div>';
	}
}

function ad_after_title() {
	global $revvedup;
	if ($revvedup->option["ad_after_title_code"]) {
		print '<div class="ad-after-title">';
		print $revvedup->option["ad_after_title_code"];
		print '</div>';
	}
}

function ad_header() {
	global $revvedup;
	if ($revvedup->option["ad_header_code"]) {
		print '<div class="ad-header">';
		print $revvedup->option["ad_header_code"];
		print '</div>';
	}
}

function ad_intermixed() {
	global $revvedup;
	if ($revvedup->option["ad_intermixed_code"]) {
		global $revvedup_ads_intermixed;
		if (!isset($revvedup_ads_intermixed)) $revvedup_ads_intermixed = 0;
		$maxads = $revvedup->option["ad_intermixed_max"];
		if ($maxads == "0") $maxads = 0;
		elseif ($maxads != "") intval($maxads);
		else $maxads = 1000;
		if ($revvedup_ads_intermixed < $maxads) {
			print '<div class="ad-intermixed">';
			print $revvedup->option["ad_intermixed_code"];
			print '</div>';
			$revvedup_ads_intermixed = $revvedup_ads_intermixed + 1;
		}
	}
}

function ad_left_of_content() {
	global $revvedup;
	if ($revvedup->option["ad_left_of_content_code"]) {
		print '<div class="ad-left-of-content">';
		print $revvedup->option["ad_left_of_content_code"];
		print '</div>';
	}
}

function ad_referral() {
	global $revvedup;
	if ($revvedup->option["ad_referral_code"]) {
		print '<div class="ad-referral">';
		print $revvedup->option["ad_referral_code"];
		print '</div>';
	}
}

function ad_right_of_content() {
	global $revvedup;
	if ($revvedup->option["ad_right_of_content_code"]) {
		print '<div class="ad-right-of-content">';
		print $revvedup->option["ad_right_of_content_code"];
		print '</div>';
	}
}

function ad_sidebar() {
	global $revvedup;
	if ($revvedup->option["ad_sidebar_code"]) {
		print '<div class="ad-sidebar">';
		print $revvedup->option["ad_sidebar_code"];
		print '</div>';
	}
}

function ad_tip_block() {
	global $revvedup;
	if ($revvedup->option["ad_tip_block_code"]) {
		print '<div class="ad-tip-block">';
		print $revvedup->option["ad_tip_block_code"];
		print '</div>';
	}
}

function ad_above_content() {
	if (rand()%2) ad_left_of_content();
	else ad_right_of_content();
}

?>