function goTo(url){
	document.location = url;
}

function openWindow(x,y,namn,url){
	if (y > screen.height) {
		y = screen.height - 100;
	}

	window.open(url,namn,"scrollbars=yes,resizable=yes,width="+x+",height="+y+",left=50,top=50");
}

function setPart(value){
	document.forms["links"].part.value = value;
	document.forms["links"].submit();
}

function vote(ao){
	var found = false;
	for ( i = 0; i < ao.elements.length; i++ ){
		lsName = ao.elements[i].name;
		if (ao.elements[i].checked == true){
			found = true;
		}
	}
	if (found == false) {
	 	alert("Du valde inget svarsalternativ.");
		return false;
	}
	
	window.open('','vote','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=yes,copyhistory=no,width=450,height=400');
	return true;
}

function voteResult(URL){
	window.open('','vote','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=yes,copyhistory=no,width=450,height=400');
	window.open(URL,'vote')
}

function verifyAction(url){
	var x=window.confirm("\xC4r du s\xE4ker?")
 	if (x)
 		document.location = url;
 	else
 		return false;
}

function setstar(id){
	if(id == 5){
		document.getElementById("star_five").src = "gui/active_star.gif";
		id = 4;
	}
	if(id == 4){
		document.getElementById("star_four").src = "gui/active_star.gif";
		id = 3;
	}
	if(id == 3){
		document.getElementById("star_three").src = "gui/active_star.gif";
		id = 2;
	}
	if(id == 2){
		document.getElementById("star_two").src = "gui/active_star.gif";
		id = 1;
	}
	if(id == 1){
		document.getElementById("star_one").src = "gui/active_star.gif";
	}
}

function clearstar(){
	document.getElementById("star_one").src = "gui/inactive_star.gif";
	document.getElementById("star_two").src = "gui/inactive_star.gif";
	document.getElementById("star_three").src = "gui/inactive_star.gif";
	document.getElementById("star_four").src = "gui/inactive_star.gif";
	document.getElementById("star_five").src = "gui/inactive_star.gif";
}