/*
-----------------------------------------------------------------------
POP Key Controls - Client Script (ver 1.0)
-----------------------------------------------------------------------
*/
var __ctlcapturekey = 0;
var __onKeyPressCache = new Array();
function pop__KeyUpEventHandler()
{
	if(__ctlcapturekey == 2){
		//key e - Edit
		//alert("edit article - key code: " + event.keyCode + " " + window.location.href)
		if(event.keyCode == 69)
		{
			if(window.location.href.lastIndexOf("&mode=edit") == -1){
				//alert("edit article - key code: " + event.keyCode + " " + window.location.href)
				if(confirm("Are you sure you would like to edit this page? press OK to continue or CANCEL to return."))
				{
					window.location.href = window.location.href + "&mode=edit";
				}
			}else{
				if(confirm("Are you sure you would like to exit edit mode? press OK to continue or CANCEL to return."))
				{
					window.location.href = window.location.href.substring(0,window.location.href.length-10);
				}
			}
		}else if(event.keyCode == 73){
			if(window.location.href.lastIndexOf("&mode=editinplace") == -1){
				//alert("edit article - key code: " + event.keyCode + " " + window.location.href)
				if(confirm("Are you shure you would like to edit this page? press OK to continue or CANCEL to return."))
				{
					window.location.href = window.location.href + "&mode=editinplace";
				}
			}else{
				if(confirm("Are you shure you would like to exit edit mode? press OK to continue or CANCEL to return."))
				{
					window.location.href = window.location.href.substring(0,window.location.href.length-17);
				}
			}
		}
	}
	__ctlcapturekey = 0;
}

function pop__KeyDownEventHandler()
{
	
	if(__ctlcapturekey < 2){
		if(event.ctrlKey || event.shiftKey){
			__ctlcapturekey ++;
		}
	}
}

if(document.body)
{
	appendOnKeyUp('pop__KeyUpEventHandler()');
	appendOnKeyDown('pop__KeyDownEventHandler()');
}


/*
-----------------------------------------------------------------------
updated: 18.11.2003
-----------------------------------------------------------------------
*/