
function getSelectedText() {

	if (window.getSelection) {
		return window.getSelection().toString();
		
	} else if (document.getSelection) {
		return document.getSelection();
		
	} else if (document.selection) {//IE
		return document.selection.createRange().text;
	}
}

document.onkeydown = suberror;
    function suberror(e)
    {
        var e = (typeof event != "undefined") ? window.event : e;
        var s = getSelectedText();
        if (e.ctrlKey && e.keyCode == 13) {
            if (s != "")
            {
				if(s.length>2000){
					alert("您选择的内容请不要超过2000个字符，请重新操作。");
					return;
				}else{
					document.forms['suggest'].url.value = window.location.href;
					document.forms['suggest'].errorstr.value = s;
					document.forms['suggest'].action = "/error/error.asp";
					document.forms['suggest'].target = "about:blank";
					document.forms['suggest'].submit();
				}
            } else {
                alert("请先用鼠标选择出错的内容片断！");
                return false;
            }
        }
    }
    //在 FireFox 下获取 input 或者 textarea 中选中的文字，可以用下面的方法
function getTextFieldSelection(e) {
	
	if (e.selectionStart != undefined && e.selectionEnd != undefined) {
	
		var start = e.selectionStart;
		
		var end = e.selectionEnd;
		
		return e.value.substring(start, end);
	} else {
		return "";
	}
}

document.write('<table bgcolor="#ffffff" height=5  width="780" border="0" cellspacing="0" cellpadding="0" align="center" style="FONT-SIZE: 9pt;"><FORM id=suggest action= method=post target=_blank><tr><td align=center>')
document.write('<Input type=hidden name=test><Input type=hidden name=msg><Input type=hidden name=errorstr><Input type=hidden name=url><div id=information_bottom  style="FONT-SIZE: 9pt;">如果您在本页发现错误，请用鼠标选择出错内容片断，然后同时按下 <b>CTRL</b> + <b>ENTER</b> 键，以便及时将错误信息通知我们，感谢您的大力支持。</div>')
document.write('</td></tr></FORM></table>')

document.write('<table bgcolor="#ffffff" width="780" border="0" cellspacing="0" cellpadding="0" align="center" style="FONT-SIZE: 9pt; COLOR: #000000;"><tr><td height="7" background="/2004shtj/images/buttom1.gif"></td></tr> <tr><td align="center"><font color="#7D7D7D">Copyright 1999-2009 上海市统计局、国家统计局上海调查总队 版权所有 | 上海市统计局网管中心制作</font></td></tr><tr><td align="center"><font color="#7D7D7D">工作联系电话：53857200　传真：53857200 | 联系地址：上海市威海路48号 | 邮政编码：200003</font></td></tr><tr><td align="center"><font color="#7D7D7D">建议使用IE6.0以上版本浏览,最佳分辨率1024*768,沪ICP备05007236号</font></td></tr></table>');
