<!--
function MM_preloadImages() { //v1.2
	if (document.images) {
	var imgFiles = MM_preloadImages.arguments;
	var preloadArray = new Array();
	for (var i=0; i<imgFiles.length; i++) {
		preloadArray[i] = new Image;
		preloadArray[i].src = imgFiles[i];
	}
	}
}

function MM_swapImage() { //v1.2
	var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
	for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
	objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
	if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
		(objStr.indexOf('document.all[')   ==0 && document.all   ==null))
		objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
	obj = eval(objStr);
	if (obj != null) {
		swapArray[j++] = obj;
		swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
		obj.src = MM_swapImage.arguments[i+2];
	} }
	document.MM_swapImgData = swapArray; //used for restore
}

function MM_swapImgRestore() { //v1.2
	if (document.MM_swapImgData != null)
	for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
		document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}
function ScrollBottomMenu() {
	ScrollBottomMenu.arguments[(navigator.appName == 'Netscape')?0:1].scrollIntoView();
}

/**
 * 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
 */

var bForbidLink = false;
 
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theLink)
{
    var theCells = null;

    if (theAction == 'click' && !bForbidLink) {
        location.href = theLink;
    }
    bForbidLink = false;
        
    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '')
        || 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;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
    }

    // 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 ForbidLink() {
	bForbidLink = true;
}

var lastsubmenu = '';
var lastsubmenu2 = '';
var currentmenu = null;

function showmenu(id) {
	currentmenu = id;
	if (id.charAt(1)=='x') 	lastsubmenu2 = lastsubmenu = id;
	var d = document.getElementById('smenu'+id);
	d.style.display='block'; 
	document.getElementById('vmenu'+id).style.visibility='visible';
	for (var i=0; i<=10; i++) {
		if (i!=id.charAt(0)) {
			m = document.getElementById('smenu'+i);
			if (m) {
				if ((m != d) && (m.style.display == 'block'))
						m.style.display = 'none';				
			}
		}
		//Hide sub-menus
		if (lastsubmenu2=='' || (id.charAt(1)=='x' && id.charAt(2)!=i)) {
			m = document.getElementById('smenu'+id.charAt(0)+'x'+i);
			if (m) {
				if ((m != d) && (m.style.display == 'block'))
						m.style.display = 'none';				
			}
		}
	}
	lastsubmenu2 = lastsubmenu;
	if (id.charAt(1)!='x') lastsubmenu = '';
}

var timerId = null;

function dohidemenu(id, timerId) {
	if (currentmenu==id) {
		return;
	}
	var v = document.getElementById('vmenu'+id);
	v.style.visibility='hidden';
	var m = document.getElementById('smenu'+id);
	m.style.display = 'none';
	clearTimeout(timerId)
}

function hidemenu(id) {
	timerId = setTimeout('dohidemenu("'+id+'", '+timerId+')', 300)
	currentmenu = -1;
}

function refreshmenu() {return;
	for (var i=0; i<=10; i++) {
		m = document.getElementById('smenu'+i);
		v = document.getElementById('vmenu'+i);
		if (v) {
			if (v.style.visibility == 'hidden' && m.style.display == 'block')
				timerId = setTimeout("if (document.getElementById('vmenu'+"+i+").style.visibility == 'hidden') document.getElementById('smenu'+"+i+").style.display='none'; clearTimeout("+timerId+")", 300);
		}
	}
}

var mapWindow;

function OpenWindow(target, width, height) {
	if (mapWindow) mapWindow.close();
	mapWindow = window.open(target,'Viewer','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,status=0,width='+width+',height='+height+',top=0,left=0')
	mapWindow.focus()
}

//-->
