
// highlight a table row
function highlightrow(theRow, thePointerColor)
{
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = thePointerColor;
    }

    return true;
}

function preview() // this function opens the preview popup (needed for popup blocker woraround)
{
	previewWindow = window.open('view.php?action=preview&init=1','preview','');
}

function preview2() { // this function updates the url of the already opened popup window
	if(window.previewWindow!=null) {
		window.previewWindow.location.href='view.php?action=preview';
		window.previewWindow.focus();
	}
}

function popup(src,windowname,width,height,screenX,screenY) {
	eval(windowname+" = window.open(src,windowname,'status=no,scrollbars=yes,resizable=no,width='+width+',height='+height+',screenX='+screenX+',screenY='+screenY+',top='+screenX+',left='+screenY);");
	if(window.windowname!=null) {
		eval('window.'+windowname+'.focus();');
	}
}