__javascript_allow_copy = false;

// build no print element
function getHtmlNoPrintScreenByFlash()
{
	var html = '';
	//html += '<div id="divNoPrintByFlash" style="width:0px;height:0px;">';
	html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="' + window.location.protocol + '://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="0" height="0" VIEWASTEXT>';
	html += '<param name="movie" value="/Include/NoPrintScreen.swf?rnd=' + Math.random().toString() + '">';
	html += '<param name="quality" value="high">';
	html += '<param name="menu" value="false">';
	html += '<embed src="/Include/NoPrintScreen.swf?rnd=' + Math.random().toString() + '" width="0" height="0" quality="high" pluginspage="' + window.location.protocol + '://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"></embed>';
	html += '</object>';
	//html += 'Test Flash';
	//html += '</div>';
	return html;
}

// create no print
function doNoPrintScreenByFlashHandleOnFocus()
{
	//doNoPrintScreenByFlashHandleOnBlur();
	var baseUrl = window.location.href.toLowerCase();
	if (window.location.href == top.location.href 
		|| baseUrl.indexOf("/navigateleft.aspx") > -1
		)
	{
		var div = window.document.getElementById("divNoPrintByFlash");
		if ( (div && div.parentElement) 
			|| TK.bAllowCopy
			// ----- special
			|| baseUrl.indexOf("/specialorder.aspx") >= 0
			|| baseUrl.indexOf("/wheelspecialorder.aspx") >= 0
			|| baseUrl.indexOf("/offlineenquiry.aspx") >= 0
			|| baseUrl.indexOf("/offlineenquiryreply.aspx") >= 0
			|| baseUrl.indexOf("/orderenquiryreply.aspx") >= 0
			|| baseUrl.indexOf("/announcementadditionalreply.aspx") >= 0
			|| baseUrl.indexOf("/emailtofriend.aspx") >= 0
			|| baseUrl.indexOf("/orderenquiry.aspx") >= 0
			// ----- login
			|| baseUrl.indexOf("/returnlogon.aspx") >= 0
			|| baseUrl.indexOf("/returninguserlogin.aspx") >= 0
			|| baseUrl.indexOf("/returnlogin.aspx") >= 0
			|| baseUrl.indexOf("/returnvideologin.aspx") >= 0
			|| baseUrl.indexOf("/indexlogin.aspx") >= 0
			|| baseUrl.indexOf("/login.aspx") >= 0
			|| baseUrl.indexOf("/needlogin.aspx") >= 0
			// ----- 
			|| baseUrl.indexOf("/none.aspx") >= 0
			|| baseUrl.indexOf("/none.aspx") >= 0
			)
		{
			return;
		}

		var divs = window.document.getElementsByTagName("SPAN");
		if (!divs && divs.length <= 0)
		{
			return;
		}
		try
		{
			div = window.document.createElement("SPAN");
			div.id = "divNoPrintByFlash";
			//div.style.display = "none";	// important : display='none' will Copy Disenable!!!
			div.innerHTML = getHtmlNoPrintScreenByFlash();
			//divs[0].appendChild(div);
			divs[divs.length - 1].appendChild(div);
		}
		catch (e)
		{
			//alert(e);
		}
		/*for (var i = 0; i < divs.length; divs ++)
		{
			if (divs[i].className == "noprint")
			{
				//alert(window.document.hasFocus() + window.event.type + ": " + window.event.clientX + " - " + window.event.clientY + "\n" + window.event.srcElement);
				div = window.document.createElement("DIV");
				div.id = "divNoPrintByFlash";
				div.innerHTML = getHtmlNoPrintScreenByFlash();
				divs[i].appendChild(div);
				break;
			}
		}*/
	}
}

// remove no print
function doNoPrintScreenByFlashHandleOnBlur()
{
	var baseUrl = window.location.href.toLowerCase();
	//if (window.location.href == top.location.href 
	//	|| baseUrl.indexOf("navigatetopchild.aspx") >= 0
	//	)
	{
		var div = window.document.getElementById("divNoPrintByFlash");
		if (div && div.parentElement)
		{
			//alert(window.document.hasFocus() + window.event.type + ": " + window.event.clientX + " - " + window.event.clientY + "\n" + window.event.srcElement);
			div.parentElement.removeChild(div);
		}   
	}
}  

function checkNoPrintScreenByFlashHandle()
{
	if (document.hasFocus())
	{
		doNoPrintScreenByFlashHandleOnFocus();
	}
	else
	{
		doNoPrintScreenByFlashHandleOnBlur();
	}
	window.setTimeout("checkNoPrintScreenByFlashHandle()", 500);
}

// fire no print event
//window.onblur = doNoPrintScreenByFlashHandleOnBlur;
//window.onfocus = doNoPrintScreenByFlashHandleOnFocus;

function checkNoPrintScreenByFlashCompleted()
{
	if (document && document.readyState == "complete")
	{
		checkNoPrintScreenByFlashHandle();
	}
	else
	{
		setTimeout("checkNoPrintScreenByFlashCompleted();", 1000);
	}
}
setTimeout("checkNoPrintScreenByFlashCompleted();", 1000);

function NoClickByKeyDown()
{
	if (event.ctrlKey && event.keyCode==80) 
	{
		event.returnValue = false;
		event.cancelBubble = true;
		event.keyCode = 0;
	}//Ctrl+P
}