function problem
I have a problem This is my code:
<html>
// this function is for table effect. When you have onmouse over its diferent color and when you click become red row.!!!
<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;
}
//Here i need to give a function wich send an ID
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,whichCla ssOnClick)
{
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>
<script type="text/javascript">
addTableRolloverEffect('myTable','tableRollOverEff ect1','tableRowClickEffect1');
addTableRolloverEffect('myTable2','tableRollOverEf fect2','tableRowClickEffect2');
</script>
<script language="javascript">
//and that is that function wich send ID to another table
function nad(ID, LINK_ID)
{
//alert("crm_dogodek.php?ID=" + ID );
if (LINK_ID != '')
{
self.location.href = 'crm_dogodek.php?ID=' + ID
+'&ID=' + ID;
}
else {
self.location.href = 'crm_dogodek.php?ID=' + ''
+'&POD_ID=' + ID;
}
}
function nazaj(ID)
{
//alert("crm_dogodek.php?ID=" + ID );
self.location.href = 'crm_dogodek.php?ID=' + ID
+'&POD_ID=' +ID;
}
function pod(ID)
{
self.location.href = 'crm_dogodek.php?ID=' + ID
+'&POD_ID=' + ID;
}
function pop(DOGODEK_ID,STRANKA_ID, VRSTA_DOGODKA_ID, DOGODEK_LINK_ID, DATUM_VNOSA, VELJA_OD, VELJA_DO, DATUM_ZAKLJUCKA,OPOMBA ,
DOKUMENT_POT, IME,NAZIV,NAZIV_OCENE)
{
self.location.href = 'crm_update.php?ID=' + DOGODEK_ID
+'&STRANKA_ID=' + STRANKA_ID
+'&VRSTA_DOGODKA_ID=' + VRSTA_DOGODKA_ID
+'&DOGODEK_LINK_ID=' + DOGODEK_LINK_ID
+'&DATUM_VNOSA =' + DATUM_VNOSA
+'&VELJA_OD=' + VELJA_OD
+'&VELJA_DO=' + VELJA_DO
+'&DATUM_ZAKLJUCKA=' + DATUM_ZAKLJUCKA
+'&OPOMBA =' + OPOMBA
+'&DOKUMENT_POT=' + DOKUMENT_POT
+'&IME=' + IME
+'&NAZIV=' + NAZIV
+'&NAZIV_OCENE=' + NAZIV_OCENE;
}
function brisi(DOGODEK_ID,STRANKA_ID, VRSTA_DOGODKA_ID, DOGODEK_LINK_ID, DATUM_VNOSA, VELJA_OD, VELJA_DO,
DATUM_ZAKLJUCKA,OPOMBA ,DOKUMENT_POT,IME,NAZIV,NAZIV_OCENE)
{
//alert("crm_delete?DOGODEK_ID=" + DOGODEK_ID );
self.location.href = 'crm_delete.php?DOGODEK_ID=' + DOGODEK_ID
+'&STRANKA_ID=' + STRANKA_ID
+'&VRSTA_DOGODKA_ID=' + VRSTA_DOGODKA_ID
+'&DOGODEK_LINK_ID=' + DOGODEK_LINK_ID
+'&DATUM_VNOSA =' + DATUM_VNOSA
+'&VELJA_OD=' + VELJA_OD
+'&VELJA_DO=' + VELJA_DO
+'&DATUM_ZAKLJUCKA=' + DATUM_ZAKLJUCKA
+'&OPOMBA =' + OPOMBA
+'&DOKUMENT_POT=' + DOKUMENT_POT
+'&IME=' + IME
+'&NAZIV=' + NAZIV
+'&NAZIV_OCENE=' + NAZIV_OCENE;
}
</script>
Thank you
|