Index: /FCKeditor/trunk/editor/_source/classes/fckcontextmenu.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fckcontextmenu.js	(revision 494)
+++ /FCKeditor/trunk/editor/_source/classes/fckcontextmenu.js	(revision 495)
@@ -95,7 +95,9 @@
 			FCKTools.CancelEvent( e ) ;
 			FCKContextMenu_AttachedElement_OnContextMenu( e, el._FCKContextMenu, el ) ;
+			return false ;
 		}
 		el = el.parentNode ;
 	}
+	return true ;
 }
 
Index: /FCKeditor/trunk/editor/_source/internals/fck.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fck.js	(revision 494)
+++ /FCKeditor/trunk/editor/_source/internals/fck.js	(revision 495)
@@ -572,5 +572,5 @@
 		if ( typeof element == 'string' )
 			element = this.EditorDocument.createElement( element ) ;
-		
+
 		var elementName = element.nodeName.toLowerCase() ;
 
@@ -583,5 +583,5 @@
 			range.SplitBlock() ;
 			range.InsertNode( element ) ;
-			
+
 			var next = FCKDomTools.GetNextSourceElement( element, false, null, [ 'hr','br','param','img','area','input' ] ) ;
 
@@ -590,9 +590,9 @@
 			{
 				next = this.EditorDocument.body.appendChild( this.EditorDocument.createElement( FCKConfig.EnterMode ) ) ;
-				
+
 				if ( FCKBrowserInfo.IsGecko )
 					next.innerHTML = GECKO_BOGUS ;
 			}
-			
+
 			if ( FCKListsLib.EmptyElements[ elementName ] == null )
 				range.MoveToElementEditStart( element ) ;
@@ -604,5 +604,5 @@
 			if ( FCKBrowserInfo.IsGecko )
 			{
-				if ( next ) 
+				if ( next )
 					next.scrollIntoView( false ) ;
 				element.scrollIntoView( false ) ;
@@ -688,4 +688,5 @@
 		if ( ! evt )
 			evt = window.event ;
+
 		var keystrokeValue = evt.keyCode ;
 
@@ -697,6 +698,6 @@
 			{
 				var range = document.selection.createRange() ;
-				if ( range.parentElement() != FCK.EditingArea.Textarea ) 
-					return ;
+				if ( range.parentElement() != FCK.EditingArea.Textarea )
+					return true ;
 				range.text = '\t' ;
 				range.select() ;
@@ -719,4 +720,6 @@
 				return ( evt.returnValue = false ) ;
 		}
+
+		return true ;
 	}
 } ;
Index: /FCKeditor/trunk/editor/_source/internals/fckselection_ie.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckselection_ie.js	(revision 494)
+++ /FCKeditor/trunk/editor/_source/internals/fckselection_ie.js	(revision 495)
@@ -47,8 +47,12 @@
 	{
 		case 'Control' :
-			if (!FCKSelection.GetSelectedElement()) return;
-			return FCKSelection.GetSelectedElement().parentElement ;
+			var el = FCKSelection.GetSelectedElement() ;
+			if ( !el )
+				return null ;
+			return el.parentElement ;
+
 		case 'None' :
 			return null ;
+
 		default :
 			return FCK.EditorDocument.selection.createRange().parentElement() ;
@@ -116,18 +120,25 @@
 {
 	var oRange = FCK.EditorDocument.selection.createRange() ;
-	if (!oRange.htmlText.search(/<TD /)) return;
-	var oCellRange = oRange.duplicate();
-	var oTable = this.MoveToAncestorNode("TABLE");
-	if (!oTable) return;
-	var aNodes = new Array();
-	for (var i = 0; i < oTable.cells.length; i++)
+
+	if ( !oRange.htmlText.search(/<TD /) )
+		return null ;
+
+	var oCellRange = oRange.duplicate() ;
+
+	var oTable = this.MoveToAncestorNode("TABLE") ;
+	if ( !oTable )
+		return null ;
+
+	var aNodes = new Array() ;
+
+	for ( var i = 0 ; i < oTable.cells.length ; i++ )
 	{
-		oCellRange.moveToElementText(oTable.cells[i]);
-		if (oRange.inRange(oCellRange))
-		{
-			aNodes[aNodes.length] = oTable.cells[i];
-		}
+		oCellRange.moveToElementText( oTable.cells[i] ) ;
+
+		if ( oRange.inRange(oCellRange) )
+			aNodes[aNodes.length] = oTable.cells[i] ;
 	}
-	return aNodes;
+
+	return aNodes ;
 }
 
Index: /FCKeditor/trunk/editor/_source/internals/fcktablehandler.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fcktablehandler.js	(revision 494)
+++ /FCKeditor/trunk/editor/_source/internals/fcktablehandler.js	(revision 495)
@@ -103,4 +103,92 @@
 
 FCKTableHandler.InsertColumn = function( insertBefore )
+{
+	// Get the cell where the selection is placed in.
+	var oCell = null ;
+	var nodes = this.GetSelectedCells() ;
+
+	if ( nodes && nodes.length )
+		oCell = nodes[ insertBefore ? 0 : ( nodes.length - 1 ) ] ;
+
+	if ( ! oCell )
+		return ;
+
+	// Get the cell's table.
+	var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
+
+	var iIndex = oCell.cellIndex ;
+
+	// Loop throw all rows available in the table.
+	for ( var i = 0 ; i < oTable.rows.length ; i++ )
+	{
+		// Get the row.
+		var oRow = oTable.rows[i] ;
+
+		// If the row doens't have enought cells, ignore it.
+		if ( oRow.cells.length < ( iIndex + 1 ) )
+			continue ;
+
+		oCell = oRow.cells[iIndex].cloneNode(false) ;
+
+		if ( FCKBrowserInfo.IsGecko )
+			oCell.innerHTML = GECKO_BOGUS ;
+
+		// Get back the currently selected cell.
+		var oBaseCell = oRow.cells[iIndex] ;
+
+		if ( insertBefore )
+			oRow.insertBefore( oCell, oBaseCell ) ;
+		else if ( oBaseCell.nextSibling )
+			oRow.insertBefore( oCell, oBaseCell.nextSibling ) ;
+		else
+			oRow.appendChild( oCell ) ;
+	}
+}
+
+FCKTableHandler.DeleteColumns = function( oCell )
+{
+	// if user selected multiple cols ( by selecting multiple cells ), walk
+	// the selected cell list and delete the rows containing the selected cells
+	if ( !oCell  )
+	{
+		var aColsToDelete = FCKTableHandler.GetSelectedCells();
+		for ( var i = aColsToDelete.length; i >= 0; i--  )
+		{
+			if ( aColsToDelete[i]  )
+				FCKTableHandler.DeleteColumns( aColsToDelete[i]  );
+		}
+		return;
+	}
+
+	if ( !oCell ) return ;
+
+	// Get the cell's table.
+	var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
+
+	// Get the cell index.
+	var iIndex = oCell.cellIndex ;
+
+	// Loop throw all rows (from down to up, because it's possible that some
+	// rows will be deleted).
+	for ( var i = oTable.rows.length - 1 ; i >= 0 ; i-- )
+	{
+		// Get the row.
+		var oRow = oTable.rows[i] ;
+
+		// If the cell to be removed is the first one and the row has just one cell.
+		if ( iIndex == 0 && oRow.cells.length == 1 )
+		{
+			// Remove the entire row.
+			FCKTableHandler.DeleteRows( oRow ) ;
+			continue ;
+		}
+
+		// If the cell to be removed exists the delete it.
+		if ( oRow.cells[iIndex] )
+			oRow.removeChild( oRow.cells[iIndex] ) ;
+	}
+}
+
+FCKTableHandler.InsertCell = function( cell, insertBefore )
 {
 	// Get the cell where the selection is placed in.
@@ -112,90 +200,4 @@
 		return null ;
 
-	// Get the cell's table.
-	var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
-
-	var iIndex = oCell.cellIndex ;
-
-	// Loop throw all rows available in the table.
-	for ( var i = 0 ; i < oTable.rows.length ; i++ )
-	{
-		// Get the row.
-		var oRow = oTable.rows[i] ;
-
-		// If the row doens't have enought cells, ignore it.
-		if ( oRow.cells.length < ( iIndex + 1 ) )
-			continue ;
-
-		oCell = oRow.cells[iIndex].cloneNode(false) ;
-
-		if ( FCKBrowserInfo.IsGecko )
-			oCell.innerHTML = GECKO_BOGUS ;
-
-		// Get back the currently selected cell.
-		var oBaseCell = oRow.cells[iIndex] ;
-
-		if ( insertBefore )
-			oRow.insertBefore( oCell, oBaseCell ) ;
-		else if ( oBaseCell.nextSibling )
-			oRow.insertBefore( oCell, oBaseCell.nextSibling ) ;
-		else
-			oRow.appendChild( oCell ) ;
-	}
-}
-
-FCKTableHandler.DeleteColumns = function( oCell )
-{
-	// if user selected multiple cols ( by selecting multiple cells ), walk
-	// the selected cell list and delete the rows containing the selected cells
-	if ( !oCell  )
-	{
-		var aColsToDelete = FCKTableHandler.GetSelectedCells();
-		for ( var i = aColsToDelete.length; i >= 0; i--  )
-		{
-			if ( aColsToDelete[i]  )
-				FCKTableHandler.DeleteColumns( aColsToDelete[i]  );
-		}
-		return;
-	}
-
-	if ( !oCell ) return ;
-
-	// Get the cell's table.
-	var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
-
-	// Get the cell index.
-	var iIndex = oCell.cellIndex ;
-
-	// Loop throw all rows (from down to up, because it's possible that some
-	// rows will be deleted).
-	for ( var i = oTable.rows.length - 1 ; i >= 0 ; i-- )
-	{
-		// Get the row.
-		var oRow = oTable.rows[i] ;
-
-		// If the cell to be removed is the first one and the row has just one cell.
-		if ( iIndex == 0 && oRow.cells.length == 1 )
-		{
-			// Remove the entire row.
-			FCKTableHandler.DeleteRows( oRow ) ;
-			continue ;
-		}
-
-		// If the cell to be removed exists the delete it.
-		if ( oRow.cells[iIndex] )
-			oRow.removeChild( oRow.cells[iIndex] ) ;
-	}
-}
-
-FCKTableHandler.InsertCell = function( cell, insertBefore )
-{
-	// Get the cell where the selection is placed in.
-	var oCell = null ;
-	var nodes = this.GetSelectedCells() ;
-	if ( nodes && nodes.length )
-		oCell = nodes[ insertBefore ? 0 : ( nodes.length - 1 ) ] ;
-	if ( ! oCell )
-		return null ;
-
 	// Create the new cell element to be added.
 	var oNewCell = FCK.EditorDocument.createElement( 'TD' ) ;
Index: /FCKeditor/trunk/editor/dialog/fck_paste.html
===================================================================
--- /FCKeditor/trunk/editor/dialog/fck_paste.html	(revision 494)
+++ /FCKeditor/trunk/editor/dialog/fck_paste.html	(revision 495)
@@ -40,5 +40,5 @@
 	// First of all, translate the dialog box texts
 	oEditor.FCKLanguageManager.TranslatePage(document) ;
-	
+
 	var sPastingType = window.parent.dialogArguments.CustomValue ;
 
@@ -112,5 +112,5 @@
 		var marker = [] ;
 		for ( var i = 0 ; i < 5 ; i++ )
-			marker.push( parseInt(Math.random() * 100000) ) ;
+			marker.push( parseInt(Math.random() * 100000, 10 ) ) ;
 		marker = marker.join( "" ) ;
 		range.InsertNode ( oDoc.createTextNode( marker ) ) ;
Index: /FCKeditor/trunk/editor/dialog/fck_replace.html
===================================================================
--- /FCKeditor/trunk/editor/dialog/fck_replace.html	(revision 494)
+++ /FCKeditor/trunk/editor/dialog/fck_replace.html	(revision 495)
@@ -35,5 +35,5 @@
 	// First of all, translate the dialog box texts.
 	oEditor.FCKLanguageManager.TranslatePage( document ) ;
-	
+
 	window.parent.SetAutoSize( true ) ;
 
@@ -201,4 +201,6 @@
 				this._State = this._Overlap[ this._State ];
 		}
+
+		return null ;
 	},
 	"Reset" : function()
@@ -222,61 +224,60 @@
 		//	- Reset KMP matcher if we encountered a block element.
 		var data = GetData( cursor ) ;
-		if ( data == null)
+		if ( data )
 		{
-			// do nothing, skip other cases
-		}
-		else if ( data.tagName )
-		{
-			if ( oEditor.FCKListsLib.BlockElements[ data.tagName.toLowerCase() ] )
-				matcher.Reset();
-		}
-		else if ( data.charAt != undefined )
-		{
-			matchState = matcher.FeedCharacter(data) ;
-
-			if ( matchState == KMP_NOMATCH )
-				matchBookmark = null ;
-			else if ( matchState == KMP_ADVANCED && matchBookmark == null )
-				matchBookmark = { "Start" : cursor.concat( [] ) } ;
-			else if ( matchState == KMP_MATCHED )
+			if ( data.tagName )
 			{
-				matchBookmark.End = cursor.concat( [] ) ;
-				matchBookmark.End[ matchBookmark.End.length - 1 ]++;
-
-				// Wait, do we have to match a whole word?
-				if ( GetMatchWord() )
+				if ( oEditor.FCKListsLib.BlockElements[ data.tagName.toLowerCase() ] )
+					matcher.Reset();
+			}
+			else if ( data.charAt != undefined )
+			{
+				matchState = matcher.FeedCharacter(data) ;
+
+				if ( matchState == KMP_NOMATCH )
+					matchBookmark = null ;
+				else if ( matchState == KMP_ADVANCED && matchBookmark == null )
+					matchBookmark = { "Start" : cursor.concat( [] ) } ;
+				else if ( matchState == KMP_MATCHED )
 				{
-					var startOk = false ;
-					var endOk = false ;
-					var start = matchBookmark.Start ;
-					var end = matchBookmark.End ;
-					if ( start[ start.length - 1 ] == 0 )
-						startOk = true ;
+					matchBookmark.End = cursor.concat( [] ) ;
+					matchBookmark.End[ matchBookmark.End.length - 1 ]++;
+
+					// Wait, do we have to match a whole word?
+					if ( GetMatchWord() )
+					{
+						var startOk = false ;
+						var endOk = false ;
+						var start = matchBookmark.Start ;
+						var end = matchBookmark.End ;
+						if ( start[ start.length - 1 ] == 0 )
+							startOk = true ;
+						else
+						{
+							var cursorBeforeStart = start.slice( 0, start.length - 1 ) ;
+							cursorBeforeStart.push( start[ start.length - 1 ] - 1 ) ;
+							var dataBeforeStart = GetData( cursorBeforeStart ) ;
+							if ( dataBeforeStart == null || dataBeforeStart.charAt == undefined )
+								startOk = true ;
+							else if ( CheckIsWhitespace( dataBeforeStart ) )
+								startOk = true ;
+						}
+
+						// this is already one character beyond the last char, no need to move
+						var cursorAfterEnd = end ;
+						var dataAfterEnd = GetData( cursorAfterEnd );
+						if ( dataAfterEnd == null || dataAfterEnd.charAt == undefined )
+							endOk = true ;
+						else if ( CheckIsWhitespace( dataAfterEnd ) )
+							endOk = true ;
+
+						if ( startOk && endOk )
+							break ;
+						else
+							matcher.Reset() ;
+					}
 					else
-					{
-						var cursorBeforeStart = start.slice( 0, start.length - 1 ) ;
-						cursorBeforeStart.push( start[ start.length - 1 ] - 1 ) ;
-						var dataBeforeStart = GetData( cursorBeforeStart ) ;
-						if ( dataBeforeStart == null || dataBeforeStart.charAt == undefined )
-							startOk = true ;
-						else if ( CheckIsWhitespace( dataBeforeStart ) )
-							startOk = true ;
-					}
-
-					// this is already one character beyond the last char, no need to move
-					var cursorAfterEnd = end ;
-					var dataAfterEnd = GetData( cursorAfterEnd );
-					if ( dataAfterEnd == null || dataAfterEnd.charAt == undefined )
-						endOk = true ;
-					else if ( CheckIsWhitespace( dataAfterEnd ) )
-						endOk = true ;
-
-					if ( startOk && endOk )
 						break ;
-					else
-						matcher.Reset() ;
 				}
-				else
-					break ;
 			}
 		}
Index: /FCKeditor/trunk/editor/plugins/dragresizetable/fckplugin.js
===================================================================
--- /FCKeditor/trunk/editor/plugins/dragresizetable/fckplugin.js	(revision 494)
+++ /FCKeditor/trunk/editor/plugins/dragresizetable/fckplugin.js	(revision 495)
@@ -15,6 +15,6 @@
 		var xMin = myCoords.x ;
 		var yMin = myCoords.y ;
-		var xMax = parseInt( xMin ) + parseInt( domNode.offsetWidth ) ;
-		var yMax = parseInt( yMin ) + parseInt( domNode.offsetHeight ) ;
+		var xMax = parseInt( xMin, 10 ) + parseInt( domNode.offsetWidth, 10 ) ;
+		var yMax = parseInt( yMin, 10 ) + parseInt( domNode.offsetHeight, 10 ) ;
 		if ( pos.x >= xMin && pos.x <= xMax && pos.y >= yMin && pos.y <= yMax )
 			return true;
@@ -44,5 +44,5 @@
 		{
 			var pos = FCKTools.GetWindowPosition( w, cells[i] ) ;
-			var rightX = pos.x + parseInt( cells[i].clientWidth ) ;
+			var rightX = pos.x + parseInt( cells[i].clientWidth, 10 ) ;
 			var rxDist = mouse.x - rightX ;
 			var yDist = mouse.y - ( pos.y + ( cells[i].clientHeight / 2 ) ) ;
@@ -77,6 +77,6 @@
 		for ( var i = 0 ; i <= this._LeftCell.cellIndex ; i++ )
 		{
-			var colSpan = parseInt( row.cells.item( i ).colSpan ) ;
-			if ( colSpan != colSpan )
+			var colSpan = parseInt( row.cells.item( i ).colSpan, 10 ) ;
+			if ( isNaN( colSpan ) )
 				colSpan = 1 ;
 			colIndex += colSpan ;
@@ -155,6 +155,6 @@
 				var cell = row.cells.item( c ) ;
 				var width = FCKDragTableHandler._GetCellWidth( table, cell ) ;
-				var colSpan = parseInt( cell.colSpan ) ;
-				if ( colSpan != colSpan )
+				var colSpan = parseInt( cell.colSpan, 10 ) ;
+				if ( isNaN( colSpan ) )
 					colSpan = 1 ;
 				if ( colArray.length < colIndex + colSpan )
@@ -212,6 +212,6 @@
 			{
 				var cell = row.cells.item( c ) ;
-				var colSpan = parseInt( cell.colSpan ) ;
-				if ( colSpan != colSpan )
+				var colSpan = parseInt( cell.colSpan, 10 ) ;
+				if ( isNaN( colSpan ) )
 					colSpan = 1 ;
 				var cellWidth = 0 ;
@@ -248,33 +248,33 @@
 	"_GetCellPadding" : function( table, cell )
 	{
-		var attrGuess = parseInt( table.cellPadding ) * 2 ;
+		var attrGuess = parseInt( table.cellPadding, 10 ) * 2 ;
 		var cssGuess = null ;
 		if ( typeof( window.getComputedStyle ) == "function" )
 		{
 			var styleObj = window.getComputedStyle( cell, null ) ;
-			cssGuess = parseInt( styleObj.getPropertyValue( "padding-left" ) ) + 
-				parseInt( styleObj.getPropertyValue( "padding-right" ) ) ;
-		}
-		else
-			cssGuess = parseInt( cell.currentStyle.paddingLeft ) + parseInt (cell.currentStyle.paddingRight ) ;
+			cssGuess = parseInt( styleObj.getPropertyValue( "padding-left" ), 10 ) + 
+				parseInt( styleObj.getPropertyValue( "padding-right" ), 10 ) ;
+		}
+		else
+			cssGuess = parseInt( cell.currentStyle.paddingLeft, 10 ) + parseInt (cell.currentStyle.paddingRight, 10 ) ;
 
 		var cssRuntime = cell.style.padding ;
-		if ( parseInt( cssRuntime ) == parseInt( cssRuntime ) )
-			cssGuess = parseInt( cssRuntime ) * 2 ;
+		if ( !isNaN( parseInt( cssRuntime, 10 ) ) )
+			cssGuess = parseInt( cssRuntime, 10 ) * 2 ;
 		else
 		{
 			cssRuntime = cell.style.paddingLeft ;
-			if ( parseInt( cssRuntime ) == parseInt( cssRuntime ) )
-				cssGuess = parseInt( cssRuntime ) ;
+			if ( !isNaN( parseInt( cssRuntime, 10 ) ) )
+				cssGuess = parseInt( cssRuntime, 10 ) ;
 			cssRuntime = cell.style.paddingRight ;
-			if ( parseInt( cssRuntime ) == parseInt( cssRuntime ) )
-				cssGuess += parseInt( cssRuntime ) ;
-		}
-
-		attrGuess = parseInt( attrGuess ) ;
-		cssGuess = parseInt( cssGuess ) ;
-		if ( attrGuess != attrGuess )
+			if ( !isNaN( parseInt( cssRuntime, 10 ) ) )
+				cssGuess += parseInt( cssRuntime, 10 ) ;
+		}
+
+		attrGuess = parseInt( attrGuess, 10 ) ;
+		cssGuess = parseInt( cssGuess, 10 ) ;
+		if ( isNaN( attrGuess ) )
 			attrGuess = 0 ;
-		if ( cssGuess != cssGuess )
+		if ( isNaN( cssGuess ) )
 			cssGuess = 0 ;
 		return Math.max( attrGuess, cssGuess ) ;
@@ -287,6 +287,6 @@
 	"_GetCellWidth" : function( table, cell )
 	{
-		var clientWidth = parseInt( cell.clientWidth ) ;
-		if ( clientWidth != clientWidth )		// NaN possible? lets just be safe...
+		var clientWidth = parseInt( cell.clientWidth, 10 ) ;
+		if ( isNaN( clientWidth ) )
 			clientWidth = 0 ;
 		return clientWidth - this._GetCellPadding( table, cell ) ;
@@ -457,9 +457,9 @@
 		paddingBar.style.top = barTop + "px" ;
 		paddingBar.style.height = barHeight + "px" ;
-		var bw = parseInt( table.border ) ;
-		if ( bw != bw )
+		var bw = parseInt( table.border, 10 ) ;
+		if ( isNaN( bw ) )
 			bw = 0 ;
-		var cs = parseInt( table.cellSpacing ) ;
-		if ( cs != cs )
+		var cs = parseInt( table.cellSpacing, 10 ) ;
+		if ( isNaN( cs ) )
 			cs = 0 ;
 		var barWidth = Math.max( bw+100, cs+100 ) ;
