
/*
// ------------------------------------------------------------------------ //
// Project Name       : Contnew.Mall                                          //
// Program Name       : scripting.event                                     //
// Copyright          : COPYRIGHT (C) 2006 BY CONTNEW NETWORK               //
// Version            : 2.0                                                 //
// Author             : webmaster@contnew.com                               //
//                                                                          //
// Date        By            Description                                    //
// ---------   ------------- -----------------------------------------------//
// 2005/05/13  SXG           客户端屏蔽鼠标事件                             //
// ------------------------------------------------------------------------ //
*/


/*
 * 对象移动事件
 * 将IMG对象移动屏蔽。避免超级拖拽
 */
function window.document.ondragstart()
{
	var oUnknown = window.event.srcElement;
	if (oUnknown.tagName == 'IMG')
	{
		window.event.returnValue = false;
	}
}

/*
 * 屏蔽鼠标右键
 * 对控件为 text textarea password 无效
 */
/*function window.document.oncontextmenu()
{
	oUnknown = window.event.srcElement;
	if (oUnknown != null)
	{
		if (oUnknown.type == 'text' || oUnknown.type == 'textarea' || oUnknown.type == 'password')
		{
			return true;
		}else{
			return false;
		}
	}else{
		return false;
	}
}*/

/*
 * 屏蔽F5 刷新，退格删除键
 * 对控件为 text textarea password 无效
 */
function window.document.onkeydown()
{
	if ((event.keyCode==116) || (event.ctrlKey && event.keyCode==82))
	{
		event.keyCode=0;
		event.returnValue=false;
	}

	if ((event.keyCode == 8))
	{
		oUnknown = window.event.srcElement;
		if (oUnknown != null)
		{
			if (oUnknown.type == 'text' || oUnknown.type == 'textarea' || oUnknown.type == 'password')
			{
				event.returnValue = true;
			}else{
				event.returnValue = false;
			}
		}else{
			event.returnValue = false;
		}
	}
}