//Script容错代码
//function killerr() {  
//return true  
//}  
//window.onerror=killerr  

function KeyDown(){ 
//alert(event.keyCode);
//屏蔽 Alt+F4
//if ((event.altKey == true)&&(event.keyCode==115)) {
//	window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px"); 
//	return false;} 
//屏蔽 Shift
//if (event.shiftKey == true){alert("Shift键已屏蔽")} 	
//屏蔽 Ctrl + R
if (event.ctrlKey == true && event.keyCode==82)
	{event.keyCode=0;return false;} 
//屏蔽 F3、F4、F5 、F6、F11
if ((event.keyCode==114)||(event.keyCode==116)||(event.keyCode==117)||(event.keyCode==122))
	{event.keyCode=0;return false;} 
//屏蔽 Alt+方向键
if ((event.altKey == true)&&((event.keyCode==37)||(event.keyCode==39))) {   
	return false;}
//屏蔽 Ctrl+N
if ((event.ctrlKey == true)&&(event.keyCode==78)) {return false;}
//屏蔽 shift+F10
if ((event.shiftKey == true)&&(event.keyCode==121)) {return false;}
} 
document.onkeydown = KeyDown;


// 显示无模式对话框
function eShowDialog(url, width, height, optValidate) {
	if (optValidate) {
		if (!validateMode()) return;
	}
	var arr = showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no");
//	var arr = showModelessDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no");
}

// 显示模式对话框
function eShowDialog2(url, width, height, optValidate) {
	if (optValidate) {
		if (!validateMode()) return;
	}
	var arr = showModelessDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no");
}

// 显示帮助
function pp(url,width,height){
	eShowDialog(url,width,height);
	return false;
}


// 显示帮助
function pp2(url,width,height){
	eShowDialog2(url,width,height);
	return false;
}

function LTrim(str) {
   var whitespace = new String(" \t\n\r");
   var s = new String(str);
   if (whitespace.indexOf(s.charAt(0)) != -1)
   {
       var j=0, i = s.length;
       while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
       {
           j++;
       }
       s = s.substring(j, i);
   }
   return s;
}

function RTrim(str) {
   var whitespace = new String(" \t\n\r");
   var s = new String(str);
   if (whitespace.indexOf(s.charAt(s.length-1)) != -1)
   {
       var i = s.length - 1;
       while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
       {
           i--;
       }
       s = s.substring(0, i+1);
   }
   return s;
}

function Trim(str) {
   return RTrim(LTrim(str));
}

function winopen(url,t,l,w,h) {	
	newWindow = window.open(url,'es','resizable=yes,scrollbars=yes,status=no,toolbar=no,location=no,menu=no,left='+l+',top='+t+',width='+w+',height='+h+'');
	newWindow.focus();
}