var subnav = new function() {
  /* enter timeout time here */
	this.timeoutTime=2000; // milliseconds

	this.html_tags = {"a":xhtmlTools.maker("a"),
				 "li":xhtmlTools.maker("li")};
  /* enter subnav items here */
	this.subNavItems = {
		"djs":[
			{"link":"/hotdjs/wakeupcrew.shtml", "text":"Wake Up Crew", "target":"_self"},
			{"link":"/hotdjs/jdub.shtml", "text":"J-Dub", "target":"_self"},
			{"link":"/hotdjs/billy_bush.shtml", "text":"Billy Bush", "target":"_self"},
			{"link":"/hotdjs/weekenders.shtml", "text":"Weekenders", "target":"_self"}
		],
		"pics":[
			{"link":"/hotpics/hotgames.shtml", "text":"Hot Games", "target":"_self"},
			{"link":"/gallery.php", "text":"Hot Pics", "target":"_self"}
		],
		"music":[
			{"link":"/hotmusic/hotmusic.shtml", "text":"Hot Music", "target":"_self"},
			{"link":"/hotmusic/musicnews.shtml", "text":"Music News", "target":"_self"},
			{"link":"/hotmusic/hot8.shtml", "text":"Hot 8 @ 8", "target":"_self"},
			{"link":"#", "text":"Music Panel", "target":"_self"},
			{"link":"/hotmusic/mobile.shtml", "text":"Hot Mobile DJ Service", "target":"_self"}
		],
		"contests":[
			{"link":"/hotcontests/", "text":"Hot Contests", "target":"_self"},
		],
		"calendar":[
			{"link":"/hotcalendar/events.shtml", "text":"Community events", "target":"_self"},
			{"link":"/hotcalendar/streets.shtml", "text":"Hot on the Streets", "target":"_self"},
			{"link":"/hotcalendar/programs.shtml", "text":"Programs", "target":"_self"},
			{"link":"/hotcalendar/relay.shtml", "text":"Relay for Life", "target":"_self"}
		],
		"contact":[
			{"link":"http://maps.infospace.com/_1_2YPETOY04L6ZBHM__info/kevmap?OP=MoveMap&OTMPL=%2Fkevmap%2Fmap-out.htm&lat=41.0583&long=-80.6380&QA=4040+Simon+Road&QC=Youngstown&QS=OH&QZ=44512&QO=US&width=360&height=270&detail=3&scale=4&matchpass=ADDRESS&keepsize=1", "text":"Directions", "target":"_blank"},
			{"link":"http://www.theradiocenter.com/", "text":"Advertise on Hot 101", "target":"_blank"},
			{"link":"http://theradiocenter.com/interns/", "text":"Internships", "target":"_blank"},
			{"link":"/contacthot/", "text":"General Info", "target":"_self"}
		]};


	this.openNav = "";
	this.tim;
	
	this.hideSubnav = function() {
		var c = document.getElementById("subnav");
		while(c.hasChildNodes()) c.removeChild(c.firstChild); 
		subnav.openNav="";
	};
	
	this.openSubnav = function(navItem) {
		clearTimeout(subnav.tim);
		
		if(navItem!=subnav.openNav) {
			subnav.hideSubnav();
			subnav.openNav=navItem;
			var c = document.getElementById("subnav");
			for(i in subnav.subNavItems[navItem]) {
				c.appendChild(subnav.html_tags["li"]([subnav.html_tags["a"]({"target":subnav.subNavItems[navItem][i]["target"],"href":subnav.subNavItems[navItem][i]["link"]},subnav.subNavItems[navItem][i]["text"])]));
			}
		}
	};
	
	this.mouseOut = function() {
		subnav.tim = setTimeout(subnav.hideSubnav,subnav.timeoutTime);
	};
}
