
pic1 = null;
if (document.images) {
	pic1 = new Image(401, 27);
	pic1.src = "layout/menu_a.gif";
}

function findField(name, where)
{
	var current, i;
	
	if (!where) where = document;

	if (!(x = where[name]) && where.all)
		current = where.all[name];

	// search through forms
	for (i = 0; !current && i < where.forms.length; i++)
		current = where.forms[i][name];

	// search through layers (divs)
	for(i = 0; !current && where.layers && i < where.layers.length; i++)
		current = findField(name, where.layers[i].document);
	
	return current;
}

function forgotPW(field, page)
{
	f = findField(field);
	if (f)
	{
		if (f.value.length)
			location.href = page + '?e=' + escape(f.value);
		else
			location.href = page;
	}
	else
		location.href = page;
}

//
function prevpopup(url)
{
	openWin('mypopup', 800, 600, url);
}

// Opens new window
function openWin(winName, width, height, url) {
	thisWin = eval('window.' + winName);
	if (thisWin) {
		thisWin = eval(winName);
		if (!thisWin.closed) thisWin.close();
	}
	newStr = 'window.' + winName + ' = window.open(\'' + url + '\', \'' + winName +
		'\', \'resizable=yes,width=' + width + ',height=' + height +
		',scrollbars=yes,dependent=yes,menubar=no,titlebar=no\')';
	eval(newStr);
}


function submitCached(formName, newView, param, value, retView, retparam, retvalue) {
	if (myform = document.forms[formName]) {
		myform.cache_form.value = '1';
		myform.cache_newview.value = newView;
		myform.cache_nv_param.value = param;
		myform.cache_nv_value.value = value;
		myform.cache_ret_view.value = retView;
		myform.cache_ret_param.value = retparam;
		myform.cache_ret_value.value = retvalue;
		myform.submit();
	}
}