	var x,y;
	document.onmousemove = getXY;
	
	// -------------------------------------------------------------------------------------------------------------
	
	function submit_me(which, confirmation)
	{
		if (confirmation != "") 
		{
			if (confirmLink(this, confirmation))
			{
				document.mainform.who.value=which;
				document.mainform.submit();											
			}
		}
		else
		{
			document.mainform.who.value=which;
			document.mainform.submit();					
		}
	}	
	
	// -------------------------------------------------------------------------------------------------------------
	
	function modulo_97(s)
	{
		var nr = '';
		
		for (i = 0; i < s.length; ++i)
		{
			var a = s.substr(i,1);
			if (a == '0' || a == '1' || a == '2' || a == '3' || 
			a == '4' || a == '5' || a == '6' || a == '7' || 
			a == '8' || a == '9') nr += a;
		}
			
		if (nr.length != 12) return false;

		return (97 - (nr.substr(0,9) % 97) == nr.substr(9,3));
	}
	
	// -------------------------------------------------------------------------------------------------------------
	
	function show_popup(s)
	{
		o = document.getElementById('Popup');
		if (o)
		{
			o.innerHTML = unescape(s);
			o.style.left = x + 'px';			
			
			if (!document.all)
			{
				// Mozilla
				o.style.top = (y - 35) + 'px';
			}
			else
			{
				// IE
				o.style.top = (y - 35 + document.documentElement.scrollTop) + 'px';
			}

			o.style.left = (x + 10) + 'px';
			o.style.zIndex = 99;
			o.style.display = 'block';
		}
	}
	
	// -------------------------------------------------------------------------------------------------------------
	
	function show_popup_menu(name)
	{
		// Define menu position; this differs slightly between IE and mozilla
		m = document.getElementById(name);
		
		// Hide?
		if (m.style.visibility == 'visible')
		{
			m.style.visibility = 'hidden';
			return;
		}
		
		if (!document.all)
		{
			// mozilla
			mouse_x = x;
			mouse_y = y + 15;
			
			window_width = window.innerWidth; 
			window_height = window.innerHeight;
			
			menu_width = m.scrollWidth;
			menu_height = m.scrollHeight;
			
			// Make sure it doesn't popup too far too the right
			if (mouse_x + menu_width > window_width) 
				x = window_width - menu_width - 20;
			else x = mouse_x;
                
			// Make sure it doesn't popup too far too the bottom
			if (mouse_y + menu_height > window_height) 
				y = window_height - menu_height;
			else y = mouse_y;
		}
		else
		{
			// IE 6 strict
			window_width = document.documentElement.clientWidth;
			window_height = document.documentElement.clientHeight;
			
			menu_width = m.scrollWidth;
			menu_height = m.scrollHeight;
			
			// Make sure it doesn't popup too far too the right
			if (mouse_x + menu_width > window_width) 
				x = window_width - menu_width;
			else x = mouse_x;			
              
			// Make sure it doesn't popup too far too the bottom
			if (mouse_y + menu_height > window_height)
				y = window_height - menu_height;
			else y = mouse_y;			
		}
		
		m.style.left = x + 'px';
		m.style.top = y +'px';
		m.style.zIndex = 999;
		m.style.visibility = 'visible';
	}
	
	// -------------------------------------------------------------------------------------------------------------
	
	function hide_popup()
	{
		document.getElementById('Popup').style.display = 'none';
	}
	
	// -------------------------------------------------------------------------------------------------------------
	
	function getXY(e)
	{
		x = (document.all) ? event.clientX : e.pageX ;
		y = (document.all) ? event.clientY : e.pageY;
	}
	
	
	// -------------------------------------------------------------------------------------------------------------
	
	// standalone onDomReady function
	window.onDomReady = function(fn){
		window.__ondom_functionArray.push(fn);
	};
	(function(){
		window.__ondom_functionArray = [];
		function _runFunctions(){
			for (var i in window.__ondom_functionArray){
				(window.__ondom_functionArray[i])();
			}
		};
		var _khtml = /(WebKit|khtml)/i.test(navigator.userAgent);
		if(document.addEventListener && !_khtml){
			document.addEventListener('DOMContentLoaded', _runFunctions, false);
		}else if(_khtml){
			var _timer = setInterval(function(){
				if(/loaded|complete/.test(document.readyState)){
					clearInterval(_timer);
					_runFunctions();
				}
			}, 10);
		}else{
			document.write('<script id=__ie_ondom defer src=javascript:void(0)><\/script>');
			var script = document.getElementById('__ie_ondom');
			script.onreadystatechange = function(){
				if(this.readyState == 'complete'){
					_runFunctions();
				}
			};
		}
	})();


	// check whether an element has a specific class
	function hasClassName(element, name)
	{
		var i, list = element.className.split(" ");

		for(i = 0; i < list.length; i++)
			if(list[i] == name)
				return true;

		return false;
	}


	// better addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html
	function addEvent(element, type, fn)
	{
		if (element.addEventListener)
		{
			element.addEventListener(type, fn, false);
		}
		else if (element.attachEvent)
		{
			element['e' + type + fn] = fn;
			element[type + fn] = function() {
				element['e' + type + fn](window.event);
			};
			element.attachEvent('on' + type, element[type + fn]);
		}
	}


	// on dom ready
	onDomReady(function(){

		// making the input in the search form to lose their defaultValue onfocus
		var
			QuickSearch = document.getElementById('QuickSearch'),
			input, inputs;

		if (QuickSearch)
		{
			inputs = QuickSearch.getElementsByTagName('input');

			for (var i = 0; input = inputs[i]; i++)
			{
				if (hasClassName(input, 'text') && input.defaultValue)
				{
					addEvent(input, 'focus', function(){
						if (this.value == this.defaultValue) this.value = '';
					});
					addEvent(input, 'blur', function(){
						if (this.value == '') this.value = this.defaultValue;
					});
				}
			}
		}

	});


