
/* =================================================== *
 * TITLE  : NBuy            | banners.js               *
 * AUTHOR : Kevin Scholl    | kscholl@comcast.net      *
 * CREATED: 01 Nov 2006     | UPDATED: 01 Nov 2006     *
 * =================================================== */

/* =================================================== *
// 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(13); // adjust for however many banners you have

BANNERGRP[0] = new bannerObj("http://www.saystudent.com/private-student-loans.html","_top","http://www.nbuy.com/student/ads/short-funds.gif","610","90","Funds for college");
BANNERGRP[1] = new bannerObj("http://www.saycollegemove.com/transportation.php","_top","http://www.nbuy.com/student/ads/school-car.gif","610","90","College Car");
BANNERGRP[2] = new bannerObj("http://www.saystudent.com/college-budget.html","_top","http://www.nbuy.com/student/ads/budget.gif","610","90","Student budgeting");
BANNERGRP[3] = new bannerObj("http://www.saycollegemove.com/student-travel.php","_top","http://www.nbuy.com/student/ads/student-travel.gif","610","90","Student travel tips");
BANNERGRP[4] = new bannerObj("http://www.webreader.com/download/student/aid-map.pdf","_top","http://www.nbuy.com/student/ads/aid-map.gif","610","90","How best to fund college");
BANNERGRP[5] = new bannerObj("http://www.saystudentcards.com","_top","http://www.nbuy.com/student/ads/credit-cards.gif","610","90","Student credit cards");
BANNERGRP[6] = new bannerObj("http://www.saystudent.com/private-student-loans.html","_top","http://www.nbuy.com/student/ads/send-money.jpg","610","90","Send more money");
BANNERGRP[7] = new bannerObj("http://www.saystudent.com/student-income.html","_top","http://www.nbuy.com/student/ads/student-income.gif","610","90","Student income ideas");
BANNERGRP[8] = new bannerObj("http://www.saystudent.com/home-equity-banker/index.html","_top","http://www.nbuy.com/student/ads/unlock-home.gif","610","90","Unlock your home's value");
BANNERGRP[9] = new bannerObj("http://www.saycollegemove.com/used-textbooks.php","_top","http://www.nbuy.com/student/ads/book-costs.gif","610","90","Reduce textbook costs");
BANNERGRP[10] = new bannerObj("http://www.webreader.com/download/student/student-aid-tracking-sheet.xls","_top","http://www.nbuy.com/student/ads/track-costs.gif","610","90","Keep track of college finances");
BANNERGRP[11] = new bannerObj("http://www.saystudent.com","_top","http://www.nbuy.com/student/ads/finance-puzzle.gif","610","90","Solve the financing puzzle");
BANNERGRP[12] = new bannerObj("http://www.saycollegemove.com/whatelse-success.php","_top","http://www.nbuy.com/student/ads/success.gif","610","90","Achieving Success");


// 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>');
	}
