function showContent(id,source){
	switchToLast(source);
	var table= $E("contentTable");
	var rows = table.rows;
	for(var i =1 ; i < rows.length;i++ ){
		rows[i].style.display="none";
	}
	$E(id).style.display="";
}

function switchToLast(source){
	var tabbedTableHead = $E("tabbedTableHead");
	var rows = tabbedTableHead.rows;
	var clickRow = null;
	var rowNum = 0;
	for(var i=0;i<rows.length;i++){
		if(isParent(rows[i],source)){
			clickRow = rows[i];
			rowNum = i;
		}
	}
	if(rowNum != rowNum.length -1){
		swapNode(clickRow,rows[rowNum]);
	}
}

function swapNode(node1,node2){
     var _parent=node1.parentNode;
     var _t1=node1.nextSubling;
     var _t2=node2.nextSubling;
     if(_t1)parent.insertBefore(node2,_t1);
     else _parent.appendChild(node2);         
     if(_t2)parent.insertBefore(node1,_t2);
     else _parent.appendChild(node1);
}

function isParent(p,elem){
	var e = elem;
	while(e){
		if(e === p){
			return true;
		}
		e = e.parentNode;
	}
	return false;
}