// ==UserScript==
// @name mininova.org - Fix Mininova menu
// @author TarquinWJ 
// @namespace http://www.howtocreate.co.uk/ 
// @version 1.0
// @description  Fixes the menu on mininova.org. This script is
//			deprecated since Opera 8.5.
// @ujs:category site: fixes
// @ujs:published 2005-06-16 23:05
// @ujs:modified 2005-10-26 15:24
// @ujs:documentation http://userjs.org/scripts/site/fixes/mininova-org-menu-fix 
// @ujs:download http://userjs.org/scripts/download/site/fixes/mininova-org-menu-fix.js
// ==/UserScript==


/* 
 * Please see
 * http://www.howtocreate.co.uk/operaStuff/userJavaScript.html#terms
 * for License and Terms of Use
 */

if( location.hostname.match(/(^|\.)mininova.org$/) ) {
	opera.addEventListener('BeforeScript',function (e) {
		var s = e.element.getAttribute('src');
		if( s && ( s.indexOf('mininova') + 1 ) ) {
			//they attach mouse* event handlers to the iframe element that holds the menu
			//the iframe page obscures the element from receiving the events
			//attach events to the iframe page, and make it run the commands in the parent
			var oSrc = e.element.text.replace(
				/\}\s*window\.onresize/,
				';frames.catmenu.window.document.onmouseover=function(){parent._menuHover=true;};'+
				'frames.catmenu.window.document.onmouseout=function(){parent._menuHover=false;'+
				'parent.setTimeout(\'checkHover()\',150);};}window.onresize'
			);
			e.element.text = oSrc.replace(/_cata\.offsetTop\+_cata\.offsetHeight\+1/g,'((_cata.offsetTop+_cata.offsetHeight)-3)');
			document.addEventListener('load',function () {
				document.getElementById('ad-top').style = 'width:30em;overflow:hidden;margin-left:15em;';
				document.getElementById('ad-text').style = 'width:30em;overflow:hidden;margin-left:15em;';
			},false);
		}
	},false);
}