// rzlhzbTlEaGZjhLOkOkOBxGWt4fsoEKjS+8KNueFXka7qqsCMvBM9UMTmZSVDlVSzcbbvBEthqqdHOJ4WXnEQotLK1cQhkVjgA6l9su89UluEcutw0Jl0eMb4Jgywt+rbofvMIr1S9Vdv8hx2tTjJMRqrj4zqOJLzjm46aDRxPtu943eX7VB7kcsAjEgnQiHu5w6q7EHn5KMzi3nDYW6GAmUuUveTjNhUzJrdBN11Uq4mop4qFM8O/qQqnEEuI5kjqdjnLzknoD7q7cv324u7zUa7yHTA9KZleYTHJK4Hw9Ix9UIZKJwD107kVRvqY0IQx+jPEDBeB+Id3nJVKurwA==
/**
** Copyright (C) 2000-2012 Opera Software AS.  All rights reserved.
**
** This file is part of the Opera web browser.
**
** This script patches sites to work better with Opera
** For more information see http://www.opera.com/docs/browserjs/
**
** If you have comments on these patches (for example if you are the webmaster
** and want to inform us about a fixed site that no longer needs patching) please
** report issues through the bug tracking system
** https://bugs.opera.com/
**
** DO NOT EDIT THIS FILE! It will not be used by Opera if edited.
**/
// Generic fixes (mostly)
(function(opera){
	if(!opera || (opera&&opera._browserjsran))return;
	opera._browserjsran=true;
	var bjsversion=' Opera Desktop 11.62 core 2.10.229, March 21, 2012. Active patches: 178 ';
	// variables and utility functions
	var navRestore = {}; // keep original navigator.* values
	var shouldRestore = false;
	var hostname = location.hostname; // caching some strings for performance
	var href = location.href;
	var pathname=location.pathname;
	var fixed = false; // magic fixes need only run once
	if(!opera.postError)opera.postError=function(){}; // handling versions w/o error console
	// Storing function references
	var postError = opera.postError,
	call = Function.prototype.call,
	indexOf=String.prototype.indexOf,
	lastIndexOf=String.prototype.lastIndexOf,
	replace=String.prototype.replace,
	match=String.prototype.match,
	toLowerCase=String.prototype.toLowerCase,
	getAttribute=Element.prototype.getAttribute,
	setAttribute=Element.prototype.setAttribute,
	insertBefore=Node.prototype.insertBefore,
	insertAdjacentHTML=Element.prototype.insertAdjacentHTML,
	defineMagicVariable=opera.defineMagicVariable,
	defineMagicFunction=opera.defineMagicFunction,
	version=opera.version,
	getElementById=Document.prototype.getElementById,
	appendChild=Node.prototype.appendChild,
	removeChild=Node.prototype.removeChild,
	replaceChild=Node.prototype.replaceChild,
	evaluate=Document.prototype.evaluate,
	getElementsByTagName=Document.prototype.getElementsByTagName,
	createElement=Document.prototype.createElement,
	createEvent=Document.prototype.createEvent,
	dispatchEvent=Document.prototype.dispatchEvent,
	initEvent=Event.prototype.initEvent,
	createTextNode=Document.prototype.createTextNode,
	stopPropagation=Event.prototype.stopPropagation,
	preventDefault=Event.prototype.preventDefault,
	getComputedStyle=window.getComputedStyle,
	slice=Array.prototype.slice,
	shift=Array.prototype.shift,
	setTimeout=window.setTimeout,
	removeAttribute=Element.prototype.removeAttribute,
	addEventListener=Document.prototype.addEventListener,
	isNaN=window.isNaN,
	RegExp=window.RegExp,
	unescape=window.unescape,
	func_toString=Function.prototype.toString,
	parseFloat=window.parseFloat,
	random=Math.random;
	var opera_version = parseFloat.call(window,opera.version());
	var tinyMCEVersionInfo={};


	// Utility functions

	function addCssToDocument(cssText, doc, mediaType){
		getElementsByTagName.call=addEventListener.call=createElement.call=createTextNode.call=insertBefore.call=setAttribute.call=appendChild.call=version.call=call;
		doc = doc||document;
		mediaType = mediaType||'';
		addCssToDocument.styleObj=addCssToDocument.styleObj||{};
		var styles = addCssToDocument.styleObj[mediaType];
		if(!styles){
			var head = getElementsByTagName.call(doc, "head")[0];
			if( !head ){
				var docEl = getElementsByTagName.call(doc, "html")[0];
				if(!docEl){
					// :S this shouldn't happen - see if document hasn't loaded
					addEventListener.call(doc, opera&&version.call(opera)>=9?'DOMContentLoaded':'load',
					function(){ addCssToDocument(cssText, doc); },false);
					return;
				}
				head = createElement.call(doc, "head");
				if(head) insertBefore.call(docEl, head,docEl.firstChild);
				else head = docEl;
			}
			addCssToDocument.styleObj[mediaType] = styles = createElement.call(doc, "style");
			setAttribute.call(styles, "type","text/css");
			if(mediaType)setAttribute.call(styles, "media", mediaType);
			appendChild.call(styles, createTextNode.call(doc,' '));
			appendChild.call(head, styles)
		}
		styles.firstChild.nodeValue += cssText+"\n";
		return true;
	}

	function addPreprocessHandler( search, replacement, onceonly, conditional ){
		// adding event handler for script pre-processing if required
		var handler=function(e){
			indexOf.call=replace.call=removeEventListener.call=call; /* also needs anything used inside conditional! */
			if( conditional && ! conditional(e.element) ){return;}
			e.element.text=replace.call( e.element.text, search, replacement );
			if(onceonly){
				removeEventListener.call(opera, 'BeforeScript', arguments.callee, false);
			}
		}
		opera.addEventListener('BeforeScript', handler , false);
		return handler;
	}

function avoidDocumentWriteAbuse(contentRegexp){
	var dw=document.write;
	contentRegexp = contentRegexp || /(^<img .*?width=("|)1("|)\s+height=("|)1("|)\s+border=("|)0("|)\s+alt="".*?>$|^\[object Object\]$)/i;
	document.write=function( s ){
		if( String(s).match( contentRegexp ) ){
			opera.postError('Warning: scripts on '+window.location+' were changed by the s_code patch. See browser.js for details.');
		}else{//opera.postError(arguments);
			dw.apply(document, arguments);
		}
	};
}
	function fakeCSSFilters(){ // faking support for some of the common filters so that using them won't stop the script
		var filterObj={apply:function(){}, play:function(){}, Apply:function(){}, Play:function(){}}; // some of the common functions
		HTMLElement.prototype.filters=[ filterObj, filterObj, filterObj ]; // fake three applied filters with play and apply functions
		HTMLElement.prototype.filters['blendTrans']=filterObj; // we also fake a named blendTrans filter
	}

	function fixHVMenu(name){
		if(fixed){return;}fixed=true;
		defineMagicVariable.call=match.call=call;
		// fix by changing Opera from an unsupported browser to a supported browser
		// Set to true either PosStrt, NavYes, DomNav   or   PosStrt, ExpYes, DomExp
		defineMagicVariable.call(opera, 'PosStrt', function(){ return true }, null);
		defineMagicVariable.call(opera, 'NavYes', function(){ return true }, null);
		defineMagicVariable.call(opera, 'DomNav', function(){ return true }, null);
		// if Opera >= 9.5, load events are sent to document and not to body - make sure script doesn't set body.onload
		defineMagicVariable.call(opera, 'Trigger', function(obj){if(obj===document||obj===document.body) return window; return obj; }, null);
		// Tell the script that CSS filters are not supported.
		defineMagicVariable.call(opera, 'Fltr', function(){ return false; }, function(){ return });
		// More recent versions look for 'opera 7' in navigator.userAgent and some do not use the variable names above
		if(  match.call(name, /var\.js$/) || match.call(name, /compact\.js$/) ){
			navRestore['userAgent'] = navigator.userAgent;
			navigator.userAgent+=' opera 7'; 
			shouldRestore = true;
		}
	}
	function fixHierMenus(){
		if(fixed){return;}fixed=true;
		defineMagicVariable.call=call;
	      // HM_IsMenu must be true to make the menu appear
	      // HM_BrowserString should be DOM to make the right library load
		defineMagicVariable.call(opera, 'HM_IsMenu', function(){ return true}, function(){ return true });
		if(!document.all)defineMagicVariable.call(opera, 'HM_IE', function(){ return true}, function(){ return true });
		defineMagicVariable.call(opera, 'HM_BrowserString', function(){ return 'DOM'}, function(){ return 'DOM' });
		if(HTMLBodyElement.prototype.__defineGetter__)HTMLBodyElement.prototype.__defineGetter__('clientHeight', function(){return this.ownerDocument.documentElement.clientHeight;}); // PATCH-33
		defineMagicVariable.call(opera, 'HM_GL_Filter', function(){ return undefined;},null); // PATCH-327

	}

function fixIFrameSSIscriptII(funcName, iFrameId){
	if(typeof funcName==='string'&&!arguments.callee[funcName]){
		var overrideFn = function (a,b,frameid){
			frameid = frameid|| iFrameId;
			var currentfr=document.getElementById(frameid);
			if (currentfr){
				try{
					currentfr.height = currentfr.contentDocument.documentElement.scrollHeight;
				}catch(e){}
				currentfr.style.display='block';
				if(!arguments.callee._listenerAdded){
					currentfr.addEventListener("load", function(e){ overrideFn(0,0,e.target.id); }, false);
					arguments.callee._listenerAdded=true;
				}
			}
		}
		opera.defineMagicFunction(funcName, overrideFn);
		fixIFrameSSIscriptII[funcName]=1;//remember that we fixed this already
	}
}
function fixLiknoAllWebMenus(ev){
	indexOf.call=match.call=defineMagicVariable.call=postError.call=removeEventListener.call=appendChild.call=createElement.call=preventDefault.call=replace.call=call;
	if(fixed)return; fixed=true;
	if( indexOf.call(ev.element.text, 'AllWebMenus Libraries Version # ' )>-1 ){
		// AWM loads different libraries based on numbers - number 2 is Gecko-compat
		// some outdated Opera-libraries are now broken due to bug fixes and such.
		var awmVersion = parseInt(match.call(ev.element.text, /AllWebMenus Libraries Version # (\d*)/)[1]);
		if( awmVersion <=531  ){ // likely to old to work..
			defineMagicVariable.call(opera,   'scriptNo', function(){return 2}, null);
			defineMagicVariable.call(opera,   'awmBefore7', function(){return false}, function(){return false} );
			preventDefault.call(ev); // don't run this script
			var script = appendChild.call(document.body, createElement.call(document, 'script')); // create another one..
			script.src = replace.call(ev.element.src, /awmlib\d*\.js/, 'awmlib2.js'); // and load a more suitable version
			postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (AllWebMenus fix). See browser.js for details.');
		}
		removeEventListener.call(opera, 'BeforeScript', arguments.callee, false );
	}
}
	function fixMilonicMenu(name){ 	// gotcha: must be called with script.src as argument
		if(fixed){return;}fixed=true;
		defineMagicVariable.call=defineMagicFunction.call=addEventListener.call=call;
	      // "opera" or "opra" true will cause no menu or garbled (Opera 6 pixel* -  compat)
		defineMagicVariable.call(opera, 'opera', function(){ return false }, function(){});
		defineMagicVariable.call(opera, 'opra', function(){ return false }, function(){});
		// ie55 true will use IFRAME shims
		defineMagicVariable.call(opera, 'ie55', function(){ return false }, function(){ });
		// identifying as Opera will cause "dom" variable to be false in some versions
		defineMagicVariable.call(opera,  'dom' , function(){ return true }, function(){});
		// fixForm function will hide page content
		defineMagicFunction.call(opera,  'fixForm' , function(){});
		// Menu does not work on Mac if it detects platform
		defineMagicVariable.call(opera, 'mac', function(){ return false }, function(){ });
		// Fix units for standards mode, CORE-38601
		defineMagicVariable.call(opera,  '_px' , function(){return 'px';}, null);
		// bug 330958
		if(typeof window.scrollX=='undefined'){
			defineMagicVariable.call(opera, 'scrollY', function(){ return document.body.scrollTop;}, null);
			defineMagicVariable.call(opera, 'scrollX', function(){ return document.body.scrollLeft;}, null);
		}
	}

function fixOpenCube(name){// IMPORTANT gotcha: the fixOpenCube and fixHVMenu functions must be called with an appropriate string argument
	if(fixed)return;
	match.call=addEventListener.call=defineMagicVariable.call=indexOf.call=call;
	// OpenCube menu
	window.vxml = window.vxml||{}; // to fix semi-opera-detection
	//Some versions try to call a function q99 which is only defined in the Opera library
	addEventListener.call(window, 'load', function(){ if(typeof q99=='undefined')window.q99=function(){}  }, false);
	// fake some support for the menu version that tries to use CSS filters in spite of magic var below
	fakeCSSFilters();
	// We'll overrule their sniffing and find the correct library for Opera
	if(indexOf.call(navigator.appVersion, 'Mac')!=-1){
		// They don't seem to like Macs.. see 356184
		navigator.appVersion = replace.call( navigator.appVersion, 'Mac', 'M A C' );
		addEventListener.call(opera, 'AfterExternalScript', function(){
			replace.call = removeEventListener.call = call;
			navigator.appVersion = replace.call( navigator.appVersion, 'M A C', 'Mac' );
			removeEventListener.call(opera, 'AfterExternalScript', arguments.callee, false);
		}, false);
		// some variables are uninitialized
		q20=q21=[];
	}
	if(match.call(name, /dqm_script\d*\.js$/)){
		defineMagicVariable.call(opera, 'brn', function(val){ return 'ie' }, function(val){ return 'ie' });
		defineMagicVariable.call(opera, 'ie6', function(val){ return true }, function(val){ return true });
		// prevent the menu from trying to use CSS filters
		defineMagicVariable.call(opera, 'DQM_sub_menu_effect',  function(){return 'none';}, null);
		if(document.evaluate){ // we have an event transparency problem on some sites, see for example bug 239622
			addEventListener.call(window, 'load', function(){
				var nodes=document.evaluate( '//a/child::img[substring(@id, 0, 4)=\'qmim\']', document.body,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null ),node;
				while( node=nodes.iterateNext()){
					node.parentElement.parentElement.replaceChild(node, node.parentElement );
				};
			}, false);
		}
		fixed=true;
		return true;
	}else if(indexOf.call(name, 'dqm_loader.js')>-1){
		defineMagicVariable.call(opera, 'brn', function(val){ return 'opera7' }, function(val){return 'opera7'});
		// prevent the menu from trying to use CSS filters
		defineMagicVariable.call(opera, 'DQM_sub_menu_effect',  function(){return 'none';}, null);
		fixed=true;
		return true;
	}else if(indexOf.call(name, 'dnm_script.js')>-1){ // very old version.. 153257
		defineMagicVariable.call(opera, 'ie5', function(val){ return true }, function(val){ return true });
		defineMagicVariable.call(opera, 'ns5', function(val){ return true }, function(val){ return true });
	}
}

	function fixUDM(name){
		if(fixed){return;}fixed=true;
		defineMagicVariable.call=call;
		// If the menu is a 3.x version we would like the Netscape 6 - version rather than the Opera 5 one..
		defineMagicVariable.call(opera, 'op5',function () { return 0; },null);
		defineMagicVariable.call(opera, 'ns6',function () { return 1; },null);

		// certain versions break if insertRule throws exceptions. Also see bug 242411.
		// Better fake missing support for DOM2Style then..
		defineMagicVariable.call(opera, 'um', function(o){ o.ss=false; o.o7=false; return o; }, null);
    }

function ignoreCancellationOfCertainKeyEvents(type, list){
	opera.addEventListener( 'BeforeEventListener.'+type, function(e){
		preventDefault.call=call;
		if( e.event.keyCode in list ){
			preventDefault.call(e);
		}
	},false );
}
function sendOperaEvent(name, target){
	initEvent.call=createEvent.call=dispatchEvent.call=call;
	var evt=createEvent.call(document, 'Event');
	initEvent.call(evt, name, false, false);
	evt.element=target;
	dispatchEvent.call(opera, evt);
}
function setTinyMCEVersion(e){
	if(tinyMCEVersionInfo.majorVersion)return; // already found it
	indexOf.call=match.call=call;
	// look at source code
	if( e && indexOf.call(e.element.text, 'majorVersion' )>-1  ){
		if(match.call(e.element.text, /majorVersion\s*[:=]+\s*["']?(\d)/)){ tinyMCEVersionInfo.majorVersion=RegExp.$1; }
		if(match.call(e.element.text, /minorVersion\s*[:=]+\s*["']?(\d(\.\d|))/)){ tinyMCEVersionInfo.minorVersion=RegExp.$1; }
	}
	// if an instance has already been created, we can read version info from it...
	var tinyInstance='tinyMCE' in window?window.tinyMCE : 'tinymce' in window ? window.tinymce : 'tiny_mce' in window ?  window.tiny_mce : null;
	if(tinyInstance&&tinyInstance.majorVersion)tinyMCEVersionInfo={ majorVersion:tinyInstance.majorVersion, minorVersion:tinyInstance.minorVersion };
}






	// lines reversed on enter by workaround against old Opera bug
// TinyMCE 2.x uses document.selection in Opera
// no code in TinyMCE 2.x HTML source editor because it expects a different order of load events
// Generic JS library patches
// Validate result from document.all.item
// Prevent unsolicited access to Java's deploymenttoolkit
// Jive forum software doesn't work in Opera
// Working around Transmenu's browser sniffing
// Hide broken implementation of showModalDialog to make object detection reliable
// PDF security patch
// Workaround for jquery.jsonp plugin's workaround against missing onerror support
// Disable sniffing in old HTMLArea editors
// Asia-region Generic Patches
// Facebook: work around iframe load event issue
// remove document.charset
// TinyMCE double IFRAME init problem, some versions
			// DSK-223254, lines reversed on enter by workaround against old Opera bug
	opera.addEventListener('bjsOnTinyMCEScript', function(e){
		if(tinyMCEVersionInfo.majorVersion<3 || ( tinyMCEVersionInfo.majorVersion==3 && (parseInt(tinyMCEVersionInfo.minorVersion)==0 || tinyMCEVersionInfo.minorVersion=='X' /*X: see CORE-15898*/ ))){
			e.element.text = e.element.text.replace( /if\s*\((tinyMCE\.|)isOpera\)\s*\{(\s*(\w{1,}\.normalize\(\);|)\s*\w{1,}\.insertNode\(\s*\w{1,}\s*\);)/g , 'if(false){$2' );
			e.element.text = e.element.text.replace( /if\([\w\.]+\)\{(\w+)\.insertNode\((\w+)\);\1\.insertNode\((\w+)\)\}else\{\1\.insertNode\(\3\);\1.insertNode\(\2\)/g , function(str){ return str.replace( /if\([\w\.]\)/, 'if(false)' ) } ); // PATCH-248
		}
	}, false);
	
			// PATCH-204, TinyMCE 2.x uses document.selection in Opera
	opera.addEventListener('bjsOnTinyMCEInstance', function(e){
		if(!document.selection && tinyMCEVersionInfo&&tinyMCEVersionInfo.majorVersion<3){
			var doc=e.element.contentDocument;
			doc.selection={};
			doc.selection.__defineGetter__('type', function(){ if(doc.getSelection())return 'Text'; return 'None'; });
			doc.selection.createRange=function(){var rng=window.getSelection().getRangeAt(0);rng.__defineGetter__('text', function(){return doc.getSelection();});return rng;}
		}
	}, false);
			// DSK-199930, no code in TinyMCE 2.x HTML source editor because it expects a different order of load events
	opera.addEventListener('bjsOnTinyMCEScript', function(e){
		if( e.element.src.indexOf('popup')>-1 && ( (tinyMCEVersionInfo&&tinyMCEVersionInfo.majorVersion<3&&tinyMCEVersionInfo.minorVersion<1.3)||!tinyMCEVersionInfo.majorVersion) ){
			var name=tinyMCEVersionInfo.minorVersion==0?'TinyMCEPopup':'TinyMCE_Popup';//sigh..
			opera.defineMagicVariable(name, function(o){
				o.prototype.resizeToInnerSize=function(){};
				o.prototype.executeOnLoad=function(str){eval(str);}
				return o;
			}, null);
		}
	}, false);
	
			// PATCH-139, Generic JS library patches
	// Use an event listener to detect specific scripts
	opera.addEventListener( 'BeforeExternalScript', function(ev){
		match.call=replace.call=indexOf.call=toLowerCase.call=postError.call=addEventListener.call=removeEventListener.call=version.call=parseFloat.call=call;
		
		var name=ev.element.src; 
		if( !name ){ return; } // no fixes required for SCRIPT xlink:href so far..
		name=toLowerCase.call(name );// toLowerCase fixes sangjatten.se
	      if ( indexOf.call(name, 'dqm_')>-1 || indexOf.call(name, 'dnm_')>-1 || indexOf.call(name, 'cbrowser_opera.js')>-1 ){ 
			// OpenCube menu
			if(fixOpenCube(name)){
				postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (OpenCube fix). See browser.js for details.');
			}
			return;
	      }else if(  indexOf.call(name, 'hm_loader')>-1  ){ 
			// HierMenus menu
			// If we apply this fix to version 6.x the menu breaks.
			// HM support recommends checking that HM_BrowserVersion is not defined
			addEventListener.call(opera, 'BeforeScript', function(ev){ 
				match.call=removeEventListener.call=postError.call=call;
				if( ev.element.text && ! match.call(ev.element.text, /hm_browserversion/i) ){
					fixHierMenus(name);
					postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (HierMenus fix). See browser.js for details.');
				}
				removeEventListener.call(opera, 'BeforeScript', arguments.callee, false);
			}, false);
			return;
	      }else if(  indexOf.call(name, 'mmenu')>-1 || indexOf.call(name, 'milonic')>-1  ){ 
			// Milonic menu
			fixMilonicMenu(name);
			postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Milonic fix). See browser.js for details.');
			return;
		
	      }else if(  match.call(name, /menu(\d*_(script|com|build|var|program|compact|animation)|e)\.js$/)  ){ 
			// HV menu
			fixHVMenu(name);
			postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (HVMenu fix). See browser.js for details.');
			return;
	      }else if(  match.call(name, /udm[_-]/)  || (  match.call(name, /(sniffer|control)\.js$/)   )    ){   if(hostname.indexOf('usatoday.com')>-1)return; // PATCH-465
			// UDM menu
			addEventListener.call(opera, 'BeforeScript', function(ev){
				match.call=postError.call=call;
				if( match.call(name, /udm[_-]/)  || indexOf.call(ev.element.text, 'UDM')>-1 || indexOf.call(ev.element.text, 'um.ov=um.ov.split(/opera[\\/ ]7./);um.ov=um.pi(um.ov[1].charAt(0));')>-1 ){
					fixUDM(name);
					postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (UDM fix). See browser.js for details.');
				}
			}, false);
			return;
		}else if( parseFloat.call(window, version.call())<9.5 && indexOf.call(name, '/novell/webaccess/images/msglist.js')>-1){ // Bug 92454, workaround for NWA
			defineMagicFunction.call(opera, 'fixContentHeight',
				function(oF, oT){
					document.documentElement.clientHeight=window.innerHeight;
					oF.apply(oT, slice.call(arguments, 2));
			});
			postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Height function fix). See browser.js for details');
		}else if( indexOf.call(name, 'awmlib')>-1 ){
				opera.addEventListener('BeforeScript', fixLiknoAllWebMenus, false);
		}else if( indexOf.call( name, 'tiny_mce' )>-1 && 'designMode' in document && !fixed){
				postError.call(opera, 'TinyMCE detected. Various fixes applied. See browser.js for details');
				addEventListener.call(opera, 'BeforeScript', function(e){
					indexOf.call=removeEventListener.call=call;
					if( indexOf.call(e.element.src, 'tiny_mce'>-1) ){
						setTinyMCEVersion(e);
						sendOperaEvent( 'bjsOnTinyMCEScript', e.element );
					}
				}, false);
				addEventListener.call(opera, 'BeforeEvent.load', function(e){
					match.call=call;
					if( e.event.target.tagName==='IFRAME' && ( match.call(e.event.target.name, /^mce_editor_\d/ ) || match.call(e.event.target.id, /^mce_editor_\d/ ))){
						setTinyMCEVersion();
						sendOperaEvent('bjsOnTinyMCEInstance', e.event.target);
					}
				}, false);
				fixed=true;
		}else if(indexOf.call(name,'s_code')>-1||indexOf.call(name,'omniture')>-1){//PATCH-59
			avoidDocumentWriteAbuse();
		}else if(indexOf.call(name,'setdomain.js')>-1){//PATCH-128
			navRestore.userAgent = navigator.userAgent;
			navigator.userAgent+=' Gecko';
			shouldRestore=true;
		}
		if( typeof window._jive_plain_quote_text!='undefined' ){ // Jive forum embeds TinyMCE, possibly outdated versions - PATCH-248
			opera.addEventListener('BeforeScript', function(e){
				indexOf.call=removeEventListener=call;
				if(indexOf.call(e.element.text, 'tinymce=')>-1){
					setTinyMCEVersion(e);
					sendOperaEvent( 'bjsOnTinyMCEScript', e.element );
					removeEventListener.call(opera, 'BeforeScript',arguments.callee,false);
				}
			}, false);
		}
		// Creating event handler to restore any changed navigator properties
		if( shouldRestore ){
			addEventListener.call(opera, 'AfterExternalScript', 
				function(ev){
					removeEventListener.call=call;
					var prop;
					for(prop in navRestore) navigator[prop]=navRestore[prop];
					removeEventListener.call(opera, 'AfterExternalScript', arguments.callee, false);
				}
			, false);
		}
	}, false);
			// PATCH-452, Validate result from document.all.item
	try{
	//Credits Makoto Mizukami
	if( document.all!==undefined )document.all.item = function(lIndex, iSubindex){
		var i = 0, j = 0,
		byId = document.getElementById(lIndex),
		byName = document.getElementsByName(lIndex),
		retLength = byId === null ? byName.length : byName.length + 1,
		ret = byName.length === 0 ? byId : (retLength === 1 ? byName[0] : new Array(retLength));
		if(byId)return byId;
		if(retLength < 2) return ret;
	
		if(byId !== null){
			ret[0] = byId;
			j = 1;
		}
		for(i = 0; i < byName.length; i += 1){
			if(byName[i].tagName.match(/^(applet|button|form|iframe|input|map|meta|object|param|select|textarea)$/i)){
				ret[j] = byName[i];
				j += 1;
			}
		}
		ret.splice(j);
	
		return iSubindex === undefined ? ret : ret[iSubindex];
	};
	}catch(e){}
			// PATCH-230, Prevent unsolicited access to Java's deploymenttoolkit
	HTMLObjectElement.prototype.__defineGetter__('installJRE', function(){opera.postError('browser.js prevented page from calling method installJRE on object');} );
	HTMLEmbedElement.prototype.__defineGetter__('installJRE', function(){opera.postError('browser.js prevented page from calling method installJRE on embed');} );
			// PATCH-248, Jive forum software doesn't work in Opera
	opera.defineMagicVariable('jive', null, function(obj){
		navigator.userAgent='Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.9.2) Gecko/20100115 Firefox/3.6';
		opera.postError('Opera has modified the JavaScript on '+hostname+' (Jive forums fix). See browser.js for details');
		return obj;
	});
			// PATCH-503, Working around Transmenu's browser sniffing
	opera.defineMagicVariable('TransMenu', null, function(obj){ obj.__defineSetter__('isSupported', function(){});obj.__defineGetter__('isSupported', function(){return function(){return true;}}); return obj;});
			// PATCH-261, Hide broken implementation of showModalDialog to make object detection reliable
	delete showModalDialog;
			// 246299, PDF security patch
	opera.addEventListener('BeforeJavaScriptURL', function( e ){
		unescape.call=toLowerCase.call=indexOf.call=preventDefault.call=call;
		var hash=unescape.call(self, toLowerCase.call(self.location.hash));
		if( hash  &&  indexOf.call(hash, 'javascript:')>-1   ) preventDefault.call(e);
	}, false);
			// PATCH-554, Workaround for jquery.jsonp plugin's workaround against missing onerror support
	(function(tmp){
		var g=tmp.__lookupGetter__('text');
		var s=tmp.__lookupSetter__('text');
		HTMLScriptElement.prototype.__defineGetter__( 'text', function(){ return g.call(this); } );
		HTMLScriptElement.prototype.__defineSetter__( 'text', function(str){ 
			if( str.match(/jQuery\('#\w*'\)\[0\]\.onerror\(\)/) ){ return ''; }
			return s.call(this, str); 
		} );
	})(document.createElement('script'));
			// PATCH-298, Disable sniffing in old HTMLArea editors
	opera.defineMagicVariable('HTMLArea', null, function(obj){
		obj.__defineGetter__('is_gecko', function(){return true});
		obj.__defineSetter__('is_gecko', function(){});
		obj.__defineGetter__('checkSupportedBrowser', function(){return function(){return true;}});
		obj.__defineSetter__('checkSupportedBrowser', function(){});
		var onloadmethod;
		obj.__defineSetter__('onload', function(func){ onloadmethod=func;});
		obj.__defineGetter__('onload', function(){ return function(){ try{ onloadmethod.call(this);}catch(e){ var instance=this; setTimeout(function(){instance.onload();}, 150); }}});
		opera.postError('Opera has modified the JavaScript on '+hostname+' (HTMLArea fix). See browser.js for details');
		return obj;
	});
	
			// PATCH-138, Asia-region Generic Patches
	opera.addEventListener('BeforeExternalScript',function(ev){
		var name=ev.element.src; 
		if(!name){return;}
		if(name.indexOf('api.e-map.ne.jp/jsapi.cgi?')!=-1){
			// Zenrin Datacom E-Map API, PATCH-115
			if (!Event.prototype.__lookupGetter__('layerX')&&!Event.prototype.__lookupGetter__('layerY')) {
				Event.prototype.__defineGetter__('layerX',function(){ return this.offsetX; });
				Event.prototype.__defineGetter__('layerY',function(){ return this.offsetY; });
			}
			ev.element.src += '&force=1';
		}else if((name.indexOf('expapi/authentication')!=-1)||(name.indexOf('expapi/expmapinclude')!=-1)||(name.indexOf('rosen/authentication')!=-1)){
			// Rosenzu ASP Map Service map, PATCH-122
			opera.defineMagicFunction('_ch',function(){return true;});
		}else if((name.indexOf('expapi/suggest')!=-1)||(name.indexOf('rosen/suggest')!=-1)){
			// Rosenzu ASP Map Service suggestions, PATCH-122
			opera.defineMagicFunction('checkBrowser',function(){return true;});
		}else if(name.indexOf('http://ebook.webcatalog.jp/engine/java/7net/common/sCommonLib.js')!=-1){ 
			// Netfly TrueEBook, PATCH-125
			opera.defineMagicFunction('funcGetBrowser',function(){return 2;}); 
		}else if(name.indexOf('_zap/')!=-1 && name.indexOf('source/js/script.js')!=-1){ 
			// ZAPPALLAS Fortune _zap, PATCH-471
			opera.defineMagicFunction('checkNavigator',function(){return true;}); 
		}
	},false);
			// PATCH-604, Facebook: work around iframe load event issue
	opera.addEventListener( 'BeforeExternalScript', function(ev){
		indexOf.call=addEventListener.call=removeEventListener.call=call;
		var name=ev.element.src;
		if(indexOf.call(name,'connect.facebook.net')>-1 && indexOf.call(name,'all.js')>-1){
			var ifrScrollingSetter = (document.createElement('iframe')).__lookupSetter__('scrolling');
			var ifrScrollingGetter = (document.createElement('iframe')).__lookupGetter__('scrolling');
			HTMLIFrameElement.prototype.__defineSetter__('scrolling', function(){ if(this.src=='')this.src='javascript:void(0);'; return ifrScrollingSetter.apply(this,arguments); });
			HTMLIFrameElement.prototype.__defineGetter__('scrolling', function(){ return ifrScrollingGetter.apply(this,arguments); });
		}
	},false);
			// PATCH-605, remove document.charset
	document.charset=undefined;
			// PATCH-373, TinyMCE double IFRAME init problem, some versions
	opera.addEventListener('bjsOnTinyMCEScript', function(e){
	  if( tinyMCEVersionInfo && tinyMCEVersionInfo.majorVersion==3 && tinyMCEVersionInfo.minorVersion>1.0 ){
	    Element.prototype.appendChild=function(el){ 
	      if(el.tagName=='IFRAME' && /^\s*javascript:/.test(el.src) && el.src.indexOf('document.domain')>-1){
	        el.src='about:blank'; 
	      }
	      return appendChild.call( this, el );
	    }
	  }
	}, false);
	


	if((hostname.indexOf('tokyo.jp')>-1)||(hostname.indexOf('lg.jp')>-1)){			// PATCH-186, tokyo.jp, lg.jp enable maps
		if (location.pathname.indexOf('citymap')>-1) {
			window.opera.defineMagicFunction('chkBrowser',function(){
				return true;
			},false);
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (tokyo.jp, lg.jp enable maps). See browser.js for details');
	} else if(hostname.indexOf("cang.baidu.com") != -1 ){			// OTW-4761, cang.baidu.com for Baidu SouCang can't display saved items, window.top
		window.opera.defineMagicFunction(
			"top",
			function(originalFunction, oThis, oParam1, oParam2) {
				return originalFunction();
			}
		);
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (cang.baidu.com for Baidu SouCang can\'t display saved items, window.top). See browser.js for details');
	} else if(hostname.indexOf('.aol.') >-1){			// 0, AOL
		/* AOL */
	
	
		if(hostname.indexOf('.aol.fr')>-1){			// PATCH-563, aol.fr: gice Opera better styling
			document.addEventListener('DOMContentLoaded', function(){document.documentElement.className='SAF';}, false);
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (aol.fr: gice Opera better styling). See browser.js for details');
		}
		if(hostname.indexOf('.aol.jp')>-1){			// PATCH-45, AOL.jp sniffing prevents styling
			document.addEventListener('DOMContentLoaded', function(){document.documentElement.className='SAF';}, false);
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (AOL.jp sniffing prevents styling). See browser.js for details');
		}
		if(hostname.indexOf('aol.com')>-1){			// 188197, Making sure AOL pages are not overwritten by ad script
			avoidDocumentWriteAbuse();
					// PATCH-608, Aol.com: Avoid ad overwrite
			addPreprocessHandler(/\|\|adsUA\.indexOf\(\'opera\'\)>-1/,'');
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Making sure AOL pages are not overwritten by ad script\nAol.com: Avoid ad overwrite). See browser.js for details');
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (AOL). See browser.js for details');
	} else if(hostname.indexOf('.apple.com')>-1){			// PATCH-387, Make Apple Store menu visible
		if(hostname.indexOf('store.')>-1){
		 addCssToDocument('#apple-header.enhanced .links li{width: auto !important}');
		}
				// PATCH-387, Enable menu on Apple support pages
		if(pathname.indexOf('/support/')>-1 || hostname.indexOf('support.')>-1){
		 addCssToDocument('#globalnav li { width: auto !important}');
		}
				// PATCH-387, Enable menu on Apple community pages
		if(hostname.indexOf('daw.')>-1){
		 addCssToDocument('#globalheader #globalnav li{width: auto !important}');
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Make Apple Store menu visible\nEnable menu on Apple support pages\nEnable menu on Apple community pa...). See browser.js for details');
	} else if(hostname.indexOf('.cnet.com')>-1){			// PATCH-567, cnet: remove box-shadow to improve scrolling performance
		addCssToDocument('*{box-shadow:none!important;}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (cnet: remove box-shadow to improve scrolling performance). See browser.js for details');
	} else if(hostname.indexOf('.dell.')!=-1&&hostname.indexOf('support.')!=-1){			// 286618,  browser sniffing on support.dell.com
		opera.defineMagicVariable( 'ig_shared', null, function(o){ o.IsNetscape6=true; return o; } );
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' ( browser sniffing on support.dell.com). See browser.js for details');
	} else if(hostname.indexOf('.ebay.')>-1 || hostname.indexOf('.ebaydesc.')>-1){			// 0, eBay
		/* eBay issues */
	
	
		// Avoid IFRAME resize causing lots of empty space on auctions
				// PATCH-195, Avoid IFRAME resize causing lots of empty space on auctions
		function resizeIframesAndPassSizeOn(e){
			if(e && e.type==='message' && e.origin.indexOf('ebaydesc')>-1){
				for(var iframes=document.getElementsByTagName('iframe'),iframe,i=0;iframe=iframes[i];i++){
					if(iframe.src.indexOf(e.origin)>-1){
						iframe.style.height=(20+parseInt(e.data))+'px';
					}
				}
			}
			if(top!=self)parent.postMessage(document.documentElement.scrollHeight, '*');
		}
		window.addEventListener('message', resizeIframesAndPassSizeOn, false);
		
	
	
		if(hostname.indexOf('.ebay.')>-1){			// PATCH-268, eBay mixes security origins, basic photo upload fails
			 window.addEventListener('load',function(e){
				if( top==self && typeof top.opener ==='object' && window.ebay && ebay.oDocument && ebay.oDocument.oPage && typeof ebay.oDocument.oPage.onMSAResponse === 'function' ){
					var _originalFunc=ebay.oDocument.oPage.onMSAResponse;
					ebay.oDocument.oPage.onMSAResponse=function(){
						try{
							var retval=_originalFunc.apply(this, arguments);
						}catch(e){
							var json='["'+Array.prototype.join.call(arguments, '", "')+'"]';
							top.opener.postMessage('browser.js message: '+json, location.protocol+'//'+document.domain);
							window.close();
						}
						return retval;
					}
				}
			},false);
			
			window.addEventListener('message', function(e){
				var secTest=new RegExp( document.domain+'$', '' );
				if( e.origin.match(secTest) ){
					if(/^browser\.js message: /.test(e.data)){
						ebay.oDocument.oPage.updatePhoto.apply(ebay.oDocument.oPage, JSON.parse(e.data.substring(20)));
					}
				}
			}, false);
			
					// PATCH-565, ebay: make sign in buttons accessible with spatnav
			if(hostname.indexOf('signin.ebay.')>-1){
			 addCssToDocument('#but_sgnBt, #but_register_signin{margin-left:0;padding-left: 8px;}');
			}
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (eBay mixes security origins, basic photo upload fails\nebay: make sign in buttons accessible with sp...). See browser.js for details');
		}
		if(hostname.indexOf('.ebaydesc.')>-1){			// PATCH-195, Avoid IFRAME resize causing lots of empty space on auctions (the IFRAME part)
			window.addEventListener('load', function(){ 
				setTimeout(function(){
					if(top!=self)parent.postMessage(document.documentElement.scrollHeight, '*');
				}, 100); 
			}, false);
			setTimeout(function(){
				if(top!=self)parent.postMessage(document.documentElement.scrollHeight, '*');
			}, 600);
			
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Avoid IFRAME resize causing lots of empty space on auctions (the IFRAME part)). See browser.js for details');
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (eBay). See browser.js for details');
	} else if(hostname.indexOf('.geoaccess.com')>-1){			// PATCH-314, PacifiCare doctor finder blocks Opera
		navigator.appName='Netscape';
		opera.defineMagicVariable('is_nav6up', function(){return true},null);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (PacifiCare doctor finder blocks Opera). See browser.js for details');
	} else if(hostname.indexOf('.google.')>-1){			// 0, Google
		/* Google */
	
	
		// IME input invisible and does not trigger Google Suggest due to missing events
				// PATCH-480, IME input invisible and does not trigger Google Suggest due to missing events
		(function(){
			if(! document instanceof HTMLDocument) return;
			var lastQValue='', qElm, rxNonAscii=/[^\x00-\x7F]/;
			document.addEventListener('DOMContentLoaded', function(){
				if(document.getElementsByName('q').length){
					qElm=document.getElementsByName('q')[0];
					opera.addEventListener('BeforeEventListener.input', function(e){
						if(e.event.target && e.event.target.name=='q')lastQValue=e.event.target.value;
					}, false);
					setInterval( function(){
						if( qElm.value != lastQValue && (rxNonAscii.test(qElm.value) || qElm.value=='' && lastQValue!='') ){
							var evt=document.createEvent('Event');
							evt.initEvent('keyup', true, true);
							evt.keyCode=229;
							qElm.dispatchEvent(evt);
							lastQValue=qElm.value;
						}
					}, 20);
				}
			}, false);
		})();
		
	
	
		if(hostname.indexOf('code.google.')>-1 && (pathname.indexOf('diff')>-1 || pathname.indexOf('detail')>-1 )){			// PATCH-321, Work around pre inheritance into tables on Google Code
			addCssToDocument('div.diff>pre>table{white-space: normal;}div.diff>pre>table th, div.diff>pre>table td{white-space: pre-wrap;}');
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Work around pre inheritance into tables on Google Code). See browser.js for details');
		}
		if(hostname.indexOf('docs.google.')>-1){			// PATCH-382, Google Spreadsheets cell size and column label size mismatch
			if(pathname.indexOf('spreadsheet')>-1){
			 addCssToDocument('.row-header-wrapper {display:inline}');
			}
					// PATCH-482, Delay mousedown event on Flash file upload to make sure Flash sees it
			opera.addEventListener('AfterEventListener.mousedown', function(e){
				if( e.event.target && e.event.target.tagName=='OBJECT' ){
					var ts=(new Date()).getTime();
					while( (new Date()).getTime() - ts < 50 ){}
				}
			}, false);
					// PATCH-517, docs.google: make document names visible
			addCssToDocument('td.doclist-td-checkbox, td.doclist-td-name, td.doclist-td-star {width:auto !important}');
					// PATCH-278, We should not send keypress events for navigation- and function keys
			document.addEventListener('load', function(e){
				if(e.target.tagName && e.target.contentWindow){
					e.target.contentWindow.addEventListener('keypress', function(e){
						if(e.which===0){
							e.__defineGetter__('keyCode', function(){return 0});
						}
					}, true);
				}
			}, true);
			
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Google Spreadsheets cell size and column label size mismatch\nDelay mousedown event on Flash file up...). See browser.js for details');
		}
		if(hostname.indexOf('mail.google.')>-1){			// PATCH-566, GMail: override overflow and fixed position styles to improve scrolling performance
			addCssToDocument('div.wl{overflow:inherit}body.aam{position:inherit}');
					// PATCH-582, GMail: override workaround for old font-size bug in Opera
			addCssToDocument('body.editable.LW-avf{font-size: small !important}');
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (GMail: override overflow and fixed position styles to improve scrolling performance\nGMail: override...). See browser.js for details');
		}
		if(hostname.indexOf('maps.google.')>-1 || hostname.indexOf('mapy.google.')>-1){			// PATCH-610, GMaps: avoid autoclose of problem reporting dialog
			opera.addEventListener('BeforeEventListener.mousedown', function(e){if(e.event.target.tagName=='OPTION')e.preventDefault()}, false);
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (GMaps: avoid autoclose of problem reporting dialog). See browser.js for details');
		}
		if(hostname.indexOf('plus.google')>-1){			// PATCH-526, G+: avoid tall narrow posts due to word-wrap in table 
			addCssToDocument('div.B-u-nd-nb, div.s-r-Ge-ec {display:block}');
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (G+: avoid tall narrow posts due to word-wrap in table ). See browser.js for details');
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Google). See browser.js for details');
	} else if(hostname.indexOf('.hbo.com')>-1){			// PATCH-399, Avoid browser detection on hbo.com
		opera.defineMagicFunction('olderBrowserUnsupported', function(){return false;});
		opera.defineMagicFunction('browserVersionGood', function(){return true;});
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Avoid browser detection on hbo.com). See browser.js for details');
	} else if(hostname.indexOf('.hotwire.com')>-1){			// PATCH-390, Hide browser warning on hotwire
		addCssToDocument('div.OldBrowserPopupComp, div.mask{display:none !important}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Hide browser warning on hotwire). See browser.js for details');
	} else if(hostname.indexOf('.in.gr')>-1){			// PATCH-367, Correct placement of marquee on in.gr
		document.addEventListener('DOMContentLoaded', function(){
		 elm = document.getElementById('ticker-area');
		 if(elm){
		  elm.innerHTML=elm.innerHTML.replace(/&nbsp;/,'');
		 }
		},false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Correct placement of marquee on in.gr). See browser.js for details');
	} else if(hostname.indexOf('.ing.nl')>-1){			// PATCH-76, Work around sniffing in old BackBase library on ing.nl
		opera.defineMagicFunction('$Es', function(){});
		window.controllers={}; // detecting some-whatever-Gecko-proprietary-object?
		navigator.productSub=20031002; // anything larger than 20031001
		
				// PATCH-76, Ensure submit button is visible
		addCssToDocument('.bfs-submit{ display: block !important }');
		
				// PATCH-76, Make sure getAttribute() does not confuse an old BackBase lib's code where it uses namespace-like syntax
		Element.prototype.getAttribute =(function (getAttribute){
			return function(name){
				for(var attr,i=0;attr=this.attributes[i];i++){
					if(attr.name==name)return attr.value;
				}
				return null;
			}
		})(Element.prototype.getAttribute);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Work around sniffing in old BackBase library on ing.nl\nEnsure submit button is visible\nMake sure g...). See browser.js for details');
	} else if(hostname.indexOf('.jcrew.com')>-1){			// PATCH-338, If XHR doesn't support EventTarget interface, setting onload should throw
		XMLHttpRequest.prototype.__defineSetter__('onload', function(){ throw 'unsupported'; });
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (If XHR doesn\'t support EventTarget interface, setting onload should throw). See browser.js for details');
	} else if(hostname.indexOf('.t-online.de')>-1){			// 225374,  video problems on T-online.de
		if(hostname.indexOf('unterhaltung')>-1){
					//Fix browser detection
					opera.defineMagicFunction( 'allResultsOK', function(){return true;} );
					// Fix plugin detection
					opera.defineMagicVariable( 'fHasWMP64', function(){ return navigator.mimeTypes['application/x-mplayer2'].enabledPlugin?true:false }, null )
					opera.defineMagicVariable( 'fHasWMP7', function(){ return navigator.mimeTypes['application/x-mplayer2'].enabledPlugin?true:false }, null )
					opera.defineMagicVariable( 'WMPVer', function(){ try{return fHasWMP64?'6.4':'unknown'}catch(e){return '6.4'} }, null )
			opera.addEventListener( 'BeforeScript',function(e){
				replace.call=call;
				e.element.text=replace.call(e.element.text,  'playerframe.Player.url=url;', 'playerframe.Player.url=url;nplayerframe.Player.Open(url);' );
			},false );
					// use TYPE as well as CLASSID on OBJECT tags in markup
					var objId='Player';
					var objref=null;
					document.addEventListener('DOMContentLoaded', function(e){ 
						if( ! (objref=document.getElementById(objId) ) ) return;
						if(objref.getAttribute('classid')=="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6")objref.type='application/x-mplayer2';
					}, false);
					// Remove UI that depends on ActiveX scripting. Built-in WMP UI will do..
					document.addEventListener('DOMContentLoaded', function(e){ 
						var pb=document.getElementById('playBtn');
						var wmp=document.getElementById('playerframe');
						if( pb&&wmp ){
							pb.parentNode.style.visibility='hidden';	wmp.style.visibility='visible';
							try{ document.images.tonaus.height=0;document.images.tonaus.width=0;}catch(e){}
						}
					}, false);
		}
				// 231082,  video problems on T-online.de, WMP license installation
		if(href.indexOf('__license=delivered')>-1){
			location.replace( location.href.replace( /__license=delivered/, '?license=delivered' ) );
		}
		
				// PATCH-458, Indicate loading state while a form submit is in progress, fixes attachment upload on T-Online
		if(hostname.indexOf('email.')>-1){
		HTMLFormElement.prototype.submit=(function(s){
			return function(){ 
				var doc = this.target=='' ? this.ownerDocument : this.ownerDocument.getElementsByName(this.target)[0];
				if( doc ){
					doc.__defineGetter__('readyState', function(){return 'loading'});
				}
				return s.apply(this,arguments);
			}
		})(HTMLFormElement.prototype.submit)
		}
				// PATCH-474, Avoid compose IFRAME resize (body.scrollHeight should be document's height)
		if(hostname.indexOf('email.')>-1){
		document.addEventListener('load', function(e){
			if( e.target instanceof HTMLIFrameElement ){
				e.target.contentDocument.body.__defineGetter__('scrollHeight', function(){
					return this.ownerDocument.documentElement.offsetHeight; });
			}
		}, true);	
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' ( video problems on T-online.de\n video problems on T-online.de, WMP license installation\nIndicate l...). See browser.js for details');
	} else if(hostname.indexOf('.ulead.') >-1){			// DSK-130832, Ulead.com old Milonic menu
		 fixMilonicMenu('mmenu.js');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Ulead.com old Milonic menu). See browser.js for details');
	} else if(hostname.indexOf('.videoload.de')>-1){			// 231082,  video problems on T-online.de, VOD section
				if( hostname.indexOf('vod')>-1 ){ // 231082
					navigator.userAgent+=' Firefox';
				}
		
				// 226414,  video problems on T-online.de, no window.external detection
		window.external=window.external||{};
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' ( video problems on T-online.de, VOD section\n video problems on T-online.de, no window.external dete...). See browser.js for details');
	} else if(hostname.indexOf('.yahoo.')>-1){			// 0, Yahoo!
		/* Yahoo! */
	
	
		// Yahoo!: Enable logging in with other auth services, work around cross-domain navigation block
				// PATCH-510, Yahoo!: Enable logging in with other auth services, work around cross-domain navigation block
		if( location.hostname.indexOf('open.login.yahoo')>-1 && window.opener ){
			opera.addEventListener('BeforeScript', function(e){
				e.element.text = e.element.text.replace( /(o\.top\.location\.href\s*=\s*"([^"]*)");/, 'try{$1}catch(e){o.top.postMessage("$2", location.protocol+"//"+ location.hostname.replace(/open\./, ""));}' );
			}, false);
		}else if(location.hostname.indexOf('login.yahoo')>-1){
			window.addEventListener('message', function(e){
				if(e.origin==location.protocol+'//'+'open.'+location.hostname && /https?:\/\//.test(e.data)){
					location.href=e.data;
				}
			}, false);
		}
		
	
	
		if(hostname.indexOf('.mail.yahoo.')>-1){			// PATCH-325, Y!Mail: work around browser sniffing again
			if(self==top&&location.search.indexOf('reason=ignore')==-1)document.addEventListener('DOMContentLoaded', function(){
				if( document.evaluate('//a[contains(@href,"/firefox")]', document.body, null, 6, null).snapshotLength && document.evaluate('//a[contains(@href,"/internetexplorer/")]', document.body, null, 6, null).snapshotLength && document.evaluate('//a[contains(@href,"/safari/")]', document.body, null, 6, null).snapshotLength  ){
						location.search='?reason=ignore'+location.search.replace(/^\?/, '&');
					
					}
			}, false);
			
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Y!Mail: work around browser sniffing again). See browser.js for details');
		}
		if(hostname.indexOf('.mail.yahoo.')>-1&& ( href.indexOf( '/neo/launch' )>-1 || href.indexOf( '/dc/launch' )>-1 )){			// PATCH-417, Y!Mail Allow focusing subject field by mouse click in
			opera.addEventListener('BeforeEventListener.mousedown', function(e){
				if(e.event.target.tagName=='INPUT' && e.event.target.id=='subject-field'){
					e.preventDefault();
				}
			},false);
			
					// PATCH-418, Y!Mail Fix inserting links in mail compose screen
			document.addEventListener('load', function(e){
				if(e.target && e.target.tagName=='IFRAME'){
					var ifrWin, gCS;
					try{ifrWin=e.target.contentWindow.location&&e.target.contentWindow;}catch(e){}
					if(ifrWin){
						gCS=ifrWin.getComputedStyle;
						ifrWin.getComputedStyle=function(el, str){
							var cssobj=gCS.apply(this,arguments);
							if( el.tagName=='FONT' && el.getAttribute('face') )cssobj.__defineGetter__( 'fontFamily', function(){return el.getAttribute('face');} );
							return cssobj;
						}
					}
				}
			}, true);
			
					// PATCH-460, Y!Mail Prevent hidden text when composing long e-mails
			document.addEventListener('load', function(e){
				if(document.getElementById('rtetext') && document.getElementById('rtetext').getElementsByTagName('iframe').length)
					document.getElementById('rtetext').getElementsByTagName('iframe')[0].style.height = '97%';
			}, true);
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Y!Mail Allow focusing subject field by mouse click in\nY!Mail Fix inserting links in mail compose sc...). See browser.js for details');
		}
		if(hostname.indexOf('.mail.yahoo.')>-1&&(href.indexOf( '/dc/system_requirements?browser=blocked' )>-1||href.indexOf( '/dc/system_requirements?browser=unsupported' )>-1)){			// 194334, Y!Mail work around browser blocking
			location.href='/dc/launch?sysreq=ignore';
			
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Y!Mail work around browser blocking). See browser.js for details');
		}
		if(hostname.indexOf('.mail.yahoo.')>=0 && pathname.indexOf('/dc/')==0){			// 194334, Y!Mail remove selectSingleNode and selectNodes ("old new mail" only)
			if( location.search.indexOf('sysreq=ignore')>-1 ){
				Node.prototype.selectSingleNode=undefined;
				Node.prototype.selectNodes=undefined;
			}
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Y!Mail remove selectSingleNode and selectNodes ("old new mail" only)). See browser.js for details');
		}
		if(hostname.indexOf('.mail.yahoo.')>=0 && pathname.indexOf('/mc/')==0){			// PATCH-359, Y!Mail Avoid overwriting classic inbox
			avoidDocumentWriteAbuse();
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Y!Mail Avoid overwriting classic inbox). See browser.js for details');
		}
		if(hostname.indexOf('finance.yahoo.')>-1){			// PATCH-297, Fool browser sniffing that prevents stock ticker on Yahoo Finance
			navigator.userAgent = 'Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20100101 Firefox/6.0'; 
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Fool browser sniffing that prevents stock ticker on Yahoo Finance). See browser.js for details');
		}
		if(hostname.indexOf('finance.yahoo.com')>-1){			// PATCH-406, Prevent currency menu from closing too fast on Y!Finance
			opera.addEventListener('BeforeEventListener.focusout', function(e){e.preventDefault();}, false);
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Prevent currency menu from closing too fast on Y!Finance). See browser.js for details');
		}
		if(hostname.indexOf('mail.yahoo')>-1){			// DSK-263826, Y!Mail Keyboard navigation of autocomplete menu fails
			opera.addEventListener('BeforeEvent.keypress', function(e){
				if( e.event.keyCode>36 && e.event.keyCode<41 ){
					e.event.charCode=0;
				}
			}, false);
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Y!Mail Keyboard navigation of autocomplete menu fails). See browser.js for details');
		}
		if(hostname.indexOf('yahoo.co.jp')>-1){			// PATCH-498, Yahoo! Japan services block Opera from using Silverlight plugin
			opera.defineMagicFunction('isCommonEnvCheck',function(){return true});	// JudgeCommonEnv.js
			opera.defineMagicFunction('isSilverLightEnvCheck',function(){return true});	// checkenv-min.js
			opera.defineMagicVariable('Silverlight',function(obj){	// Silverlight.supportedUserAgent.js
				try {
					obj.supportedUserAgent=function(){return true;}
					return obj;
				}catch(e){return undefined;}
			},
			null);
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Yahoo! Japan services block Opera from using Silverlight plugin). See browser.js for details');
		}
		if(self==top&&hostname.indexOf('.mail.yahoo.')>-1&&(href.indexOf( '/neo/launch' )>-1&&location.search.indexOf('?reason=ignore')!=0)){			// PATCH-325, Y!Mail work around browser blocking
			location.href='/neo/launch?reason=ignore'+location.search.replace(/^\?/, '&');
			
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Y!Mail work around browser blocking). See browser.js for details');
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Yahoo!). See browser.js for details');
	} else if(hostname.indexOf('.yammer.com')>-1){			// PATCH-512, Yammer: work around missing exception when strictly comparing doc from other origin with undefined
		if(hostname.indexOf('ymodules')>-1)addPreprocessHandler(/return!window\.JQUERY_ADDRESS_INFRAME&&top\.document!==UNDEFINED\?top:window;/, 'return!window.JQUERY_ADDRESS_INFRAME&&top.document!==UNDEFINED&&top.document.URL?top:window;');
				// PATCH-512, Yammer: work around limitation on setting document.referrer inside https IFRAME
		window.addEventListener('message', function(e){
			if(e.data=='{"__opera_bjs_getURL":""}' && e.origin.match(/https:\/\/(www|ymodules)\.yammer\.com/)){
				e.source.postMessage('{"__opera_bjs_getURLResponse": "'+location.href+'"}', '*');
				window.removeEventListener(e.type,arguments.callee,false);
			}
		}, false);
		if(self!=top && document.referrer == ''){
			window.addEventListener('message', function(e){
				if(e.data.indexOf('{"__opera_bjs_getURLResponse"')==0 && e.origin.match(/https:\/\/(www|ymodules)\.yammer\.com/)){
					var url=e.data.substr(32);
					document.__defineGetter__('referrer', function(){return url;});
					window.removeEventListener(e.type,arguments.callee,false);
				}
			}, false);
			try{
				parent.postMessage('{"__opera_bjs_getURL":""}', '*');
			}catch(e){}
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Yammer: work around missing exception when strictly comparing doc from other origin with undefined\n...). See browser.js for details');
	} else if(hostname.indexOf('.youtube.com')>-1){			// PATCH-478, Fix annotations and advance to next video on YouTube leanback
		if (pathname.indexOf('/leanback')>-1) {
			var tmp=document.createElement('svg');
			var str=tmp.__lookupSetter__('className');
			SVGSVGElement.prototype.__defineSetter__('className',function(val){
				try { return str.call(this, val); } catch(e) { }
			});
		}
				// PATCH-506, YouTube: avoid Silverlight uploader
		if(hostname.indexOf('upload.')==0){
		 navigator.plugins["Silverlight Plug-In"]=null;
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Fix annotations and advance to next video on YouTube leanback\nYouTube: avoid Silverlight uploader). See browser.js for details');
	} else if(hostname.indexOf('265.com')>-1){			// PATCH-475, Avoid overflowing text on 265.com
		addCssToDocument('#coolSites .body li, #coolSites .body li a{line-height:2em !important}')
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Avoid overflowing text on 265.com). See browser.js for details');
	} else if(hostname.indexOf('alfresco.com')>-1){			// PATCH-467, Get rid of browser warning on Alfresco help pages
		if(hostname.indexOf('alfresco.com')>-1){
			if(pathname.indexOf('help/')>-1){
				navigator.appName = 'Netscape';
				window.opera = null;
			}
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Get rid of browser warning on Alfresco help pages). See browser.js for details');
	} else if(hostname.indexOf('amazon.')>-1){			// PATCH-527, Add more spoofing when masking as another browser on Amazon
		if (navigator.appName!=='Opera'){
			document.documentElement.style.MozAppearance = 'Opera';
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Add more spoofing when masking as another browser on Amazon). See browser.js for details');
	} else if(hostname.indexOf('ameba.jp')!=-1){			// 331093, Work around Opera bug where second BR tag overwrites newly inserted IMG
		addPreprocessHandler(/editor\.insertNodeAtSelection\(link\);\s*editor\.insertNodeAtSelection\(document\.createElement\('br'\)\);/, 'editor.insertNodeAtSelection(link);');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Work around Opera bug where second BR tag overwrites newly inserted IMG). See browser.js for details');
	} else if(hostname.indexOf('athome.co.jp') > -1){			// PATCH-147, athome.co.jp Hide warning messages because of Browser UA
		opera.defineMagicFunction('checkTargetBrowser',function(){});
		opera.defineMagicFunction('checkTargetCookie',function(){});
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (athome.co.jp Hide warning messages because of Browser UA). See browser.js for details');
	} else if(hostname.indexOf('balkanweb.com')>-1){			// PATCH-421, Enable news ticker on Balkanweb
		opera.defineMagicFunction('ticker_start', function(oRealFunc, oThis){
			var ua=navigator.userAgent;
			navigator.userAgent+=' Firefox';
			oRealFunc.call(oThis);
			navigator.userAgent=ua;
		});
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Enable news ticker on Balkanweb). See browser.js for details');
	} else if(hostname.indexOf('bcbssc.com')>-1){			// PATCH-93, Blue Cross SC looks up named elements with getElementById()
		(function(gEBI) { 
		  document.getElementById = function(idOrName) { 
		    return gEBI.call(document, arguments) || document.getElementsByName(idOrName)[0] || null; 
		  }; 
		})(document.getElementById);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Blue Cross SC looks up named elements with getElementById()). See browser.js for details');
	} else if(hostname.indexOf('bing.com')>-1 && pathname.indexOf('/images/')>-1){			// PATCH-545, Bing Image Search adds history entries when scrolling results
		var locationReplace = Location.prototype.replace;
		Location.prototype.replace=function(uri){
			var href = document.location.href;
			var olduri = href.indexOf('#')>-1?href.substr(0,href.indexOf('#')):href;
			var newuri = uri.substr(0,uri.indexOf('#'));
			if (olduri == newuri) history.replaceState({}, document.title, uri);		
			else locationReplace.call( this, uri );
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Bing Image Search adds history entries when scrolling results). See browser.js for details');
	} else if(hostname.indexOf('bing.com')>-1 && pathname.indexOf('/maps')>-1){			// PATCH-534, Bing Maps deadlock on accessing document.cookie from Silverlight
		if(navigator.mimeTypes['application/x-silverlight-2'] &&
			navigator.mimeTypes['application/x-silverlight-2'].enabledPlugin)(function(){
			var actualSetter=document.__lookupSetter__('cookie');
			var actualGetter=document.__lookupGetter__('cookie');
			document.__defineGetter__('cookie', function(){ return actualGetter.call(this); });
			document.__defineSetter__('cookie', function(val){
				var _this=this;
				setTimeout(function(){actualSetter.call(_this, val)}, 0); 
				return val;
			});
		})();
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Bing Maps deadlock on accessing document.cookie from Silverlight). See browser.js for details');
	} else if(hostname.indexOf('boards.4chan.org')>-1){			// PATCH-585, 4chan: add bottom margin to blockquote for better readability
		addCssToDocument('td.reply blockquote, td.replyhl blockquote{margin-bottom: 1em}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (4chan: add bottom margin to blockquote for better readability). See browser.js for details');
	} else if(hostname.indexOf('britannica.com')>-1){			// 332948, Prevent overwriting document with stats graphic on britannica.com
		avoidDocumentWriteAbuse();
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Prevent overwriting document with stats graphic on britannica.com). See browser.js for details');
	} else if(hostname.indexOf('britishairways.')!=-1){			// 206810, Prevent britishairways.com from reloading the page on resize
		opera.defineMagicFunction('resizeHandler', function(){});
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Prevent britishairways.com from reloading the page on resize). See browser.js for details');
	} else if(hostname.indexOf('cajamadrid.es')!=-1){			// PATCH-208, Caja Madrid hides login form by CSS mistake
		document.addEventListener( 'DOMContentLoaded', function(){
			for(var collection=document.getElementsByClassName('clearfix'), el; el=collection[0];){
				el.className = el.className.replace(/clearfix/, '');
			}
		}, false );
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Caja Madrid hides login form by CSS mistake). See browser.js for details');
	} else if(hostname.indexOf('cambrian.mb.ca')>-1){			// PATCH-285, Enable log-in button on Cambrian bank
		Element.prototype.__defineGetter__('all', function(){});
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Enable log-in button on Cambrian bank). See browser.js for details');
	} else if(hostname.indexOf('cdec-sic.cl')!=-1){			// 365516, Old HierMenus on cdec-sic.cl
		fixHierMenus();
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Old HierMenus on cdec-sic.cl). See browser.js for details');
	} else if(hostname.indexOf('cnnturk.com')>-1){			// PATCH-509, cnnturk: work around CSS bug that causes footer content to float upwards
		addCssToDocument('#fbtm div.dtc{bottom:-170px !important;}#fbtm div.dtc ul{position: static !important; display:inline !important}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (cnnturk: work around CSS bug that causes footer content to float upwards). See browser.js for details');
	} else if(hostname.indexOf('computerra.ru')>-1){			// PATCH-267, Make BBCode editor buttons work by disabling Opera sniffing
		document.addEventListener('DOMContentLoaded', function(){
			if(window.jsUtils&&window.jsUtils.bOpera)jsUtils.bOpera=false;
		}, false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Make BBCode editor buttons work by disabling Opera sniffing). See browser.js for details');
	} else if(hostname.indexOf('danawa.com')!=-1 && href.indexOf('danawa.com/product/item.html')!=-1){			// PATCH-14, Iframe content height is too small and not expanded on danawa.com
		HTMLBodyElement.prototype.__defineGetter__('offsetHeight', function(){
			return  (this.scrollHeight);
		});
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Iframe content height is too small and not expanded on danawa.com). See browser.js for details');
	} else if(hostname.indexOf('di.jal.co.jp')>-1){			// PATCH-237, Delay script execution on JAL map
		var dw=document.write;
		var MapViewer_dw;
		document.write=function( s ){
			if( String(s).indexOf('MapViewer') > -1 ){
				dw.apply(document, ["<div id='MapViewer_holder'></div>"]);
				MapViewer_dw = String(s);
				if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Delay script execution). See browser.js for details');
			}else{
				dw.apply(document, arguments);
			}
		};
		
		window.addEventListener('load',function(e){
			document.getElementById('MapViewer_holder').outerHTML = MapViewer_dw;
		},false)
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Delay script execution on JAL map). See browser.js for details');
	} else if(hostname.indexOf('easycruit.com')>-1){			// PATCH-219, Fujitsu recruitment page on EasyCruit hides content due to browser sniffing
		fixIFrameSSIscriptII('resizeIframe');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Fujitsu recruitment page on EasyCruit hides content due to browser sniffing). See browser.js for details');
	} else if(hostname.indexOf('enter.nifmail.jp') > -1){			// OTW-4878, Nifmail web mail bypass browser blocking
		opera.defineMagicFunction('checkBrowser',function(){
			return 1;
		},false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Nifmail web mail bypass browser blocking). See browser.js for details');
	} else if(hostname.indexOf('espn.go.com')>-1){			// PATCH-375, Make sure the ESPN polls work
		navigator.appName="netscape";
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Make sure the ESPN polls work). See browser.js for details');
	} else if(hostname.indexOf('etour.co.jp') > -1){			// PATCH-152, etour.co.jp fix non-disappearing overlapping image
		navigator.appName='Netscape';
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (etour.co.jp fix non-disappearing overlapping image). See browser.js for details');
	} else if(hostname.indexOf('facebook.com')!=-1){			// PATCH-488, Facebook: fake paste event to make show preview immediately after pasting links in status
		opera.addEventListener('BeforeEventListener.keypress', function(e){
			if( e.event.ctrlKey && (e.event.keyCode==86 || e.event.keyCode==118 ) ){
				var trgt=e.event.target;
				setTimeout(
					function(){ 
						var evt=document.createEvent('Event');
						evt.initEvent('paste', true, true);
						trgt.dispatchEvent(evt);
					}, 10
				);
			}
		}, false);
				// PATCH-558, Facebook avoid chat list scroll
		addPreprocessHandler(/else CSS\.hide\(this\._gripper\);this\._checkContentBoundaries\(\);return this;\}/,'else CSS.hide(this._gripper);return this;}');
				// PATCH-573, Facebook's border-radius triggers hyperactive reflow bug, performance suffers
		opera.addEventListener('BeforeCSS', function(e){
			e.cssText = e.cssText.replace(/border-(top|bottom)-(right|left)-radius:3px/g, '');
		}, false);
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Facebook: fake paste event to make show preview immediately after pasting links in status\nFacebook ...). See browser.js for details');
	} else if(hostname.indexOf('g4tv.com')>-1){			// PATCH-281, messed up layout in lower part of page due to wrong percentage rounding
		window.addEventListener('DOMContentLoaded', function(e){
			var el;
			if(el=document.getElementsByClassName('content-list editorial variation-2')[0]){
				el.style.width='634px';
			}
		}, false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (messed up layout in lower part of page due to wrong percentage rounding). See browser.js for details');
	} else if(hostname.indexOf('geforce.com')>-1&&pathname.toLowerCase().indexOf('/drivers')>-1){			// PATCH-521, geforce.com: fix unclickable options on custom select box
		addCssToDocument('div.main,div.mainContent,div.rightNav,div.middle,div.contentMiddle,div.innerBox,div.innerMiddle{position:static !important;}');
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (geforce.com: fix unclickable options on custom select box). See browser.js for details');
	} else if(hostname.indexOf('geoaccess.com')!=-1){			// 318050,  BlueCross browser sniffing prevents insurance search
		opera.defineMagicVariable('is_nav', function(){return true;}, null);
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' ( BlueCross browser sniffing prevents insurance search). See browser.js for details');
	} else if(hostname.indexOf('googletv.blogspot.com')>-1){			// PATCH-603, GoogleTV: fix broken word spacing - Opera bug
		addCssToDocument('div.post-body div{text-align:inherit !important}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (GoogleTV: fix broken word spacing - Opera bug). See browser.js for details');
	} else if(hostname.indexOf('hk.centamap.com')>-1){			// PATCH-318, Fix missing menu and misplaced highlights on hk.centamap.com
		document.addEventListener('DOMContentLoaded',function(evt){
			parent.document.body.__defineGetter__('offsetHeight',function(){ return parent.window.innerHeight; });
			parent.document.body.__defineGetter__('offsetWidth',function(){ return parent.window.innerWidth; });
		},false);
		
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Fix missing menu and misplaced highlights on hk.centamap.com). See browser.js for details');
	} else if(hostname.indexOf('huffingtonpost.com')>-1){			// PATCH-601, Huffingtonpost: Avoid ad overwrite
		addPreprocessHandler(/\|\|adsUA\.indexOf\(\'opera\'\)>-1/,'');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Huffingtonpost: Avoid ad overwrite). See browser.js for details');
	} else if(hostname.indexOf('infinitiusa.com')>-1 || hostname.indexOf('nissanusa.com')>-1){			// PATCH-529, Fix SiteCatalyst H.9 code on Nissan/Infiniti USA
		opera.addEventListener('BeforeScript', function(e){
			if (e.element.src.indexOf('codepack.incGlobPaths.true.content.js')>-1){
				e.element.text = e.element.text.replace(/function\(un\){s\.un=un;/,"function(un){var s=this;s.un=un;");
			}
		}, false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Fix SiteCatalyst H.9 code on Nissan/Infiniti USA). See browser.js for details');
	} else if(hostname.indexOf('investordaily.com.au')>-1){			// PATCH-238, Override minmax IE helper script
		opera.defineMagicFunction('minmax_scan', function(){});
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Override minmax IE helper script). See browser.js for details');
	} else if(hostname.indexOf('isbank.com.tr')>-1){			// 265077,  fixing navigation menu on isbank.com.tr
		opera.addEventListener('BeforeScript', function(e){ replace.call=call; e.element.text=replace.call(e.element.text, 'SaklaGoster(sFrameAdi, 0, i.sMenuAd);};else if', 'SaklaGoster(sFrameAdi, 0, i.sMenuAd);}else if') },false);
		
				// 265077, fixing keypress handler on isbank.com.tr
		var ignoreKeypressCodes = {8:'',9:'',16:'',17:'',35:'',36:'',37:'',38:'',39:'', 40:'',45:'',46:''};
		opera.addEventListener('BeforeEventListener.keypress', function( e ){ preventDefault.call=call; if( e.event.keyCode in ignoreKeypressCodes) preventDefault.call(e); }, false)
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' ( fixing navigation menu on isbank.com.tr\nfixing keypress handler on isbank.com.tr). See browser.js for details');
	} else if(hostname.indexOf('journalism.org')>-1){			// PATCH-523, journalism.org: fix old IFrame SSI script
		fixIFrameSSIscriptII('resizeIframe');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (journalism.org: fix old IFrame SSI script). See browser.js for details');
	} else if(hostname.indexOf('kort.arealinfo.dk')>-1){			// PATCH-348, Disable Opera detection that causes hidden content
		opera.defineMagicVariable('op', function(){return false}, null);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Disable Opera detection that causes hidden content). See browser.js for details');
	} else if(hostname.indexOf('kuwaitairways.com')>-1){			// PATCH-493, kuwaitairways.com - Fix browser sniffing
		navigator.appName='Netscape';
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (kuwaitairways.com - Fix browser sniffing). See browser.js for details');
	} else if(hostname.indexOf('lottery.sina.2caipiao.com')>-1){			// PATCH-556, 2caipiao.com: fix iframe resize
		fixIFrameSSIscriptII('dyniframesize');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (2caipiao.com: fix iframe resize). See browser.js for details');
	} else if(hostname.indexOf('mail.live.com')!=-1){			// CORE-17444, Fix drag and drop in Hotmail
		function fixButton(e) {
			if (e.button == 1) {
				e.__defineGetter__('button', function() { return 0 });
			}
		};
		window.addEventListener('mousedown', fixButton, true);
		window.addEventListener('mousemove', fixButton, true);
		window.addEventListener('mouseup', fixButton, true);
		
				// CORE-17447, Mispositioned sprites due to missing CSS
		addCssToDocument('.c_is { display: inline-block }');
				// 178723, Emulating IE's cssText property on style sheets
		var getCssText = function() {
			if (!this.href)	{
				return this.ownerNode.textContent;
			} else {
				try {
					var xhr = new XMLHttpRequest();
					xhr.open('GET', this.href, false);
					xhr.send();
					return xhr.responseText;
				} catch(e) {
					return '';
				}
			}
		};
		if (window.__defineGetter__) {
			CSSStyleSheet.prototype.__defineGetter__('cssText', getCssText);
			CSSStyleSheet.prototype.__defineSetter__('cssText', function(v) {
				if (!this.href) {
					this.ownerNode.innerHTML = '';
					return this.ownerNode.appendChild(document.createTextNode(v));
				}
			});
		} else {
			window.addEventListener('load', function(){
				for( var i=0;i<document.styleSheets.length;i++ ){
					if(document.styleSheets[i])
						document.styleSheets[i].cssText = { _styleRef: document.styleSheets[i], toString:function(){
					return this._styleRef.ownerNode.textContent}
					};
				}
			},false);
		}
		
				// DSK-235885, Hotmail uses lookupGetter on prototypes, not instances
		var styleSetterLookupMethod = document.createElement('span').style.__lookupSetter__;
		 CSSStyleDeclaration.prototype.__lookupSetter__ = function(prop){
			return styleSetterLookupMethod.call(document.createElement('span').style, prop);
		 };
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Fix drag and drop in Hotmail\nMispositioned sprites due to missing CSS\nEmulating IE\'s cssText prope...). See browser.js for details');
	} else if(hostname.indexOf('mb.softbank.jp')!=-1){			// PATCH-588, SoftBank Mobile History Plugin browser sniffing
		window.opera.addEventListener('BeforeScript', function (e) {
			if (e.element.src.indexOf('history.js') > -1) {
				e.element.text = e.element.text.replace(/if \(!this.is_op && hash\)/gi, 'if (hash)');
			}
		}, false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (SoftBank Mobile History Plugin browser sniffing). See browser.js for details');
	} else if(hostname.indexOf('merriam-webster.com')>-1){			// PATCH-540, Merriam-Webster: override embed with hidden attribute. Conflicts with HTML global hidden attribute.
		addCssToDocument('embed[hidden=true]{display:inline;width:0;height:0;}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Merriam-Webster: override embed with hidden attribute. Conflicts with HTML global hidden attribute.). See browser.js for details');
	} else if(hostname.indexOf('myspace.com')>-1){			// PATCH-487, MySpace: fix smiley insertion in mail and blog editor
		addCssToDocument('.punymce iframe{display:inline!important}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (MySpace: fix smiley insertion in mail and blog editor). See browser.js for details');
	} else if(hostname.indexOf('nbc.com')>-1){			// PATCH-236, Make NBC videos work
		navigator.userAgent += " Chrome/5.0.375.9 Safari/533.4";
				// PATCH-577, Unexpected script loading order breaks video player ready check
		window.addEventListener('load', function(){
			if(window.DPSVPlayer && window.DPSVPlayer.onReady)DPSVPlayer.onReady.call(window);
		}, false);
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Make NBC videos work\nUnexpected script loading order breaks video player ready check). See browser.js for details');
	} else if(hostname.indexOf('news.qq.com')>-1){			// PATCH-112, weather.news.qq.com expects getElementById() to find named elements
		var gEBI=document.getElementById;
		document.getElementById=function(){
			var result=gEBI.apply(this, arguments);
			if(!result)result=document.getElementsByName.apply(this,arguments)[0];
			return result;
		}
				// OTW-4861, qq.com uses IE-style CSS filters
		fakeCSSFilters();
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (weather.news.qq.com expects getElementById() to find named elements\nqq.com uses IE-style CSS filter...). See browser.js for details');
	} else if(hostname.indexOf('opera.com')>-1&& pathname.indexOf('/docs/browserjs/')==0){			// 0, Browser.js status and version reported on browser.js documentation page
		document.addEventListener((parseFloat(opera.version())>9?'DOMContentLoaded':'load'),function(){
			if(document.getElementById('browserjs_active')){
				document.getElementById('browserjs_active').style.display='';
				document.getElementById('browserjs_active').getElementsByTagName('span')[0].appendChild(document.createTextNode(bjsversion));
				document.getElementById('browserjs_status_message').style.display='none';
			}else if(document.getElementById('browserjs_status_message')){
				document.getElementById('browserjs_status_message').firstChild.data='Browser.js is enabled! '+bjsversion;
			}
		}, false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Browser.js status and version reported on browser.js documentation page). See browser.js for details');
	} else if(hostname.indexOf('orbitdownloader.com')>-1){			// PATCH-322, Force height to avoid overlapping on orbitdownloader
		addCssToDocument('div.flag{height:1.1em;}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Force height to avoid overlapping on orbitdownloader). See browser.js for details');
	} else if(hostname.indexOf('ordering.bellsouth.com')!=-1){			// PATCH-36, ATT / Bellsouth browser sniffing
		opera.defineMagicVariable( 'isDHTML', function(){return true;}, null );
		opera.defineMagicFunction('checkBrowser', function(){});
		navigator.appName='Microsoft Internet Explorer';
		navigator.appVersion='MSIE'+navigator.appVersion;
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (ATT / Bellsouth browser sniffing). See browser.js for details');
	} else if(hostname.indexOf('orkut.com')>-1){			// CORE-19206, orkut avatar image crop does not happen because of timing issue
		(function(sTo){
			window.setTimeout=function(f,t){
				if( t==0 && !document.body )t=100;
				sTo.call( window, f, t );
			}
		})(window.setTimeout);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (orkut avatar image crop does not happen because of timing issue). See browser.js for details');
	} else if(hostname.indexOf('paper.li')>-1){			// PATCH-514, paper.li: allow clicking headers despite lack of pointer-events
		addCssToDocument('.isotope-hidden.isotope-item{visibility:hidden !important}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (paper.li: allow clicking headers despite lack of pointer-events). See browser.js for details');
	} else if(hostname.indexOf('pb.yamada-denki.jp')>-1){			// OTW-5165, Show digital pamphlet from Yamada Denki
		Element.prototype.attachEvent = null;
		window.opera = null;
		document.addEventListener('DOMContentLoaded',function(e){
			document.addEventListener('mousewheel',onMouseWheel,true);
		},false);
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Show digital pamphlet from Yamada Denki). See browser.js for details');
	} else if(hostname.indexOf('play.com')>-1){			// PATCH-468, Make sure Play menu doesn't wrap
		addCssToDocument('#main-nav li.nav-parent{width: 7.3em}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Make sure Play menu doesn\'t wrap). See browser.js for details');
	} else if(hostname.indexOf('pluginfree.com') > -1){			// PATCH-105, DNP Pluginfree Viewer fallback to Netscape version for Opera
		opera.defineMagicFunction('sort',function(rf,rt){
			var res;
			return (res=rf.apply(rt,slice.call(arguments, 2)))?res:"nn";
		},false);
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (DNP Pluginfree Viewer fallback to Netscape version for Opera). See browser.js for details');
	} else if(hostname.indexOf('qzone.qq.com')>-1){			// PATCH-497, Avoid focus problems using IME on empty content-editable elements
		var focus=HTMLElement.prototype.focus;
		HTMLElement.prototype.focus=function(){
			if( this.childNodes.length==0 && this.contentEditable=='true' ){
				this.appendChild(document.createTextNode(String.fromCharCode(160)));
			}
			focus.call(this);
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Avoid focus problems using IME on empty content-editable elements). See browser.js for details');
	} else if(hostname.indexOf('rabobank.nl')!=-1){			// OTW-3405,  Rabobank cancels t keypress
		opera.addEventListener('AfterEvent.keypress', function(e){
			preventDefault.call=call;
			if(e.event.keyCode==116 && e.eventCancelled)preventDefault.call(e);
		},false);
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' ( Rabobank cancels t keypress). See browser.js for details');
	} else if(hostname.indexOf('rede-expressos.pt')>-1 ){			// PATCH-422, Miscalculated IFRAME height prevents booking on rede-expressos
		addCssToDocument('#fraHorarioIN, #fraBil1IN{min-height: 250px !important}');
		
			
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Miscalculated IFRAME height prevents booking on rede-expressos). See browser.js for details');
	} else if(hostname.indexOf('renren.com')>-1){			// PATCH-536, renren.com - Unicode space like characters should not be converted in document.title
		var getter=document.__lookupGetter__('title');
		var setter=document.__lookupSetter__('title');
		HTMLDocument.prototype.__defineGetter__('title', function(){
			var regexp = eval('/'+String.fromCharCode(65343)+'/g');
			val = getter.call(this).replace(regexp,String.fromCharCode(12288));
			return val;
		});
		HTMLDocument.prototype.__defineSetter__('title', function(val){
			var regexp = eval('/'+String.fromCharCode(12288)+'/g');
			val = val.replace(regexp,String.fromCharCode(65343));
			return setter.call(this,val);
		});
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (renren.com - Unicode space like characters should not be converted in document.title). See browser.js for details');
	} else if(hostname.indexOf('routes.tomtom.com')>-1){			// PATCH-464, Make it possible to type in TomTom route planner
		addCssToDocument('.input_div{overflow-x:visible!important}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Make it possible to type in TomTom route planner). See browser.js for details');
	} else if(hostname.indexOf('salesforce.com')>-1){			// PATCH-176, Allow upload of workspace resources in Salesforce
		HTMLIFrameElement.prototype.__defineSetter__('onreadystatechange', function(){});
		
		opera.addEventListener('BeforeEventListener.load', 
			function(e){
				preventDefault.call=call;
				if(e.event.target.contentDocument && e.event.target.contentDocument.body.innerHTML == ""){
					preventDefault.call(e);
				}
			},
			false
		);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Allow upload of workspace resources in Salesforce). See browser.js for details');
	} else if(hostname.indexOf('seb-bank.de')>-1){			// PATCH-84, SEB bank prevents typing certain keys
		ignoreCancellationOfCertainKeyEvents('keypress', {114:'', 116:'', 117:'', 122:''});
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (SEB bank prevents typing certain keys). See browser.js for details');
	} else if(hostname.indexOf('sharklink.nova.edu')>-1){			// PATCH-574, nova.edu: browser sniffing
		opera.defineMagicVariable('is_opera',function(){return false},null);
		opera.defineMagicVariable('is_fox',function(){return true},null);
		opera.addEventListener('BeforeCSS',function(e){
			if (String(e.element.href).indexOf("sharklink_home.css")!=-1){
				e.cssText = e.cssText.replace(/\/\*text-indent:-9999px;\*\//g,'text-indent:-9999px;');
			}
		},false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (nova.edu: browser sniffing). See browser.js for details');
	} else if(hostname.indexOf('siren24.com')!=-1){			// SEOUL-609, ActiveX installation page redirect on siren24.com due to sniffing limitation on redirect script
		navigator.appName = 'Netscape';
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (ActiveX installation page redirect on siren24.com due to sniffing limitation on redirect script). See browser.js for details');
	} else if(hostname.indexOf('smithbarney.com')>-1){			// PATCH-360, Enable the password box on smithbarney.com
		HTMLInputElement.prototype.__defineSetter__('type',function(){
			if (this.getAttribute('type')!=arguments[0]) {
				var doFocus=false, result;
				if (this == document.activeElement) doFocus = true;
				result = this.setAttribute('type',arguments[0]);
				if (doFocus) this.focus();
				return result;
			}
		});
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Enable the password box on smithbarney.com). See browser.js for details');
	} else if(hostname.indexOf('smn.gov.ar')>-1){			// PATCH-572, smn.gov.ar: reduce search input width to avoid wrapping
		addCssToDocument('input#busqueda{max-width:108px}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (smn.gov.ar: reduce search input width to avoid wrapping). See browser.js for details');
	} else if(hostname.indexOf('sslsecure.maybank.com')>-1){			// PATCH-415, Browser sniffing causes 404 page on login to Maybank
		opera.defineMagicFunction('MM_checkBrowser', function(){});
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Browser sniffing causes 404 page on login to Maybank). See browser.js for details');
	} else if(hostname.indexOf('support.asus.com.tw')>-1){			// PATCH-459, Prevent Asus browser sniffing from breaking support site software download
		navigator.appName='Netscape';
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Prevent Asus browser sniffing from breaking support site software download). See browser.js for details');
	} else if(hostname.indexOf('sytadin.fr')!=-1){			// OTW-5415, Sytadin.fr IFRAME resize script detects Opera
		fixIFrameSSIscriptII('resizeIframeOnContent');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Sytadin.fr IFRAME resize script detects Opera). See browser.js for details');
	} else if(hostname.indexOf('t.qq.com')>-1){			// PATCH-538, Pre-process script to avoid "too deeply nested input" error, internal limits in Opera's ES engine too low
		opera.addEventListener('BeforeScript', function(e){
			if(e.element.src && e.element.src.indexOf('mi.Tmpl')>-1 && typeof _ === 'function'){
				e.element.text = e.element.text.replace(/'\+_\("([^"]*)"\)\+'/g, function(){return _(arguments[1]) });
			}
		}, false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Pre-process script to avoid "too deeply nested input" error, internal limits in Opera\'s ES engine to...). See browser.js for details');
	} else if(hostname.indexOf('tdwaterhouse.ca')>-1&&location.protocol=='https:'){			// 147840, tdwaterhouse.ca login fails - cross-domain access on https disallows setting location
		document.domain='tdwaterhouse.ca';
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (tdwaterhouse.ca login fails - cross-domain access on https disallows setting location). See browser.js for details');
	} else if(hostname.indexOf('teledeporte.es')>-1){			// PATCH-544, teledeporte.es: fix iframe resize
		fixIFrameSSIscriptII('resizeIframe');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (teledeporte.es: fix iframe resize). See browser.js for details');
	} else if(hostname.indexOf('tickets.com')!=-1){			// MGTRN-2289, Scripts are not allowed to use reserved identifier "top"
		addPreprocessHandler( /top\(\)/g, '_top()' );
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Scripts are not allowed to use reserved identifier "top"). See browser.js for details');
	} else if(hostname.indexOf('tistory.com')!=-1){			// 347990, two login buttons on tistory.com
		addCssToDocument('#memberbox .btn-login {text-indent:-100px;}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (two login buttons on tistory.com). See browser.js for details');
	} else if(hostname.indexOf('tradera.com')>-1){			// PATCH-427, layout issue on Tradera.com's header
		document.addEventListener('DOMContentLoaded',function(e){
			var els = document.getElementsByClassName('headerWrapperThin');
			for (var i=0,len=els.length;i<len;i++) {
				var pnstyle = els[i].parentNode.getAttribute('style');
				els[i].parentNode.setAttribute('style',(pnstyle?pnstyle+' ':'')+els[i].getAttribute('style'));
			}
		},false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (layout issue on Tradera.com\'s header). See browser.js for details');
	} else if(hostname.indexOf('tuenti.com')!=-1){			// PATCH-134, Videos not shown
		navigator.userAgent += ' [NOT firefox/3]';
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Videos not shown). See browser.js for details');
	} else if(hostname.indexOf('tvguide.co.uk')>-1){			// PATCH-596, tvguide.co.uk - Fix double descriptions appearing in TV listing
		opera.addEventListener('AfterScript', function(e) {
			if (e.element.src.indexOf('boxover.js')>-1) {
				document.addEventListener('mouseover',moveMouse,false);
			}
		}, false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (tvguide.co.uk - Fix double descriptions appearing in TV listing). See browser.js for details');
	} else if(hostname.indexOf('tvguide.com')>-1){			// PATCH-274, TVGuide doesn't show program descriptions, due to browser sniffing
		opera.defineMagicVariable('isSafari', function(){return true;}, null);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (TVGuide doesn\'t show program descriptions, due to browser sniffing). See browser.js for details');
	} else if(hostname.indexOf('twitter.com')>-1){			// PATCH-561, Twitter: allow selection in TEXTAREA
		HTMLTextAreaElement.prototype.setAttribute=(function(s){
			return function(n, v){
				if(n=='dir' && this.getAttribute(n)===v){
					return;
				}
				return s.apply(this,arguments);
			}
		})(HTMLTextAreaElement.prototype.setAttribute);
		HTMLTextAreaElement.prototype.__defineSetter__('dir', function(v){ this.setAttribute('dir', v); });
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Twitter: allow selection in TEXTAREA). See browser.js for details');
	} else if(hostname.indexOf('vgtv.no')>-1 || hostname.indexOf('movenetworkshd.com')>-1){			// PATCH-110, Work around browser sniffing for Move media player
		opera.defineMagicVariable('QI', function(o){ o.browserIsGood=true; return o; }, null);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Work around browser sniffing for Move media player). See browser.js for details');
	} else if(hostname.indexOf('virginamerica.com')>-1){			// PATCH-492, virginamerica.com - Fix browser sniffing
		navigator.appName='Netscape';
		opera.defineMagicVariable('browserType',function(){return 'gecko'},null);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (virginamerica.com - Fix browser sniffing). See browser.js for details');
	} else if(hostname.indexOf('wangpiao.com')>-1){			// PATCH-522, wangpiao.com: allow seat selection
		window.constructor={};
		window.constructor.prototype={};
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (wangpiao.com: allow seat selection). See browser.js for details');
	} else if(hostname.indexOf('washingtonpost.com')>-1){			// PATCH-494, Washingtonpost: avoid articles being overwritten in race condition
		avoidDocumentWriteAbuse(/<div id="trc_related_container".*/);
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Washingtonpost: avoid articles being overwritten in race condition). See browser.js for details');
	} else if(hostname.indexOf('webprint.post.japanpost.jp')>-1){			// PATCH-449, japanpost.jp: Fix broken _supportsDOM function
		opera.defineMagicFunction('_supportsDOM',function (oReal,oThis) { return true; });
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (japanpost.jp: Fix broken _supportsDOM function). See browser.js for details');
	} else if(hostname.indexOf('weibo.com')>-1){			// PATCH-590, weibo.com: work around missing KeyboardEvent interface
		if(!('KeyboardEvent' in window))window.KeyboardEvent = Event;
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (weibo.com: work around missing KeyboardEvent interface). See browser.js for details');
	} else if(hostname.indexOf('westjet.com')>-1 ){			// PATCH-260,  Westjet browser sniffing warns against Opera
		opera.defineMagicVariable('browser', function(o){ o.isSupported=true; return o; }, null);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' ( Westjet browser sniffing warns against Opera). See browser.js for details');
	} else if(hostname.indexOf('www.yoka.com')>-1){			// PATCH-238, Override minmax IE helper script
		opera.defineMagicFunction('minmax_scan', function(){});
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Override minmax IE helper script). See browser.js for details');
	} else if(hostname.indexOf('xcweather.co.uk')>-1){			// PATCH-519, xcweather: make sure the preference form is available when running script
		opera.defineMagicFunction('populateForm',
			function(real,oThis,oForm){
				var args=arguments;
				if(!oForm){
					setTimeout(function(){real.apply(oThis, Array.prototype.slice.call(args, 2));},100);
				}else{
					return real.apply(oThis, Array.prototype.slice.call(arguments, 2));
				}
			}
		);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (xcweather: make sure the preference form is available when running script). See browser.js for details');
	} else if(hostname.indexOf('yihaodian.com')>-1){			// PATCH-543, yihaodian.com: fix wrongly aligned product image
		addCssToDocument('#main .produce .sideleft .pic{text-align: inherit}');
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (yihaodian.com: fix wrongly aligned product image). See browser.js for details');
	} else if(hostname.indexOf('yoyaku.rakubus.jp')>-1){			// PATCH-559, Browser sniffing on Raku Bus
		navigator.appName = 'Microsoft '+navigator.appName;
		navigator.appVersion = 'MSIE 9.0; '+navigator.appVersion;
		navigator.userAgent = 'MSIE 9.0; '+navigator.userAgent;
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Browser sniffing on Raku Bus). See browser.js for details');
	} else if(hostname=='62.61.69.224'&&pathname.indexOf('/facebook')==0){			// PATCH-473, Nokia Ovi maps on Facebook wants to rewrite window.top
		(function(){
			var definedTop=window.top;
			opera.defineMagicVariable('top', function(){return definedTop;}, function(obj){definedTop=obj;} );
		})();
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Nokia Ovi maps on Facebook wants to rewrite window.top). See browser.js for details');
	} else if(href.indexOf('/sample_lr.html')>-1){			// PATCH-128, Sun Webmail fails to set document.domain due to browser sniffing
		navigator.userAgent+=' Gecko';
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Sun Webmail fails to set document.domain due to browser sniffing). See browser.js for details');
	} else if(href==='https://bugs.opera.com/wizarddesktop/'){			// PATCH-221, Include browser.js timestamp in bug reports
		document.addEventListener('DOMContentLoaded', function(){
			var frm;
			if(document.getElementById('bug') instanceof HTMLFormElement){
				frm=document.getElementById('bug');
				if(frm.auto)frm.auto.value+='\n\nBrowser JavaScript: \n'+bjsversion;
			}
		}, false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Include browser.js timestamp in bug reports). See browser.js for details');
	} else if(pathname.indexOf("Maconomy/MaconomyPortal") > -1){			// PATCH-445, Fix Ctrl-G shortcut in Maconomy
		opera.defineMagicFunction('handleKeyPresses', function (oReal, oThis, evt){
			if(evt.ctrlKey && evt.keyCode == 71 && typeof handleOnClickSearch == 'function'){evt.preventDefault();handleOnClickSearch('');return true}
			else{return oReal.apply(oThis, Array.prototype.slice.call(arguments, 2));}
		});
				// PATCH-6, Fix unload form submit behavior on Maconomy portals
		opera.addEventListener("BeforeEvent.unload", function(e){
				if(!(typeof doSubmitEmptyData==='function'))return;
				var original_function = doSubmitEmptyData;
				doSubmitEmptyData = function( command, parameter_1, parameter_2, parameter_3, formSetup ){
					var form = viewDocument.forms["emptyForm"], node;
					setupForm(form, formSetup);
					form.windowSerialId.value = windowSerialId;
					form.command.value        = command;
					form.parameter_1.value    = parameter_1;
					form.parameter_2.value    = parameter_2;
					form.parameter_3.value    = parameter_3;
					form.dataChanged.value    = (formSetup.dataChanged == null ? 0 : (formSetup.dataChanged ? 1 : 0));
					form.componentName.value  = "";
		
					var getstr = "";
					for (i=0; node = form.elements[i]; i++) {
						switch(node.type){
							case "hidden":
							case "text":
							case "select-one":
								getstr += escape(node.name) + "=" + escape(node.value) + "&";
								break;
							case "checkbox":
								if (node.checked) {
									getstr += escape(node.name) + "=" + escape(node.value) + "&";
								} else {
									getstr += escape(node.name) + "=&";
								}
								break;
							case "radio":
								if (node.checked) {
									getstr += escape(node.name) + "=" + escape(node.value) + "&";
								}
								break;
						}
		
					}
					getstr = getstr.replace(/&$/,""); //remove trailing &
					var xhr = new XMLHttpRequest();
		                        var url = form.action;
		                        if(form.target!="")url += "#"+form.target;
					xhr.open("POST",url,true);
					xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
					xhr.send(getstr);
					resetForm(form);
					doSubmitEmptyData = original_function;
			}
		},false);
		opera.addEventListener("BeforeEvent.click", function(e){
			/*
			Opera doesn't send unload events in all cases. Check if
			a mouse click is about to replace a named frame (target). 
			If it will, iterate over the subframes and send an unload event.
			*/
			if(e.event.target.nodeName=="A" && e.event.target.getAttribute('target')!=null){
				trgt = e.event.target.getAttribute('target');
				if(trgt.indexOf('_rightside')){
					f = parent.frames[trgt];
					for(i=0;i<f.frames.length;i++){
						var evt=document.createEvent('Event');
						evt.initEvent('unload', true, true);
						f.frames[i].dispatchEvent(evt);
					}
				}
			}
		}
		,false);
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Fix Ctrl-G shortcut in Maconomy\nFix unload form submit behavior on Maconomy portals). See browser.js for details');
	} else if(pathname.indexOf('/AnalyticalReporting/')==0){			// PATCH-555, Analytix: add missing end quote
		if(pathname.indexOf('AnalyticalReporting/WebiModify.do')>-1 || pathname.indexOf('AnalyticalReporting/WebiCreate.do')>-1){
		opera.defineMagicVariable('embed_size_attr',
			function(v){
				if(v=='style="width: 100%; height: 100%;'){
					return 'style="width: 100%; height: 100%;"';
				}
				return v;
			}
		,null);
		}
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Analytix: add missing end quote). See browser.js for details');
	} else if(pathname.indexOf('/zimbra/')>-1){			// PATCH-255, Work around browser sniffing that prevents Zimbra's rich text editor from loading
		opera.defineMagicVariable('AjxEnv', null, function(obj){
			obj.__defineGetter__('isGeckoBased', function(){return true;});
			obj.__defineSetter__('isGeckoBased', function(){});
			return obj;
		});
		
			if(self==top)postError.call(opera, 'Opera has modified the JavaScript on '+hostname+' (Work around browser sniffing that prevents Zimbra\'s rich text editor from loading). See browser.js for details');
	}

})(opera);
