document.writeln("<script language=\"JavaScript\" type=\"text\/javascript\">");
document.writeln("");
document.writeln("function goto1(ln) {");
document.writeln("	if(!\/^\\d+$\/.test(ln)) return;");
document.writeln("	var obj = document.getElementById(\"tt\");");
document.writeln("	var rng = obj.createTextRange();");
document.writeln("	var arr = obj.value.replace(\/\\r\/, \"\").split(\/\\n\/);");
document.writeln("	if(ln>arr.length) ln = arr.length;");
document.writeln("	var str_tmp = \"\";");
document.writeln("	for(var i=0; i<ln-1; i++) {");
document.writeln("		str_tmp += arr[i];");
document.writeln("	}");
document.writeln("	rng.moveStart(\'character\',str_tmp.length+1);");
document.writeln("	str_tmp = \"\";");
document.writeln("	for(i=ln; i<arr.length; i++) {");
document.writeln("		str_tmp += arr[i];");
document.writeln("	}");
document.writeln("	rng.moveEnd(\'character\',-str_tmp.length); ");
document.writeln("	rng.select();");
document.writeln("	return;");
document.writeln("}");
document.writeln("");
document.writeln("function runCode(obj) ");
document.writeln("{");
document.writeln("if (!obj){");
document.writeln("	obj=document.getElementById(\'tt\')");
document.writeln("}");
document.writeln("var code=obj.value");
document.writeln("newwin=window.open(\'\',\'\',\'\') ");
document.writeln("newwin.document.writeln(\"<script>\");");
document.writeln("newwin.document.writeln(\"function reportError(msg,url,line){\\nline-=14;\\nvar str=\'You have found an error as below: \\\\n\\\\n\';\\nstr+=\'Err: \'+msg+\' on line: \'+(line);\\nalert(str);\\nopener.goto1(line);\\nopener.focus();\\nwindow.onerror=null;\\nsetTimeout(\'self.close()\',10);\\nreturn true;\\n}\");");
document.writeln("newwin.document.writeln(\"window.onerror = reportError;\");");
document.writeln("newwin.document.writeln(\"<\\\/script>\");");
document.writeln("\/\/ewwin.opener = null ");
document.writeln("newwin.document.write(code)");
document.writeln("newwin.document.close()");
document.writeln("}");
document.writeln("function syncSize(){");
document.writeln("var tt=document.getElementById(\"tt\");");
document.writeln("var t1=document.documentElement.offsetHeight-document.getElementById(\"inpButton\").offsetHeight-50;");
document.writeln("tt.style.width=(document.documentElement.offsetWidth-50)+\"px\";");
document.writeln("");
document.writeln("tt.style.height=(document.documentElement.offsetHeight-document.getElementById(\"inpButton\").offsetHeight-50)+\"px\";");
document.writeln("}");
document.writeln("window.onload=syncSize;");
document.writeln("\/\/window.onresize=syncSize;");
document.writeln("<\/script>")