Fixed Header Advertisment code
wp-content/themes/vype/javascripts/scripts.js
var top_divs = $("#adspace div").not(".clearfix").hide(),
top_i = 0;
// var top_num_ads = $('#adspace > div').attr("num_ads");
var top_num_ads = $('#adspace > div').not(".clearfix").length;
var top_cycle_delay = 12000;
function top_cycle() {
top_divs.eq(top_i).fadeIn(400).delay(top_cycle_delay).fadeOut(400, top_cycle);
top_i = ++top_i % top_divs.length; // increment i,
// and reset to 0 when it equals divs.length
};
if (top_num_ads > 1) {
top_cycle();
} else {
top_divs.show();
}
And the sidebar ad cycle code derived from the fixed header code:
var sidebar_divs = $(".adsanity-group div").not(".clearfix").hide(),
sidebar_i = 0;
var sidebar_num_ads = $('.adsanity-group > div').not(".clearfix").length;
var sidebar_cycle_delay = 12000;
function sidebar_cycle() {
sidebar_divs.eq(sidebar_i).fadeIn(400).delay(sidebar_cycle_delay).fadeOut(400, sidebar_cycle);
sidebar_i = ++sidebar_i % sidebar_divs.length; // increment i,
// and reset to 0 when it equals divs.length
};
if (sidebar_num_ads > 1) {
sidebar_cycle();
} else {
sidebar_divs.show();
}
-Taylor