function table_insertObject(sObjectType,bBefore)
{
	var pos=0;
	if(!bBefore)pos=1;

	var container=getSelectedContainer();
	if(container!=null)
	{
		//find the table element
		var table=getContainerOfType(container,"TABLE");
		if(table!=null)
		{
			//find the selected td / tr
			var td=getContainerOfType(container,"TD");
			var tr=getContainerOfType(container,"TR");

			if(tr!=null && td!=null)
			{
				var tdindex=td.cellIndex;
				switch(sObjectType)
				{
					//insert a new row and create cols in it
					case "ROW":
						var newRow=table.insertRow(tr.rowIndex+pos);
						for(x=0;x<tr.cells.length;x++)
						{
							newRow.insertCell();
						}
						break;
					//insert a new column in each row
					case "COL":
						for(x=0;x<table.rows.length;x++)
						{
							table.rows[x].insertCell(tdindex+pos);
						}
						break;
					default:
						break;
				}
			}
		}
	}
}
//bBefore : boolean (true : inserts before selected, false : inserts after selected object)
bBefore : boolean (true : inserts before selected, false : inserts after selected object)
bBefore : boolean ( true : inserts before selected false : inserts after selected object )
function table_insertObject(sObjectType,bBefore)
{
	var pos=0;
	if(!bBefore)pos=1;
	var container=getSelectedContainer();
	if(container!=null)
	{
		var table=getContainerOfType(container,"TABLE");
		if(table!=null)
		{
			var td=getContainerOfType(container,"TD");
			var tr=getContainerOfType(container,"TR");
			if(tr!=null && td!=null)
			{
				var tdindex=td.cellIndex;
				switch(sObjectType)
				{
					case "ROW":
						var newRow=table.insertRow(tr.rowIndex+pos);
						for(x=0;x<tr.cells.length;x++)
						{
							newRow.insertCell();
						}
						break;
					case "COL":
						for(x=0;x<table.rows.length;x++)
						{
							table.rows[x].insertCell(tdindex+pos);
						}
						break;
					default:
						break;
				}
			}
		}
	}
}
function table_insertObject ( sObjectType , bBefore ) { var pos = 0 ; if ( ! bBefore ) pos = 1 ; var container = getSelectedContainer ( ) ; if ( container != null ) { var table = getContainerOfType ( container , "TABLE" ) ; if ( table != null ) { var td = getContainerOfType ( container , "TD" ) ; var tr = getContainerOfType ( container , "TR" ) ; if ( tr != null && td != null ) { var tdindex = td . cellIndex ; switch ( sObjectType ) { case "ROW" : var newRow = table . insertRow ( tr . rowIndex + pos ) ; for ( x = 0 ; x < tr . cells . length ; x ++ ) { newRow . insertCell ( ) ; } break ; case "COL" : for ( x = 0 ; x < table . rows . length ; x ++ ) { table . rows [ x ] . insertCell ( tdindex + pos ) ; } break ; default : break ; } } } } }
bBefore : boolean (true : inserts before selected, false : inserts after selected object)
bBefore : boolean ( true : inserts before selected false : inserts after selected object )
//find the table element //find the selected td / tr //insert a new row and create cols in it //insert a new column in each row