function keypress(ev) {if (ev.keyCode == 27) document.forms.selector.si.value='';}

function search(in_sFormName, in_sInputName, in_sSelectName)
{sSearchString = document.forms[in_sFormName].elements[in_sInputName].value.toUpperCase();
iSearchTextLength = sSearchString.length;
for (j=0; j < document.forms[in_sFormName].elements[in_sSelectName].options.length; j++)
{sOptionText = document.forms[in_sFormName].elements[in_sSelectName].options[j].text;
sOptionComp = sOptionText.substr(0, iSearchTextLength).toUpperCase();
if(sSearchString == sOptionComp)
{
document.forms[in_sFormName].elements[in_sSelectName].selectedIndex = j;
break;
}
}
}

imgFadeObjects = new Object();
imgFadeTimers = new Object();
function imgFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){
        setTimeout("imgFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }

    clearTimeout(imgFadeTimers[object.sourceIndex]);

    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        imgFadeObjects[object.sourceIndex]=object;
        imgFadeTimers[object.sourceIndex]=setTimeout("imgFade(imgFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

a = 0;
function showhide(){
	if (a == 0) {
		menus.style.display='block';
		bgm.style.visibility='visible';
		games4select.style.display='none';
		games_selected.style.display='none';
		document.forms.selector.si.blur();
		status_bg.title = "Закрыть список номинаций";
		a = 1;
	}
	else if (a == 1) {
		menus.style.display='none';
		bgm.style.visibility='hidden';
		games4select.style.display='block';
		games_selected.style.display='block';
		status_bg.title = "Нажмите здесь, чтобы открыть список номинаций";
		a = 0;
	}
	else
		return;
}

	

function p_u(x, y, z) {
	c = arguments;
	for (b = 0; b < c.length; b++) {
        if (b == 3) continue;
		c[b] = c[b].split(',');
		c[b] = c[b].reverse();
		for (a = 0; a < c[b].length; a++)
			c[b][a] = String.fromCharCode(c[b][a] - 10);
		c[b] = c[b].join('');
	}
	document.location.href = "mailto:" + c[0] + "@" + c[1] + "." + c[2] + "?subject=" + c[3] + "";
	
}

