
/* =================================================== *
 * TITLE  : NBuy            | banners.js               *
 * CREATED: 01 Nov 2006     | UPDATED: 15 May 2010     *
 * =================================================== */

/* =================================================== *
// CREATE BANNER OBJECTS AND GROUP
 * =================================================== */

function bannerObj(url,target,loc,width,height,title) {
	this.target  = target; // link target
	this.url     = url;    // link URL
	this.loc     = loc;    // path and filename for image
	this.width   = width;  // width of image
	this.height  = height; // height of image
	this.desc    = title;  // alt and title attribute for image
	}

// =================================================== *
// EDIT START HERE

var BANNERGRP = new Array(6); // adjust for however many banners you have

BANNERGRP[0] = new bannerObj("http://www.saycampuslife.com/college-financing/","_top","http://www.saycampuslife.com/images/banner-money.png","250","60","Money for School");
BANNERGRP[1] = new bannerObj("http://www.saycampuslife.com/education/","_top","http://www.saycampuslife.com/images/banner-online.png","250","60","Find the Right Online Program");
BANNERGRP[2] = new bannerObj("#","_top","http://www.saycampuslife.com/images/banner-blank.png","250","60","");
BANNERGRP[3] = new bannerObj("http://www.saycampuslife.com/textbooks/","_top","http://www.saycampuslife.com/images/banner-books.png","250","60","Buy or Rent Textbooks");
BANNERGRP[4] = new bannerObj("http://www.saycampuslife.com/success-module/","_top","http://www.saycampuslife.com/images/banner-success.png","250","60","Buy or Rent Textbooks");
BANNERGRP[5] = new bannerObj("http://www.saycampuslife.com/feed/","_top","http://www.saycampuslife.com/images/banner-feed.png","250","60","Buy or Rent Textbooks");



// EDIT END HERE
// =================================================== */

/* =================================================== *
// GET RANDOM NUMBER 
 * =================================================== */

function getRandomNum() {
	return (Math.floor(Math.random() * BANNERGRP.length));
  }

/* =================================================== *
// DYNAMICALLY WRITE OUT CONTENTS OF BANNERMAIN 
 * =================================================== */

function displayBanner() {
	var ranNum    = getRandomNum();
	var theBanner = BANNERGRP[ranNum];

	document.write('<a ');
	document.write('href="' + theBanner.url + '" target="' + theBanner.target + '"><img ');
	document.write('src="' + theBanner.loc + '" alt="' + theBanner.desc + '" title="' + theBanner.desc + '" width="' + theBanner.width + '" height="' + theBanner.height + '" border="0">');
	document.write('</a>');
	}
