/*------------------------- backspace -----------------------------------*/
function handleBkKeyDown(e)
{

    if(e.which){ //NN
	keycode = e.which;
	}
	else {
	keycode = e.keyCode;  // IE
	}
	
	if(keycode==8){  
		if (document.all)
		{
			var range = document.selection.createRange();
			if (range.length > 0)
			{
			 // control range is selected – ref.: controlRange collection
				var selectedElement = range(0);
				if (selectedElement.tagName == "IMG" || selectedElement.tagName == "TABLE" || selectedElement.tagName == "EMBED")
				{
                // alert(selectedElement.tagName);
                 e.returnValue = false;
				}
			}
			else
			{
				e.returnValue = true;// text range is selected – ref.: TextRange object
			}
		 }
		 
	}
}

/*------------------------- Display Custom Dialog -----------------------------------*/
function insClipArt(RadEditorContentArea, editorID)
{
//alert(editorID);
	var result = radEditorShowDialog(editorID, "RadControls/Editor/Dialogs/tree/deFset.html?editorID=" + editorID, null, 500, 400);
	
	if (document.all)
	{
		if (result != null)
		{
			//Making the r.a.d.editor content area active.
			RadEditorContentArea.setActive();
			var range = document.selection.createRange();
			//Here we paste the HTML generated by the Custom Dialog.
			range.pasteHTML(result);
		}
	}
	else
	{
		var msgEr = "Sorry, but the Clip Art feature only works with Microsoft Internet Explorer version 5.5 and later.";
		//msgEr+= "\n the browser you are now using is <%= bVersion %>";
		//msgEr+= "\n See the inetTeacher website 'Support' page for more information.";
				alert(msgEr);
	}
}


