function disable_user(){
	if (document.forms.view.disable.value == 'Onemogoči') {
		document.forms.view.action.value="disable";
		document.forms.view.disable.value="Omogoči";
		document.forms.view.submit();
		return true;
	}
	if (document.forms.view.disable.value == 'Omogoči') {
		document.forms.view.action.value="enable";
		document.forms.view.disable.value="Onemogoči";
		document.forms.view.submit();
		return true;
	}
}
function delete_user(){
	odg=confirm("Ali zares želite izbrisati tega uporabnika?");
	if (odg == true) {
		document.forms.view.action.value="remove";
		document.forms.view.submit();
	}
}
function chg_pwd(){
	document.forms.view.action.value="password";
	document.forms.view.submit();
}

function Preklici() {
	if (document.forms.view.back.value == "Prekliči") {
		document.forms.view.naziv.readOnly=true;
		// document.forms.view.approved.readOnly=true;
		document.forms.view.agcode.readOnly=true;
		document.forms.view.account.readOnly=true;
		document.forms.view.groupsel.disabled=true;
		document.forms.view.edit.value="Uredi";
		document.forms.view.action.value="view";
		document.forms.view.disable.disabled=false;
		document.forms.view.erase.disabled=false;
		document.forms.view.password.disabled=false;
		document.forms.view.back.value="Nazaj";
		document.forms.view.reset();
		return true;
	}
}

var width;
var timer;
var chars;
var cpos = 1;
var worg;

function scrollInit(w) {
	width = w;
	worg = w;
	document.getElementById('scroll').style.width = width + "px";
	chars = document.getElementById('text').innerHTML;
	
	over = chars.length * 5.3; //en znak cca. 5.3 pixlov širine
	
	if(over - width> 0) {
		document.getElementById('text').style.marginLeft = width + "px";
		document.getElementById('text').style.width = width + "px";
		scrollStart();
	}
}

function scrollStart() {
	if(chars.length * 5.3 - width <= 0)
		return false;
	
	width--;
	
	if(width % (chars.length * 5) == 0) {
		document.getElementById('text').innerHTML += "&nbsp;&nbsp;&nbsp;&nbsp;" + chars;
		cpos++;
		document.getElementById('text').style.width = (cpos *worg) + "px";
	}
	
	document.getElementById('text').style.marginLeft = width + "px";
	timer = setTimeout('scrollStart()', 20);
}

function scrollStop() {
	clearTimeout(timer);
}