/*
 * File         : common.js
 * Date         : 2002-04-10
 * Author       : Eric Girard
 * Description  : Common Javascipt function.
 */

// Change de top and bottom frame
// up	  : Up page parameters
// bottom : Bottom page parameters
function changeMenu(up, bottom) {
	if (up != "") {
		top.up.location.href = "/skv3/common/php/up.php?" + up;
	}

	if (bottom != "") {
		top.bottom.location.href = "/skv3/common/php/bottom.php?" + bottom;
	}
}

// Common function for opening windows
// url : Url page
function openWindow(url) {
	win = window.open(url, '');
			  //'toolbar=yes, scrollbars=yes, menubar=yes, resizable=yes');
	win.focus();
}

// Common function for opening parameters choice windows
// url : Url page
function openWindowChoice(url) {
	win= window.open(url, 'windowChoice', 'toolbar=no, scrollbars=no, menubar=no, resizable=yes, width=600, height=375');
	win.focus();
}

// Write a message in the status bar
function writeStatusMsg(msg) {
	window.defaultStatus = msg;
}

// Hightlight row
// state : IN(onmouseover) or OUT(onMouseout)
// rowId : Row ID
function hightlightRow(state, rowId) {	

	obj = eval("document.all." + rowId);
	if (state == "IN"){
		for (var i = 0; obj.cells[i]; i++) {
			// No effect when using CSS, will be corrected in far future
			//obj.cells[i].style.color = '#FFFF10';
			//obj.cells[i].style.backgroundColor = '#1004B0';
			obj.cells[i].style.backgroundColor = '#66CCFF';
		}
	}
	else{
		for (var i = 0; obj.cells[i]; i++) {
			// No effect when using CSS
			//obj.cells[i].style.color = '#000066';
			if (i % 2) {
				obj.cells[i].style.backgroundColor = '#EDF1F9';
			}
			else {
				obj.cells[i].style.backgroundColor = '#FFFFFF';
			}
		}
	}
}

