if( ((navigator.userAgent.indexOf("Netscape")!=-1))?((parseInt(navigator.appVersion)>4)?true:false):false){
	if(!document.all){
		/* 
			ns6_to_ie4_patch_v1_2.js
			Alexander Höglind of Solberg	
			http://www.solberg.se
		*/
		var ns6jscode ="<SCRIPT LANGUAGE=\"JavaScript\">\n"+
		"<!--\n"+
		" Node.prototype.__defineGetter__(\"all\", function(){\n"+
		"	if(document.getElementsByTagName(\"*\").length){\n"+
		"		if(this.nodeType==1) return this.getElementsByTagName(\"*\");\n"+
		"		else if(this.nodeType==9) return this.getElementsByTagName(\"*\");\n"+
		"		else return '';\n"+
		"	}\n"+
		"});\n"+
		" Node.prototype.__defineSetter__(\"all\", function(){});\n"+
		"\n"+	
		"HTMLElement.prototype.__defineSetter__(\"innerText\", function(txt){\n"+
		"	with(document.createRange()){selectNodeContents(this);deleteContents();}\n"+
		"	this.appendChild(document.createTextNode(txt));\n"+
		"	return txt;\n"+
		"});\n"+
		"\n"+
		"HTMLElement.prototype.__defineGetter__(\"innerText\", function(){\n"+
		"	with(document.createRange()){selectNode(this);return toString();}\n"+
		"});\n"+
		"\n"+
		"HTMLElement.prototype.__defineSetter__(\"outerHTML\", function (html){\n"+
		"	this.parentNode.replaceChild(document.createRange().selectNode(this).createContextualFragments(html), this);\n"+
		"	return html;\n"+
		"});\n"+
		"\n"+
		"HTMLElement.prototype.__defineGetter__(\"outerHTML\", function () {\n"+
		"var attr, attrs = this.attributes;\n"+
		"var str = \"<\" + this.tagName;\n"+
		"for (var i = 0; i < attrs.length; i++) {\n"+
		"	attr = attrs[i];\n"+
		"	if (attr.specified)\n"+
		"		str += \" \" + attr.name + '=\"' + attr.value + '\"';\n"+
		"}\n"+
		"if (!this.canHaveChildren)\n"+
		"	return str + \">\";\n"+
		"return str + \">\" + this.innerHTML + \"</\" + this.tagName + \">\";\n"+
		"});\n"+
		

		/*
		 * Extends the event object with srcElement, cancelBubble, returnValue,
		 * fromElement and toElement
		 */
		"function extendEventObject() {\n"+
		"	Event.prototype.__defineSetter__(\"returnValue\", function (b) {\n"+
		"		if (!b) this.preventDefault();\n"+
		"	});\n"+
		"\n"+	
		"	Event.prototype.__defineSetter__(\"cancelBubble\", function (b) {\n"+
		"		if (b) this.stopPropagation();\n"+
		"	});\n"+
		"\n"+	
		"	Event.prototype.__defineGetter__(\"srcElement\", function () {\n"+
		"		var node = this.currentTarget;\n"+
		"		while (node.nodeType != 1) node = node.parentNode;\n"+
		"		return node;\n"+
		"	});\n"+
		"\n"+
		"	Event.prototype.__defineGetter__(\"fromElement\", function () {\n"+
		"		var node;\n"+
		"		if (this.type == \"mouseover\")\n"+
		"			node = this.relatedTarget;\n"+
		"		else if (this.type == \"mouseout\");\n"+
		"			node = this.target;\n"+
		"		if (!node) return;\n"+
		"		while (node.nodeType != 1) node = node.parentNode;\n"+
		"		return node;\n"+
		"	});\n"+
		"\n"+
		"	Event.prototype.__defineGetter__(\"toElement\", function () {\n"+
		"		var node;\n"+
		"		if (this.type == \"mouseout\")\n"+
		"			node = this.relatedTarget;\n"+
		"		else if (this.type == \"mouseover\");\n"+
		"			node = this.target;\n"+
		"		if (!node) return;\n"+
		"		while (node.nodeType != 1) node = node.parentNode;\n"+
		"		return node;\n"+
		"	});\n"+
		"\n"+	
		"	Event.prototype.__defineGetter__(\"offsetX\", function () {\n"+
		"		return this.layerX;\n"+
		"	});\n"+
		"	Event.prototype.__defineGetter__(\"offsetY\", function () {\n"+
		"		return this.layerY;\n"+
		"	});\n"+
		"}\n"+
		
		/*
		 * Emulates element.attachEvent as well as detachEvent
		 */
		"function emulateAttachEvent() {\n"+
		"	HTMLDocument.prototype.attachEvent = \n"+
		"	HTMLElement.prototype.attachEvent = function (sType, fHandler) {\n"+
		"		var shortTypeName = sType.replace(/on/, \"\");\n"+
		"		fHandler._ieEmuEventHandler = function (e) {\n"+
		"			window.event = e;\n"+
		"			return fHandler();\n"+
		"		};\n"+
		"		this.addEventListener(shortTypeName, fHandler._ieEmuEventHandler, false);\n"+
		"	};\n"+
		"\n"+
		"	HTMLDocument.prototype.detachEvent = \n"+
		"	HTMLElement.prototype.detachEvent = function (sType, fHandler) {\n"+
		"		var shortTypeName = sType.replace(/on/, \"\");\n"+
		"		if (typeof fHandler._ieEmuEventHandler == \"function\")\n"+
		"			this.removeEventListener(shortTypeName, fHandler._ieEmuEventHandler, false);\n"+
		"		else\n"+
		"			this.removeEventListener(shortTypeName, fHandler, true);\n"+
		"	};\n"+
		"}\n"+
		
		/*
		 * This function binds the event object passed along in an
		 * event to window.event
		 */
		"function emulateEventHandlers(eventNames) {\n"+
		"	for (var i = 0; i < eventNames.length; i++) {\n"+	
		"		document.addEventListener(eventNames[i], function (e) {\n"+
		"			window.event = e;\n"+
		"		}, true);	// using capture\n"+
		"	}\n"+
		"}\n"+
		
		
		"function extendElementModel() {\n"+
		"	HTMLElement.prototype.__defineGetter__(\"parentElement\", function () {\n"+
		"		if (this.parentNode == this.ownerDocument) return null;\n"+
		"		return this.parentNode;\n"+
		"	});\n"+
		"\n"+	
		"	HTMLElement.prototype.__defineGetter__(\"children\", function () {\n"+
		"		var tmp = [];\n"+
		"		var j = 0;\n"+
		"		var n;\n"+
		"		for (var i = 0; i < this.childNodes.length; i++) {\n"+
		"			n = this.childNodes[i];\n"+
		"			if (n.nodeType == 1) {\n"+
		"				tmp[j++] = n;\n"+
		"				if (n.name) {\n"+	// named children
		"					if (!tmp[n.name])\n"+
		"						tmp[n.name] = [];\n"+
		"					tmp[n.name][tmp[n.name].length] = n;\n"+
		"				}\n"+
		"				if (n.id)		// child with id\n"+
		"					tmp[n.id] = n\n"+
		"			}\n"+
		"		}\n"+
		"		return tmp;\n"+
		"	});\n"+
		"\n"+	
		"	HTMLElement.prototype.contains = function (oEl) {\n"+
		"		if (oEl == this) return true;\n"+
		"		if (oEl == null) return false;\n"+
		"		return this.contains(oEl.parentNode);\n"+		
		"	};\n"+
		"}\n"+

		"function emulateCurrentStyle(properties) {\n"+
		"	HTMLElement.prototype.__defineGetter__(\"currentStyle\", function () {\n"+
		"		var cs = {};\n"+
		"		var el = this;\n"+
		"		for (var i = 0; i < properties.length; i++) {\n"+
		"			//cs.__defineGetter__(properties[i], function () {\n"+
		"			//	window.status = \"i: \" + i	;\n"+
		"			//	return document.defaultView.getComputedStyle(el, null).getPropertyValue(properties[i]);\n"+
		"			//});\n"+
		"			cs.__defineGetter__(properties[i], encapsulateObjects(el, properties[i]));\n"+
		"		}\n"+
		"		return cs;\n"+
		"	});\n"+
		"}\n"+
		// used internally for emualteCurrentStyle
		"function encapsulateObjects(el, sProperty) {\n"+
		"	return function () {\n"+
		"		return document.defaultView.getComputedStyle(el, null).getPropertyValue(sProperty);\n"+
		"	};\n"+
		"}\n"+
		
		
		"\n"+
		"function emulateHTMLModel() {\n"+
		"\n"+
			// This function is used to generate a html string for the text properties/methods
			// It replaces '\n' with "&lt;BR"&gt; as well as fixes consecutive white spaces
			// It also repalaces some special characters	
		"	function convertTextToHTML(s) {\n"+
		"		s = s.replace(/\\&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<BR>\");\n"+
		"		while (/\\s\\s/.test(s))\n"+
		"		s = s.replace(/\\s\\s/, \"&nbsp; \");\n"+
		"		return s.replace(/\\s/g, \" \");\n"+
		"	}\n"+
		"\n"+
		"	HTMLElement.prototype.insertAdjacentHTML = function (sWhere, sHTML) {\n"+
		"		var df;\n"+	// : DocumentFragment
		"		var r = this.ownerDocument.createRange();\n"+
		"	\n"+	
		"		switch (String(sWhere).toLowerCase()) {\n"+
		"			case \"beforebegin\":\n"+
		"				r.setStartBefore(this);\n"+
		"				df = r.createContextualFragment(sHTML);\n"+
		"				this.parentNode.insertBefore(df, this);\n"+
		"				break;\n"+
		"		\n"+		
		"			case \"afterbegin\":\n"+
		"				r.selectNodeContents(this);\n"+
		"				r.collapse(true);\n"+
		"				df = r.createContextualFragment(sHTML);\n"+
		"				this.insertBefore(df, this.firstChild);\n"+
		"				break;\n"+
		"		\n"+		
		"			case \"beforeend\":\n"+
		"				r.selectNodeContents(this);\n"+
		"				r.collapse(false);\n"+
		"				df = r.createContextualFragment(sHTML);\n"+
		"				this.appendChild(df);\n"+
		"				break;\n"+
		"		\n"+		
		"			case \"afterend\":\n"+
		"				r.setStartAfter(this);\n"+
		"				df = r.createContextualFragment(sHTML);\n"+
		"				this.parentNode.insertBefore(df, this.nextSibling);\n"+
		"				break;\n"+
		"		}\n"+	
		"	};\n"+
		"\n"+
		"	HTMLElement.prototype.__defineGetter__(\"canHaveChildren\", function () {\n"+
		"		switch (this.tagName) {\n"+
		"			case \"AREA\":\n"+
		"			case \"BASE\":\n"+
		"			case \"BASEFONT\":\n"+
		"			case \"COL\":\n"+
		"			case \"FRAME\":\n"+
		"			case \"HR\":\n"+
		"			case \"IMG\":\n"+
		"			case \"BR\":\n"+
		"			case \"INPUT\":\n"+
		"			case \"ISINDEX\":\n"+
		"			case \"LINK\":\n"+
		"			case \"META\":\n"+
		"			case \"PARAM\":\n"+
		"				return false;\n"+
		"		}\n"+
		"		return true;\n"+
		"	});\n"+
		"\n"+
		"}\n"+
		
		
		"emulateHTMLModel();\n"+
		"extendElementModel();\n"+
		"emulateCurrentStyle([\"left\", \"right\", \"top\", \"bottom\", \"width\", \"height\"]);\n"+
		"extendEventObject();\n"+
		"emulateAttachEvent();\n"+
		"emulateEventHandlers([\"click\", \"dblclick\", \"mouseover\", \"mouseout\",\"mousedown\", \"mouseup\", \"mousemove\",\"keydown\", \"keypress\", \"keyup\",\"keyup\"]);\n"+	

		// Mozilla returns the wrong button number
		"Event.LEFT = 1;\n"+
		"Event.MIDDLE = 2;\n"+
		"Event.RIGHT = 3;\n"+
		"//-->\n"+
		"</SCRIPT>\n";
		document.write(ns6jscode);
	}
}else{
	/*
	var ns6jscode = "<script language=\"javascript\">\n"+
	"<!--\n"+
	"Event = {};\n"+
	// IE is returning wrong button number as well :-)
	"Event.LEFT = 1;\n"+
	"Event.MIDDLE = 4;\n"+
	"Event.RIGHT = 2;\n"+
	"//-->"+
	"</script>";
	document.write(ns6jscode);
	*/
}



