Code:
<html>
//this script is for table colors and make color row red when i click on it.
<style type="text/css">
/* These classes are used by the script as rollover effect for table 1 and 2 */
.tableRollOverEffect1{
background-color:#cdffff;
color:black;
}
.tableRollOverEffect2{
background-color:#cdffff;
color:#black;
}
.tableRowClickEffect1{
background-color:#ff0000;
color:#FFF;
}
.tableRowClickEffect2{
background-color:#ff0000;
color:#FFF;
}
</style>
<script type="text/javascript">
var arrayOfRolloverClasses = new Array();
var arrayOfClickClasses = new Array();
var activeRow = false;
var activeRowClickArray = new Array();
function highlightTableRow()
{
var tableObj = this.parentNode;
if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;
if(this!=activeRow){
this.setAttribute('origCl',this.className);
this.origCl = this.className;
}
this.className = arrayOfRolloverClasses[tableObj.id];
activeRow = this;
}
function clickOnTableRow()
{
var tableObj = this.parentNode;
if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;
if(activeRowClickArray[tableObj.id] && this!=activeRowClickArray[tableObj.id]){
activeRowClickArray[tableObj.id].className='DOGODEK_ID';
}
this.className = arrayOfClickClasses[tableObj.id];
activeRowClickArray[tableObj.id] = this;
}
function resetRowStyle()
{
var tableObj = this.parentNode;
if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;
if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){
this.className = arrayOfClickClasses[tableObj.id];
return;
}
var origCl = this.getAttribute('origCl');
if(!origCl)origCl = this.origCl;
this.className=origCl;
}
function addTableRolloverEffect(tableId,whichClass,whichClassOnClick)
{
arrayOfRolloverClasses[tableId] = whichClass;
arrayOfClickClasses[tableId] = whichClassOnClick;
var tableObj = document.getElementById(tableId);
var tBody = tableObj.getElementsByTagName('TBODY');
if(tBody){
var rows = tBody[0].getElementsByTagName('TR');
}else{
var rows = tableObj.getElementsByTagName('TR');
}
for(var no=0;no<rows.length;no++){
rows[no].onmouseover = highlightTableRow;
rows[no].onmouseout = resetRowStyle;
if(whichClassOnClick){
rows[no].onclick = clickOnTableRow;
}
}
}
</script>
include ('table');
<script type="text/javascript">
addTableRolloverEffect('myTable','tableRollOverEffect1','tableRowClickEffect1');
addTableRolloverEffect('myTable2','tableRollOverEffect2','tableRowClickEffect2');
</script>
<script language="javascript">
//This code is for send ID from one table to another.
function nad(DOGODEK_ID, DOGODEK_LINK_ID)
{
//alert("crm_dogodek.php?DOGODEK_ID=" + DOGODEK_ID );
if (DOGODEK_LINK_ID != '')
{
self.location.href = 'crm_dogodek.php?DOGODEK_ID=' + DOGODEK_ID
+'&POD_ID=' + DOGODEK_ID;
}
else {
self.location.href = 'crm_dogodek.php?DOGODEK_ID=' + ''
+'&POD_ID=' + DOGODEK_ID;
}
}
So I wont that code give to first java function. So then when I click on a table ID goes to another table but not with URL. Now I have to click on img src in a table and works but I wish to click on a row becouse i don't wont to have a pictures in a table.
THANK you