
function ShowVeckansFragaResult(url) {
	var popup = null;
	var popwidth=300;
	var popheight=350;
	
	popup=window.open(url,'','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=no,width='+popwidth+',height='+popheight);
}

function Vote(url, i, strSessionCookieSet) {
	if (strSessionCookieSet == 'True')
	{
		AlreadyAnsweredAlert();
		return;
	}
	
	//alert(url + ' ' + i);
	var submitUrl = url + '&vf=' + i;

	if ( url.indexOf('vf') < 0 ) 
	{
		document.location.href = submitUrl;
	}
	else
	{
		AlreadyAnsweredAlert();
	}
}

function AlreadyAnsweredAlert()
{
	alert('Du har redan svarat!');
}

var m_focusButton = '';

function setFocusButton(name)
{
	m_focusButton = name;
}

function handleKeyPressed(e)
{
	if(event.keyCode == 13 && m_focusButton != '')
	{
		var button = null;
		for ( i=0; i<document.forms[0].elements.length; i++ )
		{
			if ( document.forms[0].elements[i].name.indexOf(m_focusButton) > 0 )
			{
				button = document.forms[0].elements[i];
			}
		}
		button.click();
		return false;
	}
	
	return true;
}



try { 
	document.captureEvents(Event.KEYPRESS); 
} catch (ex) { 
} 

document.onkeypress = handleKeyPressed; 
// document.onfocus = handleFocus;
