var PatchUtil =
{
	getBlur : function ()
	{
		var linkLen = document.links.length;
		for (var i = 0; i < linkLen; i++) document.links[i].onfocus = function () { this.blur(); };
	},
	getSelectStyle : function ()
	{
		if (navigator.appName == "Microsoft Internet Explorer") {
			var Selects = document.documentElement.getElementsByTagName("SELECT");
			for (var i = Selects.length - 1; i >= 0; i--) {
				var SelectObj = Selects[i];
				var saveSelected = SelectObj.selectedIndex;
				var DivObj = document.createElement("DIV");
				DivObj.style.border = (SelectObj.style.border) ? SelectObj.style.border : "0px solid menu";
				DivObj.style.display = "inline";
				DivObj.style.width = SelectObj.offsetWidth - 2 + "px";
				DivObj.style.height = SelectObj.offsetHeight - 2 + "px";
				DivObj.style.overflow = "hidden";
				SelectObj.parentNode.appendChild(DivObj);
				DivObj.appendChild(SelectObj.cloneNode(true));
				SelectObj.parentNode.replaceChild(DivObj,SelectObj);
				DivObj.firstChild.style.position = "relative";
				DivObj.firstChild.style.left = "-2px";
				DivObj.firstChild.style.top = "-2px";
				DivObj.firstChild.selectedIndex = saveSelected;
			}
		}
	},
	getSecure : function ()
	{
		var This = this;
		var bool = false;
		var clickState = 0;

		function hideStatusText() {
			if (bool != true) {
				window.status = "";
				return true;
			}
		}

		function notAccessKey(e) {
			//C = 67, N = 78, Esc = 27
			if (e.ctrlKey==true || e.keyCode==27) return bool;
		}

		function catch_not() {
			return bool;
		}

		function sign(e) {
			var date = new Date();
			var minutes = date.getMinutes();
			var key = new String(minutes);
			var k1 = Number(key.substr(0,1));
			var k2 = Number(key.substr(1,1));
			if (e.ctrlKey == true) {
				var Result = Math.abs(k1 - k2);
				if (!Result || Result <=0) { Result = 10; }
				clickState++;
				if (clickState == Result) {
					bool = true;
					mySecure(e);
				} else {
					bool = false;
				}
				//window.status = clickState + "--" + Result + "--" + bool;
			} else {
				clickState = 0;
			}

			if (clickState > 10) {
				opener = window;
				self.close();
			}
		}

		function mySecure(e) {
			document.body.oncontextmenu = catch_not;
			document.body.onselectstart = catch_not;
			document.body.ondragstart = catch_not;
			document.onmouseover = hideStatusText;
			document.onkeydown = function () { return notAccessKey(e); }
			document.ondblclick = function () { return sign(e); }
			var linkLen = document.links.length;
			for (var i=0; i<linkLen; i++) {
				document.links[i].onmouseover = hideStatusText;
				document.links[i].onmousemove = hideStatusText;
				document.links[i].onmousedown = hideStatusText;
				//document.links[i].onfocus = hideStatusText;
			}
		}
		
		mySecure(event);
	}
}
