function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function setPointer(theRow, thePointerColor, theNormalBgColor)
{
    var theCells = null;

    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var currentColor = null;
    var newColor     = null;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', newColor, 0);
        } // end for
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = newColor;
        }
    }

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

/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

/*PRELOAD TOP CAPTION IMAGES*/

topBlank = new Image();
topBlank.src = 'images/top_text.gif';

topSizeit = new Image();
topSizeit.src = 'captions/top/sizeit.gif';
topTradeit = new Image();
topTradeit.src = 'captions/top/tradeit.gif';
topCheckit = new Image();
topCheckit.src = 'captions/top/checkit.gif';
topTrackit = new Image();
topTrackit.src = 'captions/top/trackit.gif';
topRiskReports = new Image();
topRiskReports.src = 'captions/top/risk_reports.gif';
topProtectit = new Image();
topProtectit.src = 'captions/top/protectit.gif';
topTradeRegister = new Image();
topTradeRegister.src = 'captions/top/trade_register.gif';
topDerivCalc = new Image();
topDerivCalc.src = 'captions/top/deriv_calc.gif';
topMultMarkets = new Image();
topMultMarkets.src = 'captions/top/mult_markets.gif';
topMultCurrency = new Image();
topMultCurrency.src = 'captions/top/mult_currency.gif';
topMultLang = new Image();
topMultLang.src = 'captions/top/mult_lang.gif';
topMultPort = new Image();
topMultPort.src = 'captions/top/mult_port.gif';
topPerfReports = new Image();
topPerfReports.src = 'captions/top/perf_reports.gif';

/*PRELOAD BOTTOM CAPTION IMAGES*/

bottomBlank = new Image();
bottomBlank.src = 'images/mm_logo_text.gif';

bottomSizeit = new Image();
bottomSizeit.src = 'captions/bottom/sizeit.gif';
bottomTradeit = new Image();
bottomTradeit.src = 'captions/bottom/tradeit.gif';
bottomCheckit = new Image();
bottomCheckit.src = 'captions/bottom/checkit.gif';
bottomTrackit = new Image();
bottomTrackit.src = 'captions/bottom/trackit.gif';
bottomRiskReports = new Image();
bottomRiskReports.src = 'captions/bottom/risk_reports.gif';
bottomProtectit = new Image();
bottomProtectit.src = 'captions/bottom/protectit.gif';
bottomTradeRegister = new Image();
bottomTradeRegister.src = 'captions/bottom/trade_register.gif';
bottomDerivCalc = new Image();
bottomDerivCalc.src = 'captions/bottom/deriv_calc.gif';
bottomMultMarkets = new Image();
bottomMultMarkets.src = 'captions/bottom/mult_markets.gif';
bottomMultCurrency = new Image();
bottomMultCurrency.src = 'captions/bottom/mult_currency.gif';
bottomMultLang = new Image();
bottomMultLang.src = 'captions/bottom/mult_lang.gif';
bottomMultPort = new Image();
bottomMultPort.src = 'captions/bottom/mult_port.gif';
bottomPerfReports = new Image();
bottomPerfReports.src = 'captions/bottom/perf_reports.gif';

/*caption FUNCTION
 *SWAPS topText AND mmLogoText IMAGES BASED UPON WHICH AREA OF THE IMAGE MAPS THE MOUSE IS OVER.
 *
 *ARGUMENTS:
 *-over
 *--DEFINES AREA MOUSE IS CURRENTLY OVER, PASSING IT TO DETERMINE WHAT IMAGES TO SWAP THE CURRENT IMAGES WITH.
 */

function caption(over) {
	document.images['topText'].src = eval('top' + over + '.src');
	document.images['mmLogoText'].src = eval('bottom' + over + '.src');
	return true;
}

/*captionOut FUNCTION
 *SWAPS topText AND mmLogoText IMAGES BACK TO ORIGINAL IMAGES.
 */

function captionOut() {
	document.images['topText'].src = topBlank.src;
	document.images['mmLogoText'].src = bottomBlank.src;
	return true;
}
