init = function() {
	//checkAddress()
}
addEvent(window,"load",init);


function checkAddress() {

	var currPage = location.href;

	if (currPage.match(/#/)) {
		page = currPage.substring(currPage.indexOf("#")+1,currPage.length);
	}
	else {
		page = "home";
	}
	showPage(page);

}

pages = [];

productDescriptions = [];
var pageevents = {
	'DIV.page' : function(el) {
		pages.push(el.id);
		//el.style.display = "none";
	},
	'a.external' : function(el) {
		el.onclick = function() {
			window.open(this.href);
			return false;
		}
	},
	'table.products img' : function(el) {
		el.id = "product"+i;
		el.onmouseover = function() {
			Description.show(el.id);
			return false;
		}
		el.onmouseout = function() {
			Description.hide();
			return false;
		}
	},	
	'table.products div' : function(el) {
		productDescriptions["product"+i] = el.innerHTML;
	},				
	'a#productslink' : function(el) {
		el.onmouseover = function() {
			var pos = findPos(el);
			$("navlist").style.left = (pos.x-36)+"px";
			$("navlist").style.top = (pos.y+20)+"px";
			$("navlist").style.visibility = "visible";
		},
		el.onmouseout = function() {
			if (window.menuOutTimer) {
				clearTimeout(menuOutTimer);
			}		
			menuOutTimer = setTimeout(function() { 	$("navlist").style.visibility = "hidden";},100);
		}
	},
	'div#navlist a' : function(el) {
		el.onmouseover = function() {
			if (window.menuOutTimer) {
				clearTimeout(menuOutTimer);
			}
		}
	},	
	'div#navlist' : function(el) {
		el.onmouseout = function() {
			if (window.menuOutTimer) {
				clearTimeout(menuOutTimer);
			}		
			menuOutTimer = setTimeout(function() { 	$("navlist").style.visibility = "hidden";},500);
		}
	}

};
Behaviour.register(pageevents);



