function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=820,height=585,screenX=150,screenY=150,top=150,left=150')
}

var fade_timer = 0;
function fade_in_fade_out(el, way)
{
	var the_op = Math.min(getOpacity(el) + (0.3 * way), 1);
	setOpacity(el, the_op);
	if (way == 1)
	{
		if (the_op < 1)
			fade_timer = setTimeout("fade_in_fade_out('" + el + "', 1)", 100);
		else
			fade_timer = setTimeout("fade_in_fade_out('" + el + "', -1)", 4000);
	}
	else
	{
		if (the_op > 0)
			fade_timer = setTimeout("fade_in_fade_out('" + el + "', -1)", 100);
		else
		{
			change_text(el);
			fade_timer = setTimeout("fade_in_fade_out('" + el + "', 1)", 150);
		}
	}
}
function stop_fifo(el)
{
	clearTimeout(fade_timer);
	setOpacity(el, 1);
	fade_timer = 0;
}

var the_text_ind = 1;
function change_text(el)
{
	element = document.getElementById(el);
	element.innerHTML = texts[(the_text_ind++) % texts.length];
}

function setOpacity(el, value)
{
	element = document.getElementById(el);
	var set_value = (value === '') ? '0' : (value < 0.00001) ? 0 : value;
	element.style.opacity = set_value;
	element.style.filter  = "alpha(opacity=" + parseInt(set_value * 100) + ")";
	element.opac = set_value;
}

function getOpacity(el)
{	
	var val = document.getElementById(el).opac;
	if (typeof val != 'undefined')
		return parseFloat(val);
	else
    	return 1.0;
}

function FocusBlank(box, value) { if (box.value == value) box.value = ""; }
function BlurAdd(box, value) { if (box.value == "") box.value = value; }
