
var alphas = new Array();
var timers = new Array();
var sm_init_alpha = 100;
var init_alpha = 95;
var fade_speed = 25;

function changeBg(row, col) {
	elem = document.getElementById("l_"+row);
	if (elem && elem.style)
		elem.style.backgroundColor = col;	
	elem = document.getElementById("r_"+row);
	if (elem && elem.style)
		elem.style.backgroundColor = col;	
	}


function showMenuDelayed(id) {
	if (timers[id])	
		clearTimeout(timers[id])	
	timers[id] = setTimeout('showMenu('+id+')', 500);
	}	

function showMenu(id) {
	if (timers[id])
		clearTimeout(timers[id])
	if (id > 100)
		alphas[id] = sm_init_alpha;	
		else
			alphas[id] = init_alpha;	
	timers[id] = null;
	elem = document.getElementById("mid_"+id);
	if (elem && elem.style)
		elem.style.visibility = 'visible';
	setAlpha(elem, alphas[id]);
	}	
	
function hideMenu(id) {
	if (timers[id])
		clearTimeout(timers[id])	
	timers[id] = setTimeout('fadeMenu('+id+')', 100);
	}
	

function fadeMenu(id) {
	elem = document.getElementById("mid_"+id);
	if (alphas[id] - fade_speed <= 0) {
		alphas[id] = 0;	
		if (elem && elem.style)		
			elem.style.visibility = 'hidden';
		clearTimeout(timers[id]);
		timers[id] = null;
		return; 
		} else {
			alphas[id] -= fade_speed;
			setAlpha(elem, alphas[id]);
			}
	clearInterval(timers[id]);	
	timers[id] = setTimeout("fadeMenu('"+id+"')", 50);
	}
	
	
function setAlpha(elem, alpha) { 
	if (elem  && elem.style) {
	    elem.style.opacity = (alpha * 0.01); 
	    elem.style.MozOpacity = (alpha * 0.01); 
	    elem.style.KhtmlOpacity = (alpha * 0.01); 
	    elem.style.filter = "alpha(opacity=" + alpha + ")";
		}
	} 	


function selectSearch(e, def) {
	if (e.value == def) {
		e.value = '';
		e.style.color = '#000000';
		}
	}
	

function noEnter(e) {
	var key;
	if(window.event)
		key = window.event.keyCode; //IE
		else
			key = e.which; //firefox
	if(key == 13)
		return false;
		else
			return true;
	}
	
	
function OVM(m, y, n, page) /* open virtual magazine */ {
	URL = '/lue.html?m='+m;
	
	if (y != null)
		URL += '&y='+y;
		
	if (n != null)
		URL += '&n='+n;
		
	if (page != null) {
		URL += "?Page="+page;
		}
	window.open(
		URL,
		null,
    	'height=480,width=640,status=yes,toolbar=no,menubar=no,location=no,resizable=yes'
		);
	return false;
	}		

	
function OCM(id, name, page) /* open cust. media */ {
	URL = '/m'+id+'/'+name+'.html';
	
	if (page != null) {
		URL += "?Page="+page;
		}
	window.open(
		URL,
		null,
    	'height=480,width=640,status=yes,toolbar=no,menubar=no,location=no,resizable=yes'
		);
	return false;
	}		
	
