/******************** rotate object **********************/
/*
	The rotate object controls the rotating content found on some department
	home pages and the mu home page.  It displays one of several <div>s located
	in the body of the document for 10 seconds at a time.  Additional
	code needs to be included in the head tag of the document to implement
	the rotate object see the mu home page for an example.
*/
var Rotate = function() {
	var that = this; // for scoping issues
	this._construct = function() {
		that.f = 0;
		that.size = $("#events").find("div.event").length;
		that.seconds = 10000;
		that.old = 0;
	}
	this.init = function() {
		var current = ++that.f % that.size;
		els = $("div.event");
		lis = $("ul#events_list li");
		for(var i = 0; i < that.size; i++) {
			el = els.get(i);
			li = lis.get(i);
			if(i == current) {
				$(el).fadeIn("slow");
				$(li).addClass("selected");
				$(els.get(that.old)).hide();
				$(lis.get(that.old)).removeClass();
				that.old = i;
			}
		}
	}
	this.start = function() {
		that.interval = setInterval(that.init, that.seconds)
	}
	this._stop = function() {
		clearInterval(that.interval);
		that.f = 0;
	}
	this.restart = function(i) {
		that._stop();
		that.f = --i;
		that.init();
		that.start();
	}

	// create the object
	this._construct();
}
/******************** end rotate object *******************/


/************************ menu object *********************/
/*
	The menu object controls the top and left hand navigation bars
	all menus for all pages are defined in the menus array within the 
	menu object.  Menu needs to be instantiated in the head of all pages
	and the .show() function must also be called in the head to display
	the top menu when the page loads.
	
	todo: factor out the menu definitions
*/
var Menu = function() {
	//Used in the timer function
	initMenu = function (){};
	var timer=0;
	var timerEnabled=0; //0=Off  1=Open  -1=CloseAll
	var tmpObj = new Object();
	
	var that = this; //scoping issues
	this._construct = function() {
		that.baseHref = "http://"+document.location.hostname+"/mu/";
		if (that.baseHref == "https://webdev.uui.asu.edu/mu/") that.baseHref = "http://www.asu.edu/mu/";
		if (that.baseHref == "http://webdev.uui.asu.edu/mu/") that.baseHref = "http://www.asu.edu/mu/";
		if (that.baseHref == "http://usiwebqa.usi.asu.edu/mu/") that.baseHref = "http://www.asu.edu/mu/";
		if (that.baseHref == "http://www.vpsa.asu.edu/mu/") that.baseHref = "http://www.asu.edu/mu/";
		if (that.baseHref == "http://secure.vpsa.asu.edu/mu/") that.baseHref = "http://www.asu.edu/mu/";
		if (that.baseHref == "https://secure.vpsa.asu.edu/mu/") that.baseHref = "http://www.asu.edu/mu/";
		that.section = "";
		
		/*
		// factor out the menu definitions, not working yet
		 that.menus = $.ajax({   type: "GET",
					url: that.baseHref +"script/menu_definition.js",
					dataType: "json",
					async: "false",
					success: function(menu_def){
						 return that.menus;
   					}
				}); 
		alert(that.menus);
		*/
		 
		/*
		*	decalare menues
		*	edit the following section to add remove or change menu items
		*/
		
		that.menus = {
			"menu root" : {
				"Student Resources" : "student_resources.htm",
				"Student Involvement" : "sdic/index.htm",
				"Event \&amp\; Meeting Services" : "events/index.htm",
				"MU Services" : "mu_services.htm",
				"Memorial Union" : "index.htm"
			},
			"resources" : {
				"name" : "Student Resources",
				"section" : "menu root",
				"Computer Lab \&amp\; Wireless" : "computers.htm",
				"Learning Support Services" : "http://www.asu.edu/studentaffairs/lss/",
				/*"Child \&amp\; Family Services" : "family/index.htm",*/
				"Adult Reentry" : "http://www.asu.edu/studentaffairs/lss/ARE.html",
				"Student Legal Assistance" : "legal/index.htm",
				"Safety Escort Service" : "http://www.asu.edu/police/PDFs/SES%20flyer.pdf" /*"http://asasu.net/usg/services/safety-escort.php"*/
			},
			"involvement" : {
				"name" : "Student Involvement",
				"section" : "menu root",
				"Sun Devil Involvement Center" : "sdic/index.htm",
				"Student Government ASASU" : "http://asasu.net",
				"Transitions \&amp\; Parent Programs" : "transitions/index.htm",
				"Student Organizations" : "clubs/index.htm",
				"Fraternities \&amp\; Sororities" : "greeklife/index.htm",
				"Community Service Program" : "community/index.htm",
				"Campus Activities" : "mupa",
				"Student Coalitions" : "http://www.asu.edu/studentaffairs/mss/mcc/studentinvolvement.htm"
			},
			"ems" : {
				"name" : "Event \&amp\; Meeting Services",
				"section" : "menu root",
				"Home" : "events/index.htm",
				"Reservations" : "events/reservations.htm",
				"Meeting Rooms" : "events/meeting_rooms.htm",
				"Rates \&amp\; Fees" : "events/fees.htm",
				"Outdoor Event Requests" : "events/outdoor_event_requests.htm",
				"Sales and Solicitation" : "events/sales_solicitation.htm",
				"Catering" : "events/catering.htm",
				"Contact Us" : "contact.htm#ems"
			},
			"services" : {
				"name" : "MU Services",
				"section" : "menu root",
				"Dining" : "dining.htm",
				"Meal Plans" : "http://www.asu.campusdish.com/",
				"Businesses, Banks/ATMs" : "businesses.htm",
				"Sparky's Den" : "sparkys_den.htm",
				"Information Desk, Lost \&amp\; Found" : "information_desk.htm",
				"Marketing" : "advertising_banners.htm",
				"Air Pump Station" : "air_pump_station.htm"
			},
			"mu" : {
				"name" : "Memorial Union",
				"section" : "menu root",
				"About the MU" : "about.htm",
				"MU Advisory Board" : "muab",
				"Mission, Staff" : "staff.htm",
				"Art Cafe" : "art_cafe.htm",
				"Comedy Troupes" : "comedy_troupes.htm",
				"Art Collection" : "art_collection.htm",
				"After Dark" : "afterdark/index.html",
				"Employment" : "student_employment.htm",
				"Policies" : "http://www.asu.edu/aad/manuals/sta/index.html#500",
				"MU Maps" : "http://www.asu.edu/studentaffairs/mu/mu_map.htm",
				"Contact Us" : "contact.htm"
			},
			"muab" : {
				"name" : "Memorial Union Advisory Board",
				"Home" : "muab/index.htm",
				"Members" : "muab/members.htm",
				"iChange" : "!muab_ichange",
				"Blog" : "https://muab.blog.asu.edu",
				"Become a member" : "muab/application.htm",
				"Contact Us" : "muab/contact.htm"
			},
			"muab_ichange" : {
				"name" : "muab",
				"section" : "muab",
				"About iChange" : "muab/ichange_info.htm",
				"Application" : "muab/ichange_apply.htm"
			},
			"community" : {
				"name" : "Community Service Program",
				"section" : "involvement",
				"Home" : "community/index.htm",
				"Where do I Start" : "community/howtostart.htm",
				"Track your service hours/The President's Volunteer Service Award " : "community/Track service.htm",
				//"Teach for America" : "http://ctel.asu.edu/community/teach_america/",
				//"Community Wiki" : "http://communityservice.wiki.asu.edu",
				//"Calendar of Service Opportunities" : "!calendar_service",
				"Calendar of Service Opportunities" : "community/service_calendar.htm",
				//"Community Service FWS jobs" : "http://students.asu.edu/student-employment",
				//"Peace Corps" : "http://www.asu.edu/studentaffairs/mu/community/peacecorps.htm",
				"Student Resources" : "!csp_student",
				"Agency Resources" : "!csp_agency",
				"Leadership Through Service" : "!csp_leadership",
				"About Us" : "community/aboutcsp.htm",
				//"Photo Gallery" : "community/photogallery.htm",
				//"Community Service Blog" : "http://communityservice.blog.asu.edu",	
				"Find More Volunteer Opportunities" : "http://asu.volunteermatch.org"
			},
			"sundevilstars" : {
				"name" : "Sun Devil Stars",
				"Home" : "sundevilstars/index.htm",
				"Past Recipients" : "sundevilstars/recipients.htm",
				"Nominate" : "sundevilstars/nominate.htm"
			},
			"calendar_service" : {
				"name" : "Calendar of Service Opportunities",
				"Monthly Service Opportunities" : "community/monthly_service.htm"
			},
			"csp_student" : {
				"name" : "Student Resources",
				"Planning a Service Event" : "community/manual.htm",
				"CSP Listserv" : "community/listserv.htm",
				"On-Campus Service" : "community/campus.htm",
				"Service Within Walking Distance" : "community/local",
				"Nonprofit Internships" : "community/internships.htm",
				"Additional Service Links" : "community/links.htm",
				"Frequently Asked Questions" : "community/faq.htm"
			},
			"csp_agency" : {
				"name" : "Agency Resources",
				"Access Volunteers" : "community/access_volunteers.htm"
			},
			"csp_leadership" : {
				"name" : "Leadership Through Service",
				"CSP Team Leaders" : "community/team.htm",
				"Community Service Coalition" : "community/coalition.htm"
			},
			"holiday_coffee" : {
				"name" : "Holiday Coffee",
				"Home" : "holidaycoffee/index.htm",
				"About Holiday Coffee" : "holidaycoffee/about.htm",
				"Feedback" : "contact.htm#mu"
			},
			"sorc" : {
				"name" : "Student Organizations",
				"section" : "involvement",
				"Search for an Organization" : "clubs/search.htm",
				"Registration" : "clubs/register.htm",
				"Policies" : "!sorc_policies",
				"Resources" : "!sorc_resources",
				"FAQs" : "clubs/sorc-faq.html",
				"OrgSync" : "clubs/orgsync.html",
				"Forms" : "clubs/resources.htm",
				"Hall of Fame" : "!sorc_hall",
				"Student Risk Management" : "clubs/risk/index.htm",
				"Passport to ASU" : "!sorc_passport",
				"About SORC" : "clubs/team.htm"
			},
			"sorc_passport" : {
				"name" : "Passport to ASU",
				"section" : "sorc",
				"About Passport to ASU": "clubs/passport.htm",
				"Vendor Expo" : "http://expo.asu.edu/ ",
				"Event Registration" : "http://www.asu.edu/studentaffairs/mu/surveys/index.htm?sid=sorc_passport_registration_2009"
			},
			"sorc_policies" : {
				"name" : "Policies",
				"section" : "sorc",
				"Policy Links" : "clubs/policies.htm",
				"Handbook" : "clubs/docs/Tempe_SORC_Handbook_2009-2010.pdf",
				"Sales \&amp\; Solicitation" : "clubs/sales.htm",
				"Advertising \&amp\; Posting" : "clubs/advertising.htm",
				//"Freedom of Expression" : "clubs/freedom.htm",
				"Student Risk Management" : "clubs/studentriskmanagement.htm",
				"Trademark" : "clubs/trademark.htm"
			},
			"sorc_resources" : {
				"name" : "Resources",
				"section" : "sorc",
				"Best Practices" : "bestpractices/index.htm",
				"Copies \&amp\; Posters" : "clubs/copies.htm",
				//"Equipment" : "clubs/equipment.htm",
				"Mail Boxes" : "clubs/storage.htm",
				"Funding Options" : "clubs/funding.htm",
				"University Facility Use" : "clubs/facility.htm",
				"Mall \&amp\; Vendor Information" : "clubs/mall.htm",
				"Web \&amp\; Email" : "clubs/webspace.htm",
				//"How to Have a Healthy Spring Break" : "http://www.students.asu.edu/node/2235",
				//"Spring Break Travel Advisory " : "clubs/docs/Spring Break 2009.doc",
				"SORC HandBook" : "clubs/docs/Tempe_SORC_Handbook_2009-2010.pdf"
			},
			"sorc_hall" : {
				"name" : "Hall of Fame",
				"section" : "sorc",
				"Hall of Fame" : "clubs/hall_nomination.htm",
				"Hall of Fame Awards" : "clubs/hall.htm",
				"Past Recipients" : "clubs/hallawards.htm"
			},
			"best_practices" : {
				"name" : "Best Practices",
				"section" : "sorc_resources",
				"New Student Resources" : "bestpractices/new_orgs.htm",
				"Leadership" : "bestpractices/org_leaders.htm",
				"Group Dynamics" : "bestpractices/all_orgs.htm",
				"Public Relations &amp; Community Service" : "bestpractices/public.htm",
				"Event Planning" : "bestpractices/planning.htm",
				"Funding & Money Management" : "bestpractices/money.htm"
			},
			"greeklife" : {
				"name" : "Fraternities \&amp\; Sororities",
				"section" : "involvement",
				"Reserve Alpha Drive Fields": "greeklife/alphadrive.htm",
				"How to Join" : "!greek_join",
				"Councils" : "!greek_councils",
				"Chapters at ASU" : "greeklife/chapters_asu.htm",
				"Current Members" : "!greek_members",
				"Policies, Procedures \&amp\; Forms" : "greeklife/policies_and_procedures.htm",
				"Academic Report" : "greeklife/reports.htm",
				"View Presentations": "!greek_presentations",
				"Advisors" : "greeklife/advisors.htm",
				"Alumni" : "http://www.asu.edu/alumni/",
				"Parents" : "!greek_parents",
				"Greek Awards" : "!greek_awards",
				"Contact Us" : "!greek_contact"
			},
			"greek_join" : {
				"Recruitment" : "greeklife/recruitment.htm",
				"Housing" : "greeklife/housing.htm",
				"Glossary" : "greeklife/glossary.htm"
			},
			"greek_councils" : {
				"section" : "greeklife",
				"Interfraternity Council" : "greeklife/ifc.htm",
				"Multicultural Greek Council" : "greeklife/mgc.htm",
				"National Pan-Hellenic Council" : "greeklife/nphc.htm",
				"National Association of Latino Fraternal Organizations" : "greeklife/nalfo.htm",
				"Panhellenic Council" : "greeklife/pan.htm"
			},
			"greek_members" : {
				"Adelphi \&amp\; Adelphi2 Commons" : "http://www.campushousing.com/asum/",
				"Housing" : "greeklife/housing.htm",
				"Greek Life Classes" : "greeklife/greek_life_classes.htm",
				"Scholarships" : "greeklife/scholarships.htm",
				"Greek Life Classes" : "greeklife/greek_life_classes.htm",
				"Violations" : "greeklife/violations.htm"
			},
			"greek_awards" : {
				"Application" : "greeklife/awards_application.htm",
				"Past Winners" : "greeklife/awards_winners.htm"
			},
			"greek_parents" : {
				"FAQ" : "greeklife/parents.htm",
				"Myths &amp; Facts About Hazing" : "greeklife/parents.htm#hazing_myths"
			},
			"greek_contact" : {
				"Our Staff" : "greeklife/contact_us.htm",
				"Council Officers" : "greeklife/council_officers.htm"
			},
			"greek_presentations" : {
				"The Rights & Responsibilities of Living the Ritual Presentation":
				"greeklife/docs/fsl_rights_responsibilities.ppt",	
				"Leadership Styles Presentation" : "greeklife/docs/lead styles.ppt"
			},
			"transitions" : {
				"name" : "Transitions \&amp\; Parent Programs",
				"section" : "involvement",
				"Fall Welcome" : "transitions/fallwelcome/index.htm",
				"More to Explore" : "transitions/moretoexplore/index.htm",
				"Family Weekend" : "transitions/Family_Weekend/index.htm",
				"Spring Welcome" : "transitions/Spring_Welcome/index.htm",
				"Parent \&amp\; Family Resources" : "transitions/Parents/index.htm"	,
				"Contact Us" : "transitions/contact_us.htm",
				"Staff" : "transitions/staff.htm"
			},
			"transitions_parents" : {
				"name" : "Parent \&amp\; Family Resources",
				"section" : "transitions",
				"General Information" : "transitions/Parents/info.htm",
				"Student Resources" : "transitions/Parents/student_resources.htm",
				"Advice From Parents" : "transitions/Parents/advice.htm",
				"Room and Board" : "transitions/Parents/room_and_board.htm",
				"Finances" : "transitions/Parents/finances.htm",
				"Health &amp; Safety" : "transitions/Parents/health_and_safety.htm",
				"Transportation" : "transitions/Parents/transportation.htm",
				"Parents Association" : "http://www.asuparentsassociation.com/default.asp",				
				"Contact Us" : "transitions/Parents/contact"
			},
			"fallwelcome" : {
				"name" : "Fall Welcome",
				"Home" : "transitions/fallwelcome/index2.htm",
				"Registration" : "!fallwelcome_registration",
				"Events and Activities" : "transitions/fallwelcome/description.htm",
				"Fall Welcome 2007 Schedule" : "transitions/fallwelcome/schedule.htm",
				"Lodging and Accomodations" : "http://www.adtrav.com/asuwelcome/",
				"Directions \&amp\; Parking" : "transitions/fallwelcome/directions.htm",
				"Maps" : "http://www.asu.edu/map",
				"Frequently Asked Questions" : "transitions/fallwelcome/faq.htm",
				"Contact Us" : "transitions/fallwelcome/contact_us.htm"
			},
			"fallwelcome_registration" : {
				"New Student Registration" : "http://www.west.asu.edu/welcome/fall/fallrsvp_tempe.cfm",
				"Transfer Student Registration" : "https://secure.vpsa.asu.edu/studentaffairs/transitions/fw/register.htm",
				"Guest Registration" : "http://www.west.asu.edu/welcome/fall/fallrsvpguests_tempe.cfm"
			},
			"family_weekend" : {
				"name" : "Family Weekend",
				"Home" : "transitions/Family_Weekend/index2.htm",
				"Family Weekend Packages" : "transitions/Family_Weekend/packages.htm",
				"Register Now" : linkAfterDate("https://secure.vpsa.asu.edu/studentaffairs/c2k_fw/SignIn.asp","transitions/Family_Weekend/register.htm", Date.UTC(2007,10,10,16,0,0)),
				"Must-Attend Events" : "transitions/Family_Weekend/signature.htm",
				"Fall 2007 Schedule" : "transitions/Family_Weekend/schedule.htm",
				"Sibling Visit Program" : "!family_weekend_sibling",
				"Frequently Asked Questions" : "transitions/Family_Weekend/faq.htm",
				"Football Ticket Information" : "transitions/Family_Weekend/tickets.htm",
				"Local Attractions" : "!family_weekend_localattractions",
				"Parking/Directions" : "transitions/Family_Weekend/directions.htm",
				"Maps" : "http://www.asu.edu/map/",
				"Lodging and Accommodations" : "http://www.adtrav.com/asuwelcome/",
				"Contact Us" : "transitions/Family_Weekend/contact.htm"
			},
			"family_weekend_localattractions" : {
				"Weekend Events" : "transitions/Family_Weekend/area.htm?s=weekend&t=Weekend%20Events",
				"Museums" : "transitions/Family_Weekend/area.htm?s=museums&t=Local%20Museums",
				"Sites to See" : "transitions/Family_Weekend/area.htm?s=sites&t=Sites%20to%20See"
			},
			"family_weekend_sibling" : {
				"About Sibling Program" : "transitions/Family_Weekend/sib_about.htm",
				"Register Now" : "transitions/Family_Weekend/sib_forms.htm",
				"Waiver Form" : "transitions/Family_Weekend/sib_forms.htm",
				"Schedule" : "transitions/Family_Weekend/sib_schedule.htm",
				"Frequently Asked Questions" : "transitions/Family_Weekend/sib_faq.htm"
			},
			"fw_callforprograms" : {
				"name" : "Call For Programs",
				"section" : "fallwelcome",
				"Submit a Workshop Session" : "transitions/fallwelcome/call_for_programs/workshop.htm",
				"Submit a Department Sponsored Event" : "transitions/fallwelcome/call_for_programs/deptevents.htm",
				"Call for Programs Information" : "transitions/fallwelcome/call_for_programs/info.htm",
				"Contact Us" : "transitions/fallwelcome/call_for_programs/contact_us.htm"
			},
			"moretoexplore" : {
				"name" : "More to Explore",
				"Home" : "transitions/moretoexplore/index.htm",
				"10 Things Every Sun Devil Should Experience" : "transitions/moretoexplore/20_things_Sundevil_Should_Know.htm",
				"This Semester's More to Explore Schedule" : "transitions/moretoexplore/coming_soon.htm", /* !moretoexplore_schedule */
				"Contact Us" : "transitions/moretoexplore/contact_us.htm"
			},
			/*"moretoexplore_schedule" : {
				"name" : "This Semester's More to Explore Schedule",
				"Week 1: August 20th - August 25th" : "transitions/moretoexplore/complete_schedule_week1.htm",
				"Week 2: August 26th - September 1st" : "transitions/moretoexplore/complete_schedule_week2.htm",
				"Week 3: September 2nd - September 8th" : "transitions/moretoexplore/complete_schedule_week3.htm",
				"Continuous Events: August 20th - September 9th" : "transitions/moretoexplore/complete_schedule_cont.htm"
			},*/
			"spring_welcome" : {
				"name" : "Spring Welcome",
				"section" : "transitions",
				"Home" : "transitions/Spring_Welcome/index.htm",
				"2008 Spring Welcome Schedule" : "transitions/Spring_Welcome/schedule.htm",
				//"Registration" : "https://secure.vpsa.asu.edu/studentaffairs/c2k_sww/SignIn.asp",
				"Lodging/Accomodation" : "transitions/Spring_Welcome/lodging_accomodation.htm",
				"Academic Advising" : "transitions/Spring_Welcome/academic_advising.htm",
				"FAQs" : "transitions/Spring_Welcome/faqs.htm",
				"More to Explore" : "transitions/moretoexplore/index.htm",
				"Contact Us" : "transitions/Spring_Welcome/contact_us.htm"
			},
			"spring_welcome_registration" : {
				"name" : "Spring Welcome Registration",
				"section" : "spring_welcome"
			},
			"family_weekend_registration" : {
				"name" : "Family Weekend Registration",
				"section" : "spring_welcome"
			},
			"swt" : {
				"name" : "Sparky's Welcome Team",
				"Home" : "transitions/swt/index.htm",
				"Volunteer for Residence Hall Move-In" : "!swt_volunteers",
				//"Volunteer for Residence Hall Check-In at Wells Fargo Arena - ASU Staff Only" : "http://www.vpsa.asu.edu/studentaffairs/reslife/VolunteerForm.asp?type=staff",
				"Volunteer for a Signature Event or Program" : "http://www.vpsa.asu.edu/studentaffairs/transitions/swt/signature_event.asp"
			},
			"swt_volunteers" : {
				"link" : "http://www.vpsa.asu.edu/studentaffairs/reslife/index.asp",
				"Greek Life Student" : "http://www.vpsa.asu.edu/studentaffairs/reslife/VolunteerForm.asp?type=greek",
				"Interfaith Individual" : "http://www.vpsa.asu.edu/studentaffairs/reslife/VolunteerForm.asp?type=interfaith_i",
				"Interfaith Group" : "http://www.vpsa.asu.edu/studentaffairs/reslife/VolunteerForm.asp?type=interfaith_g",
				"Individual Student" : "http://www.vpsa.asu.edu/studentaffairs/reslife/VolunteerForm.asp?type=student",
				"Student Organization" : "http://www.vpsa.asu.edu/studentaffairs/reslife/VolunteerForm.asp?type=student_o",
				"ASU Professional Staff" : "http://www.vpsa.asu.edu/studentaffairs/reslife/VolunteerForm.asp?type=staff"
			},
			/*"swt_events" : {
				"link" : "transitions/swt/signature_event.htm",
				"Sun Devil Success Workshops" : "transitions/swt/signature_event.htm",
			    "The Sun Devil Welcome " : "transitions/swt/signature_event.htm",
				"Passport to ASU" : "transitions/swt/signature_event.htm"
			},*/
			"mupa" : {
				"name" : "Campus Activities",
				"section" : "involvement",
				"Last Lecture Series" : "mupa/last_lecture.htm",
				"Faculty/Student Programs" : "mupa/programs.htm",
				"Faculty Recognition Committee" : "mupa/frc.htm",
				"Featured Faculty" : "mupa/featured_faculty.htm",
				"Learning Outside the Classroom" : "!mupa_learning_outside",
				"Finals Breakfast" : "finalsbreakfast/",
				"Art Caf\&eacute\;" : "art_cafe.htm",
				"Programming and Activities Board" : "http://asasu.net/pab/",
				"Contact Campus Activities" : "mupa/about.htm"
			},
			"mupa_learning_outside" : {
				"name" : "Learning Outside the Classroom",
				"section" : "mupa", 
				"Benefits" : "mupa/benefits.htm",
				"Tips" : "mupa/tips.htm",
				"Campus Resources" : "mupa/resources.htm",
				"Further Reading" : "reading.htm"
			},
			"legal" : {
				"name" : "Student Legal Assistance",
				"section" : "resources",
				"Home" : "legal/index.htm",
				"Landlord \&ndash\; Tenant" : "legal/landlord.htm",
				"Family Law" : "legal/domestic.htm",
				"Traffic \&amp\; Parking Violations" : "legal/traffic.htm",
				"Criminal Law" : "legal/criminal.htm",
				"Consumer Fraud, Debt \&amp\; Collections" : "legal/consumer.htm",
				"Auto Purchase \&amp\; Repairs" : "legal/auto.htm",
				"Miscellaneous" : "legal/miscellaneous.htm",
				"Contact Us" : "legal/contactus.htm",
				"Web Site Feedback" : "legal/feedback.htm"
			},
			"symposium" : {
				"name" : "Parent & Family Programs Symposium",
				"Home" : "symposium/index.htm",
				"Register Now" : "http://www.asu.edu/studentaffairs/mu/surveys/index.htm?sid=transitions_symposium_registration",
				"Schedule of Events" : "symposium/schedule.htm",
				"Local Attractions" : "!symposium_localattractions",
				"Parking/Directions" : "symposium/directions.htm",
				"Lodging and Accommodations" : "symposium/lodging.htm",
				"Contact Us" : "symposium/contact.htm"
			},
			"symposium_localattractions" : {
				"Weekend Events" : "symposium/area.htm?s=weekend&t=Weekend%20Events",
				"Museums" : "symposium/area.htm?s=museums&t=Local%20Museums",
				"Sites to See" : "symposium/area.htm?s=sites&t=Sites%20to%20See"
			},
			"asu_connect" : {
				"name" : "ASU Connect",
				"Home" :  "asuconnect/index.htm",
				"Parents Association" : "http://www.asu.edu/parents",
				"Transition and Parent Programs" : "http://www.asu.edu/studentaffairs/mu/transitions/index.htm",
				"Parent and Family Resources" : "http://www.asu.edu/studentaffairs/mu/transitions/Parents/index.htm",
				"Contact us" : "http://www.asu.edu/studentaffairs/mu/transitions/contact_us.htm"
			},
			"sustain2009" : {
				"name" : "Sustain 2009",
				"Home": "sustain2009/index.htm",
				"Register Now!": "sustain2009/register.htm",
				"Conference Schedule": "sustain2009/schedule.htm",
				"Accommodations": "sustain2009/accomodations.htm",
				"Call for Programs": "sustain2009/call_for_programs.htm",
				"WE-LEAD": "sustain2009/welead.htm",
				"School Brag Competition": "sustain2009/schoolbrag.htm",
				"U Did What Competition": "sustain2009/udidwhat.htm",
				"Call for Award Nominations": "sustain2009/awards.htm",
				"ACUI Voucher Program": "http://member.acui.org/core/events/eventdetails.aspx?meeting=09voucher",
				"Local Attractions": "http://students.asu.edu/node/1478",
				"ACUI Region 13": "http://region13.acui.org/"

			},
			"friday_night_fusion" : {
				"name" : "Friday Night Fusion",
				"Home" : "fusion/index.htm",
				"Upcoming Events" : "fusion/events.htm",
				"Incentives" : "fusion/incentives.htm",
				"Host an Upcoming Event" : "fusion/host_event.htm",
				"Feedback" : "fusion/feedback.htm"
			},
			"mu_after_dark" : {
				"name" : "MU After Dark",
				"Home" : "afterdark/index.html",
				"Feedback" : "afterdark/feedback.htm"
			}				

		};
		// end menu item declaration
		
		that._checkTimer();
	}	
	/***** end constructor *****/
	
	/***** start top menu bar functions *****/
		
	/*	get:
	*	returns a section of the Menu.menus JSON object
	*/
	this.get = function(menu_id) {
		return that.menus[menu_id];
	}
	
	/*	show - displays the local menu or secondary navigation
	*	
	*	author: Omar Rodriguez
	*	date: 01/07
	*
	*	Description: Creates an unordered list markup structure with a h2 menu title
	*		This list is based on a section of the Menu.menus JSON object, the section of the menu
	*		to be displayed is taken from the first arguments.  All submenus contained 
	*		within the specified menu are denoted by a "!" in front of the menu item
	*		definition.  The rest of the submenu is another element of the JSON object with
	*		the identifier eaqual to the element definition without the "!"
	*		ex.
	*			"my_menu" : {
	*				"menu_item" : "!menu_item_submenu"
	*			},
	*			"menu_item_submenu" : { }
	*		The submenus are hidden until they're are moused over or clicked and disapear
	*		again when the mouse leaves the menu area.
	*
	*	Requirements: A div tag must exist in the DOM to insert the menu into.
	*/
	this.show = function(menu_id, submenu_id) {
		var i = 0;
		var idx=0;
		var _submenu = that.get(menu_id);
		var curReff = document.referrer.substr(0,document.referrer.lastIndexOf("/"));
		var curHref = document.location.href.substr(0,document.location.href.lastIndexOf("/"));

		if(_submenu["section"]) {
			_name = _submenu["name"];
			_section = that.get(_submenu["section"]);
			_href = that.baseHref + _section[_name];
		} else {
			_href = '';
		}
		// create a link to return to the homepage
		if(submenu_id == "#submenu") {
			if(_href) {
				_menu_title = "<a href=\"" + _href + "\">" + _submenu["name"] + "</a>";
			} else {
				_menu_title = _submenu["name"];
			}
		}
		var _html = "<h2>" + ((submenu_id == "#submenu")?_menu_title:'') + "</h2>";
		_html += "<ul>";
		for(li in _submenu) {
			if(li != "name" && li != "section") {
				if ( _submenu[li].indexOf("!")!=0){
					_html += "<li><a href=\"";
					_html += (_submenu[li].indexOf('http') == -1 && _submenu[li].indexOf('javascript') == -1)?that.baseHref:'';
					_html += _submenu[li] + "\">" + li + "</a></li>";
				}else{
					_html += "<li id='sm_"+ _submenu[li].substr(1,_submenu[li].length-1)+"'>";
					_html += "<a id=\""+ _submenu[li].substr(1,_submenu[li].length-1)+"\" onclick=\"menu.accordionOpenMenu(this,true)\" style=\"cursor:pointer\">" + li + "&nbsp;<img src=\"http://www.asu.edu/studentaffairs/mu/images/dropdown_arrow.png\" height=\"9\" width=\"9\"></a></li>";
				}
			}
			idx++;
		}
		_html += "</ul>";
		if(submenu_id != "#submenu" && $(submenu_id).size() == 0) {
			$("#submenu").after("<div id=\"" + submenu_id.replace(/#/, "") + "\"></div>");
		}
		$(submenu_id).html(_html);
		$(submenu_id).css("height", ""); // clear the height
		// only slide down when the submenu is hidden

		$(submenu_id + " ul li").filter( function (){ return ($("a", this).attr("id")!=null ? $(this) : null);}).each( function() {
			that.addSubs($("a", this).attr("id"));
		});

		if($(submenu_id).is(":hidden")) {
			$(submenu_id).slideDown("slow").css("margin", 0);
		} else {
			//Show only when comming from diffrent website or folder
			/*if (curReff!=curHref){
				$(submenu_id).hide();
				$(submenu_id).fadeIn(1000);
			}else{
				$(submenu_id).show();
			}*/

		}

		
		menu.addMouseEvents("#submenu");
	}
	/****** end top menu functions ******/

	/****** start left hand menu functions ******/	
	
	/*	addSubmenus
	*	required for accordian function
	*	adds the submenus dynamicly
	*/
	this.addSubs = function(menu_id) {
		//get submenu nodes
		if (menu_id=="") return;
		var _submenu = that.get(menu_id);
		var _link="";
		
		//build submenu
		var _html ="<ul>";
		for(li in _submenu) {
			if(li != "name" && li != "section" && li != "link") {
				_html += "<li><a href=\"";
				_html += (_submenu[li].indexOf('http') == -1 && _submenu[li].indexOf('javascript') == -1)?that.baseHref:'';
				_html += _submenu[li] + "\">" + li + "</a></li>";
			}
			if (li=="link"){
				_link = _submenu[li];
			}
		}
		_html += "</ul>";
		//add a link to the parent node
		if (_link!=""){
			$("#" + menu_id).parent().children("a").attr("onclick", ""); //remove click event
			$("#" + menu_id).parent().children("a").attr("href", (_submenu["link"].indexOf('http') == -1 && _submenu["link"].indexOf('javascript') == -1)?that.baseHref + _submenu["link"]:_submenu["link"]); //add link
		}
		// add  submenus and hide them
		$("#" + menu_id).parent().append(_html);
		$("#" + menu_id).siblings("ul").hide();
	}
	
	/*	accordian
	*	displays mouseover effect of the left hand menu, 
	*	not the top menu
	*/
	this.accordian = function(element, closeAll) {
		if (closeAll==false){
			$(element).siblings("ul:hidden").slideDown("normal");
			$(element).parent().siblings().children("ul:visible").slideUp("normal");
		}else
			$(element).parent().children("ul:visible").slideUp("normal");
	}
	
	/*Recursive timer check
	*	increases usability of the mouseover accordian effect
	*	pauses the mouseover function briefly to 
	*/
	this._checkTimer = function (){
		w = setTimeout("menu._checkTimer();",100);
		if (that.timerEnabled!=0){
			that.timer--;
			if (that.timer<=0){
				if (that.timerEnabled==1) {
					that.accordian(that.tmpObj, false);
				}else{
					that.accordian(that.tmpObj, true);
				}
				that.timerEnabled=0;
			}
		}
	}
	
	//Recieves input from the current page to implement the _checkTimer
    this.accordionOpenMenu = function(element,forceOpen) {
		that.timerEnabled=1;
		if (forceOpen)
			that.timer=0;
		else
			that.timer=5;
		that.tmpObj = element;
	}
	
	//Recieves input from the current page
	this.accordionCloseMenu  = function(element) {
		that.timerEnabled=-1;
		that.timer=5;
		that.tmpObj = element;
	}
	

	this.addMouseEvents = function(listContainerDiv){
		//add accordian effect
		$(listContainerDiv + " ul li").filter( function (){ return ($("a", this).attr("id")!=null ? $(this) : null);}).mouseover(function() {
			that.accordionOpenMenu($("a", this));
		});	
		$(listContainerDiv + " ul li").filter( function (){ return ($("a", this).attr("id")!=null ? $(this) : null);}).siblings("ul").mouseover(function() {
			that.accordionOpenMenu(this);
		});	
		$(listContainerDiv + " ul li").filter( function (){ return ($("a", this).attr("id")!=null ? $(this) : null);}).siblings("ul").mouseout(function() {
			that.accordionCloseMenu("#submenu ul li a");
		});	
		$(listContainerDiv + " ul li").filter( function (){ return ($("a", this).attr("id")!=null ? $(this) : null);}).mouseout(function() {
			that.accordionCloseMenu("#submenu ul li a");
		});

	}
	/****** end left hand menu functions ******/
	
	// create the menu object
	this._construct();

}

/********************* end menu object *************************/


/****************** Static Functions Section *******************/

//Helper functions for textfields usuage: onkeypress="return calculateWords(this, 'divName', 50)"
function calculateWords(textbox, divName, wordlimit){
	wordsLeft = wordlimit - textbox.value.split(' ').length;
	if (textbox.value.length>0) $(divName).html("<strong>You have "+ wordsLeft +" words left. </strong>");
	if (wordsLeft <=0)
		return false;
	return true;
}

//Helper functions for textfields usage: charLimit(document.getElementById('textbox'), 50)"
function charLimit(obj, charLimit){
	obj.onchange = function() {
		if (this.value.length > charLimit) this.value = this.value.substr(0,charLimit);
	}
	obj.onkeypress = function () {
		var charCode = (event.which) ? event.which : event.keyCode
		if (this.value.length > charLimit) this.value = this.value.substr(0,charLimit);
		if (charCode > 31 || charCode==13){
			charsLeft = charLimit - this.value.length;
			if (charsLeft <=0)
				return false;
			return true;
		}
		alert();
	};
}

//Helper funcion for textbox usge: formatField(document.getElementById('textbox'), '(###)###-####')" 
// X's are used for letters and numbers and #'s are used for numbers only
function formatField(obj, mask){
	if (!obj.mask){ 
		obj.mask = mask;
		obj.maxLength = mask.length
		obj.onkeydown = function (e) { 
			e = e || window.event;var chrs = new Array(); var cpos = new Array();	var t=0; var i; var ret = this.mask; var ret2 = this.value;
			for (i=0;i<this.mask.length;i++){if (this.mask.charAt(i)!='#' && this.mask.charAt(i)!='X'){chrs[t] = this.mask.charAt(i);cpos[t++] = i;}}
			for (i=0;i<chrs.length;i++){ret=ret.split(chrs[i]).join('');}
			for (i=0;i<chrs.length;i++){ret2=ret2.split(chrs[i]).join('');}
			var req = ret.charAt(ret2.length); if (e.shiftKey) return false; k = (!e) ? event.keyCode : e.keyCode
			if (!req) req = ret.charAt(0); if (k==8 || k==9 || k==13 || (k>32 && k<41) || (k>95 && k<106)) return true;
			if (req=="#"){ if(!((k>=48 && k<=57) || k==58)){ return false; }
			}else{if(!((k>=48 && k<=57) || (k>=65 && k<=90) || (k>=97 && k<=122) || k==58)){
			return false;}}		
		};
		obj.onkeypress= function (e) { 
			e = e || window.event; k = (!e) ? event.keyCode : e.keyCode;
			if (k==8 || k==9 || k==13 || (k>32 && k<41) || (k>95 && k<106)) return true;
			var chrs = new Array(); var cpos = new Array();	var nw=""; var ret = this.value; var t=0; var i;
			chrs[-1] = ""; cpos[-1] = -1; for (i=0;i<this.mask.length;i++){if (this.mask.charAt(i)!='#' && this.mask.charAt(i)!='X'){
			chrs[t] = this.mask.charAt(i);cpos[t++] = i;}}cpos[t] = this.mask.length;
			for (i=0;i<chrs.length;i++){ret=ret.split(chrs[i]).join('');}
			for (i=-1;i<chrs.length;i++){if (ret.length >=cpos[i]-i){nw += chrs[i] + ret.substr(cpos[i]-i,cpos[i+1]-cpos[i]-1);}}
			this.value=nw;		
		};
	}
}

//Helper function for textfields usage: onchange="return validateEmail(this, true)"
//checks if there is only one @ symbol and ends in .something
function validateEmail(textbox, displayAlert){
	var ret = true;
	if (textbox.value.indexOf('@')==-1 )
		ret = false;
	if (textbox.value.indexOf('@')!=textbox.value.lastIndexOf('@'))
		ret = false;
	if (textbox.value.lastIndexOf('.')<=textbox.value.indexOf('@')+1)
		ret = false;
	if (ret==false && displayAlert==true){
		alert("The e-mail address you've typed in is invalid!");
		textbox.value="";
	}
	return ret;
}

/* openTab - static function, which organizes content into tabs and animates tab transitions
 *
 * Author: Alejandro Gonzalez
 * Date: 5/14/07
 * 
 * Description: This function can be called from a link and is used to organize pages
 * into tabs and animate the transition between tabs.  All of the tabed content should 
 * be wraped in divs with id attributes set. Another div needs to be added for the title 
 * of the tab which needs id=section_title. <div id="section_title"></div> openTab requires
 * two arguments to be passed in when it is called, The id attribute of the div to display
 * and the html string of the title to display for the tab.
 *
 * Requirements: openTab requires the JQuery library jquery.js v1.1.2 or later and also the
 * Interface jQuery plugin v1.2 or at least the slide tranistion of the Interface plugin.
 */

/*	function openTab(divName, sect_title, showAll){
		if (showAll==true){
			$("#" + divName).siblings().slideDown("slow");
			$("#" + divName).slideDown("slow");
		}else{
			$("#" + divName).siblings("div:visible").slideUp("slow");
			$("#" + divName).slideDown("slow");
		}
		$("#section_title").SlideOutLeft("medium",function () {
			$("#section_title").html("<h2>"+ sect_title +"</h2>");
			$("#section_title").SlideInLeft("medium");
		});
	}*/
	
	function openTab(divName, sect_title){
		var i=0;
		var multiDivs = divName.split("|");
		var multiTitles = sect_title.split("|");
		
		if (multiDivs.length==1) $("#" + multiDivs[0]).siblings("div:visible").slideUp("slow");

		for(i=0; i<multiDivs.length; i++){
			$("#" + multiDivs[i]).slideDown("slow");
			$("div[@class='temp']").remove();
		}
		for(i=0; i<multiTitles.length; i++){
			if (i==0) {
				$("#section_title").fadeOut(500,function () {
					$("#section_title").html("<h2 style=\"color:#4A0030; padding-bottom:0px; margin-bottom:0px\">"+ multiTitles[0] +"</h2>");
					$("#section_title").fadeIn(500);
				});
			}else{
				$("#" + multiDivs[i-1]).prepend("<div class='temp'><br /><h2 style=\"color:#903; padding-bottom:0px; margin-bottom:0px\">"+multiTitles[i]+"</h2></div>");
			}
		}
	}
	
/* parseParameter - static function, which returns the value of a specific parameter
 *
 * Author: Alejandro Gonzalez 
 * Date: 5/14/07
 * 
 * Description: This function returns the actual value of a parameter passed through the 
 * QueryString. If there are diffrent instances of the same variable then only the last instance
 * will be read. Also, if the variable does not exist then returns null. 
 *
 */
	function parseParameter(varName){
		var ret = null;
		if (window.location.toString().split("?").length>1){
			var allParams = window.location.toString().split("?")[1].split("#")[0];
			var params = allParams.split("&");
			if (varName){
				for (var i=0; i<params.length;i++){
					if (params[i].split("=")[0]==varName)
						ret = params[i].split("=")[1];
				}
			}else
				ret = params;
		}
		return ret;
	}
	
/* getObject - static function, which returns the object of a specific tag depending on the Id
 *
 * Author: Alejandro Gonzalez
 * Date: 5/14/07
 * 
 * NOTE: This function only works if the objName has an ID attribute NOT the NAME attribute. It's
 * recommended that you specify both attributes the same name.
 *
 */
	function getObject(objName){
		return (document.all) ? document.all[objName] : document.getElementById(objName);
	}
	
/* timedRedirect - static function, which redirects the browser to a different location at a timed delay.
 *
 * Author: Alejandro Gonzalesz
 * Date: 5/14/07
 *
 */
	function timedRedirect(url, miliseconds){
		setTimeout("document.location.href = '"+ url+"'", miliseconds);	
	}
	
/* linkAfterDate - string function, which returns a URL corresponding to specific date in miliseconds must use 
 *	               Date.UTC(year,month,day,hour,minutes,seconds) for the deatline date. If today's date is before the
 *				   deadline then beforeURL is returned else it returns the afterURL. This can also be used with any 
 *				   other string not just for URL's.
 *
 * Author: Alejandro Gonzalesz
 * Date: 10/10/07
 *
 */
	function linkAfterDate(beforeURL, afterURL, deadline){
		var dt = new Date();
		var today = Date.UTC(dt.getFullYear(), dt.getMonth()+1, dt.getDate(),dt.getHours(),dt.getMinutes(),dt.getSeconds());
		if ((today-deadline) < 0) return beforeURL;
		return afterURL;
	}
	
    function emptyBox(fieldName, fieldText) {
  		if (document.getElementById(fieldName).value != fieldText)
  			{
  			// don't do anything
  			}		
  		else
  			{
  			document.getElementById(fieldName).value = "";
  			}
     	} // end function
	
	function fillBox(fieldName, fieldText) {
		if (document.getElementById(fieldName).value != "")
			{
			// don't do anything
			}			
		else
			{
			document.getElementById(fieldName).value = fieldText;
			} // end if
    } // end function	