<!--
function getmainPicture(num, dir) {
	//var num = 5;
	var order = ((Math.round(Math.random()*50) % num)+1);
	var picLink = dir + order + '.jpg';
	document.write('<img src="'+picLink+'" alt="">');
}

function getSmallPicture(num, dir) {
	//var num = 5;
	var order = ((Math.round(Math.random()*50) % num)+1);
	var picLink = dir + order + '.jpg';
	document.write('<img src="'+picLink+'" alt="">');
}

function synchronizePictures(num, div1_dir, div2_dir, div1_title, div2_title) {

	var order= ((Math.round(Math.random()*50) % num)+1);
	var div1_pic =  div1_dir + order + '.jpg';
	var div2_pic = div2_dir + order + '.jpg';

	var div1 = document.getElementById(div1_title);
	var div2 = document.getElementById(div2_title);

	if (div1 != null) {
		div1.innerHTML = '<img src="' + div1_pic + '" alt="" id="">';
	}

	if (div2 != null) {
		div2.innerHTML = '<img src="' + div2_pic + '" alt="" id="">';
	}


}
function rotateSinglePicture(num, div_dir, div_title) {

	var order= ((Math.round(Math.random()*50) % num)+1);
	var div_pic =  div_dir + order + '.jpg';

	var div = document.getElementById(div_title);

	if (div != null) {
		div.innerHTML = '<img src="' + div_pic + '" alt="" id="">';
	}
}
//---------------------------------------------------------------------
// incoming parameters:
//
// page : page title ("main", "news", "student services", etc.
// arraysize:  number of pictures to print
// num : number of total pictures
// dir : path to pictures 
// ext : File extension for images
//
// output:  rows of two images
//
// Notes:
// Images must be in diretory supplied in path in the following
// format:
// 1.EXT
// 2.EXT
// 3.EXT
// etc.
// Where the EXT is the file extension sent in as a parameter
//
//-------------------------------------------------------------------

function getButtons(page, arraySize, num, dir, ext) {	

	//-------------------------------------------------------------------------------------------
	//  Code that should be edited for this function:
	//
	//  REQUIRED:
	//  altTag array : 
	//  Each index corresponds with appropriate image alt tag.
	//  Ex.  altTag[1] is the alt tag for 1.gif, altTag[2] for 2.gif, etc.
	//---------------------------------------------------------------------------
	//  hrefTag array : 
	//  Each index corresponds with appropriate image link (href) tag.
	//  Ex.  hrefTag[1] is teh alt tag for 1.gif, hrefTag[2] for 2.gif, etc.
	//
	//  
	//  OPTIONAL:
	//  num variable : 
	//  "num=16", num should be defaulted to the number of images.  
	//  This CAN and 	//  SHOULD be set through the function parameter in order to 
	//  avoid code editing, but setting value in code prevents errors
	//------------------------------------------------------------------------------
	//  set permanment entries : 
	//  Each index is a numerical list of items to add permanmently to page.
	//  Ex.  (Adds 7.gif, 8.gif, and 16.gif as permanment images)
	//  if (page == "main") {
	//	order[0] = 7;	//Journey icon
	//	order[1] = 8;	//20th Anniversary icon
	//	order[2] = 16;	//Open House icon
	//  }
	//  The list will always be of the nature
	//  if (page == "PAGE NAME PASSED AS A PARAMETER") {
	//  	order[0] = FIRST IMAGE NUMBER;
	//	order[1] = SECOND IMAGE NUMBER;
	//	order[2] = THIRD IMAGE NUMBER;
	//	order[3] = FOURTH IMAGE NUMBER;
	//
	//  Note that you cannot go past order[3] in the list since only 4 icons 
	//  are displayed.
	//  If you only want to set 3 images, then do NOT put in order[3]!!
	//------------------------------------------------------------------------------
	//  set blocked entries : 
	//  if you don't want a particular image displayed on a certain page, then edit
	//  this section in the code below, deleting and adding entries as appropriate.
	//  This section works similarly to the permanment images:
	//  Ex.  (blocks 10.gif and 11.gif from being shown on the research page)
	// 	if (page != "research") {
	//		blocked[10] = 1;
	//		blocked[11] = 1;
	//	}
	//  The list will always be of the nature
	//  if (page == "PAGE NAME PASSED AS A PARAMETER") {
	//  	order[IMAGE NUMBER TO BLOCK] = 1;
	//	order[IMAGE NUMBER TO BLOCK] = 1;
	//  }
	//  You can add as many entries to this list as needed.
	//-------------------------------------------------------------------------------------------

	var order = new Array(arraySize);			//order array for image number
	num = 17;							//set num variable to correct number of images.  This way functionality is present to have different numbers but, for buttons, we won't.
	var blocked = new Array(num);

	//------------------------------------------------
	//set alt and href tags entries
	//------------------------------------------------
	  var altTag = new Array(num);
	  var hrefTag = new Array(num);

	  altTag[1] = "COSAM_Summer_Bridge_Program";
	  hrefTag[1] = "http://www.auburn.edu/cosam/diversity/bridge/";

	  altTag[2] = "AU_Explore_2006";
	  hrefTag[2] = "http://www.auburn.edu/academic/science_math/cosam/outreach/programs/auexplore/";

 	  altTag[3] = "Alabama_BEST_Competition";
	  hrefTag[3] = "";

	  altTag[4] = "Ask_Aubie";
	  hrefTag[4] = "http://www.auburn.edu/academic/science_math/cosam/outreach/programs/askaubie.htm";

	  altTag[5] = "Student_Services'_Bulletin_Board";
	  hrefTag[5] = "http://www.auburn.edu/academic/science_math/cosam/students/bulletinboard/";

	  altTag[6] = "Spectrum_2006";
	  hrefTag[6] = "http://www.auburn.edu/academic/science_math/cosam/news/documents/spectrum06.pdf";

	  altTag[7] = "Journey_2006";
	  hrefTag[7] = "http://www.auburn.edu/academic/science_math/cosam/news/documents/journey06.pdf";

	  //altTag[8] = "20th_Anniversary";
	  //hrefTag[8] = "http://www.auburn.edu/academic/science_math/cosam/20years/index.htm";

	  altTag[8] = "Peaks_of_Excellence";
	  hrefTag[8] = "http://www.auburn.edu/communications_marketing/peaks/";

	  altTag[9] = "Research";
	  hrefTag[9] = "http://www.auburn.edu/research/vpr/";

	  altTag[10] = "USRA";
	  hrefTag[10] = "http://www.auburn.edu/research/vpr/";
	  
	  altTag[11] = "Science_Olympiad";
	  hrefTag[11] = "http://www.auburn.edu/~stuckse/ScienceOlympiad/"
	  
	  altTag[12] = "COSAM_Golf_Classic";
	  hrefTag[12] = "http://www.auburn.edu/cosam/alumni/events/golf-tournament.html";
	  
	  altTag[13] = "Fall_Community_Courses";
	  hrefTag[13] = "https://mell-base.uce.auburn.edu/wconnect/wc.dll?acecode~SubGroup~CCR~Community+Courses";
	  
	  altTag[14] = "Rural_Medicine";
	  hrefTag[14] = "http://www.auburn.edu/academic/science_math/cosam/students/rural_med";

	  altTag[15] = "Open House";
	  hrefTag[15] = "http://www.auburn.edu/academic/science_math/cosam/students/events/openhouse";	  
	  
	  altTag[16] = "Y.E.S. Camp Summer 2007";
	  hrefTag[16] = "http://www.auburn.edu/academic/science_math/cosam/outreach/programs/fallyes/index.htm";
	  
	  altTag[17] = "National Cyber Security Awareness Month";
	  hrefTag[17] = "http://keepitsafe.auburn.edu/";
	  


	//---------------------------------
	// set permanment entries
	//---------------------------------

	// The main page needs the 20th Anniversary and Journey icons as 2 perm icons
	if (page == "main") {
		order[0] = 7;	//Journey icon
	}
	else if (page == "research") {
		order[0] = 9;
		order[1] = 6;
		order[2] = 10;
		order[3] = 11;
	}
	else if (page == "outreach") {
		order[0] = 4;
	}
	else if (page == "alumni") {
		order[0] = 13;
		order[1] = 14;
		order[2] = 6;
	}
	else if (page == "students") {
		order[0] = 4;
		order[1] = 1;
		order[2] = 5;
	}
	else if (page == "departments") {
		order[0] = 4;
		order[1] = 3;
		order[2] = 1;
		order[3] = 7;
	}

	//---------------------------------
	// set blocked entries
	//
	//---------------------------------
	if (page != "research") {
		blocked[10] = 1;
		blocked[11] = 1;
	}
	
	if (page != "students") {
		blocked[5] = 1;
	}

	blocked[16] = 1;			//Take off the open house icon
	
	
////////////////////////////////////////////////////////////////////////////////////////////////////////
//												     
//				  !! No need to edit anything below this !!			     
//											
////////////////////////////////////////////////////////////////////////////////////////////////////////

	var i = 0;						//temp counter variable
	var j = 0;						//temp counter variable
	var picLink = new Array(arraySize);		//path to image
	var Alt = new Array(arraySize);		//alt tag for image
	var href = new Array(arraySize);		//link references

	//---------------------------------------------------
	//populate all non-permanment indexes with random
	//value and adjust counter for perm. entries.
	//---------------------------------------------------
	
	i = 0;
	while (i < arraySize) {
		if (order[i] == null) {
			order[i] = ((Math.round(Math.random()*50) % num)+1);
		}
		i = i + 1;
	}


	//------------------------------------------------------------------
	//Make sure unique numbers are selected for each Array index
	//------------------------------------------------------------------
	j=0;
	i=0;
	var tmp = 0;
	var Used = new Array(num);		//Index set to 1 once image is displayed

	while (j < num) {
		Used[j] = 0;
		j = j + 1;
	}


	while (i <= arraySize) {

		tmp = order[i];
		
		while (Used[tmp] == 1 || blocked[tmp] == 1) {
			order[i] = ((Math.round(Math.random()*50) % num)+1);
			tmp = order[i];
		}

		Used[tmp] = 1;
		i = i + 1;
	}

	//--------------------------------------------------	
	//Now, we need to construct the picture paths
	//--------------------------------------------------


	i=0;
	while (i < arraySize) {
		picLink[i] = dir + order[i] + '.' + ext;
		i = i + 1;
	}
	
	//--------------------------------------------------	
	// Print out images
	//--------------------------------------------------	
	i=0;
	while (i < arraySize) {
		
		if (i % 2 == 0) {
				//document.write("<div align='center'>");
		}
		
		document.write("<a href=" + hrefTag[order[i]] + "><img src=" + picLink[i] + " alt=" + altTag[order[i]] + " border=0 /></a>");
		
		if (i % 2 == 0) {
			//document.write("</div>");
		}
		
		i = i + 1;
	}

}

/***********************************************************************************/
/*                  Begin http://www.auburn.edu/includes/ddjavascript.js	     */
/*		        Note:  Research obsession with "dd" file prefix...		     */
/***********************************************************************************/

// Global .js File for the AU Website
// Author: Daniel Dixon
// Created: 12/16/05
// Last Modified: N/A

// global variables
var searchBoxHasFocus = false;
// this function gets the width of the viewer's screen
// so the popup boxes can be placed accordingly
function getInsideWindowWidth() {
	// if a Netscape-compatible browser
	if (window.innerWidth) {
		return window.innerWidth;
	// if IE6 with CSS support
	} else if (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) {
		return document.body.parentElement.clientWidth;
	// if IE 5.5 or earlier
	} else if (document.body && document.body.clientWidth) {
		return document.body.clientWidth;
	}
	return 0;
}
// called everytime the Quick Links box is malnipulated
function displayQuickLinks() {
	quickLinksObj = document.getElementById("quickLinksBox");
	if(quickLinksObj.style.visibility == "visible") {
		quickLinksObj.style.visibility = "hidden";
	} else {
		quickLinksObj.style.visibility = "visible";
		quickLinksObj.style.left = getInsideWindowWidth() / 2 + 130;
	}
}
// called everytime the Search Box is malnipulated
function displaySearchBox() {
	searchBoxObj = document.getElementById("searchBox");
	if (searchBoxHasFocus != true) {
		if(searchBoxObj.style.visibility == "visible") {
			searchBoxObj.style.visibility = "hidden";
		} else {
			searchBoxObj.style.visibility = "visible";
			searchBoxObj.style.left = getInsideWindowWidth() / 2 + 60;
		}
	}
}
// used to place the Quick Links and Search Box in the middle of the screen
// and +/- some (notice the calls to getInsideWindowWidth)
function positionBoxes() {
	quickLinksObj = document.getElementById("quickLinksBox");
	quickLinksObj.style.left = getInsideWindowWidth() / 2 - 100;
	quickLinksObj.style.top = 8;
	searchBoxObj = document.getElementById("searchBox");
	searchBoxObj.style.left = getInsideWindowWidth() / 2 + 60;
	searchBoxObj.style.top = 16;
}
// if the user clicks inside the search box, it will remain on
function setSearchStatus(value) {
	searchBoxHasFocus = value;
}
// used to create a clickable hidden DIV tag over the Sesquicentennial title
function goToSesquicentennial() {
  this.location.href = "http://www.auburn.edu/150";
 }
// prevent the main Auburn web site from showing up
// in frames on other web sites.  -jcm Feb. 2005
if ( window.parent != window.self ) { window.open(document.location,'_top');
}
//-->


