/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function




<!--

function openPopUp_Viewer(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop,videoWidth,videoHeight,imageBg) {  // v4.01

	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=yes,left="+posLeft+",top="+posTop);

	newWindow.document.open();

	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#000000" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" background="images/'+imageBg+'.gif">'); 

	if (imageType == "wmv"){

newWindow.document.write('<DIV align=\"right\">');
newWindow.document.write('<TABLE width=\"100%\" border=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\">');
newWindow.document.write('<TR >');
newWindow.document.write('<TD align=center bgcolor=\"#ACACAC\" colspan=\"2\"><FONT COLOR=\"#FFFFFF\" SIZE=\"1\" FACE=\"tahoma, verdana,');
newWindow.document.write('arial\"><B>CNN Video Clip</TD>');
newWindow.document.write('</TR>');
newWindow.document.write('<TR>');
newWindow.document.write('<TD valign=\"top\">');

	 	
	newWindow.document.write('<OBJECT ID=\"MediaPlayer1\" width='+videoWidth+' height='+videoHeight+' classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902\" standby=\"Loading Microsoft® Windows® Media Player components...'); 
    newWindow.document.write('type=\"application/x-oleobject\">');
	newWindow.document.write('<PARAM NAME=\"FileName\" VALUE=\"');
	newWindow.document.write(imageName);
	newWindow.document.write('\">');
	newWindow.document.write('<PARAM NAME=\"animationatStart\" VALUE=\"true\">');
  	newWindow.document.write('<PARAM NAME=\"transparentatStart\" VALUE=\"true\">');
  	newWindow.document.write('<PARAM NAME=\"autoStart\" VALUE=\"true\">');
  	newWindow.document.write('<PARAM NAME=\"showControls\" VALUE=\"true\">');
 	newWindow.document.write('<EMBED type=\"application/x-mplayer2\"');
	newWindow.document.write('pluginspage = \"http://www.microsoft.com/Windows/MediaPlayer/\"');
	newWindow.document.write('SRC=\"');
	newWindow.document.write(imageName);
	newWindow.document.write('\"');
	newWindow.document.write(' name=\"MediaPlayer1\" ');
	newWindow.document.write('width='+videoWidth+' ');
	newWindow.document.write('height='+videoHeight+' ');
	newWindow.document.write('AutoStart=true>');
  	newWindow.document.write('</EMBED>');
	newWindow.document.write('</OBJECT>');
	newWindow.document.write('</TD><TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR></TABLE></DIV>');

	
	} else {

	newWindow.document.write('<OBJECT CLASSID=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" WIDTH=\"320\" HEIGHT=\"270\"');
newWindow.document.write('CODEBASE=\"http://www.apple.com/qtactivex/qtplugin.cab\">');
newWindow.document.write('<PARAM name=\"SRC\" VALUE=\"');
newWindow.document.write(imageName);
newWindow.document.write('\">');
newWindow.document.write('<PARAM name=\"AUTOPLAY\" VALUE=\"true\">');
newWindow.document.write('<PARAM name=\"CONTROLLER\" VALUE=\"true\">');
newWindow.document.write('<PARAM name=\"LOOP\" VALUE=\"false\">');
newWindow.document.write('<EMBED SRC=\"');
newWindow.document.write(imageName);
newWindow.document.write('\" WIDTH=\"pixels\" HEIGHT=\"pixels\" AUTOPLAY=\"true\" CONTROLLER=\"true\" LOOP=\"false\" PLUGINSPAGE=\"http://www.apple.com/quicktime/download/\">');
newWindow.document.write('</EMBED>');
newWindow.document.write('</OBJECT>');

	} 

	newWindow.document.write('</body></html>');

	newWindow.document.close();

	newWindow.focus();

}


function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

//-->

<!--BEGIN Pop-up Windows Script------------------------------------------>
<!--
// Copyright 1999 - 2002 by Ray Stott, Pop-up Windows Script ver 2.0
// OK to use if this copyright is included
// Script is available at http://www.crays.com/jsc          

var popWin = null    // use this when referring to pop-up window
var winCount = 0
var winName = "popWin"
function openPopWin(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
  var d_winLeft = 20  // default, pixels from screen left to window left
  var d_winTop = 20   // default, pixels from screen top to window top
  winName = "popWin" + winCount++ //unique name for each pop-up window
  closePopWin()           // close any previously opened pop-up window
  if (openPopWin.arguments.length >= 4)  // any additional features? 
    winFeatures = "," + winFeatures
  else 
    winFeatures = "" 
  if (openPopWin.arguments.length == 6)  // location specified
    winFeatures += getLocation(winWidth, winHeight, winLeft, winTop)
  else
    winFeatures += getLocation(winWidth, winHeight, d_winLeft, d_winTop)
  popWin = window.open(winURL, winName, "width=" + winWidth 
           + ",height=" + winHeight + winFeatures)
  }
function closePopWin(){    // close pop-up window if it is open 
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) //do not close if early IE
    if(popWin != null) if(!popWin.closed) popWin.close() 
  }
function getLocation(winWidth, winHeight, winLeft, winTop){
  return ""
  }
//-->

// for Netscape 4+ and IE 4+
<!--
function getLocation(winWidth, winHeight, winLeft, winTop){
  var winLocation = ""
  if (winLeft < 0)
    winLeft = screen.width - winWidth + winLeft
  if (winTop < 0)
    winTop = screen.height - winHeight + winTop
  if (winTop == "cen")
    winTop = (screen.height - winHeight)/2 - 20
  if (winLeft == "cen")
    winLeft = (screen.width - winWidth)/2
  if (winLeft>0 & winTop>0)
    winLocation =  ",screenX=" + winLeft + ",left=" + winLeft	
                + ",screenY=" + winTop + ",top=" + winTop
  else
    winLocation = ""
  return winLocation
  }
//-->
<!--END Pop-up Windows Script------------------------------------------->
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -->
