var directory='http://www.uwplatt.edu/org/thetatau/template_data/';
//var directory="template_data/";
var path='';
var departmentName="";
var pageName="";
var contactName="";
var contactEmail="";
var backgroundImage='';
var crumbsList="";
var menuList="";
var showMenu='';
var firstCrumb="true";
var lastUpdated=document.lastModified;
var currentStyle="default";
var pageQuote="The nation's oldest, and still foremost, Co-ed Fraternity for Engineers";
var template="";
var oldPage="";
var templateColor="";
var templateStyle="";

function getTemplate () {
	if (template == ""){ // Load the Old Template
		oldPage=true;
		if(templateColor=='orange'){template="classic-orange";}else{template="classic";}
	}
	template=template.toLowerCase();
	function addTemplate(templateName, templateType) {this.templateName=templateName; this.templateType=templateType;}

	var templateList=new Array();
	templateList[0]=new addTemplate('default','1');
//	templateList[1]=new addTemplate('news','3');
//	templateList[2]=new addTemplate('sax','1');
//	templateList[3]=new addTemplate('cfa','1');
//	templateList[4]=new addTemplate('classic','1');
//	templateList[5]=new addTemplate('music','1');
//	templateList[6]=new addTemplate('pioneerfarm','1');
//	templateList[7]=new addTemplate('classic-orange','1');
//	templateList[8]=new addTemplate('studentctr','1');
//	templateList[9]=new addTemplate('cpr','2');
//	templateList[10]=new addTemplate('webdev', '2');
//	templateList[11]=new addTemplate('steel','2');
//	templateList[12]=new addTemplate('athletics','3');
//	templateList[13]=new addTemplate('it','1');
//	templateList[14]=new addTemplate('alumni','3');
//	templateList[15]=new addTemplate('resnet','3');
//	templateList[16]=new addTemplate('international','2');
//	templateList[17]=new addTemplate('curvyblue','2');
//	templateList[18]=new addTemplate('homecoming','3');
//	templateList[19]=new addTemplate('biology','2');
//	templateList[20]=new addTemplate('liquid','3');
//	templateList[21]=new addTemplate('appeal','2');
//	templateList[22]=new addTemplate('it2','2');
//	templateList[23]=new addTemplate('geography','3');
//	templateList[24]=new addTemplate('heartland','3');
//	templateList[25]=new addTemplate('counseling','3');
//	templateList[26]=new addTemplate('swsbdc','3');
//	templateList[27]=new addTemplate('distance','1');
//	templateList[28]=new addTemplate('llc','3');
//	templateList[29]=new addTemplate('library','3');
//	templateList[30]=new addTemplate('admission','3');
//	templateList[31]=new addTemplate('pers','3');
//	templateList[32]=new addTemplate('finearts','3');
//	templateList[33]=new addTemplate('education','3');
//	templateList[34]=new addTemplate('cj','3');
//	templateList[35]=new addTemplate('wep','3');
//	templateList[36]=new addTemplate('pyf','3');
//	templateList[37]=new addTemplate('aces','3');
//	templateList[38]=new addTemplate('weather','3');
//	templateList[39]=new addTemplate('homecoming2003','2');
//	templateList[40]=new addTemplate('careercenter','3');
//	templateList[41]=new addTemplate('tvservices','3');
//	templateList[42]=new addTemplate('womencouncil','3');
//	templateList[43]=new addTemplate('htcp','3');
//	templateList[44]=new addTemplate('finaid','3');
//	templateList[45]=new addTemplate('news2','3'); //News 2 for now, until we have it take over the old one
//	templateList[46]=new addTemplate('cup','3');
//	templateList[47]=new addTemplate('humanities','3');
//	templateList[48]=new addTemplate('photography','3');
//	templateList[49]=new addTemplate('flag','3');
//	templateList[50]=new addTemplate('homecoming2005','2');
//	templateList[51]=new addTemplate('ee','3');
//	templateList[52]=new addTemplate('childrenc','3');
//	templateList[53]=new addTemplate('philosophy','3');
//	templateList[54]=new addTemplate('english','3');

	var found=false;
	for (var i=0; i < templateList.length; i++) {
		if (!found && template == templateList[i].templateName){found=true; templateStyle=templateList[i].templateType; }
	}
	if (!found){template="default"; templateStyle='1';}
}

function initialize()
{
	getTemplate();
	if(document.getElementById){
		document.write("<script type='text/java" + "script' src='"+directory+"search.js'></script>");
	}
	document.write("\n<link rel='icon' type='image/x-icon' href='"+directory+"favicon.ico' />");
	document.write("\n<link rel='shortcut icon' type='image/x-icon' href='"+directory+"favicon.ico' />");
	directory=directory + 'style' + templateStyle + "/";
	path=directory+template;
	document.write("\n<link rel='stylesheet' type='text/css' href='"+directory+"style.css' media='screen' />");
	if ( templateStyle == 1) {document.write("<script type='text/java" + "script' src='"+path+"/layout.js'></script>");}
	document.write ("\n<style type='text/css' media='screen'>@import url("+path+"/layout.css);</style>");
	document.write("\n<link rel='stylesheet' type='text/css' href='"+directory+"print.css' media='print' />");
	if ( (templateStyle == 1 || templateStyle == 3) && (showMenu == "no" || showMenu == "n")) {
		document.write("\n<link rel='stylesheet' type='text/css' href='"+directory+"nomenu.css' media='screen' />");
	}
}

function drawHeader() {
	document.write ("<script type='text/javascript' src='"+directory+"header.js'></script>");
}

function drawFooter() {
	document.write ("<script type='text/javascript' src='"+directory+"footer.js'></script>");
}

//start old
function menuHeader(menuTitle) { menuList=menuList+"<li class='menuHeader'>"+menuTitle+"</li>";}
function menuEntry(menuTitle, menuAddress){menuList=menuList+"\n<li class='menuEntry'><a href='"+menuAddress+"'>"+menuTitle+"</a></li>\n";}
function menuButton(menuTitle, menuAddress){menuList=menuList+"\n<li class='menuButton'><a href='"+menuAddress+"'>"+menuTitle+"</a></li>\n";}
function menuAcronym(menuTitle, menuAddress, acronym){menuList=menuList+"<li><a href='"+menuAddress+"'><acronym title='"+acronym+"'>"+menuTitle+"</acronym></a></li>";}
function menuBreak(){menuList=menuList+"<li class='menuBreak'><hr /></li>";}
function addCrumb(title, website){if (firstCrumb == "true"){crumbsList="<a href='" + website + "'>" + title + "</a>";firstCrumb="false";}else crumbsList=crumbsList + "&nbsp;>&nbsp;<a href='" + website + "'>" + title + "</a>";}
function addCrumbAcronym(title, website, acronym){if (firstCrumb == "true"){crumbsList="<a href='" + website + "'><acronym title='"+ acronym +"'>" + title + "</acronym></a>";firstCrumb="false";}else crumbsList=crumbsList + "&nbsp;>&nbsp;<a href='" + website + "'><acronym title='"+ acronym +"'>" + title + "</acronym></a>";}
function getImg(dir){var maxA=10;var maxB=9;var maxC=9;var maxD=9;var maxE=8;var maxF=9;var maxG=6;if(dir != ""){dir=dir.toUpperCase();var width=(dir=="A")?125:(dir=="B")?175:(dir=="C")?100:(dir=="D")?200:(dir=="E")?175:(dir=="F")?225:(dir=="G")?250:0;var height=(dir=="A")?125:(dir=="B")?150:(dir=="C")?200:(dir=="D")?100:(dir=="E")?250:(dir=="F")?150:(dir=="G")?250:0;var rnd=eval("(Math.round(Math.random()*(max"+dir+")))");document.write("<img src='http://www.uwplatt.edu/image/template_data/random/" + dir + "/img" + rnd + ".jpg' border='1' width='" + width + "' height='" + height + "' alt='' />");}}

//Is this needed anymore?
function menuPopup(menuTitle, menuAddress){menuList=menuList+"<li><a href='"+menuAddress+"' target='new'>"+menuTitle+"</a></li>";}
function menuBreakout(menuTitle, menuAddress){menuList=menuList+"<li><a href='"+menuAddress+"' target='_top'>"+menuTitle+"</a></li>";}
function menuTarget(menuTitle, menuAddress, target){menuList=menuList+"<li><a href='"+menuAddress+"' target='"+target+"'>"+menuTitle+"</a></li>";}