/* =================================================== *
 * 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(10); // adjust for however many banners you have

BANNERGRP[0] = new bannerObj("http://www.sayfinancialaid.com/banner-undergrad.html","_top","images/hm-student-books.jpg","294","420","Help me find scholarship money");
BANNERGRP[1] = new bannerObj("http://www.sayfinancialaid.com/banner-premed.html","_top","images/hm-student-look.jpg","294","420","Help me pay for graduate school");
BANNERGRP[2] = new bannerObj("http://www.sayfinancialaid.com/banner-engineer.html","_top","images/hm-student-notebook.jpg","294","420","Need money to pay for my computer");
BANNERGRP[3] = new bannerObj("http://www.sayfinancialaid.com/banner-agronomy.html","_top","images/hm-student-field.jpg","294","420","What Federal Student Loans are available");
BANNERGRP[4] = new bannerObj("http://www.sayfinancialaid.com/banner-graduate.html","_top","images/hm-student-diploma.jpg","294","420","Help me consolidate my student loan payments");
BANNERGRP[5] = new bannerObj("http://www.sayfinancialaid.com/banner-return.html","_top","images/hm-student-smile.jpg","294","420","Help me find scholarship money");
BANNERGRP[6] = new bannerObj("http://www.sayfinancialaid.com/banner-semester.html","_top","images/hm-student-bench.jpg","294","420","Need extra money to start the semester");
BANNERGRP[7] = new bannerObj("http://www.sayfinancialaid.com/banner-funds.html","_top","images/hm-student-ym.jpg","294","420","Help me manage my money");
BANNERGRP[8] = new bannerObj("http://www.sayfinancialaid.com/banner-gradplus.html","_top","images/hm-student-yw.jpg","294","420","Tell me more about the grad PLUS loan");
BANNERGRP[9] = new bannerObj("http://www.sayfinancialaid.com/banner-continue.html","_top","images/hm-student-cont.jpg","294","420","What aid programs are available for continuing-ed");


// 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>');
	}