
		function popUp(linkURL,name,attributes) {
				var newWindow = window.open(linkURL,name,attributes);
		}
			
//		window.onload = function() {
		function initHref() {
			if (!document.getElementsByTagName) return false;
			var links = document.getElementsByTagName("a");
			for (i=0; i < links.length; i++) {
				link = links[i];
				if (link.className && (' ' + link.className + ' ').indexOf(' popup ' ) != -1) {
					link.onclick = function() {
					var width = 780;
					var height = 590;
					var name = "popup";
					var resizable = 1;
					var scrollbars = 1;
					var status = 1;
					var newWin = 1;
					if (this.getAttribute("rel")) {
						var rels = this.getAttribute("rel");
						var relSplit = rels.split(" ");
						name = relSplit[0] ? relSplit[0] : name;
						width =  relSplit[1] ? relSplit[1] : width;
						height = relSplit[2] ? relSplit[2] : height;
						resizable = relSplit[3] ? relSplit[3] : resizable;
						scrollbars = relSplit[4] ? relSplit[4] : scrollbars;
						status = relSplit[5] ? relSplit[5] : status;
						newWin = relSplit[6] ? relSplit[6] : newWin;
					}
					attributes = "width="+width+",height="+height+", resizable="+resizable+", scrollbars="+scrollbars+", status="+status+", location="+newWin+",toolbar="+newWin;
					
					// center window:
					var leftPosition = (screen.width) ? (screen.width-width) / 2 : 0;
					var topPosition = (screen.height) ? (screen.height-height) / 2 : 0;
					attributes += ",top=" + topPosition + ",left=" + leftPosition;
					
					popUp(this.getAttribute("href"),name,attributes);
					return false;
					}
				}
			}
		}
		
		function isSupported() {
			var ua = navigator.userAgent.toLowerCase();
			var an = navigator.appName;
			var r = false;
			if (ua.indexOf("gecko") > -1) r = true; 
				else if (an == "Microsoft Internet Explorer") {
					if (document.getElementById) r = true; 
			}
			return r;			
		}			

		function init() {
			initHref();
			//==========================================================================================
			// if supported, initialize mouseovers
			//==========================================================================================
			if (isSupported()) {
				var menu1 = document.getElementById("menu1");
				var menu2 = document.getElementById("menu2");
				var menu3 = document.getElementById("menu3");
				var menu4 = document.getElementById("menu4");
				var menu5 = document.getElementById("menu5");
				var menu6 = document.getElementById("menu6");
				var menu7 = document.getElementById("menu7");
				//var menu8 = document.getElementById("menu8");
								
				menu1.onmouseover = function() { swapImage("button1", "on") };
				menu1.onmouseout = function() { swapImage("button1", "off") };
				menu2.onmouseover = function() { swapImage("button2", "on") };
				menu2.onmouseout = function() { swapImage("button2", "off") };
				menu3.onmouseover = function() { swapImage("button3", "on") };
				menu3.onmouseout = function() { swapImage("button3", "off") };
				menu4.onmouseover = function() { swapImage("button4","on") };
				menu4.onmouseout = function() { swapImage("button4", "off") };
				menu5.onmouseover = function() { swapImage("button5", "on") };
				menu5.onmouseout = function() { swapImage("button5", "off") };
				menu6.onmouseover = function() { swapImage("button6", "on") };
				menu6.onmouseout = function() { swapImage("button6", "off") };
				menu7.onmouseover = function() { swapImage("button7", "on") };
				menu7.onmouseout = function() { swapImage("button7", "off") };
				//menu8.onmouseover = function() { swapImage("button8", "on") };
				//menu8.onmouseout = function() { swapImage("button8", "off") };

			}
		}

		// image swapper script
		function swapImage(imgName, action) {
			var oCurrent = document.getElementById(imgName);
			var oNew = document.getElementById(imgName + "_" + action);
			oCurrent.src = oNew.src;
			//document.images[imgName].src = eval("document.images." + imgName + "_" + action + ".src");
		}



	