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 = "http://www.fjxp.gov.cn/ymjc/errorsub.do";
					//document.forms['suggest'].target = "about:blank";
					//document.forms['suggest'].submit();
					window.open("http://www.fjxp.gov.cn/ymjc/errorsub.do","","width=400,height=370");
				}
            } else {
                alert("请先用鼠标选择出错的内容片断！");
                return false;
            }
        }
    }
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 "";
	}
}
function setEmbed()
{
	var obj = new String;
	var parameter = new String;
	var embed = new String;
	var html = new String;
	var allParameter = new String;
	var clsid = new String;
	var codebase = new String;
	var pluginspace = new String;
	var embedType = new String;
	var src = new String;
	var width = new String;
	var height = new String;
	var name = new String;

	// n : name, s : source, w : width, h : height//

	this.init = function( getType ,s ,w ,h ,n ) {

		if ( getType == "flash")
		{
			clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";
			codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
			pluginspage = "http://www.macromedia.com/go/getflashplayer";
			embedType = "application/x-shockwave-flash";
			parameter += "<param name='movie' value='"+ s + "'>\n";
			parameter += "<param name='quality' value='high'>\n";
		}
		else if ( getType == "movie")
		{
			clsid = "CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6";
			codebase = "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715";
			pluginspage = "http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/";
			embedType = "application/x-mplayer2";
			parameter += "<param name='filename' value='"+ s + "'>\n";
		}
		src = s;
		width = w;
		height = h;
		name = n;

	}

	this.parameter = function( parm , value ) {

		parameter += "<param name='"+parm +"' value='"+ value + "'>\n";
		allParameter += " "+parm + "='"+ value+"'";

	}

	this.show = function() {

		if ( clsid )
		{
			obj = "<object classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"' name='"+ name +"'>\n";
		}

		embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height + "' name='"+ name + "' "+ allParameter +" ></embed>\n";

		if ( obj )
		{
			embed += "</object>\n";
		}
		html = obj + parameter + embed;

		document.write( html );

	} 

}

function change_view(obj_name)
{
var aa=document.getElementById(obj_name);
if(aa.style.display=="")
{
aa.style.display="none";
}
else
{
aa.style.display="";
}
}
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1] 
//extra height in px to add to iframe in FireFox 1.0+ browsers 
var FFextraHeight=getFFVersion>=0.1? 16 : 0 

function dyniframesize(iframename) { 
var pTar = null; 
if (document.getElementById){ 
pTar = document.getElementById(iframename); 
} 
else{ 
eval('pTar = ' + iframename + ';'); 
} 
if (pTar && !window.opera){ 
//begin resizing iframe 
pTar.style.display="block" 

if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){ 
//ns6 syntax 
pTar.height = pTar.contentDocument.body.offsetHeight+FFextraHeight; 
} 
else if (pTar.Document && pTar.Document.body.scrollHeight){ 
//ie5+ syntax 
pTar.height = pTar.Document.body.scrollHeight; 
} 
} 
} 

function switchSysBar(){
if (switchPoint.innerText==3){
switchPoint.innerText=4
document.all("frmTitle").style.display="none"
}else{
switchPoint.innerText=3
document.all("frmTitle").style.display=""
}}



