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 setMailListAction(action){
	document.forms[1].action.value=action;
	document.forms[1].submit();
}

function checkGroupUsers(){
	var groupId = document.forms[0].markGroup[document.forms[0].markGroup.selectedIndex].value;
	var url = "checkGroupUsers.php?groupId=" + groupId;
	openWindow('100','100','checkusers',url);
}

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')
}



var max=0;
function CSGtext() {
max=CSGtext.arguments.length;
for (i=0; i<max; i++)
this[i]=CSGtext.arguments[i];
}

tl = new CSGtext( 
"Allm\xE4nmedicinare\rInternmedicinare\rKirurg\rBarnl\xE4kare",
"Internmedicinare\rKirurg\rBarnl\xE4kare\rPsykiatriker",
"Kirurg\rBarnl\xE4kare\rPsykiatriker\rGynekolog",
"Barnl\xE4kare\rPsykiatriker\rGynekolog\rRadiolog",
"Psykiatriker\rGynekolog\rRadiolog\rOrtoped",
"Gynekolog\rRadiolog\rOrtoped\rAllm\xE4nmedicinare",
"Radiolog\rOrtoped\rAllm\xE4nmedicinare\rInternmedicinare",
"Ortoped\rAllm\xE4nmedicinare\rInternmedicinare\rKirurg"

);

var x = 0; pos = 0;
var l = tl[0].length;
function CSGtextdisplay() {
document.tickform.CSGtextfield.value = tl[x].substring(0, pos) + "_";
if(pos++ == l) {
pos = 0; 
setTimeout("CSGtextdisplay()", 1000); 
if(++x == max) x = 0; 
l = tl[x].length;
} else
setTimeout("CSGtextdisplay()", 10);
}
