/*
if(self.name != "ChengDuT2J")
{
	//获取本页面路径
	s = self.location.toString();
	s = s.substr(s.lastIndexOf("/")+1);
	//重新打开，设置无工具栏
	self.open(s,'ChengDuT2J','width='+(screen.Width-12)+',height='+(screen.Height-76)+',top=0,left=0,status=no,resizable=no,scrollbars=yes')
	self.opener = null;
	self.close();
}
else
{
	//设置位置和大小
	
	//不扩展到全屏
	//self.resizeTo(screen.width-28,screen.height-60);
	//self.moveTo(14,16);
	
	//扩展到全屏
	self.resizeTo(screen.width+8,screen.height-22);
	self.moveTo(-4,-4);	
}


function window.onload() {
	
}*/

//屏蔽快捷键函数
	
function  window.document.onkeydown()
{
	// alert(event.keyCode);
	 if(event.keyCode==13 && event.srcElement.tagName!="DIV" &&  event.srcElement.tagName!="TEXTAREA")	{	 	
	 	event.keyCode=9;		
	 }
//	 var ibnQuery=document.all.item("ibnQuery");
//		if(ibnQuery!=null) {
//			ibnQuery.focus();
//		}	
	return;
//	alert(event.keyCode);	
	
	if	((window.event.altKey)&&
		((window.event.keyCode==37)||   //屏蔽 Alt+ 方向键 ←
		(window.event.keyCode==39))){  //屏蔽 Alt+ 方向键 →
		event.returnValue=false;
     }

	if	((event.keyCode==8)  ||                 //屏蔽退格删除键
		(event.keyCode==116)||                 //屏蔽 F5 刷新键
		(event.ctrlKey && event.keyCode==82)){ //Ctrl + R
		event.keyCode=0;
		event.returnValue=false;
     }     

			
	if(	(event.keyCode==116)||                    //屏蔽 F5 刷新键
		(event.ctrlKey && event.keyCode==82) ||    //Ctrl + R
		(event.ctrlKey && event.keyCode==78) ||   //屏蔽 Ctrl+n
		(event.ctrlKey && event.keyCode==69) ||   //屏蔽 Ctrl+E
		(event.ctrlKey && event.keyCode==73) ||   //屏蔽 Ctrl+I
		(event.ctrlKey && event.keyCode==72) ||   //屏蔽 Ctrl+H
		(event.ctrlKey && event.keyCode==79) ||   //屏蔽 Ctrl+O
		(event.ctrlKey && event.keyCode==80) ||   //屏蔽 Ctrl+P
		(event.ctrlKey && event.keyCode==76) ||   //屏蔽 Ctrl+L
		(event.shiftKey&& event.keyCode==121)){   //屏蔽 shift+F10
			event.keyCode=0;
			event.returnValue=false;
	}

	if (window.event.srcElement.tagName == "A" && window.event.shiftKey) 
		window.event.returnValue = false;  //屏蔽 shift 加鼠标左键新开一网页
	
	if ((window.event.altKey)&&(window.event.keyCode==115)){ //屏蔽Alt+F4
		window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");
		return false;}
		
}
//屏蔽快捷键函数
function OpenWindow(url,width,height,a)
{
	var left=(screen.availWidth-width)/2;
	var top=(screen.availHeight-height)/2;
	var returnValue = window.open(url, "null", "width=" + width + ",height=" + height + ",left=" + left + ",resizable=yes,status=no,scrollbars=1,top=" + top); //status=1,
		if (returnValue != null)
		{		
			if(returnValue=="ok")
			{
				if(document.all.item("ibnRefresh")==null)
					window.location.reload();
				else
					document.all.item("ibnRefresh").click();				
			}
			else
			{			
				var UserList=document.all.item(a);		
				try {	
					if(UserList!=null)
						UserList.value=returnValue;//.split("||")[0];
//					if(UserList1!=null)
//						UserList1.value=returnValue.split("||")[1];							
				}
				catch(e)
				{;}
			}
			
		}
		else 
		{
		    alert("1、检测到WEB浏览器中的弹出窗口阻止程序被启用，请在WEB浏览器中的工具菜单中关闭弹出窗口阻止程序，方能使用此功能。2、按住Ctrl键，再点击查询按钮，也可使用此功能。");
		}
}
function OpenWindow(url, width, height) {
    var left = (screen.availWidth - width) / 2;
    var top = (screen.availHeight - height) / 2;
    var showwin = window.open(url, "null", "width=" + width + ",height=" + height + ",left=" + left + ",resizable=yes,location=no,status=no,scrollbars=1,top=" + top); //status=1,
    if (showwin) {
        showwin.focus();
    }
    else {
        alert("1、检测到WEB浏览器中的弹出窗口阻止程序被启用，请在WEB浏览器中的工具菜单中关闭弹出窗口阻止程序，方能使用此功能。2、按住Ctrl键，再点击查询按钮，也可使用此功能。");
    }

}
function OpenWindow(url,ckzt,width, height) {
    var left = (screen.availWidth - width) / 2;
    var top = (screen.availHeight - height) / 2;
    var showwin = window.open(url, ckzt, "width=" + width + ",height=" + height + ",left=" + left + ",resizable=yes,location=no,status=no,scrollbars=1,top=" + top); //status=1,
    if (showwin) {
        showwin.focus();
    }
    else {
        alert("1、检测到WEB浏览器中的弹出窗口阻止程序被启用，请在WEB浏览器中的工具菜单中关闭弹出窗口阻止程序，方能使用此功能。2、按住Ctrl键，再点击查询按钮，也可使用此功能。");
    }

}

//function OpenWindow(url,width,height)
//{
//	var left=(screen.availWidth-width)/2;
//	var top=(screen.availHeight-height)/2;
//	window.open(url,"_blank","width="+width+",height="+height+",left="+left+",resizable=yes,scrollbars=1,top="+top);//status=1,
//}

//弹出窗口函数
function OpenWindowBool(url,dialogWidth,dialogHeight,a,b)
{
	if (OpenWindowValue(url,dialogWidth,dialogHeight,a,b) != null)
	{
		return true;
	}
	return false;
}


function OpenWindowselect(url,dialogWidth,dialogHeight)
{
 
    var returnValue = window.showModalDialog(url, '', 'dialogWidth:' + dialogWidth + 'px;dialogHeight:' + dialogHeight + 'px;status:no;help:no;resizable:yes;:scroll: No;');
    if (returnValue != null) 
    {
        if (returnValue == "ok") 
        {
            if (document.all.item("ibnRefresh") == null)
                window.location.reload();
            else
                document.all.item("ibnRefresh").click();
        }
        else
         {
           
    
            }
    
        }

    

}
function OpenWindowValue(url,dialogWidth,dialogHeight,a,b)
{
//	dialogWidth=dialogWidth+100;
	
		var returnValue = window.showModalDialog(url,'','dialogWidth:'+dialogWidth+'px;dialogHeight:'+dialogHeight+'px;status:no;help:no;resizable:yes;:scroll: No;');	
		if (returnValue != null)
		{		
			if(returnValue=="ok")
			{
				if(document.all.item("ibnRefresh")==null)
					window.location.reload();
				else
					document.all.item("ibnRefresh").click();				
			}
			else
			{			
				var UserList=document.all.item(a);		
				var UserList1=document.all.item(b);	
				try {	
					if(UserList!=null)
						UserList.value=returnValue.split("||")[0];
					if(UserList1!=null)
						UserList1.value=returnValue.split("||")[1];							
				}
				catch(e)
				{;}
			}
			
		}
	//	return null;
	
}

function OpenWindowBool1(url,dialogWidth,dialogHeight,a,b,c,d)
{
	if (OpenWindowValue1(url,dialogWidth,dialogHeight,a,b,c,d) != null)
	{
		return true;
	}
	return false;
}
function OpenWindowValue1(url,dialogWidth,dialogHeight,a,b,c,d)
{
//	dialogWidth=dialogWidth+100;
	
		var returnValue = window.showModalDialog(url,'','dialogWidth:'+dialogWidth+'px;dialogHeight:'+dialogHeight+'px;status:no;help:no;resizable:yes;:scroll: No;');	
		if (returnValue != null)
		{		
			if(returnValue=="ok")
			{
				if(document.all.item("ibnRefresh")==null)
					window.location.reload();
				else
					document.all.item("ibnRefresh").click();				
			}
			else
			{			
				var UserList=document.all.item(a);		
				var UserList1=document.all.item(b);	
				var UserList2=document.all.item(c);	
				var UserList3=document.all.item(d);	
				
				try {	
					if(UserList!=null)
						UserList.value=returnValue.split("||")[0];
					if(UserList1!=null)
                   UserList1.value="";							
					
					if(UserList2!=null)
						UserList2.value=returnValue.split("||")[2];
					if(UserList3!=null)
                   UserList3.value="";							



				//		UserList1.value=returnValue.split("||")[1];							
				}
				catch(e)
				{;}
			}
			
		}
	//	return null;
	
}

//弹出窗口函数
try{
 HideWait();
}
catch(e) 
{; }


function SetValue(object,value)
{
	object.value =value;
}

//判断是否有CheckBox被选中,有返回真,否则为假,
//传入的参数时CheckBox标志号包含的字符串
function HasCheckedItem(IdString)
{
	var checked = false;
	for(var i=0;i<document.all.length;i++)
	{
		var e = document.all(i);
		if (e.id.indexOf(IdString) != -1)
		{
			if(e.checked)
			{
				checked = true;
				break;
			}
		}
	}
	return checked;
}

function SelectAll(obj)
{
	var objArray=document.all.tags("input");
	if(obj.checked)
	obj.checked=false;	
	else
	obj.checked=true;
	
	for(var i=0;i<objArray.length;i++)
	{
		if(objArray[i].type=="checkbox" && objArray[i].checked)	{
			objArray[i].checked=false;						
		}
		else{
			objArray[i].checked=true;			
		}
	}
	return false;
}






