YUI({
	combine: true,
	timeout: 10000
	}).use("io","node","console",
	function(Y)
	{
		var start=function()
		{
			Y.one("#reportMistake").on("click",f)
			if (Y.UA.mobile)
			{
				Y.all("div.edit").setStyle("display","block")
				Y.all("textarea").setStyle("width","100px")
			}
			if (Y.one("#content")!==null && !Y.UA.mobile)
				Y.Get.script("http://e.fstatic.eu/cm/js/codemirror.js",{
					onSuccess: function()
					{
							CodeMirror.fromTextArea('content',
							{
								height: "350px",
								parserfile: "parsexml.js",
								stylesheet: "http://e.fstatic.eu/cm/css/xmlcolors.css",
								path: "http://e.fstatic.eu/cm/js/",
								continuousScanning: 500,
								disableSpellcheck:false,
								lineNumbers: true
							})
					}
				})
			for (var i in Y.all("pre").get("className"))
				if (i.search("sh_"))
				{
					sh_highlightDocument()
					break
				}
		}
		var f=function(e)
		{
			var node=Y.one("#rmotp")
			node.setStyle("display","block")
			var v=node.get("docScrollY")+node.get("winHeight")-320
			if (Y.UA.ie && v)
			{
				node.setStyle("position","absolute")
				node.setY(v)
			}
			var debug=Y.one("#debug")
			var debugstr=[]
			for (var i in Y.UA)
				if (Y.UA[i]!=0 && Y.UA[i]!=null && Y.UA[i]!=undefined)
					debugstr.push("browser: "+i+" "+Y.UA[i])
			debugstr.push("URL: "+window.location)
			debugstr.push("OS: "+window.os)
			if (window.console)
				debugstr.push("firebug: "+window.console.firebug)
			debug.set("value",debugstr.join("\n"))
			delete(node)
			if (Y.UA.ie)
				Y.on("scroll",function()
				{
					var v=node.get("docScrollY")+node.get("winHeight")-320
					if (v)
						Y.one("#rmotp").setY(v)
				},window)
			if (e)
				e.preventDefault()
		}
		Y.one("window").on("load",start)
	}
)
