/* =================================================== *
 * 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("index-college.html","_top","images/home/hm-colleges.jpg","294","420","Help me colleges by different states");
BANNERGRP[1] = new bannerObj("index-community-college.html","_top","images/home/hm-comm-college.jpg","294","420","Starting out with a community college");
BANNERGRP[2] = new bannerObj("index-fin-aid.html","_top","images/home/hm-fin-aid.jpg","294","420","Help me understand student financial aid");
BANNERGRP[3] = new bannerObj("index-grad.html","_top","images/home/hm-grad-guide.jpg","294","420","Help me prepare for graduate school");
BANNERGRP[4] = new bannerObj("manage-money.html","_top","images/home/hm-manage.jpg","294","420","Help my manage my money during school");
BANNERGRP[5] = new bannerObj("index-degree.html","_top","images/home/hm-mba.jpg","294","420","Need to complete my Degree without disrupting my career");
BANNERGRP[6] = new bannerObj("index-part-time.html","_top","images/home/hm-online-part.jpg","294","420","Looking for online courses that I can take part time");
BANNERGRP[7] = new bannerObj("index-planning.html","_top","images/home/hm-planning-steps.jpg","294","420","Help me plan for college");
BANNERGRP[8] = new bannerObj("index-skills.html","_top","images/home/hm-skills.jpg","294","420","I need to upgrade my skills");
BANNERGRP[9] = new bannerObj("index-vo-schools.html","_top","images/home/hm-trade-school.jpg","294","420","College not for me: need to find a trade school");


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